* force to use ATT or direct parsing

This commit is contained in:
peter 1998-05-31 14:15:47 +00:00
parent 128212755c
commit 12f6e38140
5 changed files with 464 additions and 654 deletions

View File

@ -448,6 +448,7 @@ begin
end;
{$ASMMODE DIRECT}
function strpas(p:pchar):string;
begin
asm
@ -483,6 +484,8 @@ begin
movsb
end ['ECX','EAX','ESI','EDI'];
end;
{$ASMMODE ATT}
function strlen(p:pchar):longint;assembler;
asm
@ -708,6 +711,7 @@ begin
end;
{$I386_ATT} {can be removed}
Function Random(L: LongInt): LongInt;assembler;
asm
@ -719,11 +723,16 @@ asm
movl %edx,%eax
end;
{$I386_DIRECT}
{$I386_DIRECT} {can be removed}
{$ASMMODE ATT}
{
$Log$
Revision 1.11 1998-05-30 14:30:21 peter
Revision 1.12 1998-05-31 14:15:47 peter
* force to use ATT or direct parsing
Revision 1.11 1998/05/30 14:30:21 peter
* force att reading
Revision 1.10 1998/05/25 10:40:49 peter
@ -740,118 +749,4 @@ end;
Revision 1.2 1998/04/08 07:53:31 michael
+ Changed Random() function. Moved from system to processor dependent files (from Pedro Gimeno)
Revision 1.1.1.1 1998/03/25 11:18:43 root
* Restored version
Revision 1.30 1998/03/20 05:11:17 carl
* bugfix of register usage list for strcmp and strconcat
Revision 1.29 1998/03/15 19:38:41 peter
* fixed a bug in Move()
Revision 1.28 1998/03/10 23:50:39 florian
* strcopy saves now the used registers except ESI and EDI, solves
a problem with the optimizer
Revision 1.27 1998/03/10 16:25:52 jonas
* removed reloading of eax with 8(ebp), in int_help_constructor, as eax is nowhere modified
Revision 1.25 1998/03/02 11:44:43 florian
* writing of large cardinals fixed
Revision 1.24 1998/03/02 04:14:02 carl
* page fault bug fix with CHECK_OBJECT
warning: Will only work with GAS as VMT pointer field is an
.lcomm and will be ZEROED by linker (might not be true for TASM)
Revision 1.23 1998/02/24 17:50:46 peter
* upto 100% (255's char is different ;) faster STRCMP
* faster StrPas from i386.inc also strings.pp
Revision 1.22 1998/02/22 22:01:26 carl
+ IOCHECK halts with the correct errorcode now
Revision 1.21 1998/02/11 16:55:14 michael
fixed cardinal printing. Large cardinals (>0fffffff) not yet working
Revision 1.20 1998/02/06 09:12:39 florian
* bug in CHECK_OBJECT fixed
Revision 1.19 1998/02/05 22:30:25 florian
+ CHECK_OBJECT to check for an valid VMT (before calling a virtual method)
Revision 1.18 1998/02/04 14:46:36 daniel
* Some small tweaks
Revision 1.17 1998/01/27 22:05:07 florian
* again small fixes to DOM (Delphi Object Model)
Revision 1.16 1998/01/26 11:59:01 michael
+ Added log at the end
revision 1.15
date: 1998/01/25 22:52:52; author: peter; state: Exp; lines: +140 -122
* Faster string functions by using aligning
----------------------------
revision 1.14
date: 1998/01/25 22:30:48; author: florian; state: Exp; lines: +14 -2
* DOM: some fixes to tobject and the con-/destructor help routines
----------------------------
revision 1.13
date: 1998/01/23 18:08:29; author: florian; state: Exp; lines: +10 -4
* more bugs in FCL object model removed
----------------------------
revision 1.12
date: 1998/01/23 15:54:47; author: florian; state: Exp; lines: +5 -5
+ small extensions to FCL object model
----------------------------
revision 1.11
date: 1998/01/20 00:14:24; author: peter; state: Exp; lines: +18 -5
* .type is linux only, go32v2 doesn't like it
----------------------------
revision 1.10
date: 1998/01/19 16:19:53; author: peter; state: Exp; lines: +7 -1
* Works now correct with shared libs, .globl always needs a .type
----------------------------
revision 1.9
date: 1998/01/19 10:21:35; author: michael; state: Exp; lines: +1 -6
* moved Fillchar t(..,char) to system.inc
----------------------------
revision 1.8
date: 1998/01/19 09:15:05; author: michael; state: Exp; lines: +40 -132
* Bugfixes in Move and FillChar
----------------------------
revision 1.7
date: 1998/01/16 23:10:52; author: florian; state: Exp; lines: +23 -1
+ some tobject stuff
----------------------------
revision 1.6
date: 1998/01/16 22:21:35; author: michael; state: Exp; lines: +601 -493
+ Installed pentium-optimized move (optional)
----------------------------
revision 1.5
date: 1998/01/12 03:39:17; author: carl; state: Exp; lines: +2 -2
* bugfix of RE_OVERFLOW, gives out now a Runerror(215)
----------------------------
revision 1.4
date: 1998/01/01 16:57:36; author: michael; state: Exp; lines: +1 -21
Moved DO_EXIT to system.inc. Now processor independent
----------------------------
revision 1.3
date: 1997/12/10 12:12:31; author: michael; state: Exp; lines: +2 -2
* changed dateifunc to FileFunc
----------------------------
revision 1.2
date: 1997/12/01 12:34:36; author: michael; state: Exp; lines: +13 -0
+ added copyright reference in header.
----------------------------
revision 1.1
date: 1997/11/27 08:33:48; author: michael; state: Exp;
Initial revision
----------------------------
revision 1.1.1.1
date: 1997/11/27 08:33:48; author: michael; state: Exp; lines: +0 -0
FPC RTL CVS start
=============================================================================
}

View File

@ -1,7 +1,9 @@
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1993,97 by the Free Pascal development team
Copyright (c) 1993-98 by the Free Pascal development team
Implementation of mathamatical Routines (only for real)
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
@ -12,7 +14,7 @@
**********************************************************************}
{ Implementation of mathamatical Routines (only for real) }
{$ASMMODE DIRECT}
function abs(d : real) : real;
@ -367,51 +369,11 @@
{$endif}
{$ASMMODE ATT}
{
$Log$
Revision 1.1 1998-03-25 11:18:42 root
Initial revision
Revision 1.2 1998-05-31 14:15:49 peter
* force to use ATT or direct parsing
Revision 1.9 1998/02/04 14:40:31 daniel
* Translated abs for fixed to assembler.
Revision 1.8 1998/01/27 12:44:48 peter
* removed comment level 2 warning
Revision 1.7 1998/01/26 11:59:04 michael
+ Added log at the end
Working file: rtl/i386/math.inc
description:
----------------------------
revision 1.6
date: 1998/01/20 15:12:27; author: peter; state: Exp; lines: +4 -3
* fixes bug 65
----------------------------
revision 1.5
date: 1997/12/01 12:34:37; author: michael; state: Exp; lines: +11 -4
+ added copyright reference in header.
----------------------------
revision 1.4
date: 1997/11/28 23:26:44; author: florian; state: Exp; lines: +34 -33
$ifdef fixed added
----------------------------
revision 1.3
date: 1997/11/28 19:46:11; author: pierre; state: Exp; lines: +360 -358
+ fixed math in define (does not compile yet)
----------------------------
revision 1.2
date: 1997/11/28 16:50:04; author: carl; state: Exp; lines: +358 -278
+ added fixes point routines.
----------------------------
revision 1.1
date: 1997/11/27 08:33:48; author: michael; state: Exp;
Initial revision
----------------------------
revision 1.1.1.1
date: 1997/11/27 08:33:48; author: michael; state: Exp; lines: +0 -0
FPC RTL CVS start
=============================================================================
}

