xref: /aosp_15_r20/external/llvm/test/MC/X86/AlignedBundling/pad-bundle-groups.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
2*9880d681SAndroid Build Coastguard Worker# RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
4*9880d681SAndroid Build Coastguard Worker# RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker# Test some variations of padding for bundle-locked groups.
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker  .text
9*9880d681SAndroid Build Coastguard Workerfoo:
10*9880d681SAndroid Build Coastguard Worker  .bundle_align_mode 4
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker# Each of these callq instructions is 5 bytes long
13*9880d681SAndroid Build Coastguard Worker  callq   bar
14*9880d681SAndroid Build Coastguard Worker  callq   bar
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker  .bundle_lock
17*9880d681SAndroid Build Coastguard Worker  callq   bar
18*9880d681SAndroid Build Coastguard Worker  callq   bar
19*9880d681SAndroid Build Coastguard Worker  .bundle_unlock
20*9880d681SAndroid Build Coastguard Worker# We'll need a 6-byte NOP before this group
21*9880d681SAndroid Build Coastguard Worker# CHECK:        a:  nop
22*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:   10: callq
23*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:   15: callq
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker  .bundle_lock
26*9880d681SAndroid Build Coastguard Worker  callq   bar
27*9880d681SAndroid Build Coastguard Worker  callq   bar
28*9880d681SAndroid Build Coastguard Worker  .bundle_unlock
29*9880d681SAndroid Build Coastguard Worker# Same here
30*9880d681SAndroid Build Coastguard Worker# CHECK:        1a:  nop
31*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:   20: callq
32*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:   25: callq
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker  .align 16, 0x90
35*9880d681SAndroid Build Coastguard Worker  callq   bar
36*9880d681SAndroid Build Coastguard Worker  .bundle_lock
37*9880d681SAndroid Build Coastguard Worker  callq   bar
38*9880d681SAndroid Build Coastguard Worker  callq   bar
39*9880d681SAndroid Build Coastguard Worker  callq   bar
40*9880d681SAndroid Build Coastguard Worker  .bundle_unlock
41*9880d681SAndroid Build Coastguard Worker# And here we'll need a 11-byte NOP
42*9880d681SAndroid Build Coastguard Worker# CHECK:        30: callq
43*9880d681SAndroid Build Coastguard Worker# CHECK:        35: nop
44*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:   40: callq
45*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT:   45: callq
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Worker
49