-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
Description
I am testing Julia on RISC-V, and hit a small snag, but the test could perhaps be removed?
Line 82 in 7fa26f0
| @test unsafe_trunc(Int16, NaN16) === Int16(0) #18771 |
Is on line 82. Julia will issue this code (Both on X86 and Risc-V)
define i16 @julia_unsafe_trunc_1513(half %"x::Float16") #0 {
top:
%0 = fptosi half %"x::Float16" to i16
%1 = freeze i16 %0
ret i16 %1
}When you check the LLVM Language Reference for fptosi https://llvm.org/docs/LangRef.html#fptosi-to-instruction you see that if the value does not fit, it's a poison value, and it's ok to replace the value with any value of that type.
On x86 the poison value is 0 and on Risc-V the posion value is -1 for this case. Why does Julia need the poison value to be 0?
PallHaraldsson