diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-21 19:05:26 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-21 19:05:26 -0700 |
| commit | 7f70c27e9d57c8234545120da81861e2cfb354b5 (patch) | |
| tree | 47948dcf37e5e5767db2b428a8ef8177ef8eee86 /src/codegen.zig | |
| parent | a3c9bfef301e0a4675fcea57356653334e07df45 (diff) | |
| download | zig-7f70c27e9d57c8234545120da81861e2cfb354b5.tar.gz zig-7f70c27e9d57c8234545120da81861e2cfb354b5.zip | |
stage2: more division support
AIR:
* div is renamed to div_trunc.
* Add div_float, div_floor, div_exact.
- Implemented in Sema and LLVM codegen. C backend has a stub.
Improvements to std.math.big.Int:
* Add `eqZero` function to `Mutable`.
* Fix incorrect results for `divFloor`.
Compiler-rt:
* Add muloti4 to the stage2 section.
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index 5963cdd376..ac9eaeda2a 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -758,7 +758,6 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .mul => try self.airMul(inst), .mulwrap => try self.airMulWrap(inst), .mul_sat => try self.airMulSat(inst), - .div => try self.airDiv(inst), .rem => try self.airRem(inst), .mod => try self.airMod(inst), .shl, .shl_exact => try self.airShl(inst), @@ -767,6 +766,8 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { .max => try self.airMax(inst), .slice => try self.airSlice(inst), + .div_float, .div_trunc, .div_floor, .div_exact => try self.airDiv(inst), + .cmp_lt => try self.airCmp(inst, .lt), .cmp_lte => try self.airCmp(inst, .lte), .cmp_eq => try self.airCmp(inst, .eq), |
