[fpc-devel] inline of overloaded operators

Bartek bbartek at gmx.net
Thu May 19 17:00:30 CEST 2005


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





More information about the fpc-devel mailing list