61 lines · plain
1# RUN: rm -rf %t && split-file %s %t && cd %t2# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc foo.s | llvm-objdump -d --no-show-raw-insn - | FileCheck foo.s3# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc -x86-pad-max-prefix-size=1 bar.s | llvm-objdump -d --no-show-raw-insn - | FileCheck bar.s4 5 # Exercise cases where fused instructions need to be aligned.6 7#--- foo.s8 .text9 .globl foo10foo:11 .p2align 512 .rept 3013 int314 .endr15 # 'cmp %rax, %rbp' is macro fused with 'jne foo',16 # so we need to align the pair.17 # CHECK: 20: cmpq %rax, %rbp18 # CHECK: 23: jne19 cmp %rax, %rbp20 jne foo21 int322 23 .p2align 524 .rept 2825 int326 .endr27 # 'cmp %rax, %rbp' is fusible but can not fused with `jo foo`,28 # so we only need to align 'jo foo'.29 # CHECK: 5c: cmpq %rax, %rbp30 cmp %rax, %rbp31 # CHECK: 60: jo32 jo foo33 int334 35 .p2align 536 .rept 2637 int338 .endr39 # The second 'cmp %rax, %rbp' is macro fused with 'jne foo'.40 cmp %rax, %rbp41 # CHECK: a0: cmpq %rax, %rbp42 # CHECK: a3: jne43 cmp %rax, %rbp44 jne foo45 int346 47# Exercise the case where fused instructions need to be aligned,48# ensuring fusion is not broken by a NOP49 50#--- bar.s51 .text52 .globl bar53bar:54 .nops 2755# CHECK: 20: testq %rcx, %rcx56# CHECK: 23: je57 testq %rcx, %rcx58 je .EXIT59.EXIT:60 ret61