forked from llvm/clangir
-
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.
[CIR][Lowering] Add the concept of simple lowering and use it for una…
…ry fp2fp operations (llvm#806) This PR is the continuation and refinement of PR llvm#434 which is originally authored by @philnik777 . Does not update it in-place since I don't have commit access to Nikolas' repo. This PR basically just rebases llvm#434 onto the latest `main`. I also updated some naming used in the original PR to keep naming styles consistent. Co-authored-by: Nikolas Klauser <[email protected]>
- Loading branch information
Showing
8 changed files
with
207 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// RUN: cir-opt %s -cir-to-llvm -o %t.ll | ||
// RUN: FileCheck --input-file=%t.ll %s | ||
|
||
module { | ||
cir.func @test(%arg0 : !cir.float) { | ||
%1 = cir.cos %arg0 : !cir.float | ||
// CHECK: llvm.intr.cos(%arg0) : (f32) -> f32 | ||
|
||
%2 = cir.ceil %arg0 : !cir.float | ||
// CHECK: llvm.intr.ceil(%arg0) : (f32) -> f32 | ||
|
||
%3 = cir.exp %arg0 : !cir.float | ||
// CHECK: llvm.intr.exp(%arg0) : (f32) -> f32 | ||
|
||
%4 = cir.exp2 %arg0 : !cir.float | ||
// CHECK: llvm.intr.exp2(%arg0) : (f32) -> f32 | ||
|
||
%5 = cir.fabs %arg0 : !cir.float | ||
// CHECK: llvm.intr.fabs(%arg0) : (f32) -> f32 | ||
|
||
%6 = cir.floor %arg0 : !cir.float | ||
// CHECK: llvm.intr.floor(%arg0) : (f32) -> f32 | ||
|
||
%7 = cir.log %arg0 : !cir.float | ||
// CHECK: llvm.intr.log(%arg0) : (f32) -> f32 | ||
|
||
%8 = cir.log10 %arg0 : !cir.float | ||
// CHECK: llvm.intr.log10(%arg0) : (f32) -> f32 | ||
|
||
%9 = cir.log2 %arg0 : !cir.float | ||
// CHECK: llvm.intr.log2(%arg0) : (f32) -> f32 | ||
|
||
%10 = cir.nearbyint %arg0 : !cir.float | ||
// CHECK: llvm.intr.nearbyint(%arg0) : (f32) -> f32 | ||
|
||
%11 = cir.rint %arg0 : !cir.float | ||
// CHECK: llvm.intr.rint(%arg0) : (f32) -> f32 | ||
|
||
%12 = cir.round %arg0 : !cir.float | ||
// CHECK: llvm.intr.round(%arg0) : (f32) -> f32 | ||
|
||
%13 = cir.sin %arg0 : !cir.float | ||
// CHECK: llvm.intr.sin(%arg0) : (f32) -> f32 | ||
|
||
%14 = cir.sqrt %arg0 : !cir.float | ||
// CHECK: llvm.intr.sqrt(%arg0) : (f32) -> f32 | ||
|
||
cir.return | ||
} | ||
} |
Oops, something went wrong.