Discussion:
[fpc-devel] The 15k bounty: Optimizing executable speed forLinux x86 / LLVM
J. Gareth Moreton
2018-12-04 00:24:01 UTC
Permalink
A regression like this is quite serious.  I'd recommend opening a bug
report with a reproducible case so we can investigate and hopefully fix it
within the day.
At the moment I'm experimenting with increasing the speed of the optimizer
for x86_64, and then porting to i386 when it's proven successful.  Having
teething problems though!

Gareth

On Tue 04/12/18 01:16 , Simon Kissel ***@nerdherrschaft.com sent:
Hi Florian,

we are currently to try to do some real-life benchmarks with our
products, however with rev. 40346 compilation fails with the two following

showstoppers:

1.)

The assembler parser appears to be broken - the following very valid
opcodes get rejected:

SBMath.pas(1932,9) Error: Asm: [cmp imm32,imm8s] invalid combination of
opcode and operands
SBMath.pas(1934,5) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1939,9) Error: Asm: [cmp imm32,imm8s] invalid combination of
opcode and operands
SBMath.pas(1941,5) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1946,9) Error: Asm: [cmp imm32,imm8s] invalid combination of
opcode and operands
SBMath.pas(1948,5) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1953,3) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1954,3) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1955,3) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1972,3) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1976,5) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1981,5) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands
SBMath.pas(1982,5) Error: Asm: [lea reg32,imm32] invalid combination of
opcode and operands

(-Tlinux -XPi386-linux- -CpPENTIUMM -O2 -OoCSE -CfSSE2 -Ooorderfields)

2.)

On ARM, I get Internal error 200603253 at various places:

SBMath.pas(1989,1) Fatal: Internal error 200603253
(sadly the line numbers are complete off for unknown reasons, so I can
not find the actual source line causing this)

But also happens at various other places. Most easy to reproduce by
compiling PasZLib-SG (e.g. https://github.com/Soldat/PasZlib-SG [1]).

Any clues?

BR,

Simon

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[3]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
Simon Kissel
2018-12-04 19:29:28 UTC
Permalink
Hi Gareth,
A regression like this is quite serious. I'd recommend opening a
bug report with a reproducible case so we can investigate and hopefully fix it within the day.
created a test project, and opened two tickets:

https://bugs.freepascal.org/view.php?id=34646
https://bugs.freepascal.org/view.php?id=34647
At the moment I'm experimenting with increasing the speed of the
optimizer for x86_64, and then porting to i386 when it's proven
successful. Having teething problems though!
Sounds great. I wish more of our products had 64bit CPUs...

What's the speed-up you are seeing on my test project so far?

Best regards,

Simon

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/list
J. Gareth Moreton
2018-12-04 22:04:38 UTC
Permalink
The more you learn!  What is TLS, curiously? Given that I do a lot of my
work at the assembler level, I figure this is something I should know!

Gareth

On Tue 04/12/18 22:48 , Simon Kissel ***@nerdherrschaft.com sent:
Hi Florian,
Do you compile with -Aas? The internal assemblers do not support TLS
yet, this is WIP.

Ah wow! -Aas does indeed help. Both the assembler errors and
the internal error are gone, both in Linux i386 and ARM.

And the created binaries even work. Nice! Thank you!

Cheers,

Simon

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[2]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
------
[1] mailto:fpc-***@lists.freepascal.org
[2] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Sven Barth via fpc-devel
2018-12-05 06:52:34 UTC
Permalink
The more you learn! What is TLS, curiously? Given that I do a lot of my
work at the assembler level, I figure this is something I should know!
Thread Local Storage. For ELF they are pseudo instructions that the
assembler needs to expand to the correct instructions for the target (and
TLS model), which is why the internal assembler does not handle them yet.

Regards,
Sven
Loading...