Jacob Young
f316cb29cc
x86_64: implement atomic and fence ops
2023-03-21 08:49:54 +01:00
Jacob Young
3f4569bf18
codegen: fix backend breakage due to optional layout change
2023-03-21 08:49:54 +01:00
Jacob Young
6c453dd806
x86_64: implement some slice ops
2023-03-21 08:49:54 +01:00
Jacob Young
958c8e1ce9
x86_64: implement @popCount for older processors
...
This fixes the behavior tests when compiled for baseline.
2023-03-21 08:49:54 +01:00
Jacob Young
f95faac5ae
x86_64: (re)implement optional ops
...
Note that this commit also changes the layout of optional for all
other backends using `src/codegen.zig` without updating them!
2023-03-21 08:49:54 +01:00
Jacob Young
24f0900ecb
x86_64: implement some error union ops
2023-03-21 08:49:54 +01:00
Jacob Young
bbd05e2d97
x86_64: improve codegen for neg and not
2023-03-21 08:49:54 +01:00
Jacob Young
80427796df
x86_64: implement @returnAddress and @frameAddress
2023-03-21 08:49:54 +01:00
Jacob Young
53ec2a955e
x86_64: implement clz, ctz, and popCount
2023-03-21 08:49:54 +01:00
Jacob Young
edd63f9aba
x86_64: reimplement inline memcpy and memset
2023-03-21 08:49:54 +01:00
Jacob Young
c865c8fb2a
x86_64: implement float division intrinsics
2023-03-21 08:49:54 +01:00
Jacob Young
b6eebb709f
x86_64: fix OBO
...
These loops were skipping over the top stack entry, and there's already
a function that does this correctly.
2023-03-21 08:49:54 +01:00
Jacob Young
30e1daa746
x86_64: implement basic float ops
2023-03-21 08:49:54 +01:00
Jacob Young
29e6aedc95
x86_64: implement min and max as commutative binary ops
2023-03-21 08:49:54 +01:00
Luuk de Gram
09d6938df9
wasm: add atomics opcodes and refactoring
...
This adds the atomic opcodes for the Threads proposal to the
WebAssembly specification: https://github.com/WebAssembly/threads
PrefixedOpcode has been renamed to MiscOpcode as there's multiple
types of prefixed opcodes. This naming is similar to other tools
such as LLVM. As we now use the 0xFE prefix, we moved the
function_index MIR instruction as it was occupying the same value.
This commit includes renaming all related opcodes.
2023-03-18 20:13:30 +01:00
Jacob Young
d70955b0df
x86_64: turn packed struct crashes into compile errors
2023-03-15 01:04:21 -04:00
Jacob Young
ba9d93dc9f
x86_64: implement more binary immediate combinations
2023-03-15 01:04:21 -04:00
Jacob Young
05b12e6779
x86_64: handle duplicate prong deaths
2023-03-15 01:04:21 -04:00
Jacob Young
2386159840
x86_64: use short union init
2023-03-15 01:04:21 -04:00
Jacob Young
d14a9e82fe
x86_64: use new for loop syntax
2023-03-15 01:04:21 -04:00
Jacob Young
bb6b9c19e0
x86_64: fix lowering of non-pointer optional is null
2023-03-15 01:04:21 -04:00
Jacob Young
5ab426a302
x86_64: fix store of undefined
2023-03-15 00:01:44 -04:00
Jacob Young
9a4e9215fc
x86_64: fix error code paths to not have extra pops
2023-03-15 00:01:44 -04:00
Jakub Konka
ac434fd8cc
x86_64: avoid inline for-loops when scanning the encodings table
2023-03-12 22:06:22 +01:00
Jakub Konka
955e394792
x86_64: fix 32bit build issues in the encoder
2023-03-12 08:47:23 +01:00
Jakub Konka
707a74655b
x86_64: downstream encoder/assembler tests
2023-03-12 08:41:44 +01:00
Jakub Konka
433558a92f
x86_64: clean up
2023-03-11 20:05:50 +01:00
Jakub Konka
f279ccb807
x86_64: rename asmNone to asmOpOnly
2023-03-11 20:05:50 +01:00
Jakub Konka
fb38e3d6b2
x86_64: simplify immediate handling at MIR level
2023-03-11 20:05:50 +01:00
Jakub Konka
0a8b5c20aa
x86_64: add wrapper for .jcc with relocation
2023-03-11 20:05:50 +01:00
Jakub Konka
c9a153c797
x86_64: add .dead pseudo-instruction to mark an unused MIR instruction
2023-03-11 20:05:50 +01:00
Jakub Konka
621fc36b55
x86_64: add wrapper for .jmp_reloc
2023-03-11 20:05:50 +01:00
Jakub Konka
21630ea17f
x86_64: apply couple of tweaks and pass behavior tests
2023-03-11 20:05:50 +01:00
Jakub Konka
6e1da36503
x86_64: PtrSize.fromSize() should take into account nonexact sizes too
2023-03-11 20:05:50 +01:00
Jakub Konka
e34e7d5ad1
x86_64: add missing decodings for .movsx
2023-03-11 20:05:50 +01:00
Jakub Konka
fe1fab4a8e
x86_64: fix CALL emits for ELF and Plan9
2023-03-11 20:05:49 +01:00
Jakub Konka
d0e7212539
x86_64: finish rolling out all MIR assembly helpers
2023-03-11 20:05:49 +01:00
Jakub Konka
022b308d6a
x86_64: start converting MI references
2023-03-11 20:05:49 +01:00
Jakub Konka
4af8313f36
x86_64: plug up all RM/MR references
2023-03-11 20:05:49 +01:00
Jakub Konka
32708dd6e2
x86_64: add RM and MR helpers to codegen
2023-03-11 20:05:49 +01:00
Jakub Konka
9658ab6766
x86_64: handle all instructions without introducing Memory operand
2023-03-11 20:05:49 +01:00
Jakub Konka
1bde522c2c
x86_64: add helper for Jcc instruction
2023-03-11 20:05:49 +01:00
Jakub Konka
7221cd8ec9
x86_64: add helpers for CMOVcc and SETcc at the MIR level
2023-03-11 20:05:49 +01:00
Jakub Konka
f61a70e812
x86_64: handle encoding and decoding Imm64 unsigned
2023-03-11 20:05:49 +01:00
Jakub Konka
aa8fda799e
x86_64: split up assemble() into more declarative single-purpose helpers
2023-03-11 20:05:49 +01:00
Jakub Konka
6e882d730b
x86_64: introduce assemble() helper which encodes/decodes into MIR -> Instruction
2023-03-11 20:05:49 +01:00
Jakub Konka
5b37701028
x86_64: refactor immediate selection logic
2023-03-11 20:05:49 +01:00
Jakub Konka
219c1261a5
x86_64: all behavior tests passing
2023-03-11 20:05:49 +01:00
Jakub Konka
292f91aef2
Handle .ah vs .spl register aliases
2023-03-11 20:05:49 +01:00
Jakub Konka
bc43cee775
Get more things passing
2023-03-11 20:05:49 +01:00