[fpc-devel]-Anasmelf on BeOS bug?

BiPolar BiPolar at SoftHome.net
Wed Dec 3 04:11:49 CET 2003


Florian Klaempfl wrote:

> > Warning: Assembler output selected "NASMELF" is not compatible with 
> > "BeOS for i386"
> > Warning: "AS" assembler use forced
> > 
> > FPC 1.9.1 doesn't gives the warning, but it force the use of "as" 
> > as 
> > the assembler too.
> 
> 1.9.1 should allow nasmelf for BeOS now as well.

Nice! I will try it as soon as I can "make cycle" it again :-)

> > Also, the SSE portion of that code has a DQWORD (Delphi recognize 
> > it) 
> > that FPC doesn't know how to handle (undeclared identifier).
> 
> Can you give an example please? I added it but I'am not sure if it 
> works 
> already.

I'll try. The following is a snipplet from dcdspfilter's FFT code 
(http://dcdspfilter.corecodec.org)

I put the code of the "CopyFromTo" procedure because it is short and 
has the original Pascal code to compare (the rest methods that has 
DQWORD are much larger).

-------------------------------------------------
type
  // FPU Complex Array
  PComplex = ^TComplex;
  TComplex = record
    re,
    im : Single;
  end;
  PComplexArray = ^TComplexArray;
  TComplexArray = array[0..8191] of TComplex;

  // SSE Complex Array
  TComplexSSE = record
    re1,re2,re3,re4,
    im1,im2,im3,im4 : Single;
  end;
  PComplexArraySSE = ^TComplexArraySSE;
  TComplexArraySSE = array[0..255] of TComplexSSE;
--------------------------------------------------

procedure InitSSECosineTable;
{
  procedure CopyFromTo(pFrom : PChar; pTo : PChar);
  begin
    CopyMemory(pTo,pFrom,4);
    CopyMemory(@pTo[4],pFrom,4);
    CopyMemory(@pTo[8],pTo,8);
    CopyMemory(@pTo[16], at pFrom[4],4);
    CopyMemory(@pTo[20], at pFrom[4],4);
    CopyMemory(@pTo[24], at pTo[16],8);
  end;
}
  procedure CopyFromTo(pFrom : PChar; pTo : PChar);
  asm
         movss      xmm1, DWORD PTR [pFrom]
         shufps     xmm1, xmm1, $0
         movaps     DQWORD PTR [pTo], xmm1
         movss      xmm1, DWORD PTR [pFrom+4]
         shufps     xmm1, xmm1, $0
         movaps     DQWORD PTR [pTo+16], xmm1
  end;

var
  i : integer;
begin
  for i := 0 to 6 do CopyFromTo(@d32[i], at d32SSE[i]);
  for i := 0 to 14 do CopyFromTo(@d64[i], at d64SSE[i]);
  for i := 0 to 30 do CopyFromTo(@d128[i], at d128SSE[i]);
  for i := 0 to 62 do CopyFromTo(@d256[i], at d256SSE[i]);
  for i := 0 to 126 do CopyFromTo(@d512[i], at d512SSE[i]);
  for i := 0 to 126 do CopyFromTo(@d1024[i], at d1024SSE[i]);
  for i := 0 to 254 do CopyFromTo(@d2048[i], at d2048SSE[i]);
  for i := 0 to 510 do CopyFromTo(@d4096[i], at d4096SSE[i]);
  for i := 0 to 1022 do CopyFromTo(@d8192[i], at d8192SSE[i]);
end;
-------------------------------------------------

> > Oscar Lesta. (not on the mail list)
> 
> CC added.

Thanks, and sorry for the delay in replying (expensive and inestable 
dialup down here).


In other subject:

Is it there any Docs/ReadMe/Guide about the structure/layout of the 
RTL? I mean, from the point of view of someone who wants to create/
modify the RTL specific to certain OS.

I ask this because I understand that the BeOS port has a kinda very-low
-prio, and there aren't many BeOS users that also use Pascal so... I 
just wanted to investigate the posibility of keeping BeOS RTL up-to-
date before it becames more difficult.
I already took a look at other OSes RTLs to see what was similar and 
what different. But I must confess, I get lost in the jungle. That's 
why I ask if there is any info that an outsider can use. Maybe a 
diagram to understand how each part interact with each other (OS/RTL/
Compiler)?

I can't promise I will make any valuable contribution, but at least I 
will try to.

Thanks for reading.

Oscar Lesta.




More information about the fpc-devel mailing list