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
signaturelock-open 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...@@ -24232,11 +24232,13 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct
2423224232
24233static IrInstruction *ir_analyze_instruction_bit_cast_src(IrAnalyze *ira, IrInstructionBitCastSrc *instruction) {24233static IrInstruction *ir_analyze_instruction_bit_cast_src(IrAnalyze *ira, IrInstructionBitCastSrc *instruction) {
24234 IrInstruction *operand = instruction->operand->child;24234 IrInstruction *operand = instruction->operand->child;
24235 if (type_is_invalid(operand->value.type) ||24235 if (type_is_invalid(operand->value.type))
24236 instruction->result_loc_bit_cast->parent->gen_instruction == nullptr)
24237 {
24238 return operand;24236 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
24241 return instruction->result_loc_bit_cast->parent->gen_instruction;24243 return instruction->result_loc_bit_cast->parent->gen_instruction;
24242}24244}
std/special/compiler_rt/comparetf2.zig+9-6
...@@ -73,12 +73,15 @@ pub extern fn __getf2(a: f128, b: f128) c_int {...@@ -73,12 +73,15 @@ pub extern fn __getf2(a: f128, b: f128) c_int {
7373
74 if (aAbs > infRep or bAbs > infRep) return GE_UNORDERED;74 if (aAbs > infRep or bAbs > infRep) return GE_UNORDERED;
75 if ((aAbs | bAbs) == 0) return GE_EQUAL;75 if ((aAbs | bAbs) == 0) return GE_EQUAL;
76 return if ((aInt & bInt) >= 0) if (aInt < bInt)76 // zig fmt issue here, see https://github.com/ziglang/zig/issues/2661
77 GE_LESS77 return if ((aInt & bInt) >= 0)
78 else if (aInt == bInt)78 if (aInt < bInt)
79 GE_EQUAL79 GE_LESS
80 else80 else if (aInt == bInt)
81 GE_GREATER else if (aInt > bInt)81 GE_EQUAL
82 else
83 GE_GREATER
84 else if (aInt > bInt)
82 GE_LESS85 GE_LESS
83 else if (aInt == bInt)86 else if (aInt == bInt)
84 GE_EQUAL87 GE_EQUAL