[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#327351: libc rounding is broken on HPPA

Sending a copy of this mail to the debian-hppa list. After all this is the place where I expect to find the most people who know hppa assembly :)

Aurelien Jarno a écrit :

It seems the patch to fix the bug#333766 also fixes this bug. I have
built a glibc with gcc-4.0, and executed the testcase given in this bug
report. The output it the same as the expected one.

Could we consider this bug as fixed, or is it only a postive side effect
of the patch fo bug#333766? I don't speak hppa assembly, so I can't
tell. Daniel, as you written the patch, could you please comment?

Below is the new code that is now used by the glibc.


fesetround (int round)
  union { unsigned long long l; unsigned int sw[2]; } s;

  if (round & ~FE_DOWNWARD)
    /* ROUND is not a valid rounding mode.  */
    return 1;

  /* Get the current status word. */
  __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l));
  s.sw[0] &= ~FE_DOWNWARD;
  s.sw[0] |= round;
  __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l));

  return 0;

  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

Reply to: