| ... | ... | @@ -1556,10 +1556,10 @@ pub const Key = union(enum) { |
| 1556 | 1556 | // These are strange: we'll sometimes represent them as f128, even if the |
| 1557 | 1557 | // underlying type is smaller. f80 is an exception: see float_c_longdouble_f80. |
| 1558 | 1558 | const a_val = switch (a_info.storage) { |
| 1559 | | inline else => |val| @as(f128, @floatCast(val)), |
| 1559 | inline else => |val| @as(u128, @bitCast(@as(f128, @floatCast(val)))), |
| 1560 | 1560 | }; |
| 1561 | 1561 | const b_val = switch (b_info.storage) { |
| 1562 | | inline else => |val| @as(f128, @floatCast(val)), |
| 1562 | inline else => |val| @as(u128, @bitCast(@as(f128, @floatCast(val)))), |
| 1563 | 1563 | }; |
| 1564 | 1564 | return a_val == b_val; |
| 1565 | 1565 | } |
| ... | ... | @@ -1567,9 +1567,14 @@ pub const Key = union(enum) { |
| 1567 | 1567 | const StorageTag = @typeInfo(Key.Float.Storage).Union.tag_type.?; |
| 1568 | 1568 | assert(@as(StorageTag, a_info.storage) == @as(StorageTag, b_info.storage)); |
| 1569 | 1569 | |
| 1570 | | return switch (a_info.storage) { |
| 1571 | | inline else => |val, tag| val == @field(b_info.storage, @tagName(tag)), |
| 1572 | | }; |
| 1570 | switch (a_info.storage) { |
| 1571 | inline else => |val, tag| { |
| 1572 | const Bits = std.meta.Int(.unsigned, @bitSizeOf(@TypeOf(val))); |
| 1573 | const a_bits: Bits = @bitCast(val); |
| 1574 | const b_bits: Bits = @bitCast(@field(b_info.storage, @tagName(tag))); |
| 1575 | return a_bits == b_bits; |
| 1576 | }, |
| 1577 | } |
| 1573 | 1578 | }, |
| 1574 | 1579 | |
| 1575 | 1580 | .opaque_type => |a_info| { |