aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/Emit.zig
AgeCommit message (Collapse)Author
2025-09-26compiler: move self-hosted backends from src/arch to src/codegenAlex Rønne Petersen
2025-09-21Elf2: create a new linker from scratchJacob Young
This iteration already has significantly better incremental support. Closes #24110
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-11linker: delete plan9 supportAndrew Kelley
This experimental target was never fully completed. The operating system is not that interesting or popular anyway, and the maintainer is no longer around. Not worth the maintenance burden. This code can be resurrected later if it is worth it. In such case it will be subject to greater scrutiny.
2025-07-26aarch64: implement some safety checksJacob Young
Closes #24553
2025-07-07compiler: upgrade various std.io API usageAndrew Kelley
2025-06-19x86_64: increase passing test coverage on windowsJacob Young
Now that codegen has no references to linker state this is much easier. Closes #24153
2025-06-19Target: pass and use locals by pointer instead of by valueJacob Young
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
2025-06-12x86_64: implement coff relocationsJacob Young
2025-06-12codegen: make threadlocal logic consistentJacob Young
2025-06-12x86_64: remove linker references from codegenJacob Young
2025-06-12x86_64: remove air references from mirJacob Young
2025-06-06x86_64: add support for pie executablesJacob Young
2025-06-06Compilation: enable the x86_64 backend by default for debug buildsJacob Young
Closes #22257
2025-04-10x86_64: support rip-relative addressing to labels in inline asmJacob Young
2025-02-15x86_64: rewrite unsafe scalar int multiplicationJacob Young
2025-01-16x86_64: implement switch jump tablesJacob Young
2025-01-15switch to ArrayListUnmanaged for machine codeAndrew Kelley
2024-11-24dwarf: fix stepping through an inline loop containing one statementJacob Young
Previously, stepping from the single statement within the loop would always exit the loop because all of the code unrolled from the loop is associated with the same line and treated by the debugger as one line.
2024-10-24link/Coff: simplify file structure by collapsing all files into Coff.zig ↵Jakub Konka
(#21761) * coff: collapse Coff/lld.zig logic into Coff.zig * coff: rename std.coff uses to coff_util * coff: rename self to coff for *Coff references * coff: collapse Coff/Atom.zig logic into Coff.zig * coff: collapse Coff/Relocation.zig logic into Coff.zig * coff: collapse Coff/ImportTable.zig logic into Coff.zig * coff: remove unused Coff/Object.zig * link/Coff: fix rebase gone wrong
2024-10-09Dwarf: implement and test lexical blocksJacob Young
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-09-10codegen: implement output to the `.debug_info` sectionJacob Young
2024-08-27Dwarf: implement .eh_frameJacob Young
2024-08-25fix up merge conflicts with masterDavid Rubin
2024-08-22Dwarf: add missing var args info on function declsJacob Young
2024-08-21elf: emit .rela.debug* sections for relocatable if requiredJakub Konka
2024-08-20x86_64: support more dwarf locationsJacob Young
2024-08-20Dwarf: emit info about inline call sitesJacob Young
2024-08-17macho: update codegen and linker to distributed jump table approachJakub Konka
2024-08-16x86_64: move end of prologue to after function arguments are spilledJacob Young
This prevents the first step in to a function from displaying bogus argument values.
2024-08-16Dwarf: rework self-hosted debug info from scratchJacob Young
This is in preparation for incremental and actually being able to debug executables built by the x86_64 backend.
2024-08-15x86_64: fix handling on externs in lower/emitJakub Konka
2024-08-15elf: introduce Symbol.flags.is_extern_ptr for refs potentially needing GOTJakub Konka
2024-08-13elf: nuke ZigGotSection from existenceJakub Konka
2024-08-11compiler: split Decl into Nav and Caumlugg
The type `Zcu.Decl` in the compiler is problematic: over time it has gained many responsibilities. Every source declaration, container type, generic instantiation, and `@extern` has a `Decl`. The functions of these `Decl`s are in some cases entirely disjoint. After careful analysis, I determined that the two main responsibilities of `Decl` are as follows: * A `Decl` acts as the "subject" of semantic analysis at comptime. A single unit of analysis is either a runtime function body, or a `Decl`. It registers incremental dependencies, tracks analysis errors, etc. * A `Decl` acts as a "global variable": a pointer to it is consistent, and it may be lowered to a specific symbol by the codegen backend. This commit eliminates `Decl` and introduces new types to model these responsibilities: `Cau` (Comptime Analysis Unit) and `Nav` (Named Addressable Value). Every source declaration, and every container type requiring resolution (so *not* including `opaque`), has a `Cau`. For a source declaration, this `Cau` performs the resolution of its value. (When #131 is implemented, it is unsolved whether type and value resolution will share a `Cau` or have two distinct `Cau`s.) For a type, this `Cau` is the context in which type resolution occurs. Every non-`comptime` source declaration, every generic instantiation, and every distinct `extern` has a `Nav`. These are sent to codegen/link: the backends by definition do not care about `Cau`s. This commit has some minor technically-breaking changes surrounding `usingnamespace`. I don't think they'll impact anyone, since the changes are fixes around semantics which were previously inconsistent (the behavior changed depending on hashmap iteration order!). Aside from that, this changeset has no significant user-facing changes. Instead, it is an internal refactor which makes it easier to correctly model the responsibilities of different objects, particularly regarding incremental compilation. The performance impact should be negligible, but I will take measurements before merging this work into `master`. Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com> Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2024-08-07elf: fix compile errorsJakub Konka
2024-07-22macho: run more things in parallelJakub Konka
2024-07-18macho: fix compile errorsJakub Konka
2024-07-18macho: update ZigObject to use new ownership modelJakub Konka
2024-03-11std.builtin: make link mode fields lowercaseTristan Ross
2024-02-17lib/std/elf: refactor reloc enum valuesJakub Konka
2024-02-17elf: create Zig specific reloc type shared across ISAsJakub Konka
2024-02-17elf: add riscv dynamic relocsJakub Konka
2024-01-31x86_64+macho: emit .got instead of .got_load relocsJakub Konka
2024-01-24x86_64: emit MachO TLV sequenceJakub Konka
2024-01-24macho: again fix symbol index dereference in codegen wrt ZigObjectJakub Konka
2024-01-24macho: fix symbol index dereference in codegen wrt ZigObjectJakub Konka
This is incredibly confusing and I really need to simplify it. Elf also possesses this shortcoming so once I get Coff up to speed it should hopefully become clear on how to refactor this.
2024-01-24codegen: re-implement enough of codegen to error out instead panicJakub Konka
2024-01-24macho: get the ball rolling!Jakub Konka