Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GLSL Binary ops, and use it to implement GLSL FMax.
A base class is added to implement all GLSL Binary operations and is used to implement the FMax operation. The existing framework already generates all the necessary (de)serialization code. PiperOrigin-RevId: 271037166
- Loading branch information
1 parent
cf00fee
commit c5284fe
Showing
3 changed files
with
92 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s | ||
|
||
spv.module "Logical" "GLSL450" { | ||
func @fmul(%arg0 : f32) { | ||
func @fmul(%arg0 : f32, %arg1 : f32) { | ||
// CHECK: {{%.*}} = spv.GLSL.Exp {{%.*}} : f32 | ||
%0 = spv.GLSL.Exp %arg0 : f32 | ||
// CHECK: {{%.*}} = spv.GLSL.FMax {{%.*}}, {{%.*}} : f32 | ||
%1 = spv.GLSL.FMax %arg0, %arg1 : f32 | ||
spv.Return | ||
} | ||
} |
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