1 ; Test floating-point control register intrinsics.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare void @llvm.s390.sfpc(i32)
6 declare i32 @llvm.s390.efpc()
9 define void @test_sfpc(i32 %fpc) {
10 ; CHECK-LABEL: test_sfpc:
13 call void @llvm.s390.sfpc(i32 %fpc)
18 define i32 @test_efpc() {
19 ; CHECK-LABEL: test_efpc:
22 %res = call i32 @llvm.s390.efpc()
27 define void @test_lfpc1(i32 *%ptr) {
28 ; CHECK-LABEL: test_lfpc1:
31 %fpc = load i32, i32 *%ptr
32 call void @llvm.s390.sfpc(i32 %fpc)
37 define void @test_lfpc2(i32 *%ptr) {
38 ; CHECK-LABEL: test_lfpc2:
39 ; CHECK: lfpc 4092(%r2)
41 %ptr1 = getelementptr i32, i32 *%ptr, i32 1023
42 %fpc = load i32, i32 *%ptr1
43 call void @llvm.s390.sfpc(i32 %fpc)
48 define void @test_stfpc1(i32 *%ptr) {
49 ; CHECK-LABEL: test_stfpc1:
52 %fpc = call i32 @llvm.s390.efpc()
53 store i32 %fpc, i32 *%ptr
58 define void @test_stfpc2(i32 *%ptr) {
59 ; CHECK-LABEL: test_stfpc2:
60 ; CHECK: stfpc 4092(%r2)
62 %fpc = call i32 @llvm.s390.efpc()
63 %ptr1 = getelementptr i32, i32 *%ptr, i32 1023
64 store i32 %fpc, i32 *%ptr1