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

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 12:45:20 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 %[[#]]
----------------
farzonl wrote:

we are using `__builtin_elementwise_round` which maps to `intrinsics::round` We would need to use `__builtin_elementwise_roundeven` in  `clang/lib/Headers/hlsl/hlsl_intrinsics.h` but yeah that would work. I can file an issue for this.

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


More information about the llvm-commits mailing list