You've already forked lazarus-ccr
freetype1 Pascal version, initial checkin from http://cvsweb.xfree86.org/cvsweb/xc/extras/FreeType/pascal/lib/Attic/
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1565 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
99
components/freetypepascal/ttcalc3.inc
Normal file
99
components/freetypepascal/ttcalc3.inc
Normal file
@@ -0,0 +1,99 @@
|
||||
(*******************************************************************
|
||||
*
|
||||
* TTCalc3.Inc 1.2
|
||||
*
|
||||
* Arithmetic and Vectorial Computations (inline assembly)
|
||||
* This version is used for Delphi 2
|
||||
*
|
||||
* 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 *)
|
||||
|
||||
(* NOTE : Delphi seems to use the eax, edx then ecx registers to pass *)
|
||||
(* the first three parameters *)
|
||||
|
||||
(**********************************************************)
|
||||
(* 64 Bit Addition *)
|
||||
|
||||
procedure Add64( var X, Y, Z : Int64 ); assembler;
|
||||
asm
|
||||
push ebx
|
||||
push esi
|
||||
mov ebx, [ eax ]
|
||||
mov esi, [eax+4]
|
||||
add ebx, [ edx ]
|
||||
adc esi, [edx+4]
|
||||
mov [ ecx ], ebx
|
||||
mov [ecx+4], esi
|
||||
pop esi
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
|
||||
(**********************************************************)
|
||||
(* 64 Bit Substraction *)
|
||||
|
||||
procedure Sub64( var X, Y, Z : Int64 ); assembler;
|
||||
asm
|
||||
push ebx
|
||||
push esi
|
||||
mov ebx, [ eax ]
|
||||
mov esi, [eax+4]
|
||||
sub ebx, [ edx ]
|
||||
sbb esi, [edx+4]
|
||||
mov [ ecx ], ebx
|
||||
mov [ecx+4], esi
|
||||
pop esi
|
||||
pop ebx
|
||||
end;
|
||||
|
||||
|
||||
(**********************************************************)
|
||||
(* Multiply two Int32 to an Int64 *)
|
||||
|
||||
procedure MulTo64( X, Y : Int32; var Z : Int64 ); assembler;
|
||||
asm
|
||||
imul edx
|
||||
mov [ ecx ],eax
|
||||
mov [ecx+4],edx
|
||||
end;
|
||||
|
||||
(**********************************************************)
|
||||
(* Divide an Int64 by an Int32 *)
|
||||
|
||||
function Div64by32( var X : Int64; Y : Int32 ) : Int32; assembler;
|
||||
asm
|
||||
mov ecx, edx
|
||||
mov edx, [eax+4].dword
|
||||
mov eax, [ eax ].dword
|
||||
idiv ecx
|
||||
end;
|
||||
|
||||
procedure DivMod64by32( var X : Int64; Y : Int32; var Q, R : Int32 );
|
||||
assembler;
|
||||
asm
|
||||
push ebx
|
||||
mov ebx, edx
|
||||
mov edx, [eax+4].dword
|
||||
mov eax, [ eax ].dword
|
||||
idiv ebx
|
||||
mov [ecx], eax
|
||||
mov ebx, R
|
||||
mov [ebx], edx
|
||||
pop ebx
|
||||
end;
|
||||
|
Reference in New Issue
Block a user