| author | |
| committer | |
| log | 4def9c4a9b384a5980086825bcb849a88438912b |
| tree | bf8269d98e362096dfe313c300b3542d80c6993a |
| parent | 6310186d52ae4e7bccf40326a98916695192b543 |
2 files changed, 9 insertions(+), 3 deletions(-)
src/codegen/c.zig+9-1| ... | ... | @@ -3788,10 +3788,18 @@ fn airBitcast(f: *Function, inst: Air.Inst.Index) !CValue { |
| 3788 | 3788 | const local = try f.allocLocal(inst_ty, .Mut); |
| 3789 | 3789 | try writer.writeAll(";\n"); |
| 3790 | 3790 | |
| 3791 | const operand_lval = if (operand == .constant) blk: { | |
| 3792 | const operand_local = try f.allocLocal(f.air.typeOf(ty_op.operand), .Const); | |
| 3793 | try writer.writeAll(" = "); | |
| 3794 | try f.writeCValue(writer, operand, .Initializer); | |
| 3795 | try writer.writeAll(";\n"); | |
| 3796 | break :blk operand_local; | |
| 3797 | } else operand; | |
| 3798 | ||
| 3791 | 3799 | try writer.writeAll("memcpy(&"); |
| 3792 | 3800 | try f.writeCValue(writer, local, .Other); |
| 3793 | 3801 | try writer.writeAll(", &"); |
| 3794 | try f.writeCValue(writer, operand, .Other); | |
| 3802 | try f.writeCValue(writer, operand_lval, .Other); | |
| 3795 | 3803 | try writer.writeAll(", sizeof("); |
| 3796 | 3804 | try f.renderTypecast(writer, inst_ty); |
| 3797 | 3805 | try writer.writeAll("));\n"); |
test/behavior/floatop.zig-2| ... | ... | @@ -798,7 +798,6 @@ test "comptime fixed-width float non-zero divided by zero produces signed Inf" { |
| 798 | 798 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 799 | 799 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 800 | 800 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 801 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 802 | 801 | |
| 803 | 802 | inline for (.{ f16, f32, f64, f80, f128 }) |F| { |
| 804 | 803 | const pos = @as(F, 1) / @as(F, 0); |
| ... | ... | @@ -897,7 +896,6 @@ test "nan negation f80" { |
| 897 | 896 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 898 | 897 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 899 | 898 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 900 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 901 | 899 | |
| 902 | 900 | const nan_comptime = comptime math.nan(f80); |
| 903 | 901 | const neg_nan_comptime = -nan_comptime; |