mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
01cf1a3805
The primary motivation of this change is to bring the code more closely in sync behavior wise with the assembler's version of nop emission. I'd like to eventually factor them into one, but that's hard to do when one has features the other doesn't. The longest encodeable nop on x86 is 15 bytes, but many processors - for instance all intel chips - can't decode the 15 byte form efficiently. On those processors, it's better to use either a 10 byte or 11 byte sequence depending.
341 lines
12 KiB
LLVM
341 lines
12 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=znver1 | FileCheck --check-prefix=CHECK-AMD %s
|
|
|
|
; Check that we get a fast sequence of nops on each platform.
|
|
|
|
define void @nop_test() {
|
|
; CHECK-LABEL: nop_test:
|
|
; CHECK: ## %bb.0: ## %entry
|
|
; CHECK-NEXT: pushq %rbp
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 16
|
|
; CHECK-NEXT: .cfi_offset %rbp, -16
|
|
; CHECK-NEXT: movq %rsp, %rbp
|
|
; CHECK-NEXT: .cfi_def_cfa_register %rbp
|
|
; CHECK-NEXT: Ltmp0:
|
|
; CHECK-NEXT: Ltmp1:
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: Ltmp2:
|
|
; CHECK-NEXT: xchgw %ax, %ax
|
|
; CHECK-NEXT: Ltmp3:
|
|
; CHECK-NEXT: nopl (%rax)
|
|
; CHECK-NEXT: Ltmp4:
|
|
; CHECK-NEXT: nopl 8(%rax)
|
|
; CHECK-NEXT: Ltmp5:
|
|
; CHECK-NEXT: nopl 8(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp6:
|
|
; CHECK-NEXT: nopw 8(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp7:
|
|
; CHECK-NEXT: nopl 512(%rax)
|
|
; CHECK-NEXT: Ltmp8:
|
|
; CHECK-NEXT: nopl 512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp9:
|
|
; CHECK-NEXT: nopw 512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp10:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp11:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: Ltmp12:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: xchgw %ax, %ax
|
|
; CHECK-NEXT: Ltmp13:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl (%rax)
|
|
; CHECK-NEXT: Ltmp14:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 8(%rax)
|
|
; CHECK-NEXT: Ltmp15:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 8(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp16:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw 8(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp17:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 512(%rax)
|
|
; CHECK-NEXT: Ltmp18:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp19:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw 512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp20:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp21:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: Ltmp22:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: xchgw %ax, %ax
|
|
; CHECK-NEXT: Ltmp23:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl (%rax)
|
|
; CHECK-NEXT: Ltmp24:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 8(%rax)
|
|
; CHECK-NEXT: Ltmp25:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 8(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp26:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw 8(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp27:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 512(%rax)
|
|
; CHECK-NEXT: Ltmp28:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopl 512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp29:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw 512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp30:
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-NEXT: Ltmp31:
|
|
; CHECK-NEXT: popq %rbp
|
|
; CHECK-NEXT: retq
|
|
;
|
|
; CHECK-AMD-LABEL: nop_test:
|
|
; CHECK-AMD: ## %bb.0: ## %entry
|
|
; CHECK-AMD-NEXT: pushq %rbp
|
|
; CHECK-AMD-NEXT: .cfi_def_cfa_offset 16
|
|
; CHECK-AMD-NEXT: .cfi_offset %rbp, -16
|
|
; CHECK-AMD-NEXT: movq %rsp, %rbp
|
|
; CHECK-AMD-NEXT: .cfi_def_cfa_register %rbp
|
|
; CHECK-AMD-NEXT: Ltmp0:
|
|
; CHECK-AMD-NEXT: Ltmp1:
|
|
; CHECK-AMD-NEXT: nop
|
|
; CHECK-AMD-NEXT: Ltmp2:
|
|
; CHECK-AMD-NEXT: xchgw %ax, %ax
|
|
; CHECK-AMD-NEXT: Ltmp3:
|
|
; CHECK-AMD-NEXT: nopl (%rax)
|
|
; CHECK-AMD-NEXT: Ltmp4:
|
|
; CHECK-AMD-NEXT: nopl 8(%rax)
|
|
; CHECK-AMD-NEXT: Ltmp5:
|
|
; CHECK-AMD-NEXT: nopl 8(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp6:
|
|
; CHECK-AMD-NEXT: nopw 8(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp7:
|
|
; CHECK-AMD-NEXT: nopl 512(%rax)
|
|
; CHECK-AMD-NEXT: Ltmp8:
|
|
; CHECK-AMD-NEXT: nopl 512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp9:
|
|
; CHECK-AMD-NEXT: nopw 512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp10:
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp11:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp12:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp13:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp14:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp15:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp16:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nop
|
|
; CHECK-AMD-NEXT: Ltmp17:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: xchgw %ax, %ax
|
|
; CHECK-AMD-NEXT: Ltmp18:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopl (%rax)
|
|
; CHECK-AMD-NEXT: Ltmp19:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopl 8(%rax)
|
|
; CHECK-AMD-NEXT: Ltmp20:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopl 8(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp21:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopw 8(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp22:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopl 512(%rax)
|
|
; CHECK-AMD-NEXT: Ltmp23:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopl 512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp24:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopw 512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp25:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp26:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp27:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp28:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp29:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp30:
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: .byte 102
|
|
; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax)
|
|
; CHECK-AMD-NEXT: Ltmp31:
|
|
; CHECK-AMD-NEXT: popq %rbp
|
|
; CHECK-AMD-NEXT: retq
|
|
entry:
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 1)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 2, i32 2)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 3, i32 3)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 4, i32 4)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 5, i32 5)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 6, i32 6)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 7, i32 7)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 8, i32 8)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 9, i32 9)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 10, i32 10)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 11, i32 11)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 12, i32 12)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 13, i32 13)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 14, i32 14)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 15, i32 15)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 16, i32 16)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 17, i32 17)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 18, i32 18)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 19, i32 19)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 20, i32 20)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 21, i32 21)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 22, i32 22)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 23, i32 23)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 24, i32 24)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 25, i32 25)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 26, i32 26)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 27, i32 27)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 28, i32 28)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 29, i32 29)
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 30, i32 30)
|
|
; Add an extra stackmap with a zero-length shadow to thwart the shadow
|
|
; optimization. This will force all 15 bytes of the previous shadow to be
|
|
; padded with nops.
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 31, i32 0)
|
|
ret void
|
|
}
|
|
|
|
declare void @llvm.experimental.stackmap(i64, i32, ...)
|