diff options
author | Craig Topper <craig.topper@intel.com> | 2018-04-28 06:02:39 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-04-28 06:02:39 +0000 |
commit | 8a6532ae84d499b91a22de291b10bb54ebd18a8b (patch) | |
tree | 26330692aa43161a34ec7d6a01d9d1abd3083a06 | |
parent | 303572f3df5191af793bbdd402f7eb7b1008ee68 (diff) | |
download | bcm5719-llvm-8a6532ae84d499b91a22de291b10bb54ebd18a8b.tar.gz bcm5719-llvm-8a6532ae84d499b91a22de291b10bb54ebd18a8b.zip |
[X86] Rename BNDMOV instructions and hide redundant instruction encoding from the assembler.
Favor the 0x1a encoding for register/register move to match gas.
The instructions used RM and MR in their name along with rr/rm/mr at the end. To make more consistent with other instructions remove the RM/MR and use rr/rm/mr/rr_REV.
Hide the _REV encoding from the assembler but leave it for the disassembler.
llvm-svn: 331101
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrMPX.td | 37 | ||||
-rw-r--r-- | llvm/test/MC/X86/mpx-encodings.s | 2 |
3 files changed, 22 insertions, 21 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 3261b88b95b..8934f8810b4 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -6936,9 +6936,9 @@ static unsigned getLoadStoreRegOpcode(unsigned Reg, } if (X86::BNDRRegClass.hasSubClassEq(RC)) { if (STI.is64Bit()) - return load ? X86::BNDMOVRM64rm : X86::BNDMOVMR64mr; + return load ? X86::BNDMOV64rm : X86::BNDMOV64mr; else - return load ? X86::BNDMOVRM32rm : X86::BNDMOVMR32mr; + return load ? X86::BNDMOV32rm : X86::BNDMOV32mr; } llvm_unreachable("Unknown 16-byte regclass"); } diff --git a/llvm/lib/Target/X86/X86InstrMPX.td b/llvm/lib/Target/X86/X86InstrMPX.td index e4156b8f9b4..d0c421038dd 100644 --- a/llvm/lib/Target/X86/X86InstrMPX.td +++ b/llvm/lib/Target/X86/X86InstrMPX.td @@ -49,27 +49,28 @@ defm BNDCL : mpx_bound_check<0x1A, "bndcl">, XS; defm BNDCU : mpx_bound_check<0x1A, "bndcu">, XD; defm BNDCN : mpx_bound_check<0x1B, "bndcn">, XD; -def BNDMOVRMrr : I<0x1A, MRMSrcReg, (outs BNDR:$dst), (ins BNDR:$src), - "bndmov\t{$src, $dst|$dst, $src}", []>, PD, - Requires<[HasMPX]>; +def BNDMOVrr : I<0x1A, MRMSrcReg, (outs BNDR:$dst), (ins BNDR:$src), + "bndmov\t{$src, $dst|$dst, $src}", []>, PD, + Requires<[HasMPX]>; let mayLoad = 1 in { -def BNDMOVRM32rm : I<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i64mem:$src), - "bndmov\t{$src, $dst|$dst, $src}", []>, PD, - Requires<[HasMPX, Not64BitMode]>; -def BNDMOVRM64rm : RI<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i128mem:$src), - "bndmov\t{$src, $dst|$dst, $src}", []>, PD, - Requires<[HasMPX, In64BitMode]>; +def BNDMOV32rm : I<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i64mem:$src), + "bndmov\t{$src, $dst|$dst, $src}", []>, PD, + Requires<[HasMPX, Not64BitMode]>; +def BNDMOV64rm : RI<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i128mem:$src), + "bndmov\t{$src, $dst|$dst, $src}", []>, PD, + Requires<[HasMPX, In64BitMode]>; } -def BNDMOVMRrr : I<0x1B, MRMDestReg, (outs BNDR:$dst), (ins BNDR:$src), - "bndmov\t{$src, $dst|$dst, $src}", []>, PD, - Requires<[HasMPX]>; +let isCodeGenOnly = 1, ForceDisassemble = 1 in +def BNDMOVrr_REV : I<0x1B, MRMDestReg, (outs BNDR:$dst), (ins BNDR:$src), + "bndmov\t{$src, $dst|$dst, $src}", []>, PD, + Requires<[HasMPX]>; let mayStore = 1 in { -def BNDMOVMR32mr : I<0x1B, MRMDestMem, (outs), (ins i64mem:$dst, BNDR:$src), - "bndmov\t{$src, $dst|$dst, $src}", []>, PD, - Requires<[HasMPX, Not64BitMode]>; -def BNDMOVMR64mr : RI<0x1B, MRMDestMem, (outs), (ins i128mem:$dst, BNDR:$src), - "bndmov\t{$src, $dst|$dst, $src}", []>, PD, - Requires<[HasMPX, In64BitMode]>; +def BNDMOV32mr : I<0x1B, MRMDestMem, (outs), (ins i64mem:$dst, BNDR:$src), + "bndmov\t{$src, $dst|$dst, $src}", []>, PD, + Requires<[HasMPX, Not64BitMode]>; +def BNDMOV64mr : RI<0x1B, MRMDestMem, (outs), (ins i128mem:$dst, BNDR:$src), + "bndmov\t{$src, $dst|$dst, $src}", []>, PD, + Requires<[HasMPX, In64BitMode]>; def BNDSTXmr: I<0x1B, MRMDestMem, (outs), (ins i64mem:$dst, BNDR:$src), "bndstx\t{$src, $dst|$dst, $src}", []>, PS, diff --git a/llvm/test/MC/X86/mpx-encodings.s b/llvm/test/MC/X86/mpx-encodings.s index 3aaab2c54ec..6b98808e1b6 100644 --- a/llvm/test/MC/X86/mpx-encodings.s +++ b/llvm/test/MC/X86/mpx-encodings.s @@ -13,7 +13,7 @@ bndmk (%rax), %bnd0 bndmk 1024(%rax), %bnd1 // CHECK: bndmov %bnd2, %bnd1 -// ENCODING: encoding: [0x66,0x0f,0x1b,0xd1] +// ENCODING: encoding: [0x66,0x0f,0x1a,0xca] bndmov %bnd2, %bnd1 // CHECK: bndmov %bnd1, 1024(%r9) |