| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
Turns out hardware enforces SP 16-bit alignment in every SP relative
load/store, but QEMU doesn't emulate this.
|
| |
|
|
| |
We don't support #pragma pack yet
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
places
|
| | |
|
| |
|
|
|
| |
It was wrong for functions that didn't use the frame pointer but took
arguments in the stack
|
| | |
|
| |
|
|
|
| |
The shift instructions do not update flags if the shift amount was zero,
so can't realiably do this micro optimization
|
| | |
|
| | |
|
| |
|
|
| |
Checks for RADDR should also look for RSTACK when fusing addresses
|
| |
|
|
|
| |
Because the integer mov can have immediate operands, avoids a round trip
through an XMM register.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
- Missing: vaargs, >2 member HFAs
- Reworked the way stack allocation references are lowered. Now RSTACK
persists throughout all passes until emit. This allows deferring stack
frame layouting until the end in a less messy way than before, which
was emiting frame-pointer relative addresses @ isel time and patching them up
later in emit to account for actual stack frame layout.
|
| |
|
|
| |
Don't use frame pointer or explicitly modify stack pointer for these
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Undefined behavior by the standard but a GNU extension.
|
| | |
|
| |
|
|
|
|
| |
I tested it and it seems this wasn't doing anything. Maybe at some point
in the past it was needed to fix up a worse implementation of mem2reg?
So turn it into a check. Maybe it's wrong and it can be necessary.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Do it in 2 passes: 1. gather variables, 2. step thru RPO transforming
loads/stores to each variable. More elegant solution to f9e3a52eaa.
More efficient since all variable usages are visited in CFG order, which
matters due to block sealing.
|
| | |
|
| |
|
|
|
|
|
| |
If a function is stashed for inlining and inlined in all of its
callsites or unused, it never ends up in the object file. If any symbol
reference to it is emitted, then it must be de-inlined (rematerialized),
and this is done near the end before emitting the actual object file.
|
| |
|
|
|
| |
That way they are not copied when inlining.
Also rename ninstr -> ninstrtab. opnarg -> opnoper
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
It was meant as a micro-optimization but actually keeping it in sync was
annoying. This for example was broken:
```
extern enum foo { ... } g_foo;
enum foo g_foo;
```
|
| |
|
|
|
| |
Is much nicer. I don't know whether I want to do it for the other int
types too. char and uchar are fine as bytes. u/short -> u/s16int, maybe.
|
| |
|
|
| |
OpenBSD working & tested
|
| | |
|
| |
|
|
|
|
|
| |
The symref given by staticaddrof is in ex2, not sub. This worked by
chance (with sub->ssym.off happening to be zero) on linux, but on
OpenBSD it would give garbage. Which would result in messed up relocations
later leading to miscompilations.
|
| |
|
|
|
| |
Move the alloca to the beginning of the block and do a 2nd pass on those
odd cases.
|
| |
|
|
|
|
|
|
|
| |
mem2reg was assuming alloca's appeared before all their uses. When this
didn't happen it broke the logic re. sealed blocks. Normally this
doesn't happen in most natural code. Even with gotos, RPO would assure
this in most cases, the exception I found is a goto that jumps into a
loop past a variable declaration that is earlier in the loop. Then even
RPO would keep the alloca itself past the first uses, breaking things.
|