1 # RUN: llc -mtriple powerpc64le-unknown-linux-gnu -x mir -mcpu=pwr8 -mattr=-altivec \
2 # RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
3 # RUN: FileCheck %s --check-prefixes=CHECK,SAVEONE
5 # RUN: llc -mtriple powerpc64-unknown-linux-gnu -x mir -mcpu=pwr7 -mattr=-altivec \
6 # RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
7 # RUN: FileCheck %s --check-prefixes=CHECK,SAVEALL
10 # RUN: llc -mtriple powerpc64-unknown-aix-xcoff -x mir -mcpu=pwr4 -mattr=-altivec \
11 # RUN: -run-pass=prologepilog --verify-machineinstrs < %s | \
12 # RUN: FileCheck %s --check-prefixes=CHECK,SAVEALL
17 tracksRegLiveness: true
19 - { reg: '$x3', virtual-reg: '' }
23 renamable $x29 = ANDI8_rec killed renamable $x3, 1, implicit-def dead $cr0, implicit-def $cr0gt
24 renamable $cr2lt = COPY $cr0gt
25 renamable $cr4lt = COPY $cr0gt
26 renamable $x3 = COPY $x29
27 BLR8 implicit $lr8, implicit $rm, implicit $x3
29 ; CHECK-LABEL: fixedStack:
30 ; CHECK-NEXT: - { id: 0, type: spill-slot, offset: -24, size: 8, alignment: 8, stack-id: default,
31 ; CHECK-NEXT: callee-saved-register: '$x29', callee-saved-restored: true, debug-info-variable: '',
32 ; CHECK-NEXT: debug-info-expression: '', debug-info-location: '' }
33 ; CHECK-NEXT: - { id: 1, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
34 ; CHECK-NEXT: isImmutable: true, isAliased: false, callee-saved-register: '$cr4',
35 ; CHECK-NEXT: callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
36 ; CHECK-NEXT: debug-info-location: '' }
39 ; Verify the proper live-ins have been added in the prologue.
40 ; CHECK: liveins: $x3, $x29, $cr2, $cr4
42 ; CHECK: $x12 = MFCR8 implicit killed $cr2, implicit killed $cr4
43 ; CHECK-DAG: STD killed $x29, -24, $x1 :: (store (s64) into %fixed-stack.0)
44 ; CHECK-DAG: STW8 killed $x12, 8, $x1
46 ; CHECK: $x29 = LD -24, $x1 :: (load (s64) from %fixed-stack.0)
47 ; CHECK: $x12 = LWZ8 8, $x1
48 ; CHECK: $cr2 = MTOCRF8 $x12
49 ; CHECK: $cr4 = MTOCRF8 killed $x12
55 tracksRegLiveness: true
57 - { reg: '$x3', virtual-reg: '' }
61 renamable $x14 = ANDI8_rec killed renamable $x3, 1, implicit-def dead $cr0, implicit-def $cr0gt
62 renamable $cr2lt = COPY $cr0gt
63 renamable $x3 = COPY $x14
64 BLR8 implicit $lr8, implicit $rm, implicit $x3
66 ; CHECK-LABEL: CR2Save
68 ; CHECK-LABEL: fixedStack:
69 ; CHECK-NEXT: - { id: 0, type: spill-slot, offset: -144, size: 8, alignment: 16, stack-id: default,
70 ; CHECK-NEXT: callee-saved-register: '$x14', callee-saved-restored: true, debug-info-variable: '',
71 ; CHECK-NEXT: debug-info-expression: '', debug-info-location: '' }
72 ; CHECK-NEXT: - { id: 1, type: default, offset: 8, size: 4, alignment: 8, stack-id: default,
73 ; CHECK-NEXT: isImmutable: true, isAliased: false, callee-saved-register: '$cr2',
74 ; CHECK-NEXT: callee-saved-restored: true, debug-info-variable: '', debug-info-expression: '',
75 ; CHECK-NEXT: debug-info-location: '' }
78 ; Verify the proper live-ins have been added in the prologue.
79 ; CHECK: liveins: $x3, $x14, $cr2
81 ; ELF V2 ABI allows saving only the clobbered cr fields,
82 ; whereas the other ABIs do not.
83 ; SAVEONE: $x12 = MFOCRF8 killed $cr2
84 ; SAVEALL: $x12 = MFCR8 implicit killed $cr2
86 ; CHECK-DAG: STD killed $x14, -144, $x1 :: (store (s64) into %fixed-stack.0, align 16)
87 ; CHECK-DAG: STW8 killed $x12, 8, $x1
89 ; CHECK: $x14 = LD -144, $x1 :: (load (s64) from %fixed-stack.0, align 16)
90 ; CHECK: $x12 = LWZ8 8, $x1
91 ; CHECK: $cr2 = MTOCRF8 killed $x12