Sign in Join

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

Mailing lists / fpc-devel / 2007-12

improvement SSE and string+char

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

DarekM

Hi
I've notice two improvement
1. equation in SSE

# Var Zr located in register mreg0md
# Var Zi located in register mreg1md
# Var Ti located in register mreg3md
# Var Tr located in register mreg2md
# [39] Tr := Zr * Zr;
movsd %xmm0,%xmm4
mulsd %xmm0,%xmm4
movsd %xmm4,%xmm2

it can be changed to:
# [39] Tr := Zr * Zr;
movsd %xmm0,%xmm2
mulsd %xmm0,%xmm2

2. concatenation shortstring and char should not translate char to string, but only test length of string and if can add 1 char at then end.

I've use FPC 2.2

Darek

Reply by email

Florian Klaempfl
to DarekM
Show quoted text 17 lines
Hi I've notice two improvement 1. equation in SSE # Var Zr located in register mreg0md # Var Zi located in register mreg1md # Var Ti located in register mreg3md # Var Tr located in register mreg2md # [39] Tr := Zr * Zr; movsd %xmm0,%xmm4 mulsd %xmm0,%xmm4 movsd %xmm4,%xmm2 it can be changed to: # [39] Tr := Zr * Zr; movsd %xmm0,%xmm2 mulsd %xmm0,%xmm2

Yes, but it's not easy to implement ;)

Reply by email

DarekM
to Florian Klaempfl

Florian Klaempfl pisze:

Show quoted text 23 lines
DarekM schrieb: > Hi > I've notice two improvement > 1. equation in SSE > > # Var Zr located in register mreg0md > # Var Zi located in register mreg1md > # Var Ti located in register mreg3md > # Var Tr located in register mreg2md > # [39] Tr := Zr * Zr; > movsd %xmm0,%xmm4 > mulsd %xmm0,%xmm4 > movsd %xmm4,%xmm2 > > it can be changed to: > # [39] Tr := Zr * Zr; > movsd %xmm0,%xmm2 > mulsd %xmm0,%xmm2 > Yes, but it's not easy to implement ;)

I think so, but its worth of effort. That are very popular equation (the same with A=B+C) . And second: can cpu then make own optimalizations (next line use different registers).

my stupid suggest:
after translate of equation test of last line:
movsd %xmmA,%xmmB

if %xmmB is not use before change every %xmmA to %xmmB and remove last line.

but sorry it I don't understand some of it.

Darek

Reply by email