[PATCH] D35846: [X86][Asm]Allow far jmp/call to be picked when using explicit FWORD size specifier

coby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 10:15:47 PDT 2017


coby created this revision.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D35846

Files:
  lib/Target/X86/X86InstrControl.td
  test/MC/X86/intel-syntax.s


Index: lib/Target/X86/X86InstrControl.td
===================================================================
--- lib/Target/X86/X86InstrControl.td
+++ lib/Target/X86/X86InstrControl.td
@@ -171,7 +171,7 @@
                      "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 @@
                         "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]>;
   }
 
Index: test/MC/X86/intel-syntax.s
===================================================================
--- test/MC/X86/intel-syntax.s
+++ test/MC/X86/intel-syntax.s
@@ -33,6 +33,10 @@
 	movzx	EDI, WORD PTR [RCX + 2]
 // CHECK:	callq	_test
 	call	_test
+// CHECK: lcalll *(%rax)
+  call FWORD ptr [rax]
+// CHECK: ljmpl *(%rax)
+  jmp FWORD ptr [rax]
 // CHECK:	andw	$12,	%ax
 	and	ax, 12
 // CHECK:	andw	$-12,	%ax


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35846.108110.patch
Type: text/x-patch
Size: 1424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170725/e01b2211/attachment.bin>


More information about the llvm-commits mailing list