Debian Codegraph @

llvm/test/CodeGen/PowerPC/vrsave-inline-asm.ll

raw
1 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=powerpc-unknown-linux-gnu -verify-machineinstrs < %s | FileCheck %s
4
5 ; RUN: llc -mtriple=powerpc64-unknown-freebsd -verify-machineinstrs < %s | FileCheck %s
6 ; RUN: llc -mtriple=powerpc-unknown-freebsd -verify-machineinstrs < %s | FileCheck %s
7
8 define dso_local void @moveToVRSave(i32 signext %i) {
9 entry:
10 tail call void asm sideeffect "mtvrsave $0", "r,~{vrsave}"(i32 %i)
11 ret void
12 }
13
14 define dso_local signext i32 @moveFromVRSave() {
15 entry:
16 %0 = tail call i32 asm sideeffect "mfvrsave $0", "=r"()
17 ret i32 %0
18 }
19
20 define dso_local void @moveToSPR(i32 signext %i) {
21 entry:
22 tail call void asm sideeffect "mtspr 256, $0", "r,~{vrsave}"(i32 %i)
23 ret void
24 }
25
26 define dso_local signext i32 @moveFromSPR() {
27 entry:
28 %0 = tail call i32 asm sideeffect "mfspr $0, 256", "=r"()
29 ret i32 %0
30 }
31
32 ; CHECK-LABEL: moveToVRSave:
33 ; CHECK: mtvrsave 3
34
35 ; CHECK-LABEL: moveFromVRSave:
36 ; CHECK: mfvrsave {{[0-9]+}}
37
38 ; CHECK-LABEL: moveToSPR:
39 ; CHECK: mtspr 256, 3
40
41 ; CHECK-LABEL: moveFromSPR:
42 ; CHECK: mfspr {{[0-9]}}, 256