782 Commits

Author SHA1 Message Date
Timofey Frolov c01f431536 rv64: Add support for Zba, Zbb, Zbc, Zbs (#14) 2024-06-17 10:47:10 +02:00
Alexis Engelke 3e84ecbca9 tests/x86-64: Adjust address for 64k page systems 2024-06-07 17:11:12 +02:00
Alexis Engelke e5f04c93b2 Fix LLVM 16-18 build and bump to LLVM 16 2024-06-07 17:05:42 +02:00
Alexis Engelke 837fabd8ad frvdec: Update for Zba, Zbb, Zbc, Zbs support 2024-06-07 15:53:02 +02:00
Alexis Engelke 0a574bbe1c basicblock: Replace std::vector with SmallVector
Most blocks have few predecessors, so avoid two extra heap allocations
for every block.
2024-05-17 11:12:28 +02:00
Alexis Engelke cba18d5106 x86-64: BSF/BSR with zero source don't modify dest
This is specified on AMD and apparently the same on Intel. glibc makes
use of this fact.
2024-05-17 11:07:21 +02:00
Alexis Engelke c13eb03b0e basicblock: Unify register file creation 2024-05-10 12:10:20 +02:00
Alexis Engelke cbc0f586bb callconv: Correct unpack block after control flow
The begin block is not always the correct continuation point for a new
register file.
2024-05-10 11:56:57 +02:00
Alexis Engelke 2214e91740 general: Drop non-Arch-BasicBlock 2024-04-30 11:03:08 +02:00
Alexis Engelke 3d8bd82cfb tests/x86-64: Add more string operation tests 2024-04-29 18:02:36 +02:00
Alexis Engelke f93808f59f decoder: Use SmallVector 2024-04-24 17:49:37 +02:00
Alexis Engelke b08bd07977 llvm: Add support for LLVM 18 2024-04-24 17:49:23 +02:00
Alexis Engelke f4baf89b35 rv64: Implement LR.D/SC.D non-atomically 2024-04-24 17:42:43 +02:00
Alexis Engelke 9e7ce6af46 x86-64/sse: Fix packed shift with immediate
The facet is ignored for immediate operands, causing the generation of
invalid LLVM-IR.
2024-04-24 17:41:59 +02:00
Alexis Engelke f1f2bf21e4 x86-64/sse: Implement PSIGNB/PSIGNW/PSIGND 2024-02-02 16:56:32 +01:00
Alexis Engelke 210fabeb57 x86-64/sse: Implement PALIGNR 2024-02-02 15:40:12 +01:00
Alexis Engelke 055bc94231 x86-64/sse: Unify SseBinOp and SseHorzOp 2024-02-02 15:03:33 +01:00
Alexis Engelke 2c7dc5ac67 x86-64/sse: Implement PHADDSW/PHSUBSW 2024-02-02 15:01:08 +01:00
Alexis Engelke 4651a3fd34 x86-64/sse: Move horz-to-vert to separate function 2024-02-02 15:00:30 +01:00
Alexis Engelke d5219885c8 x86-64/sse: Implement PMADDUBSW 2024-02-02 12:08:13 +01:00
Alexis Engelke 8b1736e34c x86-64: Implement POPCNT 2024-02-01 16:19:44 +01:00
Alexis Engelke f15eca94c6 callconv: Hoist stores out of merge blocks
This gives some performance improvements and avoids executing stores on
some code paths where a register is not modified.
2024-01-31 15:34:31 +01:00
Alexis Engelke c859f11960 x86-64/sse: Handle zero-idiom for SSE registers 2024-01-29 15:54:21 +01:00
Alexis Engelke e8c4be2881 basicblock: Remove unnecessary no-op cast
With opaque pointer types, this can never happen.
2024-01-20 13:54:32 +01:00
Alexis Engelke b29d5e285e aarch64: Compute some flags lazily 2024-01-20 13:54:32 +01:00
Alexis Engelke 6bbdf9796f x86-64/flags: Compute ADD OF lazily 2024-01-20 13:54:24 +01:00
Alexis Engelke 296bd05750 regfile: Handle PC specially
PC is not an ordinary register and has strong connections to the lifted
CFG. Avoid relying on information encoded in (unused) LLVM-IR
instructions for lifting and store this explicitly.
2024-01-20 13:39:39 +01:00
Alexis Engelke caa79d127c general: Remove compatibility with LLVM < 15
We require opaque pointers already, so we don't need compatibility
hacks.
2024-01-17 20:44:50 +01:00
Alexis Engelke a8207825cd tests/driver: Adjust for LLVM 18 API break 2024-01-17 19:36:39 +01:00
Alexis Engelke b476ce638c tests/x86-64: Add test for MOVNTDQ 2024-01-17 19:36:34 +01:00
Alexis Engelke ff40e3a9a4 basicblock: Use cheaper assertion
Getting actual predecessors is fairly expensive, so use out predecessor
list instead.
2024-01-17 19:35:48 +01:00
Alexis Engelke d4cf4283a8 x86-64/sse: Simplify MOVSS/MOVSD code
If the regfile does the register merging, access to lower parts is more
efficient, as the extra extraction can be avoided.
2024-01-17 19:13:49 +01:00
Alexis Engelke 05df75eb5c regfile: Simplify set function naming 2024-01-17 19:11:28 +01:00
Alexis Engelke df3ab9d8bf regfile: Remove unnecessary clear method 2024-01-17 18:56:43 +01:00
Alexis Engelke 28e7868081 rv64: Simplify StoreFp for new regfile 2024-01-17 18:44:17 +01:00
Alexis Engelke ce823a063e rv64: Fix CFG for syscall 2024-01-17 18:44:03 +01:00
Alexis Engelke f6a23e0d1a aarch64: Simplify SetScalar for new regfile 2024-01-17 18:39:08 +01:00
Alexis Engelke 48b7919e2c tests/driver: Fix output of expected and actual 2024-01-17 18:02:59 +01:00
Alexis Engelke c21fc8feb1 x86-64/gp: Improve generated code for LEA
Avoid generating additions with zero or multiplications with one.
2024-01-17 18:02:08 +01:00
Alexis Engelke b9ac916a1d regfile: Use bit or pointer cast 2024-01-17 18:01:18 +01:00
Alexis Engelke c67d0d500e regfile: Fix types of lshr 2024-01-17 18:01:07 +01:00
Alexis Engelke add6268c65 x86-64: Compute carry flag lazily 2024-01-17 14:07:36 +01:00
Alexis Engelke 43803d6820 regfile: Copy all values from single predecessor
This avoids useless extensions or merges.
2024-01-17 13:30:06 +01:00
Alexis Engelke e5a02924d5 regfile: Avoid indirection to register storage 2024-01-15 15:24:10 +01:00
Alexis Engelke 186040f941 callconv: Omit undef stores 2024-01-15 15:16:27 +01:00
Alexis Engelke 1ba3a33380 basicblock: Avoid phi nodes for exit block
When the exit block has a single predecessor, there's no need to
generate phi nodes for that.
2024-01-15 15:15:51 +01:00
Alexis Engelke 290cda4117 x86-64/gp: Special-case XOR zero idiom 2024-01-15 14:28:31 +01:00
Alexis Engelke bd491c3412 x86-64/gp: Optimize XOR+DIV and CQO+IDIV sequences
Most divisions aren't actually 128 bits, so avoid generating such large
divisions in the first place.
2024-01-15 14:28:31 +01:00
Alexis Engelke 27f3d5a59a regfile: Cache extracted facets
This avoids redundant extractions of the same value
2024-01-15 14:28:31 +01:00
Alexis Engelke edc4b9e619 regfile: Minor refactoring 2024-01-15 14:28:31 +01:00