public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, alpha]: Add earlyclobber to sqrtt/sqrtf insns.
@ 2017-04-14 12:30 Uros Bizjak
  2017-04-14 12:38 ` Florian Weimer
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Uros Bizjak @ 2017-04-14 12:30 UTC (permalink / raw)
  To: libc-alpha; +Cc: Richard Henderson

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
   return ret;
 }
@@ -39,9 +39,9 @@ __ieee754_sqrtf (float d)
 {
   float ret;
 # ifdef _IEEE_FP_INEXACT
-  asm ("sqrts/suid %1,%0" : "=f"(ret) : "f"(d));
+  asm ("sqrts/suid %1,%0" : "=&f"(ret) : "f"(d));
 # else
-  asm ("sqrts/sud %1,%0" : "=f"(ret) : "f"(d));
+  asm ("sqrts/sud %1,%0" : "=&f"(ret) : "f"(d));
 # endif
   return ret;
 }

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-26 13:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14 12:30 [PATCH, alpha]: Add earlyclobber to sqrtt/sqrtf insns Uros Bizjak
2017-04-14 12:38 ` Florian Weimer
2017-04-14 12:47   ` Uros Bizjak
2017-04-14 12:54     ` Florian Weimer
2017-04-14 13:02       ` Uros Bizjak
2017-04-14 13:55 ` Richard Henderson
2017-04-14 18:01   ` Uros Bizjak
2017-04-26 13:44 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).