1 # RUN: llvm-mc -mcpu=skylake -filetype=obj -triple x86_64-pc-linux-gnu %s -x86-pad-max-prefix-size=5 -x86-pad-for-align=1 | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
3 # This test file highlights the interactions between prefix padding and
9 # We can both relax and prefix for padding purposes, but the moment, we
10 # can't prefix without first having relaxed.
17 # CHECK: a: 2e 2e 2e 2e 2e e9 0d 00 00 00 jmp
18 # CHECK: 14: 2e 2e 2e 2e 2e e9 03 00 00 00 jmp
19 # CHECK: 1e: 66 90 nop
34 # Canonical toy loop to show benefit - we can align the loop header with
35 # fewer nops by relaxing the branch, even though we don't need to
36 # CHECK: <loop_preheader>:
37 # CHECK: 45: 48 85 c0 testq %rax, %rax
38 # CHECK: 48: 2e 2e 2e 2e 0f 8e 1e 00 00 00 jle 0x70 <loop_exit>
39 # CHECK: 52: 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax)
40 # CHECK: <loop_header>:
41 # CHECK: 60: 48 83 e8 01 subq $1, %rax
42 # CHECK: 64: 48 85 c0 testq %rax, %rax
43 # CHECK: 67: 7e 07 jle 0x70 <loop_exit>
44 # CHECK: 69: 2e 2e e9 f0 ff ff ff jmp
62 # Correctness cornercase - can't prefix pad jmp without having relaxed it
63 # first as doing so would make the relative offset too large
65 # CHECK: fe: eb 80 jmp 0x80 <loop_exit+0x10>