This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, alpha]: Add earlyclobber to sqrtt/sqrtf insns.


On 04/14/2017 05:30 AM, Uros Bizjak wrote:
Add earlyclobber to sqrtt/sqrtf insns.

When using software completions, we have to prevent assembler to match
input and output operands of sqrtt/sqrtf insn. Add earlyclobber to
output operand to avoid unwanted operand matching.

2017-04-14  Uros Bizjak  <ubizjak@gmail.com>

    * sysdeps/alpha/fpu/math_private.h (__ieee754_sqrt): Add
    earlyclobber to output operand of sqrt insn.
    (__ieee754_sqrtf): Ditto.

diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h
index 9e06e25..1e97c86 100644
--- a/sysdeps/alpha/fpu/math_private.h
+++ b/sysdeps/alpha/fpu/math_private.h
@@ -27,9 +27,9 @@ __ieee754_sqrt (double d)
 {
   double ret;
 # ifdef _IEEE_FP_INEXACT
-  asm ("sqrtt/suid %1,%0" : "=f"(ret) : "f"(d));
+  asm ("sqrtt/suid %1,%0" : "=&f"(ret) : "f"(d));
 # else
-  asm ("sqrtt/sud %1,%0" : "=f"(ret) : "f"(d));
+  asm ("sqrtt/sud %1,%0" : "=&f"(ret) : "f"(d));
 # endif

Hmm. This is surprising because any host that has sqrtt also has exact traps, and so trap shadows and recovery of the input shouldn't be an issue.

That said, do we actually still support a gcc that doesn't have these as builtins? That would be more ideal than inline asm.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]