View File

@ -52,6 +52,8 @@ unit mmx;
uses
cpu;
{$ASMMODE DIRECT}
{ returns true, if the processor supports the mmx instructions }
function mmx_support : boolean;
@ -64,7 +66,7 @@ unit mmx;
asm
movl $1,%eax
cpuid
movl %edx,-4(%ebp) // _edx is ebp-4
movl %edx,_edx
end;
mmx_support:=(_edx and $800000)<>0;
end
@ -84,7 +86,7 @@ unit mmx;
asm
movl $0x80000001,%eax
cpuid
movl %edx,-4(%ebp) // _edx is ebp-4
movl %edx,_edx
end;
amd_3d_support:=(_edx and $80000000)<>0;
end
@ -92,6 +94,7 @@ unit mmx;
{ a cpu with without cpuid instruction supports never mmx }
amd_3d_support:=false;
end;
procedure emms;assembler;
asm
@ -120,34 +123,8 @@ begin
end.
{
$Log$
Revision 1.1 1998-03-25 11:18:43 root
Initial revision
Revision 1.7 1998/03/24 09:32:57 peter
* fixed comments
Revision 1.6 1998/03/22 12:41:51 florian
* fix of amd_3d_support procedure
Revision 1.5 1998/03/20 23:27:48 florian
+ some AMD 3D support:
single type and detection of AMD 3D
Revision 1.4 1998/03/03 22:47:01 florian
* small problems fixed
Revision 1.3 1998/02/09 23:48:18 florian
+ exit handler added (executes emms)
+ is_mmx_cpu variable added
Revision 1.2 1998/02/05 22:30:48 florian
+ types for fixed mmx type
Revision 1.1 1998/02/04 23:00:30 florian
+ Initial revision
+ basic data types
+ emms procedure
+ mmx detection from unit cpu inserted
Revision 1.2 1998-05-31 14:15:50 peter
* force to use ATT or direct parsing
}

