Skip to content

x86_64/ARM optimization One

Linux - yes

Windows - not verified
Android - yes
Rus: Компилятор не просматривает код, наперёд, пример:
Eng: The compiler does not look at the code, in advance, an example:
` var

array: quad[0..3] of single

begin
...
quad[1].X := X + charDesc.xx2;
quad[2].X := quad[1].X; <----- here
quad[0].X := X + charDesc.xx1;
... `

Linux asm:
`quad[1].X := X + charDesc.xx2;

movss 0x2c(%rsp),%xmm0

addss 0x34(%r15),%xmm0

movss %xmm0,0xc(%rsp) <--- calculated

quad[2].X := quad[1].X;

mov 0xc(%rsp),%eax <--- unnecessary action

mov %eax,0x14(%rsp) <--- So? --> movss %xmm0,0x14(%rsp)

quad[0].X := X + charDesc.xx1;

movss 0x2c(%rsp),%xmm0

addss 0x30(%r15),%xmm0

movss %xmm0,0x4(%rsp)`

Android ARM32 asm:
` quad[1].X := X + charDesc.xx2;

vldr	s0,[r8, #52]

vadd.f32	s0,s16,s0

vstr	s0,[r11, #-72]   <--- calculated

   quad[2].X := quad[1].X;

ldr	r0,[r11, #-72]   <--- unnecessary action

str	r0,[r11, #-64]   <--- So? --> vstr	s0,[r11, #-64]

    quad[0].X := X + charDesc.xx1;

vldr	s0,[r8, #48]

vadd.f32	s0,s16,s0

b	.Lj362`  

Rus: Было бы очень неплохо, если б просмотр был на несколько команд вперёд. С сохранением регистров, для более сильной оптимизации кода.
Eng: It would be very nice if several commands were viewed ahead. With saving data in the register of registers, for stronger code optimization.

Благодарю за внимание!

Edited by Seenkao
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information