OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [sys/] [a29khif/] [sys/] [romdcl.h] - Blame information for rev 207

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
; @(#)romdcl.h  1.4 90/10/14 20:56:12, Copyright 1988, 1989, 1990 AMD 
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
; Copyright 1990 Advanced Micro Devices, Inc.
4
;
5
; This software is the property of Advanced Micro Devices, Inc  (AMD)  which
6
; specifically  grants the user the right to modify, use and distribute this
7
; software provided this notice is not removed or altered.  All other rights
8
; are reserved by AMD.
9
;
10
; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
11
; SOFTWARE.  IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
12
; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
13
; USE OF THIS SOFTWARE.
14
;
15
; So that all may benefit from your experience, please report  any  problems
16
; or  suggestions about this software to the 29K Technical Support Center at
17
; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131  in  the  UK,  or
18
; 0031-11-1129 in Japan, toll free.  The direct dial number is 512-462-4118.
19
;
20
; Advanced Micro Devices, Inc.
21
; 29K Support Products
22
; Mail Stop 573
23
; 5900 E. Ben White Blvd.
24
; Austin, TX 78741
25
; 800-292-9263
26
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27
 
28
        .sbttl  "Register, Constant and Macro Declarations - v1.4"
29
 
30
; Copyright 1988, Advanced Micro Devices
31
; Written by Gibbons and Associates, Inc.
32
 
33
;v1.4   JG      correct FUNCTION macro - fault in register padding to even
34
 
35
;-----------------------------------------------------------------------
36
;Global registers
37
;-----------------------------------------------------------------------
38
        .reg    rsp,            gr1     ;local reg. var. stack pointer
39
 
40
        .equ    SYS_TEMP,       64      ;system temp registers
41
 
42
        .reg    st0,            gr64
43
        .reg    st1,            gr65
44
        .reg    st2,            gr66
45
        .reg    st3,            gr67
46
        .reg    st4,            gr68
47
        .reg    st5,            gr69
48
        .reg    st6,            gr70
49
        .reg    st7,            gr71
50
        .reg    st8,            gr72
51
        .reg    st9,            gr73
52
        .reg    st10,           gr74
53
        .reg    st11,           gr75
54
        .reg    st12,           gr76
55
        .reg    st13,           gr77
56
        .reg    st14,           gr78
57
        .reg    st15,           gr79
58
 
59
        .equ    SYS_STAT,       80      ;system static registers
60
 
61
        .reg    ss0,            gr80
62
        .reg    ss1,            gr81
63
        .reg    ss2,            gr82
64
        .reg    ss3,            gr83
65
        .reg    ss4,            gr84
66
        .reg    ss5,            gr85
67
        .reg    ss6,            gr86
68
        .reg    ss7,            gr87
69
        .reg    ss8,            gr88
70
        .reg    ss9,            gr89
71
        .reg    ss10,           gr90
72
        .reg    ss11,           gr91
73
        .reg    ss12,           gr92
74
        .reg    ss13,           gr93
75
        .reg    ss14,           gr94
76
        .reg    ss15,           gr95
77
 
78
        .equ    RET_VAL,        96      ;return registers
79
 
80
        .reg    v0,             gr96
81
        .reg    v1,             gr97
82
        .reg    v2,             gr98
83
        .reg    v3,             gr99
84
        .reg    v4,             gr100
85
        .reg    v5,             gr101
86
        .reg    v6,             gr102
87
        .reg    v7,             gr103
88
        .reg    v8,             gr104
89
        .reg    v9,             gr105
90
        .reg    v10,            gr106
91
        .reg    v11,            gr107
92
        .reg    v12,            gr108
93
        .reg    v13,            gr109
94
        .reg    v14,            gr110
95
        .reg    v15,            gr111
96
 
97
        .equ    TEMP_REG,       96      ;temp registers
98
 
99
        .reg    t0,             gr96
100
        .reg    t1,             gr97
101
        .reg    t2,             gr98
102
        .reg    t3,             gr99
103
        .reg    t4,             gr100
104
        .reg    t5,             gr101
105
        .reg    t6,             gr102
106
        .reg    t7,             gr103
107
        .reg    t8,             gr104
108
        .reg    t9,             gr105
109
        .reg    t10,            gr106
110
        .reg    t11,            gr107
111
        .reg    t12,            gr108
112
        .reg    t13,            gr109
113
        .reg    t14,            gr110
114
        .reg    t15,            gr111
115
 
116
        .equ    RES_REG,        112     ;reserved (for user)
117
 
118
        .reg    r0,             gr112
119
        .reg    r1,             gr113
120
        .reg    r2,             gr114
121
        .reg    r3,             gr115
122
 
123
        .equ    TEMP_EXT,       116     ;temp extension (and shared)
124
 
125
        .reg    x0,             gr116
126
        .reg    x1,             gr117
127
        .reg    x2,             gr118
128
        .reg    x3,             gr119
129
        .reg    x4,             gr120
130
        .reg    x5,             gr121
131
        .reg    x6,             gr122
132
        .reg    x7,             gr123
133
        .reg    x8,             gr124
134
 
135
;-----------------------------------------------------------------------
136
;Global registers with special calling convention uses
137
;-----------------------------------------------------------------------
138
 
139
        .reg    tav,            gr121   ;trap handler argument (also x6)
140
        .reg    tpc,            gr122   ;trap handler return (also x7)
141
        .reg    lsrp,           gr123   ;large return pointer (also x8)
142
        .reg    slp,            gr124   ;static link pointer (also x9)
143
        .reg    msp,            gr125   ;memory stack pointer
144
        .reg    rab,            gr126   ;register alloc bound
145
        .reg    rfb,            gr127   ;register frame bound
146
 
147
;-----------------------------------------------------------------------
148
;Local compiler registers - output parameters, etc.
149
;  (only valid if frame has been established)
150
;-----------------------------------------------------------------------
151
 
152
        .reg    p15,            lr17    ;parameter registers
153
        .reg    p14,            lr16
154
        .reg    p13,            lr15
155
        .reg    p12,            lr14
156
        .reg    p11,            lr13
157
        .reg    p10,            lr12
158
        .reg    p9,             lr11
159
        .reg    p8,             lr10
160
        .reg    p7,             lr9
161
        .reg    p6,             lr8
162
        .reg    p5,             lr7
163
        .reg    p4,             lr6
164
        .reg    p3,             lr5
165
        .reg    p2,             lr4
166
        .reg    p1,             lr3
167
        .reg    p0,             lr2
168
 
169
 
170
;-----------------------------------------------------------------------
171
;TLB register count
172
;-----------------------------------------------------------------------
173
 
174
        .equ    TLB_CNT,        128
175
 
176
        .eject
177
 
178
;-----------------------------------------------------------------------
179
;constants for general use
180
;-----------------------------------------------------------------------
181
        .equ    WRD_SIZ,        4               ;word size
182
        .equ    TRUE,           0x80000000      ;logical true -- bit 31
183
        .equ    FALSE,          0x00000000      ;logical false -- 0
184
        .equ    CHKPAT_a5,      0xa5a5a5a5      ;check pattern
185
 
186
;-----------------------------------------------------------------------
187
;constants for data access control
188
;-----------------------------------------------------------------------
189
        .equ    CE,             0b1             ;coprocessor enable
190
        .equ    CD,             0b0             ;coprocessor disable
191
 
192
        .equ    AS,             0b1000000        ;set for I/O
193
        .equ    PA,             0b0100000        ;set for physical ad
194
        .equ    SB,             0b0010000        ;set for set BP
195
        .equ    UA,             0b0001000        ;set for user access
196
 
197
        .equ    ROM_OPT,        0b100            ;OPT values for acc
198
        .equ    DATA_OPT,       0b000
199
        .equ    INST_OPT,       0b000
200
 
201
        .equ    ROM_CTL,        (PA + ROM_OPT)  ;control field
202
        .equ    DATA_CTL,       (PA + DATA_OPT)
203
        .equ    INST_CTL,       (PA + INST_OPT)
204
        .equ    IO_CTL,         (AS + PA + DATA_OPT)
205
 
206
 
207
        .eject
208
 
209
;-----------------------------------------------------------------------
210
;defined vectors
211
;-----------------------------------------------------------------------
212
 
213
        .equ    V_IllegalOp,            0
214
        .equ    V_Unaligned,            1
215
        .equ    V_OutOfRange,           2
216
        .equ    V_NoCoProc,             3
217
        .equ    V_CoProcExcept,         4
218
        .equ    V_ProtViol,             5
219
        .equ    V_InstAccExcept,        6
220
        .equ    V_DataAccExcept,        7
221
        .equ    V_UserInstTLB,          8
222
        .equ    V_UserDataTLB,          9
223
        .equ    V_SupInstTLB,           10
224
        .equ    V_SupDataTLB,           11
225
        .equ    V_InstTLBProt,          12
226
        .equ    V_DataTLBProt,          13
227
        .equ    V_Timer,                14
228
        .equ    V_Trace,                15
229
        .equ    V_INTR0,                16
230
        .equ    V_INTR1,                17
231
        .equ    V_INTR2,                18
232
        .equ    V_INTR3,                19
233
        .equ    V_TRAP0,                20
234
        .equ    V_TRAP1,                21
235
 
236
        ;                               22 - 31 reserved
237
 
238
        .equ    V_MULTIPLY,             32
239
        .equ    V_DIVIDE,               33
240
        .equ    V_MULTIPLU,             34
241
        .equ    V_DIVIDU,               35
242
        .equ    V_CONVERT,              36
243
 
244
        ;                               37 - 41 reserved
245
 
246
        .equ    V_FEQ,                  42
247
        .equ    V_DEQ,                  43
248
        .equ    V_FGT,                  44
249
        .equ    V_DGT,                  45
250
        .equ    V_FGE,                  46
251
        .equ    V_DGE,                  47
252
        .equ    V_FADD,                 48
253
        .equ    V_DADD,                 49
254
        .equ    V_FSUB,                 50
255
        .equ    V_DSUB,                 51
256
        .equ    V_FMUL,                 52
257
        .equ    V_DMUL,                 53
258
        .equ    V_FDIV,                 54
259
        .equ    V_DDIV,                 55
260
 
261
        ;                               56 - 63 reserved
262
 
263
        .equ    V_SPILL,                64
264
        .equ    V_FILL,                 65
265
        .equ    V_BSDCALL,              66
266
        .equ    V_SYSVCALL,             67
267
        .equ    V_BRKPNT,               68
268
        .equ    V_EPI_OS,               69
269
 
270
        .eject
271
 
272
 .macro R_LEFT,REGVAR
273
 
274
 ;Rotate left
275
 ;
276
 ; Parameters:  REGVAR  register to rotate
277
 
278
        add     REGVAR, REGVAR, REGVAR  ;shift left by 1 bit, C = MSB
279
        addc    REGVAR, REGVAR, 0        ;add C to LSB
280
 
281
 .endm
282
;----------------------------------------------------------------------
283
 
284
 
285
 .macro FUNCTION,NAME,INCNT,LOCCNT,OUTCNT
286
 
287
 ;Introduces a non-leaf routine.
288
 ;
289
 ;This macro defines the standard tag word before the function,
290
 ;then establishes the statement label with the function's name
291
 ;and finally allocates a register stack frame.  It may not be used
292
 ;if a memory stack frame is required.
293
 ;
294
 ;Note also that the size of the register stack frame is limited.
295
 ;Neither this nor the lack of a memory frame is considered to be
296
 ;a severe restriction in an assembly language environment.  The
297
 ;assembler will report errors if the requested frame is too large
298
 ;for this macro.
299
 ;
300
 ;It may be good practice to allocate an even number of both output
301
 ;registers and local registers.  This will help in maintaining
302
 ;double word alignment within these groups.  The macro will assure
303
 ;double word alignment of the stack frame as a whole as required
304
 ;for correct linkage.
305
 ;
306
 ; Paramters:   NAME    the function name
307
 ;              INCNT   input parameter count
308
 ;              LOCCNT  local register count
309
 ;              OUTCNT  output parameter count
310
 
311
        .set    ALLOC_CNT, ((2 + OUTCNT + LOCCNT) << 2)
312
        .set    PAD_CNT, (ALLOC_CNT & 4)
313
        .set    ALLOC_CNT, (ALLOC_CNT + PAD_CNT)
314
        .set    REG_PAD, (PAD_CNT >> 2)
315
   .if  (INCNT)
316
        .set    IN_PRM, (4 + OUTCNT + REG_PAD + LOCCNT + 0x80)
317
   .endif
318
   .if  (LOCCNT)
319
        .set    LOC_REG, (2 + OUTCNT + REG_PAD + 0x80)
320
   .endif
321
   .if  (OUTCNT)
322
        .set    OUT_PRM, (2 + 0x80)
323
   .endif
324
 
325
        .word   ((2 + OUTCNT + LOCCNT) << 16)
326
NAME:
327
        sub     rsp, rsp, ALLOC_CNT
328
        asgeu   V_SPILL, rsp, rab
329
        add     lr1, rsp, ((4 + OUTCNT + LOCCNT + REG_PAD + INCNT) << 2)
330
 
331
 .endm
332
;----------------------------------------------------------------------
333
 
334
 
335
 .macro LEAF,NAME,INCNT
336
 
337
 ;Introduces a leaf routine
338
 ;
339
 ;This macro defines the standard tag word before the function,
340
 ;then establishes the statement label with the function's name.
341
 ;
342
 ; Paramters:   NAME    the function name
343
 ;              INCNT   input parameter count
344
 
345
   .if  (INCNT)
346
        .set    IN_PRM, (2 + 0x80)
347
   .endif
348
        .set    ALLOC_CNT, 0
349
 
350
        .word   0
351
NAME:
352
 
353
 .endm
354
;----------------------------------------------------------------------
355
 
356
 
357
 .macro EPILOGUE
358
 
359
 ;De-allocates register stack frame (only and only if necessary).
360
 
361
   .if  (ALLOC_CNT)
362
 
363
        add     rsp, rsp, ALLOC_CNT
364
        nop
365
        jmpi    lr0
366
        asleu   V_FILL, lr1, rfb
367
 
368
   .else
369
 
370
        jmpi    lr0
371
        nop
372
 
373
   .endif
374
 
375
        .set    IN_PRM, (1024)          ;illegal, to cause err on ref
376
        .set    LOC_REG, (1024)         ;illegal, to cause err on ref
377
        .set    OUT_PRM, (1024)         ;illegal, to cause err on ref
378
        .set    ALLOC_CNT, (1024)       ;illegal, to cause err on ref
379
 
380
 .endm
381
;----------------------------------------------------------------------
382
 
383
 
384
;Initial values for macro set variables to guard against misuse
385
 
386
        .set    IN_PRM, (1024)          ;illegal, to cause err on ref
387
        .set    LOC_REG, (1024)         ;illegal, to cause err on ref
388
        .set    OUT_PRM, (1024)         ;illegal, to cause err on ref
389
        .set    ALLOC_CNT, (1024)       ;illegal, to cause err on ref
390
 
391
;......................................................................
392
; end of romdcl.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.