aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@systemhalted.org>2014-04-29 02:35:06 -0400
committerCarlos O'Donell <carlos@systemhalted.org>2014-04-29 02:41:43 -0400
commitb86699bf4ff38ec815498d5c785a0e52473cc7f5 (patch)
treee2afb7dedbf49015cade1ec33a8e3ede23573b2b
parentfff763a512d574881c51dd273824e8457f413fc7 (diff)
downloadglibc-b86699bf4ff38ec815498d5c785a0e52473cc7f5.tar
glibc-b86699bf4ff38ec815498d5c785a0e52473cc7f5.tar.gz
glibc-b86699bf4ff38ec815498d5c785a0e52473cc7f5.tar.bz2
glibc-b86699bf4ff38ec815498d5c785a0e52473cc7f5.zip
hppa: Use r25 as second input to __longjmp.
The generated assembly is simplified if we use r25, the expected second argument to the function given the calling convention.
-rw-r--r--ports/ChangeLog.hppa5
-rw-r--r--ports/sysdeps/hppa/__longjmp.c25
2 files changed, 18 insertions, 12 deletions
diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa
index 3efd186109..105b04aef8 100644
--- a/ports/ChangeLog.hppa
+++ b/ports/ChangeLog.hppa
@@ -1,3 +1,8 @@
+2014-04-29 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/__longjmp.c (__longjmp): Use r25 as second arg
+ to simplify generated assembly.
+
2014-04-11 Torvald Riegel <triegel@redhat.com>
[BZ #15215]
diff --git a/ports/sysdeps/hppa/__longjmp.c b/ports/sysdeps/hppa/__longjmp.c
index 3637fdbc49..cb1aed1c5c 100644
--- a/ports/sysdeps/hppa/__longjmp.c
+++ b/ports/sysdeps/hppa/__longjmp.c
@@ -27,6 +27,7 @@ __longjmp (__jmp_buf env, int val)
/* We must use one of the non-callee saves registers
for env. */
register unsigned long r26 asm ("r26") = (unsigned long)&env[0];
+ register unsigned long r25 asm ("r25") = (unsigned long)(val == 0 ? 1 : val);
#ifdef CHECK_SP
CHECK_SP (env[0].__jmp_buf.__sp);
@@ -61,22 +62,22 @@ __longjmp (__jmp_buf env, int val)
/* Load return pointer. */
"ldw 80(%1), %%rp\n\t"
/* Ues a spare caller saves register. */
- "ldo 88(%1),%%r20\n\t"
+ "ldo 88(%1),%%r25\n\t"
/* Load callee saves from fr12 to fr21. */
- "fldds,ma 8(%%r20), %%fr12\n\t"
- "fldds,ma 8(%%r20), %%fr13\n\t"
- "fldds,ma 8(%%r20), %%fr14\n\t"
- "fldds,ma 8(%%r20), %%fr15\n\t"
- "fldds,ma 8(%%r20), %%fr16\n\t"
- "fldds,ma 8(%%r20), %%fr17\n\t"
- "fldds,ma 8(%%r20), %%fr18\n\t"
- "fldds,ma 8(%%r20), %%fr19\n\t"
- "fldds,ma 8(%%r20), %%fr20\n\t"
- "fldds 0(%%r20), %%fr21\n\t"
+ "fldds,ma 8(%%r25), %%fr12\n\t"
+ "fldds,ma 8(%%r25), %%fr13\n\t"
+ "fldds,ma 8(%%r25), %%fr14\n\t"
+ "fldds,ma 8(%%r25), %%fr15\n\t"
+ "fldds,ma 8(%%r25), %%fr16\n\t"
+ "fldds,ma 8(%%r25), %%fr17\n\t"
+ "fldds,ma 8(%%r25), %%fr18\n\t"
+ "fldds,ma 8(%%r25), %%fr19\n\t"
+ "fldds,ma 8(%%r25), %%fr20\n\t"
+ "fldds 0(%%r25), %%fr21\n\t"
/* Jump back to stored return address. */
"bv,n %%r0(%%r2)\n\t"
: /* No outputs. */
- : "r" (val == 0 ? 1 : val), "r" (r26)
+ : "r" (r25), "r" (r26)
: /* No point in clobbers. */ );
/* Avoid `volatile function does return' warnings. */
for (;;);