patch-src_arisparc64_d 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. $OpenBSD: patch-src_arisparc64_d,v 1.1 2010/09/23 13:42:22 joshe Exp $
  2. Disable the assembler loops, at least one of them is broken.
  3. Remove a couple of potentially-broken math functions to make sure they
  4. aren't used in case the maze of #ifdefs in arilev0.d ever changes.
  5. --- src/arisparc64.d.orig Wed Dec 5 08:06:32 2007
  6. +++ src/arisparc64.d Sun Sep 19 16:25:17 2010
  7. @@ -14,6 +14,7 @@
  8. #ifdef INCLUDED_FROM_C
  9. +#if 0
  10. #define COPY_LOOPS
  11. #define FILL_LOOPS
  12. #define CLEAR_LOOPS
  13. @@ -23,6 +24,7 @@
  14. #define SHIFT_LOOPS
  15. #define MUL_LOOPS
  16. #define DIV_LOOPS
  17. +#endif
  18. #else
  19. @@ -73,30 +75,12 @@ C(mulu16_:) # Input in %o0,%o1, Output in %o0
  20. retl
  21. _ srl %o2,0,%o0
  22. -# extern struct { uint32 lo; uint32 hi; } mulu32_ (uint32 arg1, uint32 arg2);
  23. -# 2^32*hi+lo := arg1*arg2.
  24. -C(mulu32_:) # Input in %o0,%o1, Output in %o0,%g1
  25. - umul %o0,%o1,%o2
  26. - rd %y,%g1
  27. - retl
  28. - _ srl %o2,0,%o0
  29. -
  30. # extern uint32 mulu32_unchecked (uint32 x, uint32 y);
  31. # result := arg1*arg2 < 2^32.
  32. C(mulu32_unchecked:) # Input in %o0,%o1, Output in %o0
  33. umul %o0,%o1,%o2
  34. retl
  35. _ srl %o2,0,%o0
  36. -
  37. -# extern struct { uint32 q; uint32 r; } divu_6432_3232_ (uint32 xhi, uint32 xlo, uint32 y);
  38. -# x = 2^32*xhi+xlo = q*y+r schreiben. Sei bekannt, dass 0 <= x < 2^32*y .
  39. -C(divu_6432_3232_:) # Input in %o0,%o1,%o2, Output in %o0,%g1
  40. - wr %o0,%g0,%y
  41. - udiv %o1,%o2,%o0 # x durch y dividieren, %o0 := q
  42. - umul %o0,%o2,%g1 # %g1 := (q*y) mod 2^32
  43. - sub %o1,%g1,%g1 # %g1 := (xlo-q*y) mod 2^32 = r
  44. - retl
  45. - _ srl %o0,0,%o0
  46. # extern struct { uint16 q; uint16 r; } divu_3216_1616_ (uint32 x, uint16 y);
  47. # x = q*y+r schreiben. Sei bekannt, dass 0 <= x < 2^16*y .