mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Use a single 'ld' to read the jmpbuf magic values instead of 'la; ld'.
This saves an instruction in each case as well as an extra memory indirection via the GOT for PIC code. Reviewed by: br, James Clarke Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22656
This commit is contained in:
parent
3487d66820
commit
c0acb84da7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355402
|
@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||
|
||||
ENTRY(_setjmp)
|
||||
/* Store the magic value and stack pointer */
|
||||
la t0, .Lmagic
|
||||
ld t0, 0(t0)
|
||||
ld t0, .Lmagic
|
||||
sd t0, (0 * 8)(a0)
|
||||
sd sp, (1 * 8)(a0)
|
||||
addi a0, a0, (2 * 8)
|
||||
|
@ -89,8 +88,7 @@ END(_setjmp)
|
|||
ENTRY(_longjmp)
|
||||
/* Check the magic value */
|
||||
ld t0, 0(a0)
|
||||
la t1, .Lmagic
|
||||
ld t1, 0(t1)
|
||||
ld t1, .Lmagic
|
||||
bne t0, t1, botch
|
||||
|
||||
/* Restore the stack pointer */
|
||||
|
|
|
@ -53,8 +53,7 @@ ENTRY(setjmp)
|
|||
addi sp, sp, (2 * 8)
|
||||
|
||||
/* Store the magic value and stack pointer */
|
||||
la t0, .Lmagic
|
||||
ld t0, 0(t0)
|
||||
ld t0, .Lmagic
|
||||
sd t0, (0 * 8)(a0)
|
||||
sd sp, (1 * 8)(a0)
|
||||
addi a0, a0, (2 * 8)
|
||||
|
@ -119,8 +118,7 @@ ENTRY(longjmp)
|
|||
|
||||
/* Check the magic value */
|
||||
ld t0, 0(a0)
|
||||
la t1, .Lmagic
|
||||
ld t1, 0(t1)
|
||||
ld t1, .Lmagic
|
||||
bne t0, t1, botch
|
||||
|
||||
/* Restore the stack pointer */
|
||||
|
|
Loading…
Reference in a new issue