[llvm] r331102 - [X86] Remove REX.W from 64-bit mode BND instructions.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 23:02:40 PDT 2018


Author: ctopper
Date: Fri Apr 27 23:02:40 2018
New Revision: 331102

URL: http://llvm.org/viewvc/llvm-project?rev=331102&view=rev
Log:
[X86] Remove REX.W from 64-bit mode BND instructions.

As far as I can tell from the docs, the instructions are automatically 64-bit in 64-bit mode. We don't need REX.W.

Modified:
    llvm/trunk/lib/Target/X86/X86InstrMPX.td
    llvm/trunk/test/MC/X86/mpx-encodings.s

Modified: llvm/trunk/lib/Target/X86/X86InstrMPX.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrMPX.td?rev=331102&r1=331101&r2=331102&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrMPX.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrMPX.td Fri Apr 27 23:02:40 2018
@@ -21,7 +21,7 @@ let mayLoad = 1 in {
   def 32rm: I<opc, MRMSrcMem, (outs BNDR:$dst), (ins i32mem:$src),
               OpcodeStr#"\t{$src, $dst|$dst, $src}", []>,
               Requires<[HasMPX, Not64BitMode]>;
-  def 64rm: RI<opc, MRMSrcMem, (outs BNDR:$dst), (ins i64mem:$src),
+  def 64rm: I<opc, MRMSrcMem, (outs BNDR:$dst), (ins i64mem:$src),
               OpcodeStr#"\t{$src, $dst|$dst, $src}", []>,
               Requires<[HasMPX, In64BitMode]>;
 }
@@ -34,14 +34,14 @@ let mayLoad = 1 in {
   def 32rm: I<opc, MRMSrcMem, (outs), (ins  BNDR:$src1, i32mem:$src2),
               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", []>,
               Requires<[HasMPX, Not64BitMode]>;
-  def 64rm: RI<opc, MRMSrcMem, (outs), (ins  BNDR:$src1, i64mem:$src2),
+  def 64rm: I<opc, MRMSrcMem, (outs), (ins  BNDR:$src1, i64mem:$src2),
               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", []>,
               Requires<[HasMPX, In64BitMode]>;
 }
   def 32rr: I<opc, MRMSrcReg, (outs), (ins  BNDR:$src1, GR32:$src2),
               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", []>,
               Requires<[HasMPX, Not64BitMode]>;
-  def 64rr: RI<opc, MRMSrcReg, (outs), (ins  BNDR:$src1, GR64:$src2),
+  def 64rr: I<opc, MRMSrcReg, (outs), (ins  BNDR:$src1, GR64:$src2),
               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", []>,
               Requires<[HasMPX, In64BitMode]>;
 }
@@ -56,7 +56,7 @@ let mayLoad = 1 in {
 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),
+def BNDMOV64rm : I<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i128mem:$src),
                   "bndmov\t{$src, $dst|$dst, $src}", []>, PD,
                   Requires<[HasMPX, In64BitMode]>;
 }
@@ -68,7 +68,7 @@ let mayStore = 1 in {
 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),
+def BNDMOV64mr : I<0x1B, MRMDestMem, (outs), (ins i128mem:$dst, BNDR:$src),
                   "bndmov\t{$src, $dst|$dst, $src}", []>, PD,
                   Requires<[HasMPX, In64BitMode]>;
 

Modified: llvm/trunk/test/MC/X86/mpx-encodings.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/mpx-encodings.s?rev=331102&r1=331101&r2=331102&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/mpx-encodings.s (original)
+++ llvm/trunk/test/MC/X86/mpx-encodings.s Fri Apr 27 23:02:40 2018
@@ -5,11 +5,11 @@
 // RUN:   llvm-objdump -d - | FileCheck %s
 
 // CHECK: bndmk (%rax), %bnd0
-// ENCODING:  encoding: [0xf3,0x48,0x0f,0x1b,0x00]
+// ENCODING:  encoding: [0xf3,0x0f,0x1b,0x00]
 bndmk (%rax), %bnd0
 
 // CHECK: bndmk 1024(%rax), %bnd1
-// ENCODING:  encoding: [0xf3,0x48,0x0f,0x1b,0x88,0x00,0x04,0x00,0x00]
+// ENCODING:  encoding: [0xf3,0x0f,0x1b,0x88,0x00,0x04,0x00,0x00]
 bndmk 1024(%rax), %bnd1
 
 // CHECK: bndmov  %bnd2, %bnd1
@@ -17,7 +17,7 @@ bndmk 1024(%rax), %bnd1
 bndmov %bnd2, %bnd1
 
 // CHECK: bndmov %bnd1, 1024(%r9)
-// ENCODING:  encoding: [0x66,0x49,0x0f,0x1b,0x89,0x00,0x04,0x00,0x00]
+// ENCODING:  encoding: [0x66,0x41,0x0f,0x1b,0x89,0x00,0x04,0x00,0x00]
 bndmov %bnd1, 1024(%r9)
 
 // CHECK: bndstx %bnd1, 1024(%rax)
@@ -29,13 +29,13 @@ bndstx %bnd1, 1024(%rax)
 bndldx 1024(%r8), %bnd1
 
 // CHECK: bndcl 121(%r10), %bnd1
-// ENCODING:  encoding: [0xf3,0x49,0x0f,0x1a,0x4a,0x79]
+// ENCODING:  encoding: [0xf3,0x41,0x0f,0x1a,0x4a,0x79]
 bndcl 121(%r10), %bnd1
 
 // CHECK: bndcn 121(%rcx), %bnd3
-// ENCODING:  encoding: [0xf2,0x48,0x0f,0x1b,0x59,0x79]
+// ENCODING:  encoding: [0xf2,0x0f,0x1b,0x59,0x79]
 bndcn 121(%rcx), %bnd3
 
 // CHECK: bndcu %rdx, %bnd3
-// ENCODING:  encoding: [0xf2,0x48,0x0f,0x1a,0xda]
+// ENCODING:  encoding: [0xf2,0x0f,0x1a,0xda]
 bndcu %rdx, %bnd3




More information about the llvm-commits mailing list