OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-maccod.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                   S Y S T E M . M A C H I N E _ C O D E                  --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                                                                          --
10 --          Copyright (C) 1992-2000 Free Software Foundation, Inc.          --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
21 -- MA 02111-1307, USA.                                                      --
22 --                                                                          --
23 -- As a special exception,  if other files  instantiate  generics from this --
24 -- unit, or you link  this unit with other files  to produce an executable, --
25 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
26 -- covered  by the  GNU  General  Public  License.  This exception does not --
27 -- however invalidate  any other reasons why  the executable file  might be --
28 -- covered by the  GNU Public License.                                      --
29 --                                                                          --
30 -- GNAT was originally developed  by the GNAT team at  New York University. --
31 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
32 --                                                                          --
33 ------------------------------------------------------------------------------
34
35 --  This package provides machine code support, both for instrinsic machine
36 --  operations, and also for machine code statements. See GNAT documentation
37 --  for full details.
38
39 package System.Machine_Code is
40 pragma Pure (Machine_Code);
41
42    type Asm_Input_Operand  is private;
43    type Asm_Output_Operand is private;
44    --  These types are never used directly, they are declared only so that
45    --  the calls to Asm are type correct according to Ada semantic rules.
46
47    No_Input_Operands  : constant Asm_Input_Operand;
48    No_Output_Operands : constant Asm_Output_Operand;
49
50    type Asm_Input_Operand_List  is
51      array (Integer range <>) of Asm_Input_Operand;
52
53    type Asm_Output_Operand_List is
54      array (Integer range <>) of Asm_Output_Operand;
55
56    type Asm_Insn is private;
57    --  This type is not used directly. It is declared only so that the
58    --  aggregates used in code statements are type correct by Ada rules.
59
60    procedure Asm (
61      Template : String;
62      Outputs  : Asm_Output_Operand_List;
63      Inputs   : Asm_Input_Operand_List;
64      Clobber  : String  := "";
65      Volatile : Boolean := False);
66
67    procedure Asm (
68      Template : String;
69      Outputs  : Asm_Output_Operand := No_Output_Operands;
70      Inputs   : Asm_Input_Operand_List;
71      Clobber  : String  := "";
72      Volatile : Boolean := False);
73
74    procedure Asm (
75      Template : String;
76      Outputs  : Asm_Output_Operand_List;
77      Inputs   : Asm_Input_Operand := No_Input_Operands;
78      Clobber  : String  := "";
79      Volatile : Boolean := False);
80
81    procedure Asm (
82      Template : String;
83      Outputs  : Asm_Output_Operand := No_Output_Operands;
84      Inputs   : Asm_Input_Operand  := No_Input_Operands;
85      Clobber  : String  := "";
86      Volatile : Boolean := False);
87
88    function Asm (
89      Template : String;
90      Outputs  : Asm_Output_Operand_List;
91      Inputs   : Asm_Input_Operand_List;
92      Clobber  : String  := "";
93      Volatile : Boolean := False)
94      return     Asm_Insn;
95
96    function Asm (
97      Template : String;
98      Outputs  : Asm_Output_Operand := No_Output_Operands;
99      Inputs   : Asm_Input_Operand_List;
100      Clobber  : String  := "";
101      Volatile : Boolean := False)
102      return     Asm_Insn;
103
104    function Asm (
105      Template : String;
106      Outputs  : Asm_Output_Operand_List;
107      Inputs   : Asm_Input_Operand := No_Input_Operands;
108      Clobber  : String  := "";
109      Volatile : Boolean := False)
110      return     Asm_Insn;
111
112    function Asm (
113      Template : String;
114      Outputs  : Asm_Output_Operand := No_Output_Operands;
115      Inputs   : Asm_Input_Operand  := No_Input_Operands;
116      Clobber  : String  := "";
117      Volatile : Boolean := False)
118      return     Asm_Insn;
119
120    pragma Import (Intrinsic, Asm);
121
122 private
123
124    type Asm_Input_Operand  is new Integer;
125    type Asm_Output_Operand is new Integer;
126    type Asm_Insn           is new Integer;
127    --  All three of these types are dummy types, to meet the requirements of
128    --  type consistenty. No values of these types are ever referenced.
129
130    No_Input_Operands  : constant Asm_Input_Operand  := 0;
131    No_Output_Operands : constant Asm_Output_Operand := 0;
132
133 end System.Machine_Code;