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
mratsim
changed the title
Upstream regression: input becomes a cint for an uknown reason
Upstream regression: compiler refuses to convert cint to uint32
Sep 25, 2024
See: https://github.com/mratsim/constantine/actions/runs/11034017591/job/30646539242?pr=468
The flow:
Threadpool has a cint
numThreads
constantine/constantine/threadpool/threadpool.nim
Lines 188 to 195 in 65147ed
It is passed to
pseudoRandomPermutation
which only accepts an uint32constantine/constantine/threadpool/threadpool.nim
Lines 656 to 667 in 65147ed
There should be an error but there aren't, I assume because it's an iterator.
The input is cast to
uint32
constantine/constantine/threadpool/threadpool.nim
Lines 121 to 122 in 65147ed
And then passed to a function that only accepts unsigned integers with no problem
constantine/constantine/platforms/bithacks.nim
Lines 156 to 159 in 65147ed
Forwarded to a dispatcher
constantine/constantine/platforms/bithacks.nim
Lines 97 to 105 in 65147ed
And to the final builtins, depending on Clang/GCC vs ICC/MSVC, the result is a cint that is converted back to
T
in the previous procconstantine/constantine/platforms/intrinsics/bitops.nim
Lines 25 to 36 in 65147ed
constantine/constantine/platforms/intrinsics/bitops.nim
Lines 82 to 90 in 65147ed
Notice the error
Error: type mismatch: got 'cint' for 'log2_c_compiler_vartime(n)' but expected 'uint32'
The text was updated successfully, but these errors were encountered: