aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2023-09-23spirv: fixesRobin Voetter
2023-09-23spirv: air dbg_var_val and dbg_var_ptrRobin Voetter
2023-09-23spirv: fix blocks that return no valueRobin Voetter
2023-09-23spirv: fix source line numbersRobin Voetter
2023-09-23spirv: enable passing testsRobin Voetter
2023-09-23spirv: constant elem ptrRobin Voetter
2023-09-23spirv: air sliceRobin Voetter
2023-09-23spirv: air wrap_errunion_payloadRobin Voetter
2023-09-23spirv: air unwrap_errunion_payloadRobin Voetter
2023-09-23spirv: air is_err, is_non_errRobin Voetter
2023-09-23spirv: generate module initializerRobin Voetter
2023-09-23spirv: air array_elem_val using hackRobin Voetter
SPIR-V doesn't support true element indexing, so we probably need to switch over to isByRef like in llvm for this to work properly. Currently a temporary is used, which at least seems to work.
2023-09-23spirv: air aggregate_init for arrayRobin Voetter
2023-09-23spirv: air array_to_sliceRobin Voetter
2023-09-23spirv: air sub_with_overflowRobin Voetter
2023-09-23spirv: air union_initRobin Voetter
2023-09-23spirv: air set_union_tag + improve load()/store()Robin Voetter
2023-09-23spirv: air struct_field_ptr for unionsRobin Voetter
2023-09-23spirv: air struct_field_val for unionsRobin Voetter
2023-09-23spirv: add names to globals and initializersRobin Voetter
2023-09-23spirv: emit OpLogical(Not)Equal for comparing boolsRobin Voetter
2023-09-23spirv: emit OpNot for arithmetic notRobin Voetter
2023-09-23spirv: fix store of undefRobin Voetter
2023-09-23spirv: fix type_map use-after-realloc issuesRobin Voetter
2023-09-23spirv: make construct(Struct|Array) use the Function storage classRobin Voetter
2023-09-23spirv: always emit unsigned integersRobin Voetter
This is required for SPIR-V in Kernel mode. The Intel implementation just didn't care about this fact.
2023-09-23spirv: fixesRobin Voetter
2023-09-23spirv: remove indirect constant loweringRobin Voetter
It is stupid and I hate it.
2023-09-23spirv: put global var initializers in functionsRobin Voetter
2023-09-23spirv: lower union initialization at runtimeRobin Voetter
2023-09-23spirv: lower struct aggregate initialization at runtimeRobin Voetter
2023-09-23spirv: lower array aggregate at runtimeRobin Voetter
2023-09-23spirv: lower opt constantsRobin Voetter
2023-09-23spirv: lower ptr constantsRobin Voetter
2023-09-23spirv: lower enum_tag constantsRobin Voetter
2023-09-23spirv: assign type names to (error) unionsRobin Voetter
2023-09-23spirv: construct error union at runtimeRobin Voetter
2023-09-23spirv: add type_map to map AIR types to SPIR-V typesRobin Voetter
This will help us both to make the implementation a little more efficient by caching emission for certain types like structs, and also allow us to attach extra information about types that we can use while lowering without performing a search over the entire type tree for some property.
2023-09-23spirv: disable failing testsRobin Voetter
2023-09-21LLVM: fix UAF when lowering debug info for structsAndrew Kelley
Gotta call the get() function inside the loop if the loop adds anything to InternPool.
2023-09-21compiler: fix structFieldName crash for tuplesAndrew Kelley
When struct types have no field names, the names are implicitly understood to be strings corresponding to the field indexes in declaration order. It used to be the case that a NullTerminatedString would be stored for each field in this case, however, now, callers must handle the possibility that there are no names stored at all. This commit introduces `legacyStructFieldName`, a function to fake the previous behavior. Probably something better could be done by reworking all the callsites of this function.
2023-09-21InternPool,Sema,type,llvm: alignment fixesmlugg
This changeset fixes the handling of alignment in several places. The new rules are: * `@alignOf(T)` where `T` is a runtime zero-bit type is at least 1, maybe greater. * Zero-bit fields in `extern` structs *do* force alignment, potentially offsetting following fields. * Zero-bit fields *do* have addresses within structs which can be observed and are consistent with `@offsetOf`. These are not necessarily all implemented correctly yet (see disabled test), but this commit fixes all regressions compared to master, and makes one new test pass.
2023-09-21compiler: get codegen of behavior tests working on at least one backendmlugg
We're hitting false compile errors, but this is progress!
2023-09-21fix regressions from this branchAndrew Kelley
2023-09-21compiler: move struct types into InternPool properAndrew Kelley
Structs were previously using `SegmentedList` to be given indexes, but were not actually backed by the InternPool arrays. After this, the only remaining uses of `SegmentedList` in the compiler are `Module.Decl` and `Module.Namespace`. Once those last two are migrated to become backed by InternPool arrays as well, we can introduce state serialization via writing these arrays to disk all at once. Unfortunately there are a lot of source code locations that touch the struct type API, so this commit is still work-in-progress. Once I get it compiling and passing the test suite, I can provide some interesting data points such as how it affected the InternPool memory size and performance comparison against master branch. I also couldn't resist migrating over a bunch of alignment API over to use the log2 Alignment type rather than a mismash of u32 and u64 byte units with 0 meaning something implicitly different and special at every location. Turns out you can do all the math you need directly on the log2 representation of alignments.
2023-09-19llvm: update riscv floating-point c abi for LLVM 17Jacob Young
2023-09-19llvm: update data layout computation to LLVM 17Jacob Young
2023-09-19llvm: update address space definitions to LLVM 17Jacob Young
2023-09-19Builder: further constant select cleanupJacob Young
2023-09-19LLVM: update backend to LLVM 17Andrew Kelley
* LLVMConstSelect is removed (see https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179) * a couple functions use uint64_t instead of int now which means we no longer need `@intCast`. release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8