Page MenuHomeFreeBSD

Use a single 'ld' to read the jmpbuf magic values instead of 'la; ld'.

Authored by jhb on Dec 3 2019, 10:18 PM.



This saves an instruction in each case.

Test Plan
  • tests in /usr/tests/lib/libc/setjmp pass

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Dec 3 2019, 10:18 PM
jhb added a reviewer: jrtc27.Dec 3 2019, 10:19 PM

This is particularly beneficial as, for PIC code, which this will almost always be, la expands to auipc/ld to index the GOT, so we save a level of unnecessary indirection too. (This could have been lla instead to save the indirection but still take 2 instructions just to do the address calculation.)

br accepted this revision.Dec 4 2019, 2:40 PM
This revision is now accepted and ready to land.Dec 4 2019, 2:40 PM