From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by sourceware.org (Postfix) with ESMTPS id 9E6F9385843D for ; Tue, 9 Nov 2021 22:03:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9E6F9385843D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bluespec.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=bluespec.com Received: by mail-qk1-x72b.google.com with SMTP id bi29so587935qkb.5 for ; Tue, 09 Nov 2021 14:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bluespec-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Xc6ulctRmLAKCONb884NLnwM+2Anuz9nv1eT3tcFoKg=; b=VqDAA9fy/PHP/rDCp0Sl3n2ONgZDtjP5Je+mJZkEt42KS17oAQROsO08/knFprtlf5 BXImWfE4iFPa7m1llU0vcSZFOQ1/Kk6R5+JqXekOJu7XmwFrlgaUxFhi17u79c7npWcj bTUBCSJFEqVcGOXVgisg3fpWr1SPHmD7XfdurQ2Z6+QFrM5YEPVxM4KyjHKoC6WcXl7/ ikCsOEdI/lEkdXKQolIbg19zDtIIOdw/u8twjNR/wSz863R5/oRIoRvtU1xNOIqC3CMc BAlJNGHJIr+iEUG1WH1BxFuOhPs5Q5X13TXVdmgwmr4PVObvMfJ9uJYEFUmUUzB+BptD uVfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Xc6ulctRmLAKCONb884NLnwM+2Anuz9nv1eT3tcFoKg=; b=bnYZH1VwwjfjtTVIs1bQX24mhNUkuVLfEr4D/UthtWHAStxjFhiAPCJRlEhKqjm/vT 8T5oNOtFa+3d6Zx25bE0TlV0/uNmiuQW1eo5/nfLJ0QIFYDF/0IWwFzToZznHYa+Gfe0 cntTdK4PJZb896oBQNX5PV4pNZNzfRuOPmCbCbQxmLTfIbMNUW8VeRXX6wTABgPHWvgr oLvViuviUUeTjVIHe6d286V+AuZ2QvLX9KdZw0tyzTArMSLdBhMpULDVLZwgDBoSpYBI pvnNQu8FVP5Kf0MpJSD/9RQlnJHauiHO5dFegbws5V6vmyAy5p0pnlffq2yYzXOQvbUW QBgw== X-Gm-Message-State: AOAM530ONaulrLnDbbpqVAAm2+qKJfxmAbIY3XjqW7SyUzVFJhuULp0r 74DOomV6ip+q0TcVGM5jj82omnagA6d2 X-Google-Smtp-Source: ABdhPJzy+j5intw4jWViY6ZJ/hUET0/KGPjVYqC4ZxoJCLF0gMj+evGU5v0dU54WQH0uogxeS/Ykeg== X-Received: by 2002:a05:620a:248f:: with SMTP id i15mr8735692qkn.23.1636495415259; Tue, 09 Nov 2021 14:03:35 -0800 (PST) Received: from bruce.bluespec.com ([154.3.44.94]) by smtp.gmail.com with ESMTPSA id s6sm10185112qtc.45.2021.11.09.14.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 14:03:33 -0800 (PST) Date: Tue, 9 Nov 2021 17:03:31 -0500 From: Darius Rad To: Andrew Waterman Cc: Vincent Chen , libc-alpha@sourceware.org, Palmer Dabbelt , DJ Delorie Subject: Re: [RFC patch 0/5] RISC-V: Add vector ISA support Message-ID: Mail-Followup-To: Andrew Waterman , Vincent Chen , libc-alpha@sourceware.org, Palmer Dabbelt , DJ Delorie References: <1631497278-29829-1-git-send-email-vincent.chen@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 22:03:37 -0000 On Tue, Nov 09, 2021 at 11:30:49AM -0800, Andrew Waterman wrote: > On Tue, Nov 9, 2021 at 11:21 AM Darius Rad wrote: > > > > On Mon, Sep 13, 2021 at 09:41:13AM +0800, Vincent Chen wrote: > > > This patchset adds required ports to support RISC-V Vector (RVV) extension. > > > > > > Since the length of the vector register in RVV (the theoretical maximum > > > is 2^XLEN-1 bits) is variable, a huge and flexible space is needed to back > > > up all vector registers in the signal context. This patchset expands the > > > default SIGSTKSZ, MINSIGSTKSZ, and PTHREAD_STACK_MIN to ensure the stack > > > size is enough for the normal case (VLENB <= 128 bytes). Linux kernel also > > > places the exact minimum signal stack size in AT_MINSIGSTKSZ entry of the > > > auxiliary vector to inform user, so user still can know the sutible minimum > > > signal stack size by sysconf (_SC_MINSIGSTKSZ) if the VLENB is greater > > > than 128 bytes. > > > > > > In addition, according to the specification, the VCSR that combines VXRM and > > > VXSAT has thread storage duration, so this patchset adds the required user > > > context operation for it. > > > > > > Finally, the RISC-V glibc customized sigcontext.h has been removed in this > > > patchset. to reduce the synchronization work when new extension support is > > > introduced to the Linux environment. However, it may bring some backward > > > incompatible issues. Therefore, I sent an RFC patch > > > (https://sourceware.org/pipermail/libc-alpha/2020-June/115549.html) > > > to discuss this modification before this patchset. As I mentioned in the > > > RFC patch thread, I used OpenEmbeded to evaluate the impact. During the > > > tests, I didn't get any compiler errors. Therefore, I infer that this > > > modification may not cause server backward incompatible issues at this > > > moment. > > > > > > 1. The RISC-V V-extension draft v1.0 can be found in > > > https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc > > > 2. The associated kernel implementation can be found in > > > http://lists.infradead.org/pipermail/linux-riscv/2021-September/008249.html > > > 3. QEMU with RISC-V V-extension support can be found in > > > https://github.com/sifive/qemu/tree/rvv-1.0 > > > > > > > For the record on libc-alpha, I object to these changes. In particular, > > the lack of a user space API for the corresponding Linux support. More > > discussion on linux-riscv: > > > > https://lists.infradead.org/pipermail/linux-riscv/2021-September/thread.html#8361 > > I do not agree with that analysis. The vector extension scales down > to having potentially very little state (512 bytes on RV64) and we > expect typical applications-processor implementations to land in the > 512 - 2048-byte range. This matches AVX, not AMX. Furthermore, we > want all implementations to take advantage of vectorized C > string/memory functions without having to explicitly opt in. Not > doing this would put RISC-V at a significant competitive disadvantage > vs. other architectures with SIMD units. > The vector extension also scales up to 256 kiB, which, for comparison sake, is considerably more than AMX. There are those that believe AVX should have had some sort of user space control [1], as well. [1] https://lore.kernel.org/lkml/87k0ntazyn.ffs@nanos.tec.linutronix.de/ I don't see how having user space control either prevents glibc from using vector by default when it is available or how it puts RISC-V at a significant competitive disadvantage.