authorgravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2018-06-30 20:15:02+12:00
committergravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2018-06-30 21:58:59+12:00
log887c97742f86071ffab2a79443d48c4153b63ad6
treecf5af051ed69088e057136b6b03f9131717cfe49
parent951512f5ae52e41d3f2bdcb9a533668bcca3a9cd

Alignment fix and allow rudimentary f128 float printing


2 files changed, 2 insertions(+), 2 deletions(-)

std/fmt/index.zig+1-1
...@@ -327,7 +327,7 @@ pub fn formatFloatScientific(...@@ -327,7 +327,7 @@ pub fn formatFloatScientific(
327 comptime Errors: type,327 comptime Errors: type,
328 output: fn (@typeOf(context), []const u8) Errors!void,328 output: fn (@typeOf(context), []const u8) Errors!void,
329) Errors!void {329) Errors!void {
330 var x = f64(value);330 var x = @floatCast(f64, value);
331331
332 // Errol doesn't handle these special cases.332 // Errol doesn't handle these special cases.
333 if (math.signbit(x)) {333 if (math.signbit(x)) {
std/special/compiler_rt/floatunditf.zig+1-1
...@@ -17,7 +17,7 @@ pub extern fn __floatunditf(a: u128) f128 {...@@ -17,7 +17,7 @@ pub extern fn __floatunditf(a: u128) f128 {
17 const exp = (u128.bit_count - 1) - @clz(a);17 const exp = (u128.bit_count - 1) - @clz(a);
18 const shift = mantissa_bits - @intCast(u7, exp);18 const shift = mantissa_bits - @intCast(u7, exp);
1919
20 var result: u128 = (a << shift) ^ implicit_bit;20 var result: u128 align(16) = (a << shift) ^ implicit_bit;
21 result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits;21 result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits;
2222
23 return @bitCast(f128, result);23 return @bitCast(f128, result);