[fpc-devel] SSE in FPC

Dariusz Mazur darekm at emadar.com
Sat Nov 29 18:15:18 CET 2008


Florian Klaempfl pisze:
> Jonas Maebe schrieb:
>   
>> On 29 Nov 2008, at 11:11, Felipe Monteiro de Carvalho wrote:
>>
>>     
>>> You can tell FPC to do the SSE code for you:
>>>
>>>     -Cf<x>     Select fpu instruction set to use, see fpc -i for
>>> possible values
>>>       
>> That only applies to (scalar) FPU operations at this time. It won't do
>> any (auto or other) vectorisation.
>>     
>
> With -Sv -Cfsse2 you can compile things like
>   
I know this, but its hard to discover where and when is is used. Often 
is good, when compiler  make optimization itself, but some times is 
better tell them about possible vectorization.
> function f : double;
>   var
>     d1,d2,d3 : array[0..1] of double;

> begin
>   
>     d1:=d2*d3;
>   end;
>   

I would expect some thing like this
  type
     tSSEvector= packed record of
               a,b : double;
    end;

{ or }
     tSSEvector= array[0..1] of double;


function f : double;
  var
    d1,d2,d3 : tSSEVector;

begin

d1:=d2*d3;
 end;


Of course tSSEVector should be declared in System unit.
Then  any one can use SSE intentionally.



> However, it's not well tested.
>   
Is there a list of  SSE function, which can FPC use?


Darek





More information about the fpc-devel mailing list