Page MenuHomeFreeBSD

Swap words order instead of bits order on BIG ENDIAN
ClosedPublic

Authored by fernando.valle_eldorado.org.br on Mar 2 2020, 4:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 29 2024, 10:13 AM
Unknown Object (File)
Jan 29 2024, 10:13 AM
Unknown Object (File)
Jan 15 2024, 7:31 AM
Unknown Object (File)
Dec 23 2023, 3:23 AM
Unknown Object (File)
Dec 12 2023, 12:30 PM
Unknown Object (File)
Dec 12 2023, 11:12 AM
Unknown Object (File)
Dec 2 2023, 7:22 AM
Unknown Object (File)
Nov 20 2023, 6:27 AM
Subscribers

Details

Summary

The for loop on big endian was inverting all the bits instead of just the words

Test Plan

kyua test -k /usr/tests/lib/msun/Kyuafile nan_test

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30093
Build 27901: arc lint + arc unit

Event Timeline

Hmm... if the tests pass I guess it is good, but does the comment need updating as well?
The else case in the old code was going backwards but this one doesn't.

Approved BTW, the code obviously doesn't change anything for LE.

This revision is now accepted and ready to land.Mar 2 2020, 9:30 PM
pfg requested changes to this revision.Mar 3 2020, 3:25 AM

The code is rather tricky, it would be convenient to checksum the object code on Little Endian to make sure nothing changes.

lib/msun/src/s_nan.c
75

Actually, this doesn't look like correct style: we need spaces around/within that -1- and you it seems like the line is too long.

This revision now requires changes to proceed.Mar 3 2020, 3:25 AM

LGTM

lib/msun/src/s_nan.c
75

Minor knit, and strictly optional:
num_words - 1 - (bitpos / 32) is more readable
num_words - (bitpos / 32) - 1

This revision is now accepted and ready to land.Mar 3 2020, 2:48 PM
lib/msun/src/s_nan.c
75

And actually the parenthesis is unnecessary, as division takes precedence over subtraction.

Following recommendation, removing unnecessary parentheses.

This revision now requires review to proceed.Mar 25 2020, 1:25 PM
This revision is now accepted and ready to land.Mar 25 2020, 3:20 PM