From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 00AC23858D28 for ; Mon, 28 Aug 2023 22:40:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00AC23858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-68a3e943762so3230970b3a.1 for ; Mon, 28 Aug 2023 15:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693262441; x=1693867241; 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=qiJCOlXRGiuocQYhsJdCIbRQfiz/KL6WEZUzy3Qy3n0=; b=sq6QGp9tz0MhatsJTRPeu73hknb67ZosIe75HtuRExvg2+BVzGh5NaAbJWxhbDc2e1 aNhgWXULXYqSmI+maxQGNPpUET8noUc8BRQEAYx84GJ+nkUv3xnlD+ryRsVrB7ac7OKz dYXx25P1yle3SWPFvcPY5mYTu/Ork2i1LpDqTcBZ/0lbf5ybe8n7ZqChxmmK4lwl63Pf tA7KL+1lJKQjNX1o3UjkKcOIGX167J9UXl9wEYk3G9CZfbJXD516UpCdcCUPLXhrRZyA gWdPKptXB7n7TWRFuM9AmnT8ljaxS+vGooqQSir4QP+pJFV3FZI/RHBds8UIVVMsdS9q qEzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693262441; x=1693867241; 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=qiJCOlXRGiuocQYhsJdCIbRQfiz/KL6WEZUzy3Qy3n0=; b=dqqM8hhS73Yt3tgin5jkMgVditjUejI3xSFM2y6Jb71Nakx1ZCFojjedUhM3bwVXC3 5tLsG6nHSeoXQRvoTGdOE+wIN4tjAnrVpNWjbmdtoLNjF3SEqo9Ff7kTnbv6hwjiyO2N R5WAjkBxWUor5BxBKtOFrRPFzkwRSvcd0vkhML5Uki9P5BsXKyYEdb96vQ4xdyOe+tP1 NUaoL/rxFbJapr7aL4XJ0FbjBMq4jTIzRxpH2jNUZ4gHYasclEf6rVv5qu4X2IO06Gby dxoX3gQ9NmknVzzi2VQsu1MbFmCjLwNLTzgMKXoGw3Bw6RE4wTN/ODw518dyOmAzoru0 2Plg== X-Gm-Message-State: AOJu0YyYvnYDpWROWtxI5vwD9IVHjE/WaklFIYGcUlY5llTMApnlo9en RE1zdUHNEe0CI6ulzmDQpxo= X-Google-Smtp-Source: AGHT+IHl96o16Gi9iRhAHu5j/v8zn6zBI9siSijP/9c4vEQZ6nqLVgbeueT80QQUenE/WMmqur0iJg== X-Received: by 2002:a05:6a00:1d05:b0:68c:58b2:14de with SMTP id a5-20020a056a001d0500b0068c58b214demr2965699pfx.23.1693262440850; Mon, 28 Aug 2023 15:40:40 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id p25-20020a637f59000000b00528513c6bbcsm7874423pgn.28.2023.08.28.15.40.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Aug 2023 15:40:40 -0700 (PDT) Message-ID: <62d8c70a-43f8-c450-a8c6-05e5e58b76a6@gmail.com> Date: Mon, 28 Aug 2023 16:40:38 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH V3] riscv: generate builtin macro for compilation with strict alignment: Content-Language: en-US To: Edwin Lu , gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com, Vineet Gupta References: <20230815182913.2824479-1-ewlu@rivosinc.com> From: Jeff Law In-Reply-To: <20230815182913.2824479-1-ewlu@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,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 8/15/23 12:29, Edwin Lu wrote: > This patch is a modification of > https://gcc.gnu.org/pipermail/gcc-patches/2023-January/610115.html > following the discussion on > https://github.com/riscv-non-isa/riscv-c-api-doc/issues/32 > > Distinguish between explicit -mstrict-align and cpu tune param > for slow_unaligned_access=true/false. > > Tested for regressions using rv32/64 multilib with newlib/linux > > gcc/ChangeLog: > > * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): > Generate __riscv_unaligned_avoid with value 1 or > __riscv_unaligned_slow with value 1 or > __riscv_unaligned_fast with value 1 > * config/riscv/riscv.cc (riscv_option_override): > Define riscv_user_wants_strict_align. Set > riscv_user_wants_strict_align to TARGET_STRICT_ALIGN > * config/riscv/riscv.h: Declare riscv_user_wants_strict_align > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/attribute-1.c: Check for > __riscv_unaligned_slow or __riscv_unaligned_fast > * gcc.target/riscv/attribute-4.c: Check for > __riscv_unaligned_avoid > * gcc.target/riscv/attribute-5.c: Check for > __riscv_unaligned_slow or __riscv_unaligned_fast > * gcc.target/riscv/predef-align-1.c: New test. > * gcc.target/riscv/predef-align-2.c: New test. > * gcc.target/riscv/predef-align-3.c: New test. > * gcc.target/riscv/predef-align-4.c: New test. > * gcc.target/riscv/predef-align-5.c: New test. > * gcc.target/riscv/predef-align-6.c: New test. OK. Though I'm pretty sure the commit hooks are going to complain about your ChangeLog :-) jeff