forked from OSchip/llvm-project
95 lines
3.6 KiB
YAML
95 lines
3.6 KiB
YAML
# RUN: llc -mtriple powerpc64le-unknown-linux-gnu -x mir -mcpu=pwr8 \
|
|
# RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
|
|
# RUN: FileCheck %s --check-prefixes=CHECK,SAVEONE,ELF
|
|
|
|
# RUN: llc -mtriple powerpc64-unknown-linux-gnu -x mir -mcpu=pwr7 \
|
|
# RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
|
|
# RUN: FileCheck %s --check-prefixes=CHECK,SAVEALL,ELF
|
|
|
|
|
|
# RUN: llc -mtriple powerpc64-unknown-aix-xcoff -x mir -mcpu=pwr4 \
|
|
# RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
|
|
# RUN: FileCheck %s --check-prefixes=CHECK,SAVEALL
|
|
|
|
# TODO FIXME: We only check the save and restores of the callee saved gpr for
|
|
# ELF becuase AIX callee saved registers haven't been properly implemented yet.
|
|
|
|
---
|
|
name: CRAllSave
|
|
alignment: 16
|
|
tracksRegLiveness: true
|
|
liveins:
|
|
- { reg: '$x3', virtual-reg: '' }
|
|
body: |
|
|
bb.0.entry:
|
|
liveins: $x3
|
|
renamable $x29 = ANDI8_rec killed renamable $x3, 1, implicit-def dead $cr0, implicit-def $cr0gt
|
|
renamable $cr2lt = COPY $cr0gt
|
|
renamable $cr4lt = COPY $cr0gt
|
|
renamable $x3 = COPY $x29
|
|
BLR8 implicit $lr8, implicit $rm, implicit $x3
|
|
|
|
; CHECK-LABEL: fixedStack:
|
|
; ELF: - { id: 1, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
|
|
; AIX: - { id: 0, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
|
|
; CHECK: isImmutable: true, isAliased: false, callee-saved-register: '$cr4',
|
|
; CHECK-NEXT: callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
|
|
; CHECK-NEXT: debug-info-location: '' }
|
|
; CHECK-LABEL: stack:
|
|
|
|
; Verify the proper live-ins have been added in the prologue.
|
|
; CHECK: liveins: $x3, $x29, $cr2, $cr4
|
|
|
|
; CHECK: $x12 = MFCR8 implicit killed $cr2, implicit killed $cr4
|
|
; ELF-DAG: STD killed $x29, -24, $x1 :: (store 8 into %fixed-stack.0)
|
|
; CHECK-DAG: STW8 killed $x12, 8, $x1
|
|
|
|
; ELF: $x29 = LD -24, $x1 :: (load 8 from %fixed-stack.0)
|
|
; CHECK: $x12 = LWZ8 8, $x1
|
|
; CHECK: $cr2 = MTOCRF8 $x12
|
|
; CHECK: $cr4 = MTOCRF8 killed $x12
|
|
|
|
...
|
|
---
|
|
name: CR2Save
|
|
alignment: 16
|
|
tracksRegLiveness: true
|
|
liveins:
|
|
- { reg: '$x3', virtual-reg: '' }
|
|
body: |
|
|
bb.0.entry:
|
|
liveins: $x3
|
|
renamable $x14 = ANDI8_rec killed renamable $x3, 1, implicit-def dead $cr0, implicit-def $cr0gt
|
|
renamable $cr2lt = COPY $cr0gt
|
|
renamable $x3 = COPY $x14
|
|
BLR8 implicit $lr8, implicit $rm, implicit $x3
|
|
|
|
; CHECK-LABEL: CR2Save
|
|
|
|
; CHECK-LABEL: fixedStack:
|
|
; ELF: - { id: 1, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
|
|
; AIX: - { id: 0, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
|
|
; CHECK: isImmutable: true, isAliased: false, callee-saved-register: '$cr2',
|
|
; CHECK-NEXT: callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
|
|
; CHECK-NEXT: debug-info-location: '' }
|
|
; CHECK-LABEL: stack:
|
|
|
|
; Verify the proper live-ins have been added in the prologue.
|
|
; CHECK: liveins: $x3, $x14, $cr2
|
|
|
|
; ELF V2 ABI allows saving only the clobbered cr fields,
|
|
; whereas the other ABIs do not.
|
|
; SAVEONE: $x12 = MFOCRF8 killed $cr2
|
|
; SAVEALL: $x12 = MFCR8 implicit killed $cr2
|
|
|
|
; ELF-DAG: STD killed $x14, -144, $x1 :: (store 8 into %fixed-stack.0, align 16)
|
|
; CHECK-DAG: STW8 killed $x12, 8, $x1
|
|
|
|
; ELF: $x14 = LD -144, $x1 :: (load 8 from %fixed-stack.0, align 16)
|
|
; CHECK: $x12 = LWZ8 8, $x1
|
|
; CHECK: $cr2 = MTOCRF8 killed $x12
|
|
|
|
|
|
...
|
|
|