]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add attribute to vtype change only vsetvl
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Wed, 23 Aug 2023 02:11:06 +0000 (10:11 +0800)
committerPan Li <pan2.li@intel.com>
Wed, 23 Aug 2023 02:13:02 +0000 (10:13 +0800)
This patch is prepare patch for VSETVL PASS.

Commited.

gcc/ChangeLog:

* config/riscv/vector.md: Add attribute.

gcc/config/riscv/vector.md

index e772e79057d1c88d2c4ffb0405664417441f4b87..6ceae25dbedb80a34e41733a30ae1bc5e4dfa566 100644 (file)
   "TARGET_VECTOR"
   "vsetvli\tzero,zero,e%0,%m1,t%p2,m%p3"
   [(set_attr "type" "vsetvl")
-   (set_attr "mode" "SI")])
+   (set_attr "mode" "SI")
+   (set (attr "sew") (symbol_ref "INTVAL (operands[0])"))
+   (set (attr "vlmul") (symbol_ref "INTVAL (operands[1])"))
+   (set (attr "ta") (symbol_ref "INTVAL (operands[2])"))
+   (set (attr "ma") (symbol_ref "INTVAL (operands[3])"))])
 
 ;; vsetvl zero,rs1,vtype instruction.
 ;; The reason we need this pattern since we should avoid setting X0 register