[llvm] 3be1abd - [RISCV] Require Zve32f for XAndesVSIntH FP conversions (#226001)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 04:13:47 PDT 2026


Author: Zeyi Xu
Date: 2026-09-24T19:13:39+08:00
New Revision: 3be1abd559ad2084a0b5ee082656bc590697d44d

URL: https://github.com/llvm/llvm-project/commit/3be1abd559ad2084a0b5ee082656bc590697d44d
DIFF: https://github.com/llvm/llvm-project/commit/3be1abd559ad2084a0b5ee082656bc590697d44d.diff

LOG: [RISCV] Require Zve32f for XAndesVSIntH FP conversions (#226001)

`XAndesVSIntH` currently implies only `Zve32x`. This commit requires
vector floating-point support for its four integer-to-FP conversion
instructions.

Added: 
    llvm/test/MC/RISCV/xandesvsinth-invalid.s

Modified: 
    llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td
    llvm/test/MC/RISCV/xandesvsinth-valid.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td b/llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td
index e1d2920612907..b556b91adbd03 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td
@@ -736,10 +736,14 @@ let Predicates = [HasVendorXAndesVBFHCvt],
 //===----------------------------------------------------------------------===//
 
 let Predicates = [HasVendorXAndesVSIntH] in {
+
+  let append Predicates = [HasVInstructionsAnyF] in {
   def NDS_VFWCVT_F_N  : NDSRVInstVSINTCvt<0b00100, "nds.vfwcvt.f.n.v">;
   def NDS_VFWCVT_F_NU : NDSRVInstVSINTCvt<0b00101, "nds.vfwcvt.f.nu.v">;
   def NDS_VFWCVT_F_B  : NDSRVInstVSINTCvt<0b00110, "nds.vfwcvt.f.b.v">;
   def NDS_VFWCVT_F_BU : NDSRVInstVSINTCvt<0b00111, "nds.vfwcvt.f.bu.v">;
+  } // append Predicates = [HasVInstructionsAnyF]
+
   def NDS_VLE4_V : NDSRVInstVSINTLN<0b00000, "nds.vle4.v">;
 } // Predicates = [HasVendorXAndesVSIntH]
 

diff  --git a/llvm/test/MC/RISCV/xandesvsinth-invalid.s b/llvm/test/MC/RISCV/xandesvsinth-invalid.s
new file mode 100644
index 0000000000000..818ac98d9e30e
--- /dev/null
+++ b/llvm/test/MC/RISCV/xandesvsinth-invalid.s
@@ -0,0 +1,15 @@
+# XAndesVSIntH - Andes Vector Small INT Handling Extension
+# RUN: not llvm-mc -triple=riscv32 -mattr=+xandesvsinth < %s 2>&1 | FileCheck %s
+# RUN: not llvm-mc -triple=riscv64 -mattr=+xandesvsinth < %s 2>&1 | FileCheck %s
+
+# CHECK: :[[@LINE+1]]:1: error: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32f' (Vector Extensions for Embedded Processors){{$}}
+nds.vfwcvt.f.n.v v8, v10
+
+# CHECK: :[[@LINE+1]]:1: error: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32f' (Vector Extensions for Embedded Processors){{$}}
+nds.vfwcvt.f.nu.v v8, v10
+
+# CHECK: :[[@LINE+1]]:1: error: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32f' (Vector Extensions for Embedded Processors){{$}}
+nds.vfwcvt.f.b.v v8, v10
+
+# CHECK: :[[@LINE+1]]:1: error: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32f' (Vector Extensions for Embedded Processors){{$}}
+nds.vfwcvt.f.bu.v v8, v10

diff  --git a/llvm/test/MC/RISCV/xandesvsinth-valid.s b/llvm/test/MC/RISCV/xandesvsinth-valid.s
index 387bb116fe86f..ab5868676905b 100644
--- a/llvm/test/MC/RISCV/xandesvsinth-valid.s
+++ b/llvm/test/MC/RISCV/xandesvsinth-valid.s
@@ -1,17 +1,17 @@
-# XAndesVSIntLoad - Andes Vector INT4 Load Extension
-# RUN: llvm-mc %s -triple=riscv32 -mattr=+xandesvsinth -show-encoding \
+# XAndesVSIntH - Andes Vector Small INT Handling Extension
+# RUN: llvm-mc %s -triple=riscv32 -mattr=+xandesvsinth,+zve32f -show-encoding \
 # RUN:     | FileCheck -check-prefixes=CHECK-ASM %s
-# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+xandesvsinth < %s \
-# RUN:     | llvm-objdump --mattr=+xandesvsinth -M no-aliases -d -r - \
+# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+xandesvsinth,+zve32f < %s \
+# RUN:     | llvm-objdump --mattr=+xandesvsinth,+zve32f -M no-aliases -d -r - \
 # RUN:     | FileCheck -check-prefixes=CHECK-OBJ %s
-# RUN: not llvm-mc -triple=riscv32 -show-encoding %s 2>&1 \
+# RUN: not llvm-mc -triple=riscv32 -mattr=+zve32f -show-encoding %s 2>&1 \
 # RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
-# RUN: llvm-mc %s -triple=riscv64 -mattr=+xandesvsinth -show-encoding \
+# RUN: llvm-mc %s -triple=riscv64 -mattr=+xandesvsinth,+zve32f -show-encoding \
 # RUN:     | FileCheck -check-prefixes=CHECK-ASM %s
-# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+xandesvsinth < %s \
-# RUN:     | llvm-objdump --mattr=+xandesvsinth -M no-aliases -d -r - \
+# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+xandesvsinth,+zve32f < %s \
+# RUN:     | llvm-objdump --mattr=+xandesvsinth,+zve32f -M no-aliases -d -r - \
 # RUN:     | FileCheck -check-prefixes=CHECK-OBJ %s
-# RUN: not llvm-mc -triple=riscv64 -show-encoding %s 2>&1 \
+# RUN: not llvm-mc -triple=riscv64 -mattr=+zve32f -show-encoding %s 2>&1 \
 # RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
 # CHECK-OBJ: nds.vfwcvt.f.n.v  v8, v10
 # CHECK-ASM: nds.vfwcvt.f.n.v  v8, v10


        


More information about the llvm-commits mailing list