Advertisement
Guest User

Untitled

a guest
Dec 8th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. --- a/lib/std/math/exp2.zig Tue Dec 08 00:07:14 2020 -0700
  2. +++ b/lib/std/math/exp2.zig Tue Dec 08 16:00:26 2020 -0500
  3. @@ -95,7 +95,7 @@
  4. uf -= redux;
  5.  
  6. const z: f64 = x - uf;
  7. - var r: f64 = exp2ft[i_0];
  8. + var r: f64 = exp2ft[@truncate(c_uint, i_0)];
  9. const t: f64 = r * z;
  10. r = r + t * (P1 + z * P2) + t * (z * z) * (P3 + z * P4);
  11. return @floatCast(f32, r * uk);
  12. @@ -418,8 +418,8 @@
  13.  
  14. // r = exp2(y) = exp2t[i_0] * p(z - eps[i])
  15. var z = x - uf;
  16. - const t = exp2dt[2 * i_0];
  17. - z -= exp2dt[2 * i_0 + 1];
  18. + const t = exp2dt[2 * @truncate(c_uint, i_0)];
  19. + z -= exp2dt[2 * @truncate(c_uint, i_0) + 1];
  20. const r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5))));
  21.  
  22. return math.scalbn(r, ik);
  23. diff -r f5790902119e lib/std/special/compiler_rt.zig
  24. --- a/lib/std/special/compiler_rt.zig Tue Dec 08 00:07:14 2020 -0700
  25. +++ b/lib/std/special/compiler_rt.zig Tue Dec 08 16:00:26 2020 -0500
  26. @@ -317,7 +317,8 @@
  27. @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
  28. }
  29.  
  30. -pub usingnamespace @import("compiler_rt/atomics.zig");
  31. +// Temporarily removed to get this working
  32. +// pub usingnamespace @import("compiler_rt/atomics.zig");
  33.  
  34. // Avoid dragging in the runtime safety mechanisms into this .o file,
  35. // unless we're trying to test this file.
  36. nathan@stalagmite:~/zig/zig/build$ locate crt0.S
  37. nathan@stalagmite:~/zig/zig/build$ hg diff
  38. diff -r f5790902119e lib/std/math/exp2.zig
  39. --- a/lib/std/math/exp2.zig Tue Dec 08 00:07:14 2020 -0700
  40. +++ b/lib/std/math/exp2.zig Tue Dec 08 16:24:19 2020 -0500
  41. @@ -95,7 +95,7 @@
  42. uf -= redux;
  43.  
  44. const z: f64 = x - uf;
  45. - var r: f64 = exp2ft[i_0];
  46. + var r: f64 = exp2ft[@truncate(c_uint, i_0)];
  47. const t: f64 = r * z;
  48. r = r + t * (P1 + z * P2) + t * (z * z) * (P3 + z * P4);
  49. return @floatCast(f32, r * uk);
  50. @@ -418,8 +418,8 @@
  51.  
  52. // r = exp2(y) = exp2t[i_0] * p(z - eps[i])
  53. var z = x - uf;
  54. - const t = exp2dt[2 * i_0];
  55. - z -= exp2dt[2 * i_0 + 1];
  56. + const t = exp2dt[2 * @truncate(c_uint, i_0)];
  57. + z -= exp2dt[2 * @truncate(c_uint, i_0) + 1];
  58. const r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5))));
  59.  
  60. return math.scalbn(r, ik);
  61. diff -r f5790902119e lib/std/special/compiler_rt.zig
  62. --- a/lib/std/special/compiler_rt.zig Tue Dec 08 00:07:14 2020 -0700
  63. +++ b/lib/std/special/compiler_rt.zig Tue Dec 08 16:24:19 2020 -0500
  64. @@ -317,7 +317,8 @@
  65. @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
  66. }
  67.  
  68. -pub usingnamespace @import("compiler_rt/atomics.zig");
  69. +// Temporarily removed to get this working
  70. +// pub usingnamespace @import("compiler_rt/atomics.zig");
  71.  
  72. // Avoid dragging in the runtime safety mechanisms into this .o file,
  73. // unless we're trying to test this file.
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement