You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.
Running code containing the llvm.bswap intrinsic through llvm-spirv crashes with
Fails to save LLVM as SPIRV: InvalidFunctionCall: Unexpected llvm intrinsic
According to the LLVM Language Reference, this intrinsic is used to swap the bytes in integers, e.g. to move from little-endian to big-endian and vice versa.
Since the SPIR-V specification offers no instruction to swap bytes, I guess this intrinsic should be implemented by manually shifting the single bytes in the integer numbers.
The text was updated successfully, but these errors were encountered:
So far SPIR-V translation library was used by OpenCL front-end compiler only with disabled optimizations. I suppose clang doesn't produce llvm.bswap intrinsic in this mode.
What it the environment you are using SPIR-V library in?
So far SPIR-V translation library was used by OpenCL front-end compiler only with disabled optimizations. I suppose clang doesn't produce llvm.bswap intrinsic in this mode.
This could very well be, since I explicitly run OpenCL -> (SPIR-V-LLVM clang) -> LLVM-IR -> (llvm-spriv) -> SPIR-V so I can use optimizations -O3 in clang.
I'll try to write a pull request to support this intrinsic once #209 is through.
doe300
added a commit
to doe300/SPIRV-LLVM
that referenced
this issue
Sep 12, 2017
Running code containing the llvm.bswap intrinsic through
llvm-spirv
crashes withAccording to the LLVM Language Reference, this intrinsic is used to swap the bytes in integers, e.g. to move from little-endian to big-endian and vice versa.
Since the SPIR-V specification offers no instruction to swap bytes, I guess this intrinsic should be implemented by manually shifting the single bytes in the integer numbers.
The text was updated successfully, but these errors were encountered: