1 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
2 ; RUN: -stop-before=finalize-isel -verify-machineinstrs | \
3 ; RUN: FileCheck -check-prefix=BEFORE-FINALIZE-ISEL %s
4 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
5 ; RUN: -stop-after=finalize-isel -verify-machineinstrs | \
6 ; RUN: FileCheck -check-prefix=AFTER-FINALIZE-ISEL %s
7 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
8 ; RUN: -verify-machineinstrs | FileCheck %s
9 ; RUN: llc -mcpu=pwr7 -mtriple=powerpc64le-unknown-linux-gnu < %s \
10 ; RUN: -verify-machineinstrs | FileCheck -check-prefix=CHECK-PWR7 %s
12 define double @test_setrndi() {
14 %0 = tail call double @llvm.ppc.setrnd(i32 2)
17 ; BEFORE-FINALIZE-ISEL: test_setrndi
18 ; BEFORE-FINALIZE-ISEL: SETRNDi 2, implicit-def dead $rm, implicit $rm
20 ; AFTER-FINALIZE-ISEL: test_setrndi
21 ; AFTER-FINALIZE-ISEL: MFFS implicit $rm
22 ; AFTER-FINALIZE-ISEL: MTFSB0 31, implicit-def $rm
23 ; AFTER-FINALIZE-ISEL: MTFSB1 30, implicit-def $rm
25 ; CHECK-LABEL: @test_setrndi
28 ; CHECK-DAG: mtfsb0 31
29 ; CHECK-DAG: mtfsb1 30
33 define double @test_setrnd(i32 signext %x) {
35 %0 = tail call double @llvm.ppc.setrnd(i32 %x)
38 ; BEFORE-FINALIZE-ISEL: test_setrnd
39 ; BEFORE-FINALIZE-ISEL: SETRND killed %1, implicit-def dead $rm, implicit $rm
41 ; AFTER-FINALIZE-ISEL: test_setrnd
42 ; AFTER-FINALIZE-ISEL: MFFS implicit $rm
43 ; AFTER-FINALIZE-ISEL: MTFSF 255, %7, 0, 0, implicit-def $rm
45 ; CHECK-LABEL: @test_setrnd
48 ; CHECK-DAG: mffprd [[REG1:[0-9]+]], 1
49 ; CHECK-DAG: rldimi [[REG1]], 3, 0, 62
50 ; CHECK-DAG: mtfprd [[REG2:[0-9]+]], [[REG1]]
51 ; CHECK-DAG: mtfsf 255, [[REG2]]
54 ; CHECK-PWR7-LABEL: @test_setrnd
55 ; CHECK-PWR7: # %bb.0:
56 ; CHECK-PWR7-DAG: mffs 1
57 ; CHECK-PWR7-DAG: stfd 1, -8(1)
58 ; CHECK-PWR7-DAG: ld [[REG1:[0-9]+]], -8(1)
59 ; CHECK-PWR7-DAG: rldimi [[REG1]], 3, 0, 62
60 ; CHECK-PWR7-DAG: std [[REG1]], -16(1)
61 ; CHECK-PWR7-DAG: lfd [[REG2:[0-9]+]], -16(1)
62 ; CHECK-PWR7-DAG: mtfsf 255, [[REG2]]
66 declare double @llvm.ppc.setrnd(i32)