aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/CodeGen.zig
AgeCommit message (Collapse)Author
2022-05-25x64: move from compare_flags_* mcv to eflags with condition codes enumJakub Konka
2022-05-24stage2: fixes for error unions, optionals, errorsAndrew Kelley
* `?E` where E is an error set with only one field now lowers the same as `bool`. * Fix implementation of errUnionErrOffset and errUnionPayloadOffset to properly compute the offset of each field. Also name them the same as the corresponding LLVM functions and have the same function signature, to avoid confusion. This fixes a bug where wasm was passing the error union type instead of the payload type. * Fix C backend handling of optionals with zero-bit payload types. * C backend: separate out airOptionalPayload and airOptionalPayloadPtr which reduces branching and cleans up control flow. * Make Type.isNoReturn return true for error sets with no fields. * Make `?error{}` have only one possible value (null).
2022-05-24aarch64: update for new error union layoutJakub Konka
2022-05-24x64: update for new error union layoutJakub Konka
2022-05-24dwarf: update abbrev info generation for new error union layoutJakub Konka
2022-05-20x64: implement matching SSE instructions for generic cross-comp targetJakub Konka
2022-05-19regalloc: make register class bitmask non-optionalJakub Konka
2022-05-19x64: load float from memory to register on PIE targetsJakub Konka
2022-05-19x64: check for floating-point intrinsics in codegenJakub Konka
2022-05-19x64: use StaticBitSet instead of an integer internally in RegisterManagerJakub Konka
2022-05-19x64: re-enable behavior testsJakub Konka
2022-05-19x64: handle basic f32 using AVX registersJakub Konka
2022-05-19x64: remove special-casing of AVX for br()Jakub 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-17stage2: fix pointer arithmetic result typeAndrew Kelley
This makes it so the result of doing pointer arithmetic creates a new pointer type that has adjusted alignment.
2022-05-16stage2: disable error return tracing on unsupported targetsVeikka Tuominen
2022-05-16stage2: implement error return tracesVeikka Tuominen
2022-05-15x64: rename brk to int3, and MIR to interruptJakub Konka
2022-05-15x64: remove verbose_mir functionalityJakub Konka
Originally I thought interleaving AIR with MIR will be useful, however as it stands, I have used it very sporadically, and recently, not at all, and I do not think anyone else is actually using it. If there is a simple error such as a wrong instruction emitted, `objdump` is perfectly capable of narrowing it down, while if there's something more subtle happening, regardless of having `--verbose-mir` functionality or not, you still gotta go via the debugger which offers a better view at interleaved source program with the emitted machine code. Finally, I believe `-femit-asm` when we add it will offer a more generic substitute.
2022-05-10x64: fix binary not implementationJakub Konka
2022-05-10x64: implement shl with overflow for non-pow-2Jakub Konka
2022-05-10x64: implement shl_with_overflow for powers of twoJakub Konka
2022-05-10x64: implement missing bits in add_with_overflow and sub_with_overflowJakub Konka
2022-05-10x64: implement shl_exact and shr_exactJakub Konka
2022-05-10x64: consolidate shifts into single MIR helper fnJakub Konka
2022-05-10x64: handle immediate as RHS of shift bin opsJakub Konka
2022-05-10x64: pull shl and shr into one helper fnJakub Konka
2022-05-10x64: refactor genMulDivBinOp helperJakub Konka
2022-05-10x64: migrate div to genMulDivBinOpJakub Konka
2022-05-10x64: converge add_with_overflow and sub_with_overflowJakub Konka
2022-05-10x64: make genBinOp operate on MCValues directlyJakub Konka
2022-05-10x64: migrate mod and rem into genBinOpJakub Konka
2022-05-09x64: pass tag and maybe_inst explictly to genBinOpJakub Konka
2022-05-09x64: migrate mul to new genBinOp helperJakub Konka
2022-05-09x64: make one entry point for binary opsJakub Konka
* rename `genBinMathOp` into `genBinOp` and handle commutativity * rename `genBinMathOpMir` into `genBinOpMir`
2022-05-09x64: add naive impl of shrJakub 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-05-06x64: handle CF flags spilling in overflow callsJakub Konka
Handle spilling of CF flags set with an overflow call. Add saving stack offset to memory.
2022-05-05x64: mul_with_overflow: cannot reuse operand if not the resultJakub Konka
2022-05-05x64: handle unsigned mul_with_overflow for non-pow-2 intsJakub Konka
2022-05-05x64: handle signed mul_with_overflow for non-pow-2 intsJakub Konka
2022-05-05x64: explicitly handle Vector vs Int types for overflow arithJakub Konka