| ... | ... | @@ -1510,6 +1510,7 @@ fn genBody(func: *Func, body: []const Air.Inst.Index) InnerError!void { |
| 1510 | 1510 | .mul, |
| 1511 | 1511 | .mul_wrap, |
| 1512 | 1512 | .div_trunc, |
| 1513 | .div_exact, |
| 1513 | 1514 | .rem, |
| 1514 | 1515 | |
| 1515 | 1516 | .shl, .shl_exact, |
| ... | ... | @@ -1533,7 +1534,6 @@ fn genBody(func: *Func, body: []const Air.Inst.Index) InnerError!void { |
| 1533 | 1534 | .mod, |
| 1534 | 1535 | .div_float, |
| 1535 | 1536 | .div_floor, |
| 1536 | | .div_exact, |
| 1537 | 1537 | => return func.fail("TODO: {s}", .{@tagName(tag)}), |
| 1538 | 1538 | |
| 1539 | 1539 | .sqrt, |
| ... | ... | @@ -2563,10 +2563,12 @@ fn genBinOp( |
| 2563 | 2563 | .mul_wrap, |
| 2564 | 2564 | .rem, |
| 2565 | 2565 | .div_trunc, |
| 2566 | .div_exact, |
| 2566 | 2567 | => { |
| 2567 | 2568 | switch (tag) { |
| 2568 | 2569 | .rem, |
| 2569 | 2570 | .div_trunc, |
| 2571 | .div_exact, |
| 2570 | 2572 | => { |
| 2571 | 2573 | if (!math.isPowerOfTwo(bit_size)) { |
| 2572 | 2574 | try func.truncateRegister(lhs_ty, lhs_reg); |
| ... | ... | @@ -2576,7 +2578,7 @@ fn genBinOp( |
| 2576 | 2578 | else => { |
| 2577 | 2579 | if (!math.isPowerOfTwo(bit_size)) |
| 2578 | 2580 | return func.fail( |
| 2579 | | "TODO: genBinOp verify {s} non-pow 2, found {}", |
| 2581 | "TODO: genBinOp verify if needs to truncate {s} non-pow 2, found {}", |
| 2580 | 2582 | .{ @tagName(tag), bit_size }, |
| 2581 | 2583 | ); |
| 2582 | 2584 | }, |
| ... | ... | @@ -2604,7 +2606,7 @@ fn genBinOp( |
| 2604 | 2606 | 8, 16, 32 => if (is_unsigned) .remuw else .remw, |
| 2605 | 2607 | else => if (is_unsigned) .remu else .rem, |
| 2606 | 2608 | }, |
| 2607 | | .div_trunc => switch (bit_size) { |
| 2609 | .div_trunc, .div_exact => switch (bit_size) { |
| 2608 | 2610 | 8, 16, 32 => if (is_unsigned) .divuw else .divw, |
| 2609 | 2611 | else => if (is_unsigned) .divu else .div, |
| 2610 | 2612 | }, |