[llvm] [SPIRV] Implement log10 for logical SPIR-V (PR #66921)

Natalie Chouinard via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 09:53:49 PDT 2023


================
@@ -0,0 +1,42 @@
+; RUN: llc -O0 -mtriple=spirv-unknown-linux %s -o - | FileCheck %s
+
+; CHECK: OpExtInstImport "GLSL.std.450"
+
+; CHECK: %[[#float:]] = OpTypeFloat 32
----------------
sudonatalie wrote:

The HLSL intrinsic is only valid on floats. In DXC bitcasting and warning about precision loss is done on the frontend to handle it if you do pass in a double, but it doesn't look like that's implemented in Clang yet. I did add a TODO since currently log10 (and many other math functions) pass legalization even though they shouldn't be generated by the frontend and they're not selectable on the backend.

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


More information about the llvm-commits mailing list