forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SystemZ] Support floating-point control register instructions
Add assembler support for instructions manipulating the FPC. Also add codegen support via the GCC compatibility builtins: __builtin_s390_sfpc __builtin_s390_efpc git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288525 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
14 changed files
with
480 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
; Test floating-point control register intrinsics. | ||
; | ||
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s | ||
|
||
declare void @llvm.s390.sfpc(i32) | ||
declare i32 @llvm.s390.efpc() | ||
|
||
; SFPC. | ||
define void @test_sfpc(i32 %fpc) { | ||
; CHECK-LABEL: test_sfpc: | ||
; CHECK: sfpc %r2 | ||
; CHECK: br %r14 | ||
call void @llvm.s390.sfpc(i32 %fpc) | ||
ret void | ||
} | ||
|
||
; EFPC. | ||
define i32 @test_efpc() { | ||
; CHECK-LABEL: test_efpc: | ||
; CHECK: efpc %r2 | ||
; CHECK: br %r14 | ||
%res = call i32 @llvm.s390.efpc() | ||
ret i32 %res | ||
} | ||
|
||
; LFPC. | ||
define void @test_lfpc1(i32 *%ptr) { | ||
; CHECK-LABEL: test_lfpc1: | ||
; CHECK: lfpc 0(%r2) | ||
; CHECK: br %r14 | ||
%fpc = load i32, i32 *%ptr | ||
call void @llvm.s390.sfpc(i32 %fpc) | ||
ret void | ||
} | ||
|
||
; LFPC with offset. | ||
define void @test_lfpc2(i32 *%ptr) { | ||
; CHECK-LABEL: test_lfpc2: | ||
; CHECK: lfpc 4092(%r2) | ||
; CHECK: br %r14 | ||
%ptr1 = getelementptr i32, i32 *%ptr, i32 1023 | ||
%fpc = load i32, i32 *%ptr1 | ||
call void @llvm.s390.sfpc(i32 %fpc) | ||
ret void | ||
} | ||
|
||
; STFPC. | ||
define void @test_stfpc1(i32 *%ptr) { | ||
; CHECK-LABEL: test_stfpc1: | ||
; CHECK: stfpc 0(%r2) | ||
; CHECK: br %r14 | ||
%fpc = call i32 @llvm.s390.efpc() | ||
store i32 %fpc, i32 *%ptr | ||
ret void | ||
} | ||
|
||
; STFPC with offset. | ||
define void @test_stfpc2(i32 *%ptr) { | ||
; CHECK-LABEL: test_stfpc2: | ||
; CHECK: stfpc 4092(%r2) | ||
; CHECK: br %r14 | ||
%fpc = call i32 @llvm.s390.efpc() | ||
%ptr1 = getelementptr i32, i32 *%ptr, i32 1023 | ||
store i32 %fpc, i32 *%ptr1 | ||
ret void | ||
} | ||
|
Oops, something went wrong.