diff --git a/lib/Target/VE/AsmParser/VEAsmParser.cpp b/lib/Target/VE/AsmParser/VEAsmParser.cpp index a64a161a807..a3309a68c76 100644 --- a/lib/Target/VE/AsmParser/VEAsmParser.cpp +++ b/lib/Target/VE/AsmParser/VEAsmParser.cpp @@ -939,6 +939,14 @@ StringRef VEAsmParser::splitMnemonic(StringRef Name, SMLoc NameLoc, Mnemonic = parseRD(Name, 12, NameLoc, Operands); } else if (Name.startswith("pvcvt.w.s")) { Mnemonic = parseRD(Name, 9, NameLoc, Operands); + } else if (Name.startswith("vfmk.l.") || Name.startswith("vfmk.w.") || + Name.startswith("vfmk.d.") || Name.startswith("vfmk.s.")) { + bool ICC = Name[5] == 'l' || Name[5] == 'w' ? true : false; + Mnemonic = parseCC(Name, 7, Name.size(), ICC, true, NameLoc, Operands); + } else if (Name.startswith("pvfmk.w.lo.") || Name.startswith("pvfmk.w.up.") || + Name.startswith("pvfmk.s.lo.") || Name.startswith("pvfmk.s.up.")) { + bool ICC = Name[6] == 'l' || Name[6] == 'w' ? true : false; + Mnemonic = parseCC(Name, 11, Name.size(), ICC, true, NameLoc, Operands); } else { Operands->push_back(VEOperand::CreateToken(Mnemonic, NameLoc)); } diff --git a/lib/Target/VE/VEInstrVec.td b/lib/Target/VE/VEInstrVec.td index 701f9ad26f4..77de72dc5cd 100644 --- a/lib/Target/VE/VEInstrVec.td +++ b/lib/Target/VE/VEInstrVec.td @@ -654,6 +654,81 @@ multiclass RVSHFmopc, RegisterClass RC, let cy = 0 in defm vvi : RVlm; } +// Multiclass for generic mask calculation +let vx = ?, hasSideEffects = 0, Uses = [VL] in +multiclass RVMKbmopc, dag dag_out, + dag dag_in> { + def "" : RV; + let DisableEncoding = "$vl", isCodeGenOnly = 1, VE_VLInUse = 1 in { + def l : RV; + def L : RV; + } +} +multiclass RVMKlmopc, RegisterClass RCM, + dag dag_in> { + defm "" : RVMKbm; + let m = ?, VE_VLWithMask = 1 in + defm m : RVMKbm; +} +// Generic RV multiclass for mask calculation with a condition. +// e.g. VFMK, VFMS, and VFMF +let cy = 0, sy = 0 in +multiclass RVMKom opc, RegisterClass RC, + RegisterClass RCM> { + let vy = ?, vz = ?, VE_VLIndex = 3 in + defm v : RVMKlm; + let vy = 15 /* AT */, VE_VLIndex = 1 in + defm a : RVMKlm; + let vy = 0 /* AF */, VE_VLIndex = 1 in + defm na : RVMKlm; +} +multiclass RVMKm opc, RegisterClass RC, + RegisterClass RCM> { + defm "" : RVMKom; +} +// Generic RV multiclass for mask calculation with 2 arguments. +// e.g. ANDM, ORM, XORM, and etc. +let cy = 0, sy = 0, vx = ?, vy = ?, vz = ?, hasSideEffects = 0 in +multiclass RVM2m opc, RegisterClass RCM> { + def mm : RV; +} +// Generic RV multiclass for mask calculation with 1 argument. +// e.g. NEGM +let cy = 0, sy = 0, vx = ?, vy = ?, hasSideEffects = 0 in +multiclass RVM1m opc, RegisterClass RCM> { + def m : RV; +} +// Generic RV multiclass for mask calculation with 1 argument. +// e.g. PCVM, LZVM, and TOVM +let cy = 0, sy = 0, vy = ?, hasSideEffects = 0, Uses = [VL] in +multiclass RVMSbmopc, dag dag_in> { + def "" : RV { + bits<7> sx; + let Inst{54-48} = sx; + } + let DisableEncoding = "$vl", isCodeGenOnly = 1, VE_VLInUse = 1 in { + def l : RV { + bits<7> sx; + let Inst{54-48} = sx; + } + def L : RV { + bits<7> sx; + let Inst{54-48} = sx; + } + } +} +let VE_VLIndex = 2 in +multiclass RVMSm opc, RegisterClass RCM> { + defm m : RVMSbm; +} // Section 8.10.1 - VADD (Vector Add) let cx = 0, cx2 = 0 in @@ -1290,3 +1365,65 @@ defm VCP : RV1m<"vcp", 0x8d, V64, VM>; // Section 8.16.4 - VEX (Vector Expand) defm VEX : RV1m<"vex", 0x9d, V64, VM>; + +//----------------------------------------------------------------------------- +// Section 8.17 - Vector Mask Operation Instructions +//----------------------------------------------------------------------------- + +// Section 8.17.1 - VFMK (Vector Form Mask) +defm VFMKL : RVMKm<"vfmk.l.", 0xb4, V64, VM>; +def : MnemonicAlias<"vfmk.l", "vfmk.l.at">; + +// Section 8.17.2 - VFMS (Vector Form Mask Single) +defm VFMKW : RVMKm<"vfmk.w.", 0xb5, V64, VM>; +let isCodeGenOnly = 1 in defm PVFMKWLO : RVMKm<"vfmk.w.", 0xb5, V64, VM>; +let cx = 1 in defm PVFMKWUP : RVMKm<"pvfmk.w.up.", 0xb5, V64, VM>; +def : MnemonicAlias<"vfmk.w", "vfmk.w.at">; +def : MnemonicAlias<"pvfmk.w.up", "pvfmk.w.up.at">; +def : MnemonicAlias<"pvfmk.w.lo", "vfmk.w.at">; +foreach CC = [ "af", "gt", "lt", "ne", "eq", "ge", "le", "at" ] in { + def : MnemonicAlias<"pvfmk.w.lo."#CC, "vfmk.w."#CC>; +} + +// Section 8.17.3 - VFMF (Vector Form Mask Floating Point) +defm VFMKD : RVMKm<"vfmk.d.", 0xb6, V64, VM>; +let cx2 = 1 in defm PVFMKSLO : RVMKm<"pvfmk.s.lo.", 0xb6, V64, VM>; +let cx = 1 in { + defm PVFMKSUP : RVMKm<"pvfmk.s.up.", 0xb6, V64, VM>; + let isCodeGenOnly = 1 in defm VFMKS : RVMKm<"vfmk.s.", 0xb6, V64, VM>; +} +def : MnemonicAlias<"vfmk.d", "vfmk.d.at">; +def : MnemonicAlias<"pvfmk.s.lo", "pvfmk.s.lo.at">; +def : MnemonicAlias<"pvfmk.s.up", "pvfmk.s.up.at">; +def : MnemonicAlias<"vfmk.s", "pvfmk.s.up.at">; +foreach CC = [ "af", "gt", "lt", "ne", "eq", "ge", "le", "at", "num", "nan", + "gtnan", "ltnan", "nenan", "eqnan", "genan", "lenan" ] in { + def : MnemonicAlias<"vfmk.s."#CC, "pvfmk.s.up."#CC>; +} + +// Section 8.17.4 - ANDM (And VM) +defm ANDM : RVM2m<"andm", 0x84, VM>; + +// Section 8.17.5 - ORM (Or VM) +defm ORM : RVM2m<"orm", 0x85, VM>; + +// Section 8.17.6 - XORM (Exclusive Or VM) +defm XORM : RVM2m<"xorm", 0x86, VM>; + +// Section 8.17.7 - EQVM (Equivalence VM) +defm EQVM : RVM2m<"eqvm", 0x87, VM>; + +// Section 8.17.8 - NNDM (Negate And VM) +defm NNDM : RVM2m<"nndm", 0x94, VM>; + +// Section 8.17.9 - NEGM (Negate VM) +defm NEGM : RVM1m<"negm", 0x95, VM>; + +// Section 8.17.10 - PCVM (Population Count of VM) +defm PCVM : RVMSm<"pcvm", 0xa4, VM>; + +// Section 8.17.11 - LZVM (Leading Zero of VM) +defm LZVM : RVMSm<"lzvm", 0xa5, VM>; + +// Section 8.17.12 - TOVM (Trailing One of VM) +defm TOVM : RVMSm<"tovm", 0xa6, VM>; diff --git a/test/MC/VE/ANDM.s b/test/MC/VE/ANDM.s new file mode 100644 index 00000000000..30c349f69f7 --- /dev/null +++ b/test/MC/VE/ANDM.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: andm %vm0, %vm0, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84] +andm %vm0, %vm0, %vm0 + +# CHECK-INST: andm %vm11, %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x0f,0x01,0x0b,0x00,0x00,0x00,0x84] +andm %vm11, %vm1, %vm15 + +# CHECK-INST: andm %vm11, %vm15, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0x84] +andm %vm11, %vm15, %vm0 diff --git a/test/MC/VE/EQVM.s b/test/MC/VE/EQVM.s new file mode 100644 index 00000000000..e88fc5c551e --- /dev/null +++ b/test/MC/VE/EQVM.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: eqvm %vm0, %vm0, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87] +eqvm %vm0, %vm0, %vm0 + +# CHECK-INST: eqvm %vm11, %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x0f,0x01,0x0b,0x00,0x00,0x00,0x87] +eqvm %vm11, %vm1, %vm15 + +# CHECK-INST: eqvm %vm11, %vm15, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0x87] +eqvm %vm11, %vm15, %vm0 diff --git a/test/MC/VE/LZVM.s b/test/MC/VE/LZVM.s new file mode 100644 index 00000000000..d9e1cce4e9e --- /dev/null +++ b/test/MC/VE/LZVM.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: lzvm %s11, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0xa5] +lzvm %s11, %vm0 + +# CHECK-INST: lzvm %s11, %vm1 +# CHECK-ENCODING: encoding: [0x00,0x00,0x01,0x00,0x00,0x00,0x0b,0xa5] +lzvm %s11, %vm1 + +# CHECK-INST: lzvm %s11, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x00,0x00,0x00,0x0b,0xa5] +lzvm %s11, %vm15 diff --git a/test/MC/VE/NEGM.s b/test/MC/VE/NEGM.s new file mode 100644 index 00000000000..0af9d3a5081 --- /dev/null +++ b/test/MC/VE/NEGM.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: negm %vm0, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x95] +negm %vm0, %vm0 + +# CHECK-INST: negm %vm11, %vm1 +# CHECK-ENCODING: encoding: [0x00,0x00,0x01,0x0b,0x00,0x00,0x00,0x95] +negm %vm11, %vm1 + +# CHECK-INST: negm %vm11, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0x95] +negm %vm11, %vm15 diff --git a/test/MC/VE/NNDM.s b/test/MC/VE/NNDM.s new file mode 100644 index 00000000000..fdb56188b59 --- /dev/null +++ b/test/MC/VE/NNDM.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: nndm %vm0, %vm0, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94] +nndm %vm0, %vm0, %vm0 + +# CHECK-INST: nndm %vm11, %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x0f,0x01,0x0b,0x00,0x00,0x00,0x94] +nndm %vm11, %vm1, %vm15 + +# CHECK-INST: nndm %vm11, %vm15, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0x94] +nndm %vm11, %vm15, %vm0 diff --git a/test/MC/VE/ORM.s b/test/MC/VE/ORM.s new file mode 100644 index 00000000000..d44e4116a72 --- /dev/null +++ b/test/MC/VE/ORM.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: orm %vm0, %vm0, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x85] +orm %vm0, %vm0, %vm0 + +# CHECK-INST: orm %vm11, %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x0f,0x01,0x0b,0x00,0x00,0x00,0x85] +orm %vm11, %vm1, %vm15 + +# CHECK-INST: orm %vm11, %vm15, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0x85] +orm %vm11, %vm15, %vm0 diff --git a/test/MC/VE/PCVM.s b/test/MC/VE/PCVM.s new file mode 100644 index 00000000000..17b4bc69f8b --- /dev/null +++ b/test/MC/VE/PCVM.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: pcvm %s11, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0xa4] +pcvm %s11, %vm0 + +# CHECK-INST: pcvm %s11, %vm1 +# CHECK-ENCODING: encoding: [0x00,0x00,0x01,0x00,0x00,0x00,0x0b,0xa4] +pcvm %s11, %vm1 + +# CHECK-INST: pcvm %s11, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x00,0x00,0x00,0x0b,0xa4] +pcvm %s11, %vm15 diff --git a/test/MC/VE/TOVM.s b/test/MC/VE/TOVM.s new file mode 100644 index 00000000000..69918f8a062 --- /dev/null +++ b/test/MC/VE/TOVM.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: tovm %s11, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0xa6] +tovm %s11, %vm0 + +# CHECK-INST: tovm %s11, %vm1 +# CHECK-ENCODING: encoding: [0x00,0x00,0x01,0x00,0x00,0x00,0x0b,0xa6] +tovm %s11, %vm1 + +# CHECK-INST: tovm %s11, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x00,0x00,0x00,0x0b,0xa6] +tovm %s11, %vm15 diff --git a/test/MC/VE/VFMF.s b/test/MC/VE/VFMF.s new file mode 100644 index 00000000000..5f21543eeba --- /dev/null +++ b/test/MC/VE/VFMF.s @@ -0,0 +1,276 @@ +# 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: vfmk.d.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0xb6] +vfmk.d %vm11 + +# CHECK-INST: vfmk.d.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0xb6] +vfmk.d.at %vm11 + +# CHECK-INST: vfmk.d.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x0f,0xb6] +vfmk.d.af %vm1, %vm15 + +# CHECK-INST: vfmk.d.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x00,0xb6] +vfmk.d.gt %vm12, %v22 + +# CHECK-INST: vfmk.d.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x0f,0xb6] +vfmk.d.lt %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.d.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x00,0xb6] +vfmk.d.ne %vm11, %v32 + +# CHECK-INST: vfmk.d.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x0f,0xb6] +vfmk.d.eq %vm1, %vix, %vm15 + +# CHECK-INST: vfmk.d.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x00,0xb6] +vfmk.d.ge %vm12, %v22 + +# CHECK-INST: vfmk.d.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x0f,0xb6] +vfmk.d.le %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.d.num %vm11, %v45 +# CHECK-ENCODING: encoding: [0x00,0x2d,0x07,0x0b,0x00,0x00,0x00,0xb6] +vfmk.d.num %vm11, %v45 + +# CHECK-INST: vfmk.d.nan %vm1, %v50, %vm14 +# CHECK-ENCODING: encoding: [0x00,0x32,0x08,0x01,0x00,0x00,0x0e,0xb6] +vfmk.d.nan %vm1, %v50, %vm14 + +# CHECK-INST: vfmk.d.gtnan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x09,0x0c,0x00,0x00,0x00,0xb6] +vfmk.d.gtnan %vm12, %v22 + +# CHECK-INST: vfmk.d.ltnan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0a,0x0c,0x00,0x00,0x0f,0xb6] +vfmk.d.ltnan %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.d.nenan %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x0b,0x0b,0x00,0x00,0x00,0xb6] +vfmk.d.nenan %vm11, %v32 + +# CHECK-INST: vfmk.d.eqnan %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0c,0x01,0x00,0x00,0x0f,0xb6] +vfmk.d.eqnan %vm1, %vix, %vm15 + +# CHECK-INST: vfmk.d.genan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x0d,0x0c,0x00,0x00,0x00,0xb6] +vfmk.d.genan %vm12, %v22 + +# CHECK-INST: vfmk.d.lenan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0e,0x0c,0x00,0x00,0x0f,0xb6] +vfmk.d.lenan %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x80,0xb6] +vfmk.s %vm11 + +# CHECK-INST: pvfmk.s.up.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x80,0xb6] +vfmk.s.at %vm11 + +# CHECK-INST: pvfmk.s.up.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x8f,0xb6] +vfmk.s.af %vm1, %vm15 + +# CHECK-INST: pvfmk.s.up.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x80,0xb6] +vfmk.s.gt %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x8f,0xb6] +vfmk.s.lt %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x80,0xb6] +vfmk.s.ne %vm11, %v32 + +# CHECK-INST: pvfmk.s.up.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x8f,0xb6] +vfmk.s.eq %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x80,0xb6] +vfmk.s.ge %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x8f,0xb6] +vfmk.s.le %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.num %vm11, %v45 +# CHECK-ENCODING: encoding: [0x00,0x2d,0x07,0x0b,0x00,0x00,0x80,0xb6] +vfmk.s.num %vm11, %v45 + +# CHECK-INST: pvfmk.s.up.nan %vm1, %v50, %vm14 +# CHECK-ENCODING: encoding: [0x00,0x32,0x08,0x01,0x00,0x00,0x8e,0xb6] +vfmk.s.nan %vm1, %v50, %vm14 + +# CHECK-INST: pvfmk.s.up.gtnan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x09,0x0c,0x00,0x00,0x80,0xb6] +vfmk.s.gtnan %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.ltnan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0a,0x0c,0x00,0x00,0x8f,0xb6] +vfmk.s.ltnan %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.nenan %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x0b,0x0b,0x00,0x00,0x80,0xb6] +vfmk.s.nenan %vm11, %v32 + +# CHECK-INST: pvfmk.s.up.eqnan %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0c,0x01,0x00,0x00,0x8f,0xb6] +vfmk.s.eqnan %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.genan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x0d,0x0c,0x00,0x00,0x80,0xb6] +vfmk.s.genan %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.lenan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0e,0x0c,0x00,0x00,0x8f,0xb6] +vfmk.s.lenan %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x80,0xb6] +pvfmk.s.up %vm11 + +# CHECK-INST: pvfmk.s.up.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x80,0xb6] +pvfmk.s.up.at %vm11 + +# CHECK-INST: pvfmk.s.up.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.af %vm1, %vm15 + +# CHECK-INST: pvfmk.s.up.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x80,0xb6] +pvfmk.s.up.gt %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.lt %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x80,0xb6] +pvfmk.s.up.ne %vm11, %v32 + +# CHECK-INST: pvfmk.s.up.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.eq %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x80,0xb6] +pvfmk.s.up.ge %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.le %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.num %vm11, %v45 +# CHECK-ENCODING: encoding: [0x00,0x2d,0x07,0x0b,0x00,0x00,0x80,0xb6] +pvfmk.s.up.num %vm11, %v45 + +# CHECK-INST: pvfmk.s.up.nan %vm1, %v50, %vm14 +# CHECK-ENCODING: encoding: [0x00,0x32,0x08,0x01,0x00,0x00,0x8e,0xb6] +pvfmk.s.up.nan %vm1, %v50, %vm14 + +# CHECK-INST: pvfmk.s.up.gtnan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x09,0x0c,0x00,0x00,0x80,0xb6] +pvfmk.s.up.gtnan %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.ltnan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0a,0x0c,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.ltnan %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.nenan %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x0b,0x0b,0x00,0x00,0x80,0xb6] +pvfmk.s.up.nenan %vm11, %v32 + +# CHECK-INST: pvfmk.s.up.eqnan %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0c,0x01,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.eqnan %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.s.up.genan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x0d,0x0c,0x00,0x00,0x80,0xb6] +pvfmk.s.up.genan %vm12, %v22 + +# CHECK-INST: pvfmk.s.up.lenan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0e,0x0c,0x00,0x00,0x8f,0xb6] +pvfmk.s.up.lenan %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.lo.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x40,0xb6] +pvfmk.s.lo %vm11 + +# CHECK-INST: pvfmk.s.lo.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.at %vm11 + +# CHECK-INST: pvfmk.s.lo.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.af %vm1, %vm15 + +# CHECK-INST: pvfmk.s.lo.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.gt %vm12, %v22 + +# CHECK-INST: pvfmk.s.lo.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.lt %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.lo.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.ne %vm11, %v32 + +# CHECK-INST: pvfmk.s.lo.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.eq %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.s.lo.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.ge %vm12, %v22 + +# CHECK-INST: pvfmk.s.lo.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.le %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.lo.num %vm11, %v45 +# CHECK-ENCODING: encoding: [0x00,0x2d,0x07,0x0b,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.num %vm11, %v45 + +# CHECK-INST: pvfmk.s.lo.nan %vm1, %v50, %vm14 +# CHECK-ENCODING: encoding: [0x00,0x32,0x08,0x01,0x00,0x00,0x4e,0xb6] +pvfmk.s.lo.nan %vm1, %v50, %vm14 + +# CHECK-INST: pvfmk.s.lo.gtnan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x09,0x0c,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.gtnan %vm12, %v22 + +# CHECK-INST: pvfmk.s.lo.ltnan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0a,0x0c,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.ltnan %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.s.lo.nenan %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x0b,0x0b,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.nenan %vm11, %v32 + +# CHECK-INST: pvfmk.s.lo.eqnan %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0c,0x01,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.eqnan %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.s.lo.genan %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x0d,0x0c,0x00,0x00,0x40,0xb6] +pvfmk.s.lo.genan %vm12, %v22 + +# CHECK-INST: pvfmk.s.lo.lenan %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x0e,0x0c,0x00,0x00,0x4f,0xb6] +pvfmk.s.lo.lenan %vm12, %vix, %vm15 diff --git a/test/MC/VE/VFMK.s b/test/MC/VE/VFMK.s new file mode 100644 index 00000000000..c10f321895a --- /dev/null +++ b/test/MC/VE/VFMK.s @@ -0,0 +1,40 @@ +# 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: vfmk.l.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0xb4] +vfmk.l %vm11 + +# CHECK-INST: vfmk.l.at %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x01,0x00,0x00,0x0f,0xb4] +vfmk.l.at %vm1, %vm15 + +# CHECK-INST: vfmk.l.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x0f,0xb4] +vfmk.l.af %vm1, %vm15 + +# CHECK-INST: vfmk.l.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x00,0xb4] +vfmk.l.gt %vm12, %v22 + +# CHECK-INST: vfmk.l.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x0f,0xb4] +vfmk.l.lt %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.l.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x00,0xb4] +vfmk.l.ne %vm11, %v32 + +# CHECK-INST: vfmk.l.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x0f,0xb4] +vfmk.l.eq %vm1, %vix, %vm15 + +# CHECK-INST: vfmk.l.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x00,0xb4] +vfmk.l.ge %vm12, %v22 + +# CHECK-INST: vfmk.l.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x0f,0xb4] +vfmk.l.le %vm12, %vix, %vm15 diff --git a/test/MC/VE/VFMS.s b/test/MC/VE/VFMS.s new file mode 100644 index 00000000000..801668905ce --- /dev/null +++ b/test/MC/VE/VFMS.s @@ -0,0 +1,112 @@ +# 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: vfmk.w.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0xb5] +vfmk.w %vm11 + +# CHECK-INST: vfmk.w.at %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x01,0x00,0x00,0x0f,0xb5] +vfmk.w.at %vm1, %vm15 + +# CHECK-INST: vfmk.w.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x0f,0xb5] +vfmk.w.af %vm1, %vm15 + +# CHECK-INST: vfmk.w.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x00,0xb5] +vfmk.w.gt %vm12, %v22 + +# CHECK-INST: vfmk.w.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x0f,0xb5] +vfmk.w.lt %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.w.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x00,0xb5] +vfmk.w.ne %vm11, %v32 + +# CHECK-INST: vfmk.w.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x0f,0xb5] +vfmk.w.eq %vm1, %vix, %vm15 + +# CHECK-INST: vfmk.w.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x00,0xb5] +vfmk.w.ge %vm12, %v22 + +# CHECK-INST: vfmk.w.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x0f,0xb5] +vfmk.w.le %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.w.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0xb5] +pvfmk.w.lo %vm11 + +# CHECK-INST: vfmk.w.at %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x01,0x00,0x00,0x0f,0xb5] +pvfmk.w.lo.at %vm1, %vm15 + +# CHECK-INST: vfmk.w.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x0f,0xb5] +pvfmk.w.lo.af %vm1, %vm15 + +# CHECK-INST: vfmk.w.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x00,0xb5] +pvfmk.w.lo.gt %vm12, %v22 + +# CHECK-INST: vfmk.w.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x0f,0xb5] +pvfmk.w.lo.lt %vm12, %vix, %vm15 + +# CHECK-INST: vfmk.w.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x00,0xb5] +pvfmk.w.lo.ne %vm11, %v32 + +# CHECK-INST: vfmk.w.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x0f,0xb5] +pvfmk.w.lo.eq %vm1, %vix, %vm15 + +# CHECK-INST: vfmk.w.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x00,0xb5] +pvfmk.w.lo.ge %vm12, %v22 + +# CHECK-INST: vfmk.w.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x0f,0xb5] +pvfmk.w.lo.le %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.w.up.at %vm11 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x80,0xb5] +pvfmk.w.up %vm11 + +# CHECK-INST: pvfmk.w.up.at %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x01,0x00,0x00,0x8f,0xb5] +pvfmk.w.up.at %vm1, %vm15 + +# CHECK-INST: pvfmk.w.up.af %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x01,0x00,0x00,0x8f,0xb5] +pvfmk.w.up.af %vm1, %vm15 + +# CHECK-INST: pvfmk.w.up.gt %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x01,0x0c,0x00,0x00,0x80,0xb5] +pvfmk.w.up.gt %vm12, %v22 + +# CHECK-INST: pvfmk.w.up.lt %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x02,0x0c,0x00,0x00,0x8f,0xb5] +pvfmk.w.up.lt %vm12, %vix, %vm15 + +# CHECK-INST: pvfmk.w.up.ne %vm11, %v32 +# CHECK-ENCODING: encoding: [0x00,0x20,0x03,0x0b,0x00,0x00,0x80,0xb5] +pvfmk.w.up.ne %vm11, %v32 + +# CHECK-INST: pvfmk.w.up.eq %vm1, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x04,0x01,0x00,0x00,0x8f,0xb5] +pvfmk.w.up.eq %vm1, %vix, %vm15 + +# CHECK-INST: pvfmk.w.up.ge %vm12, %v22 +# CHECK-ENCODING: encoding: [0x00,0x16,0x05,0x0c,0x00,0x00,0x80,0xb5] +pvfmk.w.up.ge %vm12, %v22 + +# CHECK-INST: pvfmk.w.up.le %vm12, %vix, %vm15 +# CHECK-ENCODING: encoding: [0x00,0xff,0x06,0x0c,0x00,0x00,0x8f,0xb5] +pvfmk.w.up.le %vm12, %vix, %vm15 diff --git a/test/MC/VE/XORM.s b/test/MC/VE/XORM.s new file mode 100644 index 00000000000..f1e5b81b0f4 --- /dev/null +++ b/test/MC/VE/XORM.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: xorm %vm0, %vm0, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86] +xorm %vm0, %vm0, %vm0 + +# CHECK-INST: xorm %vm11, %vm1, %vm15 +# CHECK-ENCODING: encoding: [0x00,0x0f,0x01,0x0b,0x00,0x00,0x00,0x86] +xorm %vm11, %vm1, %vm15 + +# CHECK-INST: xorm %vm11, %vm15, %vm0 +# CHECK-ENCODING: encoding: [0x00,0x00,0x0f,0x0b,0x00,0x00,0x00,0x86] +xorm %vm11, %vm15, %vm0