1 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
2 ; RUN: -verify-machineinstrs | FileCheck %s
3 ; RUN: llc -mcpu=pwr7 -mtriple=powerpc64le-unknown-linux-gnu < %s \
4 ; RUN: -verify-machineinstrs | FileCheck -check-prefix=CHECK-PWR7 %s
6 define double @test_setrndi() {
8 %0 = tail call double @llvm.ppc.setrnd(i32 2)
11 ; CHECK-LABEL: @test_setrndi
14 ; CHECK-DAG: mtfsb0 31
15 ; CHECK-DAG: mtfsb1 30
19 define double @test_setrnd(i32 signext %x) {
21 %0 = tail call double @llvm.ppc.setrnd(i32 %x)
24 ; CHECK-LABEL: @test_setrnd
27 ; CHECK-DAG: mffprd [[REG1:[0-9]+]], 1
28 ; CHECK-DAG: rldimi [[REG1]], 3, 0, 62
29 ; CHECK-DAG: mtvsrd [[REG2:[0-9]+]], [[REG1]]
30 ; CHECK-DAG: mtfsf 255, [[REG2]]
33 ; CHECK-PWR7-LABEL: @test_setrnd
34 ; CHECK-PWR7: # %bb.0:
35 ; CHECK-PWR7-DAG: mffs 1
36 ; CHECK-PWR7-DAG: stfd 1, -8(1)
37 ; CHECK-PWR7-DAG: ld [[REG1:[0-9]+]], -8(1)
38 ; CHECK-PWR7-DAG: rldimi [[REG1]], 3, 0, 62
39 ; CHECK-PWR7-DAG: std [[REG1]], -16(1)
40 ; CHECK-PWR7-DAG: lfd [[REG2:[0-9]+]], -16(1)
41 ; CHECK-PWR7-DAG: mtfsf 255, [[REG2]]
45 declare double @llvm.ppc.setrnd(i32)