authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-12 15:02:46-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-12 15:02:46-04:00
log1526d89711c90a4a98dfecb6d3c64f28c3ab7da6
treec7e2354a7ea33cc0d5a17cca810d8a8b21de28ef
parent35352e0f489882b9d5919ffd569e7dcda990f39b
signature Commit is signed but in an unrecognized format.

fix `@bitCast` with runtime scalar and dest result loc var


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

src/ir.cpp+6-4
......@@ -24232,11 +24232,13 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct
2423224232
2423324233static IrInstruction *ir_analyze_instruction_bit_cast_src(IrAnalyze *ira, IrInstructionBitCastSrc *instruction) {
2423424234 IrInstruction *operand = instruction->operand->child;
24235 if (type_is_invalid(operand->value.type) ||
24236 instruction->result_loc_bit_cast->parent->gen_instruction == nullptr)
24237 {
24235 if (type_is_invalid(operand->value.type))
2423824236 return operand;
24239 }
24237
24238 IrInstruction *result_loc = ir_resolve_result(ira, &instruction->base,
24239 &instruction->result_loc_bit_cast->base, operand->value.type, operand);
24240 if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)))
24241 return result_loc;
2424024242
2424124243 return instruction->result_loc_bit_cast->parent->gen_instruction;
2424224244}
std/special/compiler_rt/comparetf2.zig+9-6
......@@ -73,12 +73,15 @@ pub extern fn __getf2(a: f128, b: f128) c_int {
7373
7474 if (aAbs > infRep or bAbs > infRep) return GE_UNORDERED;
7575 if ((aAbs | bAbs) == 0) return GE_EQUAL;
76 return if ((aInt & bInt) >= 0) if (aInt < bInt)
77 GE_LESS
78 else if (aInt == bInt)
79 GE_EQUAL
80 else
81 GE_GREATER else if (aInt > bInt)
76 // zig fmt issue here, see https://github.com/ziglang/zig/issues/2661
77 return if ((aInt & bInt) >= 0)
78 if (aInt < bInt)
79 GE_LESS
80 else if (aInt == bInt)
81 GE_EQUAL
82 else
83 GE_GREATER
84 else if (aInt > bInt)
8285 GE_LESS
8386 else if (aInt == bInt)
8487 GE_EQUAL