Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2017-11

Re: FillWord, FillDWord and FillQWord are very poorly optimised on Win64 (notsureabout x86-64 on Linux)

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

Okay, I'm about to start attempting to implement my versions of FillWord, FillDWord and FillQWord (along with some fixes to bugs that I noticed in my code in the interim)... given that I have to push and pop RDI to use REP STOSQ etc, what do I need to do in order to ensure SEH handles the stack frame correctly? All the other assembler functions that have FillChar/Move etc don't do any pushing or popping.

J. Gareth "Kit" Moreton

Reply by email

J. Gareth Moreton

Patch submitted.

https://bugs.freepascal.org/view.php?id=32637

Note that this hasn't been tested on Linux yet because I don't have the correct facilities and configuration to do that - I think the code is correct but it will need testing. It has been tested under Windows rather thoroughly, testing different input values, memory sizes that are not powers of two and also memory blocks that are slightly misaligned (but not so much that you're trying to, for example, write a 16-bit Word to memory that has an odd-numbered pointer address).

If anyone knows how to add some SEH code to account for "push %rdi" (Linux doesn't have this problem), I'd be most grateful. I hope it's at least a good start.

Yours faithfully,

J. Gareth Moreton

Reply by email