1 ; Check handling of the mftb instruction.
2 ; For CPUs 601 and pwr3, the mftb instruction should be emitted.
3 ; On all other CPUs (including generic, ppc, ppc64), the mfspr instruction
4 ; should be used instead. There should no longer be a deprecated warning
5 ; message emittedfor this instruction for any CPU.
7 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s 2>&1 \
8 ; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
9 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s 2>&1 \
10 ; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
11 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s 2>&1 \
12 ; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
13 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu < %s 2>&1 \
14 ; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
15 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=ppc < %s 2>&1 \
16 ; RUN: | FileCheck %s --check-prefix=CHECK-MFSPR
17 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=601 < %s 2>&1 \
18 ; RUN: | FileCheck %s --check-prefix=CHECK-MFTB
19 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=pwr3 < %s 2>&1 \
20 ; RUN: | FileCheck %s --check-prefix=CHECK-MFTB
22 ; CHECK-MFSPR-NOT: warning: deprecated
23 ; CHECK-MFTB-NOT: warning: deprecated
25 define i32 @get_time() {
26 %time = call i32 asm "mftb $0, 268", "=r"()
28 ; CHECK-MFSPR-LABEL: @get_time
29 ; CHECK-MFSPR: mfspr 3, 268
32 ; CHECK-MFTB-LABEL: @get_time
33 ; CHECK-MFTB: mftb 3, 268
37 define i32 @get_timeu() {
38 %time = call i32 asm "mftb $0, 269", "=r"()
40 ; CHECK-MFSPR-LABEL: @get_timeu
41 ; CHECK-MFSPR: mfspr 3, 269
44 ; CHECK-MFTB-LABEL: @get_timeu
49 define i32 @get_time_e() {
50 %time = call i32 asm "mftb $0", "=r"()
52 ; CHECK-MFSPR-LABEL: @get_time_e
53 ; CHECK-MFSPR: mfspr 3, 268
56 ; CHECK-MFTB-LABEL: @get_time_e
57 ; CHECK-MFTB: mftb 3, 268
61 define i32 @get_timeu_e() {
62 %time = call i32 asm "mftbu $0", "=r"()
64 ; CHECK-MFSPR-LABEL: @get_timeu_e
65 ; CHECK-MFSPR: mfspr 3, 269
68 ; CHECK-MFTB-LABEL: @get_timeu_e