1
0
Files
aarre
applications
bindings
components
ZVDateTimeCtrls
acs
beepfp
chelper
cmdline
cmdlinecfg
colorpalette
csvdocument
epiktimer
fpsound
fpspreadsheet
freetypepascal
freetype.pas
lazfreetype.lpk
lazfreetype.pas
ttcache.pas
ttcalc.pas
ttcalc1.inc
ttcalc2.inc
ttcalc3.inc
ttcalc4.inc
ttcmap.pas
ttconfig.inc
ttdebug.pas
tterror.pas
ttfile.pas
ttgload.pas
ttinterp.pas
ttload.pas
ttmemory.pas
ttobjs.pas
ttraster.pas
tttables.pas
tttypes.pas
geckoport
gradcontrols
iosdesigner
iphonelazext
jujiboutils
jvcllaz
kcontrols
lazbarcodes
manualdock
mplayer
multithreadprocs
nvidia-widgets
onguard
orpheus
powerpdf
rgbgraphics
richmemo
richview
rtfview
rx
smnetgradient
spktoolbar
svn
tdi
thtmlport
tparadoxdataset
tvplanit
virtualtreeview
virtualtreeview-new
xdev_toolkit
zlibar
examples
lclbindings
wst
lazarus-ccr/components/freetypepascal/ttcalc4.inc

151 lines
2.9 KiB
PHP
Raw Normal View History

(*******************************************************************
*
* TTCalc4.Inc 1.2
*
* Arithmetic and Vectorial Computations (inline assembly)
* This version is used for i386 FreePascal
*
* Copyright 1996 David Turner, Robert Wilhelm and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* NOTES : All vector operations were moved to the interpreter
*
******************************************************************)
(**********************************************************)
(* *)
(* The following routines are inline assembly, they are *)
(* thus processor and bitness specific. Replace them *)
(* with your own if you want to port the TrueType Engine *)
(**********************************************************)
(* 64 Bit Addition *)
procedure Add64( var X, Y, Z : Int64 );// assembler;
begin
X := Y + Z;
end;
{asm
push %ebx
push %edx
mov X,%ebx
mov (%ebx) ,%eax
mov 4(%ebx) ,%edx
mov Y,%ebx
add (%ebx) ,%eax
adc 4(%ebx) ,%edx
mov Z,%ebx
mov %eax, (%ebx)
mov %edx, 4(%ebx)
pop %edx
pop %ebx
end;}
(**********************************************************)
(* 64 Bit Substraction *)
procedure Sub64( var X, Y, Z : Int64 );// assembler;
begin
X := Y - Z;
end;
{asm
push %ebx
push %edx
mov X,%ebx
mov (%ebx) ,%eax
mov 4(%ebx) ,%edx
mov Y,%ebx
sub (%ebx) ,%eax
sbb 4(%ebx) ,%edx
mov Z,%ebx
mov %eax, (%ebx)
mov %edx, 4(%ebx)
pop %edx
pop %ebx
end;}
(**********************************************************)
(* Multiply two Int32 to an Int64 *)
procedure MulTo64( X, Y : Int32; var Z : Int64 );// assembler;
begin
X := X * Y;
end;
{asm
push %ebx
push %edx
mov X,%eax
imull Y
mov Z,%ebx
mov %eax, (%ebx)
mov %edx, 4(%ebx)
pop %edx
pop %ebx
end;}
(**********************************************************)
(* Divide an Int64 by an Int32 *)
function Div64by32( var X : Int64; Y : Int32 ) : Int32;// assembler;
begin
Result := X div Y;
end;
{asm
push %ebx
push %edx
mov X,%ebx
mov (%ebx) ,%eax
mov 4(%ebx) ,%edx
idivl Y
pop %edx
pop %ebx
end;}
procedure DivMod64by32( var X : Int64; Y : Int32; var Q, R : Int32 );
// assembler;
begin
Q := X div Y;
R := X mod Y;
end;
{asm
push %ebx
push %edx
mov X,%ebx
mov (%ebx) ,%eax
mov 4(%ebx) ,%edx
idivl Y
mov Q, %ebx
mov %eax, (%ebx)
mov R, %ebx
mov %edx, (%ebx)
pop %edx
pop %ebx
end;}