aboutsummaryrefslogtreecommitdiff
path: root/src/register_manager.zig
AgeCommit message (Collapse)Author
2022-07-26std.fmt: require specifier for unwrapping ?T and E!TInKryption
2022-07-24Revert "std.fmt: require specifier for unwrapping ?T and E!T."Andrew Kelley
This reverts commit 7cbd586ace46a8e8cebab660ebca3cfc049305d9. This is causing a fail to build from source: ``` ./lib/std/fmt.zig:492:17: error: cannot format optional without a specifier (i.e. {?} or {any}) @compileError("cannot format optional without a specifier (i.e. {?} or {any})"); ^ ./src/link/MachO/Atom.zig:544:26: note: called from here log.debug(" RELA({s}) @ {x} => %{d} in object({d})", .{ ^ ``` I looked at the code to fix it but none of those args are optionals.
2022-07-24std.fmt: require specifier for unwrapping ?T and E!T.InKryption
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-06-07x64: simplify saving registers to stack in prologueJakub Konka
2022-05-26regalloc: use StaticBitSet internallyJakub Konka
2022-05-21regalloc: test allocating from multiple register claasesJakub Konka
2022-05-20regalloc: temporarily nerf back to raw ints until stage2 catches upJakub Konka
2022-05-19regalloc: make register class bitmask non-optionalJakub Konka
2022-05-19x64: use StaticBitSet instead of an integer internally in RegisterManagerJakub Konka
2022-05-19x64: re-enable incremental testsJakub Konka
2022-05-19x64: use register classes mask to select between gp and avxJakub Konka
2022-05-19regalloc: allow for optional selector mask when allocatingJakub Konka
2022-05-19x64: merge general purpose with simd register into one bitsetJakub Konka
This way, we do not have to tweak the `RegisterManager` to handle multiple register types - we have one linear space instead. Additionally we can use the bitset itself to separate the registers into overlapping (the ones that are aliases of differing bitwidths) and nonoverlapping classes (for example, AVX registers do not overlap general purpose registers, thus they can be allocated simultaneously). Another huge benefit of this simple approach is the fact that we can still refer to *all* registers regardless of their class via enum literals which makes the code so much more readable. Finally, `RegisterLock` is universal across different register classes.
2022-05-19x64: add unordered cmp with EFLAGSJakub Konka
2022-05-19x64: load/store to/from AVX registers for f64Jakub Konka
2022-05-07regalloc: refactor locking multiple registers at onceJakub Konka
2022-05-07x64: refactor code to avoid stage1 sema limitationsJakub Konka
2022-05-07regalloc: rename freeze/unfreeze to lock/unlock registersJakub Konka
2022-05-07x64: fix misused register locksJakub Konka
2022-05-07regalloc: ensure we only freeze/unfreeze at the outermost scopeJakub Konka
This prevents a nasty type of bugs where we accidentally unfreeze a register that was frozen purposely in the outer scope, risking accidental realloc of a taken register. Fix CF flags spilling on aarch64 backend.
2022-03-18stage2 regalloc: fix tryAllocRegs for specific situationsjoachimschmidt557
Previously, tryAllocRegs did not take frozen registers into account when checking if enough registers are available.
2022-03-11stage2 ARM: implement caller-saved registersjoachimschmidt557
2022-03-11stage2 regalloc: replace Register.allocIndex with generic indexOfRegjoachimschmidt557
* callee_preserved_regs and other ABI-specific information have been moved to the respective abi.zig files
2022-02-13stage2 regalloc: track Inst instead of ?Inst in register mappingjoachimschmidt557
The information whether a register is allocated to an instruction is already encoded in the free_registers "bitmap". Duplicating that information in the registers map is unnecessary and may lead to performance degradations.
2022-02-06stage2 regalloc: Introduce error.OutOfRegistersjoachimschmidt557
2022-02-03stage2: remove the concept of register exceptionsJakub Konka
2022-01-28stage2 regalloc: Fix bug where regs were not marked as allocatedjoachimschmidt557
2022-01-26stage2 regalloc: Add freezeRegs/unfreezeRegs APIjoachimschmidt557
The freeze/unfreeze API replaces the exceptions API for hopefully preventing bugs in codegen code using the RegisterManager. The exceptions API is still available for backwards compatibility and will be removed once all backends transition to the new freeze/unfreeze API.
2021-12-30stage2 ARM: implement struct_field_ptr and struct_field_valjoachimschmidt557
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-07-20Get register_manager.zig tests to compile - use value '1' as mock Air.Inst.IndexLewis Gaul
2021-07-20stage2: first pass over Module.zig for AIR memory layoutAndrew Kelley
2021-07-20stage2: first pass over codegen.zig for AIR memory layoutAndrew Kelley
2021-07-20stage2: rework AIR memory layoutAndrew Kelley
This commit changes the AIR file and the documentation of the memory layout. The actual work of modifying the surrounding code (in Sema and codegen) is not yet done.
2021-06-21fix code broken from previous commitJacob G-W
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-05-22stage2: rename ir.zig to air.zigAndrew Kelley
We've settled on the nomenclature for the artifacts the compiler pipeline produces: 1. Tokens 2. AST (Abstract Syntax Tree) 3. ZIR (Zig Intermediate Representation) 4. AIR (Analyzed Intermediate Representation) 5. Machine Code Renaming `ir` identifiers to `air` will come with the inevitable air-memory-layout branch that I plan to start after the 0.8.0 release.
2021-05-14stage2 register manager: clean up API and add more unit testsjoachimschmidt557
2021-05-09stage2 ARM: Overhaul of genArmBinOpjoachimschmidt557
2021-05-08update usage of std.testing in stage2Veikka Tuominen
2021-04-25stage2 register manager: Use an array instead of a hashmap for trackingjoachimschmidt557
allocated registers
2021-04-16stage2 register manager: Add functions for allocating multiple registersjoachimschmidt557
2021-04-07stage2 regalloc: Add unit test for getRegjoachimschmidt557
2021-04-06stage2 regalloc: Add getReg and getRegWithoutTrackingjoachimschmidt557
2021-04-02stage2 register_manager: Add unit tests for tryAllocReg and allocRegjoachimschmidt557
2021-04-02stage2 codegen: Extract register management code into separate filejoachimschmidt557