[VE] Add vector control instructions

Add LVL/SVL/SMVL/LVIX isntructions.  Add regression tests too.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D90355
This commit is contained in:
Kazushi (Jam) Marukawa 2020-10-28 20:11:40 +09:00
parent 749f13e763
commit 9c82944b2d
5 changed files with 88 additions and 0 deletions

View File

@ -1427,3 +1427,27 @@ defm LZVM : RVMSm<"lzvm", 0xa5, VM>;
// 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">;
}

16
llvm/test/MC/VE/LVIX.s Normal file
View File

@ -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

16
llvm/test/MC/VE/LVL.s Normal file
View File

@ -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

16
llvm/test/MC/VE/SMVL.s Normal file
View File

@ -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

16
llvm/test/MC/VE/SVL.s Normal file
View File

@ -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