[fpc-devel] Successful implementation of inline support for pure assembler routines on x86

Marģers . margers.roked at inbox.lv
Mon Mar 18 00:15:51 CET 2019


 

----- Reply to message -----
Subject: Re: [fpc-devel] Successful implementation
of inline support for pure assembler routines on x86
Date: 2019. gada 17. marts 19:38:03
From:  Florian Klämpfl <florian at freepascal.org>
To:  <fpc-devel at lists.freepascal.org>
> Am 15.03.19 um 11:32 schrieb J. Gareth Moreton:
> * using inline assembler is always the worst
> solution to do something,
> it normally means either:
> - the compiler misses a certain feature

Question is about, who is going to implement every
imaginable feature in reasonable time frame? For
example intrinsics for BMI.

> - the compiler is generating bad code

Generated code for x86_64 instruction set is
pretty  good, if pascal code is tuned to take
advantaged of optimization currently done by
compiler (LLVM target does not do any better). But
assembler still give 10-20% boost. So there is
still space for improvements. 

> * intrinsics provide a much better way to achieve
> exactly what this
> approach aims at:
> - they enable the use of all registers as the
> compiler does register
> allocation

sadly it does not apply to bsf

> Is there any advantage over intrinsics, I missed
> so far?

To take advantage of flags changed by instruction.

I looking forward for assembler inline
functionality to be accepted. I would benefit of it.




More information about the fpc-devel mailing list