public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4793] arm: correctly define __ARM_FEATURE_CLZ
Date: Mon, 19 Dec 2022 15:04:00 +0000 (GMT)	[thread overview]
Message-ID: <20221219150400.DC9183858D1E@sourceware.org> (raw)

https://gcc.gnu.org/g:aa510619f8b650322c113d8593dd57afe6c6f9ae

commit r13-4793-gaa510619f8b650322c113d8593dd57afe6c6f9ae
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Mon Dec 19 15:01:49 2022 +0000

    arm: correctly define __ARM_FEATURE_CLZ
    
    The ACLE requires that __ARM_FEATURE_CLZ be defined if the hardware
    supports it; it's also clear that this doesn't mean the current ISA,
    so we must define this even when compiling for Thumb1 if the target
    supports CLZ in A32.
    
    This brings GCC into alignment with Clang.
    
    gcc/ChangeLog:
    
            * config/arm/arm-c.cc (__ARM_FEATURE_CLZ): Fix definition of
            preprocessor macro when target has CLZ in another ISA.

Diff:
---
 gcc/config/arm/arm-c.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/config/arm/arm-c.cc b/gcc/config/arm/arm-c.cc
index 86c56bf2680..202898fa041 100644
--- a/gcc/config/arm/arm-c.cc
+++ b/gcc/config/arm/arm-c.cc
@@ -238,8 +238,12 @@ arm_cpu_builtins (struct cpp_reader* pfile)
     builtin_define_with_int_value ("__ARM_FEATURE_LDREX",
 				   TARGET_ARM_FEATURE_LDREX);
 
+  /* ACLE says that __ARM_FEATURE_CLZ is defined if the hardware
+     supports it; it's also clear that this doesn't mean the current
+     ISA, so we define this even when compiling for Thumb1 if the
+     target supports CLZ in A32.  */
   def_or_undef_macro (pfile, "__ARM_FEATURE_CLZ",
-		      ((TARGET_ARM_ARCH >= 5 && !TARGET_THUMB)
+		      ((TARGET_ARM_ARCH >= 5 && arm_arch_notm)
 		       || TARGET_ARM_ARCH_ISA_THUMB >=2));
 
   def_or_undef_macro (pfile, "__ARM_FEATURE_NUMERIC_MAXMIN",

                 reply	other threads:[~2022-12-19 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221219150400.DC9183858D1E@sourceware.org \
    --to=rearnsha@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).