1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-aix \
3 ; RUN: -mcpu=pwr7 < %s | FileCheck %s
5 declare i32 @llvm.ppc.mfspr.i32(i32 immarg)
6 declare void @llvm.ppc.mtspr.i32(i32 immarg, i32)
8 @ula = external dso_local global i32, align 4
10 define dso_local i32 @test_mfxer() {
11 ; CHECK-LABEL: test_mfxer:
12 ; CHECK: # %bb.0: # %entry
16 %0 = call i32 @llvm.ppc.mfspr.i32(i32 1)
20 define dso_local i32 @test_mflr() {
21 ; CHECK-LABEL: test_mflr:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: mfspr 3, 8
26 %0 = call i32 @llvm.ppc.mfspr.i32(i32 8)
30 define dso_local i32 @test_mfctr() {
31 ; CHECK-LABEL: test_mfctr:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: mfspr 3, 9
36 %0 = call i32 @llvm.ppc.mfspr.i32(i32 9)
40 define dso_local i32 @test_mfppr() {
41 ; CHECK-LABEL: test_mfppr:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: mfspr 3, 896
46 %0 = call i32 @llvm.ppc.mfspr.i32(i32 896)
50 define dso_local i32 @test_mfppr32() {
51 ; CHECK-LABEL: test_mfppr32:
52 ; CHECK: # %bb.0: # %entry
53 ; CHECK-NEXT: mfspr 3, 898
56 %0 = call i32 @llvm.ppc.mfspr.i32(i32 898)
60 define dso_local void @test_mtxer() {
61 ; CHECK-LABEL: test_mtxer:
62 ; CHECK: # %bb.0: # %entry
63 ; CHECK-NEXT: lwz 3, L..C0(2) # @ula
64 ; CHECK-NEXT: lwz 3, 0(3)
68 %0 = load i32, ptr @ula, align 8
69 tail call void @llvm.ppc.mtspr.i32(i32 1, i32 %0)
73 define dso_local void @test_mtlr() {
74 ; CHECK-LABEL: test_mtlr:
75 ; CHECK: # %bb.0: # %entry
76 ; CHECK-NEXT: lwz 3, L..C0(2) # @ula
77 ; CHECK-NEXT: lwz 3, 0(3)
78 ; CHECK-NEXT: mtspr 8, 3
81 %0 = load i32, ptr @ula, align 8
82 tail call void @llvm.ppc.mtspr.i32(i32 8, i32 %0)
86 define dso_local void @test_mtctr() {
87 ; CHECK-LABEL: test_mtctr:
88 ; CHECK: # %bb.0: # %entry
89 ; CHECK-NEXT: lwz 3, L..C0(2) # @ula
90 ; CHECK-NEXT: lwz 3, 0(3)
91 ; CHECK-NEXT: mtspr 9, 3
94 %0 = load i32, ptr @ula, align 8
95 tail call void @llvm.ppc.mtspr.i32(i32 9, i32 %0)
99 define dso_local void @test_mtppr() {
100 ; CHECK-LABEL: test_mtppr:
101 ; CHECK: # %bb.0: # %entry
102 ; CHECK-NEXT: lwz 3, L..C0(2) # @ula
103 ; CHECK-NEXT: lwz 3, 0(3)
104 ; CHECK-NEXT: mtspr 896, 3
107 %0 = load i32, ptr @ula, align 8
108 tail call void @llvm.ppc.mtspr.i32(i32 896, i32 %0)
112 define dso_local void @test_mtppr32() {
113 ; CHECK-LABEL: test_mtppr32:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: lwz 3, L..C0(2) # @ula
116 ; CHECK-NEXT: lwz 3, 0(3)
117 ; CHECK-NEXT: mtspr 898, 3
120 %0 = load i32, ptr @ula, align 8
121 tail call void @llvm.ppc.mtspr.i32(i32 898, i32 %0)