mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
csu: Avoid additional nops in the MIPS INIT_CALL_SEQ macro
Since we had a .set reorder, the nop after the "jal" was being placed after the delay slot, resulting in two nops. While changing this code also guard the .set noreorder with .set push/pop and use $zero as the cpsetup save register since we don't need to save $gp. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D25025
This commit is contained in:
parent
652f26f9c5
commit
3fe733f375
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361830
|
@ -30,29 +30,31 @@
|
||||||
#define CTORS_CONSTRUCTORS
|
#define CTORS_CONSTRUCTORS
|
||||||
#ifdef __mips_o32
|
#ifdef __mips_o32
|
||||||
#define INIT_CALL_SEQ(func) \
|
#define INIT_CALL_SEQ(func) \
|
||||||
|
".set push \n" \
|
||||||
".set noreorder \n" \
|
".set noreorder \n" \
|
||||||
"bal 1f \n" \
|
"bal 1f \n" \
|
||||||
"nop \n" \
|
"nop \n" \
|
||||||
"1: \n" \
|
"1: \n" \
|
||||||
".cpload $ra \n" \
|
".cpload $ra \n" \
|
||||||
"addu $sp, $sp, -8 \n" \
|
"addu $sp, $sp, -8 \n" \
|
||||||
".set reorder \n" \
|
|
||||||
".cprestore 4 \n" \
|
".cprestore 4 \n" \
|
||||||
".local " __STRING(func) "\n" \
|
".local " __STRING(func) "\n" \
|
||||||
"jal " __STRING(func) "\n" \
|
"jal " __STRING(func) "\n" \
|
||||||
"nop \n" \
|
"nop \n" \
|
||||||
"addu $sp, $sp, 8 \n"
|
"addu $sp, $sp, 8 \n" \
|
||||||
|
".set pop\n"
|
||||||
#else
|
#else
|
||||||
#define INIT_CALL_SEQ(func) \
|
#define INIT_CALL_SEQ(func) \
|
||||||
|
".set push \n" \
|
||||||
".set noreorder \n" \
|
".set noreorder \n" \
|
||||||
"bal 1f \n" \
|
"bal 1f \n" \
|
||||||
"nop \n" \
|
"nop \n" \
|
||||||
"1: \n" \
|
"1: \n" \
|
||||||
".set reorder \n" \
|
".cpsetup $ra, $zero, 1b \n" \
|
||||||
".cpsetup $ra, $v0, 1b \n" \
|
|
||||||
".local " __STRING(func) "\n" \
|
".local " __STRING(func) "\n" \
|
||||||
"jal " __STRING(func) "\n" \
|
"jal " __STRING(func) "\n" \
|
||||||
"nop \n"
|
"nop \n" \
|
||||||
|
".set pop\n"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue