From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by sourceware.org (Postfix) with ESMTPS id CBFE63858D29 for ; Fri, 24 May 2024 23:43:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBFE63858D29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dabbelt.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CBFE63858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716594203; cv=none; b=nvLYIkdo4Q0j5v5WzabF1fXzQbq6UFE9blpDYtGh5vukfG2LW2BA5XTL2ZMyoJWvWzYdS5LnfKiz9xJQ61H0CMQ7Fc+0BccmufRlCqauSyWuChEIOQ3+3P5WW+694AO8uellWkwtANbqmsqOo5E9q9REfeH/gU4H0UXfZISVoMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716594203; c=relaxed/simple; bh=mqvgQhZ256hbS7z7I/VAmeer4xdFBksgkciVyPuEETg=; h=DKIM-Signature:Date:Subject:From:To:Message-ID:Mime-Version; b=hhhxxuPHCP2BUNSo2WfGKsTIf2VTS9XuyhnsoMI/LHTpvyamu/yS2sjzSqUXB9B3XxnPApbZdTu+lyyi8QYeo+RkIpruYR3vAraOUllLrDFWgdpcfY9+BoTztKa+ePar5ZdK4b5oUj7Slq1xfzy0Pu5xTMdDEYdCTEeJn1BV0Co= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5b96a95c5e8so840193eaf.3 for ; Fri, 24 May 2024 16:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1716594201; x=1717199001; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=Uro2TQ38jyu6vnG2SbEl7ztlauFT+IPNYtyF+sUMn0U=; b=FQ9B1G3jSiWv+dD+30jBJc4yxQCOPNvMQUbwBMxaopaxEcd0ghplWFa/HytNKXaumT Zu3XJZwAHZ5nC+d3p49MDRRW2QcALR0+iWuOo+SO95LIYx52px0FcYAso2qyJWgM3n6L YNGR6aXTXzjtBmPMJKgrVTchKbtEtspH7k96PiVw3+QEJAiRm9rP/f3TEXtzGxpGykcF y+/J4dKeAK0Z1mVtLCO/ImMtDX3ySkhC5bf5kQp60PTHW+cIJPfHt+79SptW/Fm6kn7S 7EXcDsAW7kIMYMyJFrxWpUDTwSU3CgLhvERuBFXoMd1nDrEpffqB8hJu2ESpnnRHirJg mcrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716594201; x=1717199001; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Uro2TQ38jyu6vnG2SbEl7ztlauFT+IPNYtyF+sUMn0U=; b=Osfm5FmdMVn0zxqyRfPqQkdl4lB/SyEhGmr764NC7lEKuE5tmXrcG0lR2otWqQexlk nW8nAIUIV1bPZAO/Y1STq/pKL0UuNx8zMacoBgln5SSN6Rc3Z2U0sNX5xdXL/Skr4YpN u/TW9I4BlgLp53EHCtYqFn0ZapHntDqIsxxxdJMEEdUQWWmbnct1bANMTwdF45KCXTsi cDgqrYjJPlcrfAgfTGQucNxQF22Q+dB1X0FY2LuXc61OJwWbENCvUC8F77xhirXoro+p T+x3I5DG9gqv0lq3+h+yBeHgfdyDKsb2vZ37MhloNPnw6ss5OOafKCHQos0opIIN9nay aYgg== X-Forwarded-Encrypted: i=1; AJvYcCUOnH7lURhXmqaT7ZgL7M9Yi6czpOSzMflMrXyFM68ZDbGARJAaRr0ajEYr0o/dXeEyIdrhDrvyIJuNDYuX6nwMaVpfXkfO6Q== X-Gm-Message-State: AOJu0Yy+Y4Yb8marOa5Hj5fk/SNNeo41gRH+5c8UH7dDKUXfOyQtROEh 5ExuGFI0s08WMERT8xABHz06s7zVjqPd8Puil+J0H6AjubHqnTIx3CCKddStcVw= X-Google-Smtp-Source: AGHT+IGPqzMG0DZzXFYSpjGPFqfKWXTeA7UILCvsgQ9RqdLeltBZO0MxSx6IG2q7wJmykKIc+L2GBQ== X-Received: by 2002:a05:6358:3211:b0:196:c48b:cb2d with SMTP id e5c5f4694b2df-197e566da71mr410712955d.27.1716594200658; Fri, 24 May 2024 16:43:20 -0700 (PDT) Received: from localhost ([192.184.165.199]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6822635db49sm1726417a12.59.2024.05.24.16.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 16:43:20 -0700 (PDT) Date: Fri, 24 May 2024 16:43:20 -0700 (PDT) X-Google-Original-Date: Fri, 24 May 2024 16:43:18 PDT (-0700) Subject: Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign. In-Reply-To: CC: Robin Dapp , gcc-patches@gcc.gnu.org, Kito Cheng , juzhe.zhong@rivai.ai From: Palmer Dabbelt To: jeffreyalaw@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 24 May 2024 16:41:39 PDT (-0700), jeffreyalaw@gmail.com wrote: > > > On 5/24/24 5:39 PM, Palmer Dabbelt wrote: >> On Fri, 24 May 2024 16:31:48 PDT (-0700), jeffreyalaw@gmail.com wrote: >>> >>> >>> On 5/24/24 11:14 AM, Palmer Dabbelt wrote: >>>> On Fri, 24 May 2024 09:19:09 PDT (-0700), Robin Dapp wrote: >>>>>> We should have something in doc/invoke too, this one is going to be >>>>>> tricky for users.  We'll also have to define how this interacts with >>>>>> the existing -mstrict-align. >>>>> >>>>> Addressed the rest in the attached v2 which also fixes tests. >>>>> I'm really not sure about -mstrict-align.  I would have hoped that >>>>> using >>>>> -mstrict-align we'd never run into any movmisalign situation but that >>>>> might be wishful thinking.  Do we need to specify an >>>>> interaction, though?  For now the new options disables movmisalign so >>>>> if we hit that despite -mstrict-align we'd still not vectorize it. >>>> >>>> I think we just need to write it down.  I think there's two ways to >>>> encode this: either we treat scalar and vector as independent, or we >>>> couple them.  If we treat them independently then we end up with four >>>> cases, it's not clear if they're all interesting.  IIUC with this patch >>>> we'd be able to encode >>> Given the ISA documents them as independent, I think we should follow >>> suit and allow them to vary independently. >> >> I'm only reading Zicclsm as saying both scalar and vector misaligned >> accesses are supported, but nothing about the performance. > I think it was in the vector docs. It didn't say anything about > performance, just a note that scalar & vector behavior could differ. Either way, the split naming scheme seems clearer to me. It also avoids getting mixed up by the no-scalar-misaligned, yes-vector-misaligned systems if they ever show up. So if Robin's OK with re-spinning things, let's just go that way? >> Seems reasonable to me.  Just having a regular naming scheme for the >> scalar/vector makes it clear what we're doing, and it's not like having >> the extra name for -mscalar-strict-align really costs anything. > That was my thinking -- get the names right should help avoid confusion. > > Jeff