[llvm] r310485 - [X86][Asm]Allow far jmp/call to be picked when using explicit FWORD size specifier
Coby Tayree via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 08:34:55 PDT 2017
Author: coby
Date: Wed Aug 9 08:34:55 2017
New Revision: 310485
URL: http://llvm.org/viewvc/llvm-project?rev=310485&view=rev
Log:
[X86][Asm]Allow far jmp/call to be picked when using explicit FWORD size specifier
Currently, far jmp/call which utilizes a 48bit memory operand would have been invoked via the 'lcall/ljmp' mnemonic (intel style).
This patch align those variants to formal intel spec
Differential Revision: https://reviews.llvm.org/D35846
Modified:
llvm/trunk/lib/Target/X86/X86InstrControl.td
llvm/trunk/test/MC/X86/intel-syntax.s
llvm/trunk/test/MC/X86/x86-64.s
Modified: llvm/trunk/lib/Target/X86/X86InstrControl.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrControl.td?rev=310485&r1=310484&r2=310485&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrControl.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrControl.td Wed Aug 9 08:34:55 2017
@@ -171,7 +171,7 @@ let isBranch = 1, isTerminator = 1, isBa
"ljmp{w}\t{*}$dst", [], IIC_JMP_FAR_MEM>, OpSize16,
Sched<[WriteJumpLd]>;
def FARJMP32m : I<0xFF, MRM5m, (outs), (ins opaque48mem:$dst),
- "ljmp{l}\t{*}$dst", [], IIC_JMP_FAR_MEM>, OpSize32,
+ "{l}jmp{l}\t{*}$dst", [], IIC_JMP_FAR_MEM>, OpSize32,
Sched<[WriteJumpLd]>;
}
@@ -233,7 +233,7 @@ let isCall = 1 in
"lcall{w}\t{*}$dst", [], IIC_CALL_FAR_MEM>, OpSize16,
Sched<[WriteJumpLd]>;
def FARCALL32m : I<0xFF, MRM3m, (outs), (ins opaque48mem:$dst),
- "lcall{l}\t{*}$dst", [], IIC_CALL_FAR_MEM>, OpSize32,
+ "{l}call{l}\t{*}$dst", [], IIC_CALL_FAR_MEM>, OpSize32,
Sched<[WriteJumpLd]>;
}
Modified: llvm/trunk/test/MC/X86/intel-syntax.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/intel-syntax.s?rev=310485&r1=310484&r2=310485&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/intel-syntax.s (original)
+++ llvm/trunk/test/MC/X86/intel-syntax.s Wed Aug 9 08:34:55 2017
@@ -50,6 +50,15 @@ main:
// CHECK: leaq 8(%rax), %rdx
lea RDX, [8 + RAX]
+// CHECK: lcalll *(%rax)
+ call FWORD ptr [rax]
+// CHECK: lcalll *(%rax)
+ lcall [rax]
+// CHECK: ljmpl *(%rax)
+ jmp FWORD ptr [rax]
+// CHECK: ljmpl *(%rax)
+ ljmp [rax]
+
// CHECK: movl $257, -4(%rsp)
mov DWORD PTR [RSP - 4], 257
// CHECK: movl $258, 4(%rsp)
Modified: llvm/trunk/test/MC/X86/x86-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=310485&r1=310484&r2=310485&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Wed Aug 9 08:34:55 2017
@@ -394,11 +394,14 @@ shrd %cl, %bx, (%rax)
sldt %ecx
sldt %cx
-// CHECK: lcalll *3135175374
-// CHECK: ljmpl *3135175374
-lcall *0xbadeface
-ljmp *0xbadeface
-
+// CHECK: lcalll *3135175374
+// CHECK: ljmpl *3135175374
+// CHECK: lcalll *(%rax)
+// CHECK: ljmpl *(%rax)
+lcall *0xbadeface
+ljmp *0xbadeface
+lcall *(%rax)
+ljmpl *(%rax)
// rdar://8444631
// CHECK: enter $31438, $0
More information about the llvm-commits
mailing list