From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 1D9B93858D29 for ; Fri, 24 May 2024 23:41:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D9B93858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1D9B93858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716594105; cv=none; b=x8RrUczbP/TBeP4Acn+vSoo0ZMo3EKqcjWVlLuderEQFBzmt3vYkGKMK9gIssT5Fcuf6jg0aGcj7dAIj5BK2V4iKimmfXvpUyARPrs+HrX6J2vye18lyHY5MaRRvkwhhp13oHzmuR/Vr0oGTeD0rzo8+Ed/5+gs/H65xBfrk/7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716594105; c=relaxed/simple; bh=iwgnp9jjKgnoq9p8OzojLBRo6PNtZsd7V/Jf64r1FN4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=QXz7xvpaQ++ZnJ/lc23ShwwmVbFb451ZAJfcDBULcU6kAsGdA5qhwIq5XgA2zYowhJFabDLWgRn0St50pLWtnWBFQeDq/uREl3bKjKI0le57Usc/t+dHI70dvpELEJIae+a4iMbM9JfESbBPOkqPa2VW2C+vlyAC/aO47W3aT28= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-681bee6bb13so968842a12.1 for ; Fri, 24 May 2024 16:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716594102; x=1717198902; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/1j1GQOU08Ke9jgS4VLFDPC5lteRpXTChMzcI8N4FP8=; b=hgkY/OBCjRXBoDofLQx45PeBqOCMxSnOno+72aRFV46HGXNHJRPQ+h/0mf3t1b5q5t kuCGGZgDHn9nFlADtKMar3iGCt4BzcBBaz8+ZMxfJLiYydi7SzMfDH8mKt1TB4sCWYel Gie3ESFEZlowmxqo5PtTcEJdmlOHysOXYBNg6dUlGLJ/WM69Y9m3Lj4ddVjWdl5nlXXa l0cTi29Hi+yp064oRqS/Xlkbzo/1LfIg9CQX7TNvjHVj2X+IlJdOEHgPNhhZ8LdDy5QZ IjNAjOB4WWW8zZfkmIeGJ8aiyeNzuQsJDTvwyEzY4XMzqeKe7DQFbAAlJMRCi1f+9HMN c+vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716594102; x=1717198902; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/1j1GQOU08Ke9jgS4VLFDPC5lteRpXTChMzcI8N4FP8=; b=t5hSKCCFqER8m8ZwBoOQDsB9oxnQG2EG5zTRJ9bTO275X96vkZ1XIZLNhPgwNzFoEy GLu3XWKexZ7q5JOe6EINjgoT8bSXK+J9wgFzbFzWA1hOCN6ZnNt68ZnSyV5OiQc7HuDG XAMEd2rDxlA1Rzjw0TvxpuZusHsdscN1PCIGxV5p2/f4xoUzf8ThTjnLKrf1MwumvnA/ Yzr1/OUbKwb+Baea78pRAyU7OVpSIyYeTuegTRTdKMS8SYGFqFijsGyFpo7IWhnj4Tvl g9L8qViy1Q36VuKP8Q7OJ3+Zl3iLai+yAOXS390DQkmhQD8m+BdRqL5IxCSD1a3PCoJ0 QoDg== X-Forwarded-Encrypted: i=1; AJvYcCXXgeCrR3GFN1w/7ZzwGIZgAE3nj2sTaGiepYPcenAtdY1y2duvMZ3hVsAXXJmesNzWud4OBEwsIgLHNUgjkB3vnG0pm2WoEw== X-Gm-Message-State: AOJu0Yzs7Dvaaob6u9fZzy+bHXxkvhrn5QEAuGU6GKeZDhnqBpsuWO6p w17KptYpx0EusKHnyLuNmZCEOyxK3TDgZEcQGFeVnD3v+3ygeL3SEWV6TAiD X-Google-Smtp-Source: AGHT+IHwnWgeY4+qlQbTqfUUwNomdzctx9JjR+0w2Jo7CJZHnTPmpSADmPTI1lb/g2qTzJGL9q8d1w== X-Received: by 2002:a17:90a:f2c1:b0:2bf:8824:d0a5 with SMTP id 98e67ed59e1d1-2bf8824f30amr356334a91.6.1716594101953; Fri, 24 May 2024 16:41:41 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bdd9f0649asm3806303a91.25.2024.05.24.16.41.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 May 2024 16:41:41 -0700 (PDT) Message-ID: Date: Fri, 24 May 2024 17:41:39 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign. Content-Language: en-US To: Palmer Dabbelt Cc: Robin Dapp , gcc-patches@gcc.gnu.org, Kito Cheng , juzhe.zhong@rivai.ai References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 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. > > > 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