[llvm] [SPIRV][HLSL] Add HLSL intrinsic tests (PR #86844)

Natalie Chouinard via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 12:39:51 PDT 2024


================
@@ -0,0 +1,20 @@
+; RUN: llc -O0 -mtriple=spirv-unknown-linux %s -o - | FileCheck %s
+
+; CHECK: OpExtInstImport "GLSL.std.450"
+
+define noundef float @round_float(float noundef %a) {
+entry:
+; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Round %[[#]]
----------------
sudonatalie wrote:

Should HLSL `round` be lowered to `llvm.roundeven`?

https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-round
https://llvm.org/docs/LangRef.html#llvm-roundeven-intrinsic

https://github.com/llvm/llvm-project/pull/86844


More information about the llvm-commits mailing list