On 10/11/2016 10:14 PM, Bernd Schmidt wrote:
On 10/11/2016 04:23 PM, Denys Vlasenko wrote:
This is better than current behavior, but this is not what I want.
15-byte function does not need to be aligned to 16 bytes on a
machine with 128-byte L1I cachelines. It needs to be aligned to 128
bytes if there are less than 15 bytes remaining; if there are MORE
than 15 bytes remaining, why align at all? It's a waste of space.
So that sounds like you'd want to modify the max_skip value based on
the size of the function - which would be a fairly minor change.
Yes, something like "if max_skip >= func_size, temporarily lower
max_skip to func_size-1" (because otherwise we can create padding
bigger-or-equal to the entire function in size, which is stupid
- it's better to just put the function in that space).
This would be a nice.