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.

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 OK
Unit
No Unit 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
74

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
74

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
74

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