]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH v4 2/3] RISC-V: Update XCValu constraints to match other vendors
authorMary Bennett <mary.bennett@embecosm.com>
Fri, 15 Dec 2023 23:10:15 +0000 (16:10 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 15 Dec 2023 23:10:15 +0000 (16:10 -0700)
gcc/ChangeLog:
* config/riscv/constraints.md: CVP2 -> CV_alu_pow2.
* config/riscv/corev.md: Likewise.

gcc/config/riscv/constraints.md
gcc/config/riscv/corev.md

index d0f95b2b594779d75449571b3e53420960e81cbe..de4359af00d6484ac0bd911a77a90d203f6be45b 100644 (file)
 (define_register_constraint "zmvr" "(TARGET_ZFA || TARGET_XTHEADFMV) ? GR_REGS : NO_REGS"
   "An integer register for  ZFA or XTheadFmv.")
 
-;; CORE-V Constraints
-(define_constraint "CVP2"
-  "Checking for CORE-V ALU clip if ival plus 1 is a power of 2"
-  (and (match_code "const_int")
-       (and (match_test "IN_RANGE (ival, 0, 1073741823)")
-            (match_test "exact_log2 (ival + 1) != -1"))))
-
 ;; Vector constraints.
 
 (define_register_constraint "vr" "TARGET_VECTOR ? V_REGS : NO_REGS"
    A MEM with a valid address for th.[l|s]*ur* instructions."
   (and (match_code "mem")
        (match_test "th_memidx_legitimate_index_p (op, true)")))
+
+;; CORE-V Constraints
+(define_constraint "CV_alu_pow2"
+  "@internal
+   Checking for CORE-V ALU clip if ival plus 1 is a power of 2"
+  (and (match_code "const_int")
+       (and (match_test "IN_RANGE (ival, 0, 1073741823)")
+            (match_test "exact_log2 (ival + 1) != -1"))))
index c7a2ba07bcca7e4dec1e77da0f70842b8395d93a..92bf0b5d6a6831bd9ccf5b0d3d8e7c502617ad8d 100644 (file)
 (define_insn "riscv_cv_alu_clip"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
    (unspec:SI [(match_operand:SI 1 "register_operand" "r,r")
-               (match_operand:SI 2 "immediate_register_operand" "CVP2,r")]
+               (match_operand:SI 2 "immediate_register_operand" "CV_alu_pow2,r")]
     UNSPEC_CV_ALU_CLIP))]
 
   "TARGET_XCVALU && !TARGET_64BIT"
 (define_insn "riscv_cv_alu_clipu"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
    (unspec:SI [(match_operand:SI 1 "register_operand" "r,r")
-               (match_operand:SI 2 "immediate_register_operand" "CVP2,r")]
+               (match_operand:SI 2 "immediate_register_operand" "CV_alu_pow2,r")]
     UNSPEC_CV_ALU_CLIPU))]
 
   "TARGET_XCVALU && !TARGET_64BIT"