diff options
| author | Denis Khalikov <khalikov.denis@huawei.com> | 2020-01-07 22:11:59 -0500 |
|---|---|---|
| committer | Lei Zhang <antiagainst@google.com> | 2020-01-07 22:13:07 -0500 |
| commit | eac01f63a6c99d6ffd03b7b7c88cf8e28d364e5c (patch) | |
| tree | 821ac74b9c72762fc0eeb720520e2882f0c1071e /mlir/test | |
| parent | dab2921f77099534ff19fead9a79fbff312feabf (diff) | |
| download | bcm5719-llvm-eac01f63a6c99d6ffd03b7b7c88cf8e28d364e5c.tar.gz bcm5719-llvm-eac01f63a6c99d6ffd03b7b7c88cf8e28d364e5c.zip | |
[mlir][spirv] Add lowering for std.fpext, std.fptrunc, std.sitofp.
Differential Revision: https://reviews.llvm.org/D72137
Diffstat (limited to 'mlir/test')
| -rw-r--r-- | mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir b/mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir index 2c5b347286a..30b4c4a9324 100644 --- a/mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir +++ b/mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir @@ -246,6 +246,28 @@ func @logical_vector(%arg0 : vector<4xi1>, %arg1 : vector<4xi1>) { } //===----------------------------------------------------------------------===// +// std.fpext +//===----------------------------------------------------------------------===// + +// CHECK-LABEL: @fpext +func @fpext(%arg0 : f32) { + // CHECK: spv.FConvert + %0 = std.fpext %arg0 : f32 to f64 + return +} + +//===----------------------------------------------------------------------===// +// std.fptrunc +//===----------------------------------------------------------------------===// + +// CHECK-LABEL: @fptrunc +func @fptrunc(%arg0 : f64) { + // CHECK: spv.FConvert + %0 = std.fptrunc %arg0 : f64 to f32 + return +} + +//===----------------------------------------------------------------------===// // std.select //===----------------------------------------------------------------------===// @@ -256,3 +278,14 @@ func @select(%arg0 : i32, %arg1 : i32) { %1 = select %0, %arg0, %arg1 : i32 return } + +//===----------------------------------------------------------------------===// +// std.sitofp +//===----------------------------------------------------------------------===// + +// CHECK-LABEL: @sitofp +func @sitofp(%arg0 : i32) { + // CHECK: spv.ConvertSToF + %0 = std.sitofp %arg0 : i32 to f32 + return +} |