View File

@ -3,6 +3,8 @@
This file is part of the Free Pascal run time library.
Copyright (c) 1993,97 by the Free Pascal development team
Include file with set operations called by the compiler
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
@ -12,14 +14,12 @@
**********************************************************************}
{ include file with procedures used for set operations }
{ these procedures should never be called directly }
{ the compiler calls them }
{ add the element b to the set pointed by p }
procedure do_set(p : pointer;b : byte);
[public,alias: 'SET_SET_BYTE'];
{$ASMMODE ATT}
procedure do_set(p : pointer;b : byte); [public,alias: 'SET_SET_BYTE'];
{
add the element b to the set pointed by p
}
begin
asm
pushl %eax
@ -38,9 +38,12 @@
end;
end;
{ bad implementation, but it's very seldom used }
procedure do_set(p : pointer;l,h : byte);[public,alias: 'SET_SET_RANGE'];
{$ASMMODE DIRECT}
procedure do_set(p : pointer;l,h : byte);[public,alias: 'SET_SET_RANGE'];
{
bad implementation, but it's very seldom used
}
begin
asm
pushl %eax
@ -58,13 +61,13 @@
popl %eax
end;
end;
{$ASMMODE ATT}
{ tests if the element b is in the set p }
{ the carryflag is set if it present }
procedure do_in(p : pointer;b : byte);
[public,alias: 'SET_IN_BYTE'];
procedure do_in(p : pointer;b : byte);[public,alias: 'SET_IN_BYTE'];
{
tests if the element b is in the set p the carryflag is set if it present
}
begin
asm
pushl %eax
@ -82,10 +85,13 @@
ret $6
end;
end;
{ adds set1 and set2 into set dest }
procedure add_sets(set1,set2,dest : pointer);[public,alias: 'SET_ADD_SETS'];
{
adds set1 and set2 into set dest
}
begin
asm
movl 8(%ebp),%esi
@ -107,7 +113,6 @@
{ result put in dest }
procedure mul_sets(set1,set2,dest : pointer);[public,alias: 'SET_MUL_SETS'];
begin
asm
movl 8(%ebp),%esi
@ -124,11 +129,11 @@
end;
end;
{ computes the diff from set1 to set2 }
{ result in dest }
procedure sub_sets(set1,set2,dest : pointer);[public,alias: 'SET_SUB_SETS'];
{
computes the diff from set1 to set2 result in dest
}
begin
asm
movl 8(%ebp),%esi
@ -147,11 +152,11 @@
end;
end;
{ computes the symetric diff from set1 to set2 }
{ result in dest }
procedure sym_sub_sets(set1,set2,dest : pointer);[public,alias: 'SET_SYMDIF_SETS'];
{
computes the symetric diff from set1 to set2 result in dest
}
begin
asm
movl 8(%ebp),%esi
@ -169,10 +174,10 @@
end;
end;
{ compares set1 and set2 }
{ zeroflag is set if they are equal }
procedure comp_sets(set1,set2 : pointer);[public,alias: 'SET_COMP_SETS'];
{
compares set1 and set2 zeroflag is set if they are equal
}
begin
asm
movl 8(%ebp),%esi
@ -186,19 +191,21 @@
addl $4,%edi
decl %ecx
jnz .LMCOMPSETS1
// we are here only if the two sets are equal
// we have zero flag set, and that what is expected
{ we are here only if the two sets are equal
we have zero flag set, and that what is expected }
cmpl %eax,%eax
.LMCOMPSETEND:
end;
end;
{ sets the element b in set p }
{ works for sets larger than 256 elements }
{ not yet use by the compiler so }
{$ifdef ver_above without the number }
procedure do_set(p : pointer;b : word);[public,alias: 'SET_SET_WORD'];
{$ifdef LARGESETS}
procedure do_set(p : pointer;b : word);[public,alias: 'SET_SET_WORD'];
{
sets the element b in set p works for sets larger than 256 elements
not yet use by the compiler so
}
begin
asm
pushl %eax
@ -214,12 +221,12 @@
end;
end;
{ tests if the element b is in the set p }
{ the carryflag is set if it present }
{ works for sets larger than 256 elements }
procedure do_in(p : pointer;b : word);[public,alias: 'SET_IN_WORD'];
{
tests if the element b is in the set p the carryflag is set if it present
works for sets larger than 256 elements
}
begin
asm
pushl %eax
@ -235,11 +242,11 @@
end;
end;
{ adds set1 and set2 into set dest }
{ size is the number of bytes in the set }
procedure add_sets(set1,set2,dest : pointer;size : longint);
[public,alias: 'SET_ADD_SETS_SIZE'];
procedure add_sets(set1,set2,dest : pointer;size : longint);[public,alias: 'SET_ADD_SETS_SIZE'];
{
adds set1 and set2 into set dest size is the number of bytes in the set
}
begin
asm
@ -257,13 +264,12 @@
end;
end;
{ multiplies (i.E. takes common elements of) set1 and set2 }
{ result put in dest }
{ size is the number of bytes in the set }
procedure mul_sets(set1,set2,dest : pointer;size : longint);
[public,alias: 'SET_MUL_SETS_SIZE'];
procedure mul_sets(set1,set2,dest : pointer;size : longint);[public,alias: 'SET_MUL_SETS_SIZE'];
{
multiplies (i.E. takes common elements of) set1 and set2 result put in
dest size is the number of bytes in the set
}
begin
asm
movl 8(%ebp),%esi
@ -282,7 +288,6 @@
procedure sub_sets(set1,set2,dest : pointer;size : longint);[public,alias: 'SET_SUB_SETS_SIZE'];
begin
asm
movl 8(%ebp),%esi
@ -301,11 +306,11 @@
end;
end;
{ computes the symetric diff from set1 to set2 }
{ result in dest }
procedure sym_sub_sets(set1,set2,dest : pointer;size : longint);[public,alias: 'SET_SYMDIF_SETS_SIZE'];
{
computes the symetric diff from set1 to set2 result in dest
}
begin
asm
movl 8(%ebp),%esi
@ -325,7 +330,6 @@
procedure comp_sets(set1,set2 : pointer;size : longint);[public,alias: 'SET_COMP_SETS_SIZE'];
begin
asm
movl 8(%ebp),%esi
@ -339,51 +343,18 @@
addl $4,%edi
decl %ecx
jnz .LMCOMPSETSIZES1
// we are here only if the two sets are equal
// we have zero flag set, and that what is expected
{ we are here only if the two sets are equal
we have zero flag set, and that what is expected }
cmpl %eax,%eax
.LMCOMPSETSIZEEND:
end;
end;
{$endif ver_above without the number }
{$endif LARGESET}
{
$Log$
Revision 1.1 1998-03-25 11:18:42 root
Initial revision
Revision 1.2 1998-05-31 14:15:51 peter
* force to use ATT or direct parsing
Revision 1.7 1998/03/03 12:07:11 florian
* undid the change of some procedures to plain assembler procedures
Revision 1.6 1998/03/02 23:10:33 florian
* SET_* are now assembler procedures
Revision 1.5 1998/02/11 18:37:01 florian
* stupid typing mistake fixed (I though it compiles, but the assembler
wrote an error message)
Revision 1.4 1998/02/11 16:17:45 florian
+ helper routine for "dynamic" set constructors with ranges added
Revision 1.3 1998/01/26 11:59:09 michael
+ Added log at the end
Working file: rtl/i386/set.inc
description:
----------------------------
revision 1.2
date: 1997/12/01 12:34:37; author: michael; state: Exp; lines: +11 -4
+ added copyright reference in header.
----------------------------
revision 1.1
date: 1997/11/27 08:33:48; author: michael; state: Exp;
Initial revision
----------------------------
revision 1.1.1.1
date: 1997/11/27 08:33:48; author: michael; state: Exp; lines: +0 -0
FPC RTL CVS start
=============================================================================
}

View File

@ -233,6 +233,7 @@ implementation
end ['EDI','ESI','EBX','EAX','ECX'];
end;
{$ASMMODE DIRECT}
function strpas(p : pchar) : string;
begin
asm
@ -268,6 +269,7 @@ implementation
movsb
end ['ECX','EAX','ESI','EDI'];
end;
{$ASMMODE ATT}
function strcat(dest,source : pchar) : pchar;
@ -587,7 +589,10 @@ end.
{
$Log$
Revision 1.3 1998-05-30 14:30:22 peter
Revision 1.4 1998-05-31 14:15:52 peter
* force to use ATT or direct parsing
Revision 1.3 1998/05/30 14:30:22 peter
* force att reading
Revision 1.2 1998/05/23 01:14:06 peter