]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AArch64: make `far_branch` attribute a boolean
authorKarl Meakin <karl.meakin@arm.com>
Thu, 3 Jul 2025 11:48:30 +0000 (12:48 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 3 Jul 2025 11:48:30 +0000 (12:48 +0100)
The `far_branch` attribute only ever takes the values 0 or 1, so make it
a `no/yes` valued string attribute instead.

gcc/ChangeLog:

* config/aarch64/aarch64.md (far_branch): Replace 0/1 with
no/yes.
(aarch64_bcond): Handle rename.
(aarch64_cbz<optab><mode>1): Likewise.
(*aarch64_tbz<optab><mode>1): Likewise.
(@aarch64_tbz<optab><ALLI:mode><GPI:mode>): Likewise.

gcc/config/aarch64/aarch64.md

index 3f37ea6cff7ce0e67483ec21726a9baed5f0d7b0..0169ec5cf24c02638a8c9e3edc1dcad4956c1dc1 100644 (file)
 ;; Attribute that specifies whether we are dealing with a branch to a
 ;; label that is far away, i.e. further away than the maximum/minimum
 ;; representable in a signed 21-bits number.
-;; 0 :=: no
-;; 1 :=: yes
-(define_attr "far_branch" "" (const_int 0))
+(define_attr "far_branch" "no,yes" (const_string "no"))
 
 ;; Attribute that specifies whether the alternative uses MOVPRFX.
 (define_attr "movprfx" "no,yes" (const_string "no"))
                               (const_int BRANCH_LEN_N_1MiB))
                           (lt (minus (match_dup 2) (pc))
                               (const_int BRANCH_LEN_P_1MiB)))
-                     (const_int 0)
-                     (const_int 1)))]
+                     (const_string "no")
+                     (const_string "yes")))]
 )
 
 ;; For a 24-bit immediate CST we can optimize the compare for equality
                               (const_int BRANCH_LEN_N_1MiB))
                           (lt (minus (match_dup 2) (pc))
                               (const_int BRANCH_LEN_P_1MiB)))
-                     (const_int 0)
-                     (const_int 1)))]
+                     (const_string "no")
+                     (const_string "yes")))]
 )
 
 ;; For an LT/GE comparison against zero, emit `TBZ`/`TBNZ`
   {
     if (get_attr_length (insn) == 8)
       {
-       if (get_attr_far_branch (insn) == 1)
+       if (get_attr_far_branch (insn) == FAR_BRANCH_YES)
          return aarch64_gen_far_branch (operands, 1, "Ltb",
                                         "<inv_tb>\\t%<w>0, <sizem1>, ");
        else
                               (const_int BRANCH_LEN_N_1MiB))
                           (lt (minus (match_dup 1) (pc))
                               (const_int BRANCH_LEN_P_1MiB)))
-                     (const_int 0)
-                     (const_int 1)))]
+                     (const_string "no")
+                     (const_string "yes")))]
 )
 
 ;; -------------------------------------------------------------------
                               (const_int BRANCH_LEN_N_1MiB))
                           (lt (minus (match_dup 2) (pc))
                               (const_int BRANCH_LEN_P_1MiB)))
-                     (const_int 0)
-                     (const_int 1)))]
+                     (const_string "no")
+                     (const_string "yes")))]
 
 )