1 ; RUN: llc -mtriple=x86_64-windows -show-mc-encoding < %s | FileCheck %s 2 3 ; The Win64 ABI wants tail jmps to use a REX_W prefix so it can distinguish 4 ; in-function jumps from function exiting jumps. 5 6 define void @tail_jmp_reg(i32, i32, void ()* %fptr) { 7 tail call void () %fptr() 8 ret void 9 } 10 11 ; Check that we merge the REX prefixes into 0x49 instead of 0x48, 0x41. 12 13 ; CHECK-LABEL: tail_jmp_reg: 14 ; CHECK: rex64 jmpq *%r8 15 ; CHECK: encoding: [0x49,0xff,0xe0] 16 17 declare void @tail_tgt() 18 19 define void @tail_jmp_imm() { 20 tail call void @tail_tgt() 21 ret void 22 } 23 24 ; CHECK-LABEL: tail_jmp_imm: 25 ; CHECK: rex64 jmp tail_tgt 26 27 @g_fptr = global void ()* @tail_tgt 28 29 define void @tail_jmp_mem() { 30 %fptr = load void ()*, void ()** @g_fptr 31 tail call void () %fptr() 32 ret void 33 } 34 35 ; CHECK-LABEL: tail_jmp_mem: 36 ; CHECK: rex64 jmpq *g_fptr(%rip) 37