Sign in Join

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

Mailing lists / fpc-devel / 2005-05

inline of overloaded operators

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Bartek

hi,

as you can see the "abs" function has been inlined correctly, but the "slash" operator is called.
is this my fault - wrong operator definition - or can't I inline operators currently? are there any plans to do so?

asm source:

# [115] Normalize:=v1/abs(v1);
leal -40(%ebp),%edi
leal -24(%ebp),%esi
cld
movl $4,%ecx
rep
movsl
flds -40(%ebp)
fmul %st,%st
flds -36(%ebp)
fmul %st,%st
faddp %st,%st(1)
flds -32(%ebp)
fmul %st,%st
faddp %st,%st(1)
fsqrt
fstps -4(%ebp)
fwait
pushl -4(%ebp)
leal -24(%ebp),%edx
leal -40(%ebp),%eax
call BVMATH_slash$VECTOR4$SINGLE$$VECTOR4
movl -8(%ebp),%edi
leal -40(%ebp),%esi
cld
movl $4,%ecx
rep
movsl

code source:

operator / (v1 :vector4; s1: single) v_r:vector4;assembler;inline; asm
movups xmm0, [v1]
movups xmm1, [s1]
shufps xmm1, xmm1, 00000000b
divps xmm0, xmm1
movups [v_r], xmm0
end;

thanks in advance
bartek

Reply by email

Peter Vreman
to Bartek
Show quoted text 6 lines
hi, as you can see the "abs" function has been inlined correctly, but the "slash" operator is called. is this my fault - wrong operator definition - or can't I inline operators currently? are there any plans to do so?

Assembler procedures/functions/operators can't be inlined. For the near future there are no plans to get it working. It is full of pitfalls. Also Delphi 2005 doesn't allow inlining of assembler procedures.

Reply by email