diff --git a/llvm/lib/Target/VE/VEInstrVec.td b/llvm/lib/Target/VE/VEInstrVec.td --- a/llvm/lib/Target/VE/VEInstrVec.td +++ b/llvm/lib/Target/VE/VEInstrVec.td @@ -1427,3 +1427,27 @@ // Section 8.17.12 - TOVM (Trailing One of VM) defm TOVM : RVMSm<"tovm", 0xa6, VM>; + +//----------------------------------------------------------------------------- +// Section 8.18 - Vector Control Instructions +//----------------------------------------------------------------------------- + +// Section 8.18.1 - LVL (Load VL) +let sx = 0, cz = 0, sz = 0, hasSideEffects = 0, Defs = [VL] in { + def LVLr : RR<0xbf, (outs), (ins I64:$sy), "lvl $sy">; + let cy = 0 in def LVLi : RR<0xbf, (outs), (ins simm7:$sy), "lvl $sy">; +} + +// Section 8.18.2 - SVL (Save VL) +let cy = 0, sy = 0, cz = 0, sz = 0, hasSideEffects = 0, Uses = [VL] in +def SVL : RR<0x2f, (outs I64:$sx), (ins), "svl $sx">; + +// Section 8.18.3 - SMVL (Save Maximum Vector Length) +let cy = 0, sy = 0, cz = 0, sz = 0, hasSideEffects = 0 in +def SMVL : RR<0x2e, (outs I64:$sx), (ins), "smvl $sx">; + +// Section 8.18.4 - LVIX (Load Vector Data Index) +let sx = 0, cz = 0, sz = 0, hasSideEffects = 0, Defs = [VIX] in { + def LVIXr : RR<0xaf, (outs), (ins I64:$sy), "lvix $sy">; + let cy = 0 in def LVIXi : RR<0xaf, (outs), (ins uimm6:$sy), "lvix $sy">; +} diff --git a/llvm/test/MC/VE/LVIX.s b/llvm/test/MC/VE/LVIX.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/VE/LVIX.s @@ -0,0 +1,16 @@ +# RUN: llvm-mc -triple=ve --show-encoding < %s \ +# RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +# RUN: llvm-mc -triple=ve -filetype=obj < %s | llvm-objdump -d - \ +# RUN: | FileCheck %s --check-prefixes=CHECK-INST + +# CHECK-INST: lvix %s11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x8b,0x00,0xaf] +lvix %s11 + +# CHECK-INST: lvix 63 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0xaf] +lvix 63 + +# CHECK-INST: lvix %s63 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0xbf,0x00,0xaf] +lvix %s63 diff --git a/llvm/test/MC/VE/LVL.s b/llvm/test/MC/VE/LVL.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/VE/LVL.s @@ -0,0 +1,16 @@ +# RUN: llvm-mc -triple=ve --show-encoding < %s \ +# RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +# RUN: llvm-mc -triple=ve -filetype=obj < %s | llvm-objdump -d - \ +# RUN: | FileCheck %s --check-prefixes=CHECK-INST + +# CHECK-INST: lvl %s11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x8b,0x00,0xbf] +lvl %s11 + +# CHECK-INST: lvl 63 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0xbf] +lvl 63 + +# CHECK-INST: lvl -64 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xbf] +lvl -64 diff --git a/llvm/test/MC/VE/SMVL.s b/llvm/test/MC/VE/SMVL.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/VE/SMVL.s @@ -0,0 +1,16 @@ +# RUN: llvm-mc -triple=ve --show-encoding < %s \ +# RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +# RUN: llvm-mc -triple=ve -filetype=obj < %s | llvm-objdump -d - \ +# RUN: | FileCheck %s --check-prefixes=CHECK-INST + +# CHECK-INST: smvl %s11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x2e] +smvl %s11 + +# CHECK-INST: smvl %s0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e] +smvl %s0 + +# CHECK-INST: smvl %s63 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x2e] +smvl %s63 diff --git a/llvm/test/MC/VE/SVL.s b/llvm/test/MC/VE/SVL.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/VE/SVL.s @@ -0,0 +1,16 @@ +# RUN: llvm-mc -triple=ve --show-encoding < %s \ +# RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +# RUN: llvm-mc -triple=ve -filetype=obj < %s | llvm-objdump -d - \ +# RUN: | FileCheck %s --check-prefixes=CHECK-INST + +# CHECK-INST: svl %s11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x2f] +svl %s11 + +# CHECK-INST: svl %s0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2f] +svl %s0 + +# CHECK-INST: svl %s63 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x2f] +svl %s63