]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add missing VLS mask bool mode reg -> reg patterns
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Mon, 11 Sep 2023 03:22:26 +0000 (11:22 +0800)
committerLehua Ding <lehua.ding@rivai.ai>
Mon, 11 Sep 2023 03:25:51 +0000 (11:25 +0800)
Committed.

gcc/ChangeLog:

* config/riscv/autovec-vls.md (*mov<mode>_vls): New pattern.
* config/riscv/vector-iterators.md: New iterator

gcc/config/riscv/autovec-vls.md
gcc/config/riscv/vector-iterators.md

index d208b418e5fbba46cfd4cc9c52598ab5763c69f7..6f48f7d62320f7df2f1c54eb3370928363d3dd6f 100644 (file)
   [(set_attr "type" "vmov")
    (set_attr "mode" "<MODE>")])
 
+(define_insn "*mov<mode>_vls"
+  [(set (match_operand:VLSB 0 "register_operand" "=vr")
+       (match_operand:VLSB 1 "register_operand" " vr"))]
+  "TARGET_VECTOR"
+  "vmv1r.v\t%0,%1"
+  [(set_attr "type" "vmov")
+   (set_attr "mode" "<MODE>")])
+
 (define_expand "movmisalign<mode>"
   [(set (match_operand:VLS 0 "nonimmediate_operand")
        (match_operand:VLS 1 "general_operand"))]
index a98ed9fcbb6f2d7acc57a9f9c579e87bcb3f80c2..5694c0c8f37712087c2c40c184ca078952133560 100644 (file)
   (V256DF "TARGET_VECTOR_VLS && TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 2048")
   (V512DF "TARGET_VECTOR_VLS && TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 4096")])
 
+(define_mode_iterator VLSB [
+  (V1BI "TARGET_VECTOR_VLS")
+  (V2BI "TARGET_VECTOR_VLS")
+  (V4BI "TARGET_VECTOR_VLS")
+  (V8BI "TARGET_VECTOR_VLS")
+  (V16BI "TARGET_VECTOR_VLS")
+  (V32BI "TARGET_VECTOR_VLS")
+  (V64BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 64")
+  (V128BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 128")
+  (V256BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 256")
+  (V512BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 512")
+  (V1024BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 1024")
+  (V2048BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 2048")
+  (V4096BI "TARGET_VECTOR_VLS && TARGET_MIN_VLEN >= 4096")])
+
 ;; VLS modes that has NUNITS < 32.
 (define_mode_iterator VLS_AVL_IMM [
   (V1QI "TARGET_VECTOR_VLS")