aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2025-04-28spirv: allow `offset_and_cast` for vectors when possibleAli Cheraghi
2025-04-27C backend: less branchingAndrew Kelley
2025-04-28Merge pull request #23698 from alexrp/goff-xcoff-stubsAlex Rønne Petersen
`link`: Stub out GOFF/XCOFF linker code based on LLVM
2025-04-28cbe: aggregate assignment does not need a second castmlugg
`writeCValue` already emits a cast; including another here is, in fact, invalid, and emits errors under MSVC. Probably this code was originally added to work around the incorrect `.Initializer` location which was fixed in the previous commit.
2025-04-28cbe: assignment is not initializationJacob Young
Turns out the backend currently never emits a non-static initializer, but the handling is kept in case it is needed again in the future.
2025-04-28std.Target: Remove Os.Tag.elfiamcu.Alex Rønne Petersen
The last Intel Quark MCU was released in 2015. Quark was announced to be EOL in 2019, and stopped shipping entirely in 2022. The OS tag was only meaningful for Intel's weird fork of Linux 3.8.7 with a special ABI that differs from the regular i386 System V ABI; beyond that, the CPU itself is just a plain old P54C (i586). We of course keep support for the CPU itself, just not Intel's Linux fork.
2025-04-27Merge pull request #22605 from dweiller/memmoveAndrew Kelley
add `@memmove` builtin
2025-04-27llvm: Fix data layout string for s390x-zos.Alex Rønne Petersen
2025-04-26std.Target: Remove Abi.gnuilp32.Alex Rønne Petersen
* This has not seen meaningful development for about a decade. * The Linux kernel port was never upstreamed. * The glibc port was never upstreamed. * GCC 15.1 recently deprecated support it. It may still make sense to support an ILP32 ABI on AArch64 more broadly (which we already have the Abi.ilp32 tag for), but, to the extent that it even existed in any "official" sense, the *GNU* ILP32 ABI is certainly dead.
2025-04-26compiler: add @memmove builtindweiller
2025-04-11compiler: Move int size/alignment functions to std.Target and std.zig.target.Alex Rønne Petersen
This allows using them in e.g. compiler-rt.
2025-04-11std.Target: Rename charSignedness() to cCharSignedness().Alex Rønne Petersen
To be consistent with the other functions that answer C ABI questions.
2025-04-09compiler: Allow using LLVM's SPIR-V backend.Alex Rønne Petersen
2025-04-09Merge pull request #23501 from imreallybadatnames/masterimreallybadatnames™️
Step.Compile: use LtoMode enum for lto option
2025-04-09Fix mach-o naming for sancov sectionsSuperAuguste
2025-04-07Remove overzealous LLVM anti-instrumentation attributesSuperAuguste
2025-04-04llvm: Remove workaround for zero-length memset/memcpy on wasm.Alex Rønne Petersen
Closes #16360.
2025-04-04llvm: Use muslabin32/muslabi64 environments in the target triple.Alex Rønne Petersen
Closes #2909.
2025-04-04llvm: Allow FastISel on mips again.Alex Rønne Petersen
Closes #21215.
2025-04-04llvm: never_tail implies never_inline, so set noinline in this case too.Alex Rønne Petersen
2025-04-04llvm: Update the list of targets that use native f16/f128.Alex Rønne Petersen
Closes #22003. Closes #22013.
2025-04-04llvm: Fix i128 alignment for various targets.Alex Rønne Petersen
This ABI bug was fixed in LLVM 20.
2025-04-04llvm: Set target-abi module flag.Alex Rønne Petersen
LLVM is increasingly making use of this module flag when present.
2025-04-04std.Target: Add Abi.muslf32 and Abi.muslsf.Alex Rønne Petersen
2025-04-04std.Target: Update CPU models/features for LLVM 20.Alex Rønne Petersen
Closes #21818.
2025-04-04compiler: Updates for LLVM/Clang 20 API changes.Alex Rønne Petersen
2025-03-24Use `-unknown` when converting WASI/Emscripten target triples into LLVM triplesCarl Åstholm
The "musl" part of the Zig target triples `wasm32-wasi-musl` and `wasm32-emscripten-musl` refers to the libc, not really the ABI. For WASM, most LLVM-based tooling uses `wasm32-wasi`, which is normalized into `wasm32-unknown-wasi`, with an implicit `-unknown` and without `-musl`. Similarly, Emscripten uses `wasm32-unknown-emscripten` without `-musl`. By using `-unknown` instead of `-musl` we get better compatibility with external tooling.
2025-03-23Merge pull request #23209 from jacobly0/x86_64-rewriteJacob Young
x86_64: rewrite wrapping multiplication
2025-03-23Lower `@returnAddress` to a constant 0 in Emscripten release buildsCarl Åstholm
Emscripten currently implements `emscripten_return_address()` by calling out into JavaScript and parsing a stack trace, which introduces significant overhead that we would prefer to avoid in release builds. This is especially problematic for allocators because the generic parts of `std.mem.Allocator` make frequent use of `@returnAddress`, even though very few allocator implementations even observe the return address, which makes allocators nigh unusable for performance-critical applications like games if the compiler is unable to devirtualize the allocator calls.
2025-03-21x86_64: rewrite wrapping multiplicationJacob Young
2025-03-21big.int: fix yet another truncate bugJacob Young
Too many bugs have been found with `truncate` at this point, so it was rewritten from scratch. Based on the doc comment, the utility of `convertToTwosComplement` over `r.truncate(a, .unsigned, bit_count)` is unclear and it has a subtle behavior difference that is almost certainly a bug, so it was deleted.
2025-03-19spirv: Assemble OpTypeRuntimeArray.dan
2025-03-19compiler: Support more GCC code models and fix the mapping to LLVM code models.Alex Rønne Petersen
Closes #22517.
2025-03-18spirv: require int8/int16 capabilitiesAli Cheraghi
2025-03-18spirv: aligned load for physical storage variablesAli Cheraghi
Resolves #23212
2025-03-18spirv: packed struct init + field val accessAli Cheraghi
2025-03-17spirv/target: arbitrary_precision_integers feature supportAli Cheraghi
2025-03-17spirv: lower more types in assemblerAli Cheraghi
2025-03-17target: split `addresses` and `physical_storage_buffer` featuresAli Cheraghi
2025-03-17Sema: error on illegal code when targeting spirvAli Cheraghi
2025-03-17spirv: don't hardcode test error type alignmentAli Cheraghi
2025-03-08Merge pull request #22998 from jacobly0/x86_64-rewriteAndrew Kelley
x86_64: rewrite aggregate init
2025-03-08llvm: Replace DataLayoutBuilder with a simple target -> string switch.Alex Rønne Petersen
This should be a lot easier to maintain. It's also a small step towards eventually making the builder API parse the data layout string in order to answer layout questions that we need to ask during code generation.
2025-03-07x86_64: implement write register splittingJacob Young
2025-03-05Remove uses of deprecated callconv aliasesLinus Groh
2025-02-27Move the compiler's LLVM bitcode builder to std.zig.llvm.Alex Rønne Petersen
2025-02-24spirv: get rid of function_types cacheRobin Voetter
This deep hash map doesn't work
2025-02-24spirv: do not generate unnecessary forward pointerAli Cheraghi
Co-authored-by: Robin Voetter <robin@voetter.nl>
2025-02-24spirv: replace some unreachables with compile errorsAli Cheraghi
2025-02-24Merge pull request #22154 from alexrp/disable-intrinsicsAlex Rønne Petersen
compiler: Implement `@disableIntrinsics()` builtin function.