~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to compiler/sparc/itcpugas.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
    $Id: itcpugas.pas,v 1.2 2004/01/12 16:39:41 peter Exp $
3
 
    Copyright (c) 1998-2002 by Mazen NEIFER
4
 
 
5
 
    This unit contains the PowerPC GAS instruction tables
6
 
 
7
 
    This program is free software; you can redistribute it and/or modify
8
 
    it under the terms of the GNU General Public License as published by
9
 
    the Free Software Foundation; either version 2 of the License, or
10
 
    (at your option) any later version.
11
 
 
12
 
    This program is distributed in the hope that it will be useful,
13
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
    GNU General Public License for more details.
16
 
 
17
 
    You should have received a copy of the GNU General Public License
18
 
    along with this program; if not, write to the Free Software
19
 
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 
 
21
 
 ****************************************************************************
22
 
}
23
 
unit itcpugas;
24
 
 
25
 
{$i fpcdefs.inc}
26
 
 
27
 
interface
28
 
 
29
 
    uses
30
 
      cpubase,cgbase;
31
 
 
32
 
    const
33
 
      gas_op2str : array[tasmop] of string[14] = ({$INCLUDE strinst.inc});
34
 
 
35
 
    function gas_regnum_search(const s:string):Tregister;
36
 
    function gas_regname(r:Tregister):string;
37
 
 
38
 
 
39
 
implementation
40
 
 
41
 
    uses
42
 
      cutils,verbose;
43
 
 
44
 
    const
45
 
      gas_regname_table : array[tregisterindex] of string[7] = (
46
 
        {$i rspstd.inc}
47
 
      );
48
 
 
49
 
      gas_regname_index : array[tregisterindex] of tregisterindex = (
50
 
        {$i rspsri.inc}
51
 
      );
52
 
 
53
 
 
54
 
    function findreg_by_gasname(const s:string):tregisterindex;
55
 
      var
56
 
        i,p : tregisterindex;
57
 
      begin
58
 
        {Binary search.}
59
 
        p:=0;
60
 
        i:=regnumber_count_bsstart;
61
 
        repeat
62
 
          if (p+i<=high(tregisterindex)) and (gas_regname_table[gas_regname_index[p+i]]<=s) then
63
 
            p:=p+i;
64
 
          i:=i shr 1;
65
 
        until i=0;
66
 
        if gas_regname_table[gas_regname_index[p]]=s then
67
 
          findreg_by_gasname:=gas_regname_index[p]
68
 
        else
69
 
          findreg_by_gasname:=0;
70
 
      end;
71
 
 
72
 
 
73
 
    function gas_regnum_search(const s:string):Tregister;
74
 
      begin
75
 
        result:=regnumber_table[findreg_by_gasname(s)];
76
 
      end;
77
 
 
78
 
 
79
 
    function gas_regname(r:Tregister):string;
80
 
      var
81
 
        p : longint;
82
 
      begin
83
 
        { Double uses the same table as single }
84
 
        if getsubreg(r)=R_SUBFD then
85
 
          setsubreg(r,R_SUBFS);
86
 
        p:=findreg_by_number(r);
87
 
        if p<>0 then
88
 
          result:=gas_regname_table[p]
89
 
        else
90
 
          result:=generic_regname(r);
91
 
      end;
92
 
 
93
 
end.
94
 
{
95
 
  $Log: itcpugas.pas,v $
96
 
  Revision 1.2  2004/01/12 16:39:41  peter
97
 
    * sparc updates, mostly float related
98
 
 
99
 
  Revision 1.1  2003/12/08 13:03:06  mazen
100
 
  + support for native sparc assembler reader
101
 
 
102
 
  Revision 1.2  2003/11/15 19:00:10  florian
103
 
    * fixed ppc assembler reader
104
 
 
105
 
  Revision 1.1  2003/11/12 16:05:40  florian
106
 
    * assembler readers OOPed
107
 
    + typed currency constants
108
 
    + typed 128 bit float constants if the CPU supports it
109
 
 
110
 
  Revision 1.2  2003/10/01 20:34:49  peter
111
 
    * procinfo unit contains tprocinfo
112
 
    * cginfo renamed to cgbase
113
 
    * moved cgmessage to verbose
114
 
    * fixed ppc and sparc compiles
115
 
 
116
 
  Revision 1.1  2003/09/03 19:35:24  peter
117
 
    * powerpc compiles again
118
 
 
119
 
}