| ... | @@ -2380,6 +2380,14 @@ fn transCCast( | ... | @@ -2380,6 +2380,14 @@ fn transCCast( |
| 2380 | }); | 2380 | }); |
| 2381 | } | 2381 | } |
| 2382 | if (cIsFloating(src_type) and !cIsFloating(dst_type)) { | 2382 | if (cIsFloating(src_type) and !cIsFloating(dst_type)) { |
| | 2383 | // bool expression: floating val != 0 |
| | 2384 | if (qualTypeIsBoolean(dst_type)) { |
| | 2385 | return Tag.not_equal.create(c.arena, .{ |
| | 2386 | .lhs = expr, |
| | 2387 | .rhs = Tag.zero_literal.init(), |
| | 2388 | }); |
| | 2389 | } |
| | 2390 | |
| 2383 | // @as(dest_type, @intFromFloat(val)) | 2391 | // @as(dest_type, @intFromFloat(val)) |
| 2384 | return Tag.as.create(c.arena, .{ | 2392 | return Tag.as.create(c.arena, .{ |
| 2385 | .lhs = dst_node, | 2393 | .lhs = dst_node, |