mftb.ll
2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
; Check handling of the mftb instruction.
; For CPUs 601 and pwr3, the mftb instruction should be emitted.
; On all other CPUs (including generic, ppc, ppc64), the mfspr instruction
; should be used instead. There should no longer be a deprecated warning
; message emittedfor this instruction for any CPU.
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=ppc < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=601 < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFTB
; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=pwr3 < %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MFTB
; CHECK-MFSPR-NOT: warning: deprecated
; CHECK-MFTB-NOT: warning: deprecated
define i32 @get_time() {
%time = call i32 asm "mftb $0, 268", "=r"()
ret i32 %time
; CHECK-MFSPR-LABEL: @get_time
; CHECK-MFSPR: mfspr 3, 268
; CHECK-MFSPR: blr
; CHECK-MFTB-LABEL: @get_time
; CHECK-MFTB: mftb 3, 268
; CHECK-MFTB: blr
}
define i32 @get_timeu() {
%time = call i32 asm "mftb $0, 269", "=r"()
ret i32 %time
; CHECK-MFSPR-LABEL: @get_timeu
; CHECK-MFSPR: mfspr 3, 269
; CHECK-MFSPR: blr
; CHECK-MFTB-LABEL: @get_timeu
; CHECK-MFTB: mftbu 3
; CHECK-MFTB: blr
}
define i32 @get_time_e() {
%time = call i32 asm "mftb $0", "=r"()
ret i32 %time
; CHECK-MFSPR-LABEL: @get_time_e
; CHECK-MFSPR: mfspr 3, 268
; CHECK-MFSPR: blr
; CHECK-MFTB-LABEL: @get_time_e
; CHECK-MFTB: mftb 3, 268
; CHECK-MFTB: blr
}
define i32 @get_timeu_e() {
%time = call i32 asm "mftbu $0", "=r"()
ret i32 %time
; CHECK-MFSPR-LABEL: @get_timeu_e
; CHECK-MFSPR: mfspr 3, 269
; CHECK-MFSPR: blr
; CHECK-MFTB-LABEL: @get_timeu_e
; CHECK-MFTB: mftbu 3
; CHECK-MFTB: blr
}