Commit Graph

133 Commits

Author SHA1 Message Date
Ivan Krysak b4e4d73d49 Layout: introduce usedRegisters helper 2024-03-18 12:24:21 +00:00
Ivan Krysak 25bd3b437f Distributor: add nextPositionBasedIndex 2024-03-18 12:24:21 +00:00
Ivan Krysak 80375de3cb Layout: introduce finalStackOffset helper 2024-03-18 12:24:21 +00:00
Ivan Krysak c003a62212 Layout: rework dump 2024-03-18 12:24:21 +00:00
Ivan Krysak 08041ba771 ToCFT: fix last stack argument verification
It was still broken, even after `feature/alignment-fixes`, so
this commit softens requirements even further, to allow some of
the desired cases to pass through the verifier.
2024-03-15 19:05:10 +01:00
Ivan Krysak 069d3d3972 ToCABI: improve logger messages 2024-02-09 15:09:37 +00:00
Ivan Krysak e708a3655b ABI: drop incomplete clrcall support 2024-02-09 15:09:37 +00:00
Ivan Krysak c8cd0ab503 ValueDistributor: improve success log message 2024-02-09 15:09:37 +00:00
Ivan Krysak 27491410d6 ABI: introduce a way to disable vector registers 2024-02-09 15:09:37 +00:00
Ivan Krysak bc6673d90d ABI: make alignment-computation fails stricter 2024-02-09 15:09:37 +00:00
Ivan Krysak a018d443e1 ABI: update "safe" conversion list 2024-02-09 15:09:37 +00:00
Ivan Krysak 68301138c0 ABI: redesign register sorting from the ground up 2024-02-09 15:09:37 +00:00
Ivan Krysak 5bf4b3fa1e ABI: improve robustness to duplicate registers 2024-02-09 15:09:37 +00:00
Ivan Krysak 9d815d79ec ToRaw: take advantage of the updated distributor
This lets us drop the repeated alignment calculations at
the "leaves" of the conversion. Since new distributor already
provides the necessary information, we can just grab it from
there.
2024-02-09 15:09:37 +00:00
Ivan Krysak 40e443f354 ArgumentDistributor: add a SPTAR helper 2024-02-09 15:09:37 +00:00
Ivan Krysak 526cb7385a ValueDistributor: support stack argument offset 2024-02-09 15:09:37 +00:00
Ivan Krysak 5c99229c6f ToRaw: fix issues with how types were selected
Pointer-to-copy support was severely flawed.
2024-02-09 15:09:37 +00:00
Ivan Krysak 65cf1f08fd Distributor: add explicit pointer-to-copy-support 2024-02-09 15:09:37 +00:00
Ivan Krysak a468698d23 ValueDistributor: be extra explicit around padding
Before this, padding was just handled as a part of the size, but that
made it unnecessarily hard to work with. Now, everything padding-related
is extremely explicit.
2024-02-09 15:09:37 +00:00
Ivan Krysak 5994e4bf05 ToCAFT: always preserve stack types with metadata 2024-02-09 15:09:37 +00:00
Ivan Krysak d13e83163d Minor improvements 2024-02-09 15:09:37 +00:00
Ivan Krysak 8a74ff94b7 ABI: prevent emission of unsupported primitives 2024-02-09 10:04:27 +01:00
Alessandro Di Federico d9367954a4 Convert all public strings to kebab-case 2024-02-09 10:04:24 +01:00
Alessandro Di Federico 54025b48ff s/ConvertToRawFunctionType/ConvertFunctionsToRaw/g 2024-02-09 10:04:23 +01:00
Alessandro Di Federico a9aaa8ced4 s/ToCABIFunctionType/FunctionsToCABI/s 2024-02-09 10:04:23 +01:00
Ivan Krysak a331dcc878 ToCFT: improve naming 2024-01-29 11:57:54 +02:00
Ivan Krysak 82c2162d7d ABI: add an explicit void distribution helper 2024-01-29 11:57:54 +02:00
Ivan Krysak 78510010f8 ABI: rename isIncompatibleWith
The new name is `isPreliminarilyCompatibleWith`.
2024-01-29 11:57:54 +02:00
Ivan Krysak 81d365a24b ABI: assert on broken alignment calculation result 2024-01-29 11:57:54 +02:00
Ivan Krysak 79d68dcafc ABI: allow reusing the stack struct
When there's a single struct argument (as in, all we see is a nested
struct) and all the sizes match, just use the inner struct instead of
creating a new one.
2024-01-29 11:57:54 +02:00
Ivan Krysak d0b3777db4 ToCFT: use structs as a fallback
When a stack argument cannot be converted "as is",
use a struct instead to try and overcome the limitation.
2024-01-29 11:57:54 +02:00
Ivan Krysak 093cacdb6f ValueDistributor: enable working on model::Type 2024-01-29 11:57:54 +02:00
Ivan Krysak 35326b29ec ABI: streamline position-based argument handling 2024-01-29 11:57:54 +02:00
Ivan Krysak 4093cd30c4 ABI: provide alignment computation for model::Type 2024-01-29 11:57:54 +02:00
Ivan Krysak ce0ada6027 ToCFT: fix a invalid iterator access
Because of a mistake in the previous iteration, an invalid iteration was
dereferenced when a struct had non-zero size but no fields (padding only
struct).
2024-01-29 11:57:54 +02:00
Ivan Krysak 89b5cacc3b ToCFT: introduce more complete result verification 2024-01-29 11:57:54 +02:00
Ivan Krysak 39532658f9 ToCFT: improve alignment verification logger 2024-01-29 11:57:54 +02:00
Ivan Krysak 039efcfee8 ToCFT: use adjusted alignment for verification
Adjusted alignment means alignment when it's bigger than the pointer
size and pointer size otherwise.
2024-01-29 11:57:54 +02:00
Ivan Krysak 83bb28023c ToCFT: turn verifyAlignment into a free function 2024-01-29 11:57:54 +02:00
Ivan Krysak 7041d5ab4e ABI: expose argument distribution API
This allows external code to peek inside a layout and to tell how
a specific argument would be treated based on its type.
2024-01-29 11:57:54 +02:00
Ivan Krysak 11b1214896 ABI: avoid mentioning TrackingSortedVector
Use `decltype` to dynamically detect the type instead.
2024-01-29 11:57:54 +02:00
Ivan Krysak 386cb26f6d ABI: introduce a new ABI configuration option
It's called `AllowUnnaturallyAlignedTypesInRegisters` and explicitly
allows weirdly aligned structs in registers.
2024-01-29 11:57:54 +02:00
Ivan Krysak 16dc85cb0f ABI: improve unnatural alignment support 2024-01-29 11:57:54 +02:00
Ivan Krysak 54ffd723e6 ABI: decouple alignment from model::VerifyHelper 2024-01-29 11:57:54 +02:00
Ivan Krysak e97ce16240 ToRFT: rename DistributedArgument
The new name is `DistributedValue`, the change is warranted because it's
used for return values as well.
2024-01-29 11:57:54 +02:00
Ivan Krysak 75d0ba700c ToRFT: work on a single argument at a time 2024-01-29 11:57:54 +02:00
Ivan Krysak 7f1d14e149 ToCFT: streamline logger output 2024-01-29 11:57:54 +02:00
Ivan Krysak a2ef041cb2 Move TypeBucket to the model 2024-01-29 11:57:54 +02:00
Ivan Krysak 77b1acaf00 Prefer uint64_t to size_t wherever relevant 2024-01-29 11:57:54 +02:00
Ivan Krysak b25a32de2a Stop using std:: prefix for std::size_t 2024-01-29 11:57:54 +02:00