From ef3866a85999129c3c3959d776b9437fa5301732 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 28 Apr 2018 06:02:40 +0000 Subject: [PATCH] [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. llvm-svn: 331102 --- llvm/lib/Target/X86/X86InstrMPX.td | 10 +++++----- llvm/test/MC/X86/mpx-encodings.s | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrMPX.td b/llvm/lib/Target/X86/X86InstrMPX.td index d0c4210..15129c3 100644 --- a/llvm/lib/Target/X86/X86InstrMPX.td +++ b/llvm/lib/Target/X86/X86InstrMPX.td @@ -21,7 +21,7 @@ let mayLoad = 1 in { def 32rm: I, Requires<[HasMPX, Not64BitMode]>; - def 64rm: RI, Requires<[HasMPX, In64BitMode]>; } @@ -34,14 +34,14 @@ let mayLoad = 1 in { def 32rm: I, Requires<[HasMPX, Not64BitMode]>; - def 64rm: RI, Requires<[HasMPX, In64BitMode]>; } def 32rr: I, Requires<[HasMPX, Not64BitMode]>; - def 64rr: RI, 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]>; diff --git a/llvm/test/MC/X86/mpx-encodings.s b/llvm/test/MC/X86/mpx-encodings.s index 6b98808..3bdd08c 100644 --- a/llvm/test/MC/X86/mpx-encodings.s +++ b/llvm/test/MC/X86/mpx-encodings.s @@ -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 -- 2.7.4