Replies: 1 comment 1 reply
-
The requirement in the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
stdlib/src/stdlib_io_npy_save.fypp
Lines 70 to 79 in 9c4abca
Is there a reason to perform the byte encoding this way? I assume this function guarantees little-endian byte order is observed? Or it correctly handles the range of unsigned integers?
Wouldn't it be sufficient to implement this with transfer:
There is a big difference in the number of instructions needed. In the old days
equivalence
might have been used, but in this case it interferes with theresult
attribute.Here is a demonstration on Compiler Explorer: https://godbolt.org/z/Ecr7Teree
If the endianness is an issue, an if-else block (
if (little_endian) then
...) could be used. The endianness can be determined as a compile-time constant:stdlib/src/stdlib_hash_32bit.fypp
Lines 54 to 56 in 9f1aa24
Beta Was this translation helpful? Give feedback.
All reactions