merge GHC HEAD
[ghc-hetmet.git] / includes / stg / MachRegs.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 1998-2009
4  *
5  * Registers used in STG code.  Might or might not correspond to
6  * actual machine registers.
7  *
8  * Do not #include this file directly: #include "Rts.h" instead.
9  *
10  * To understand the structure of the RTS headers, see the wiki:
11  *   http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
12  *
13  * ---------------------------------------------------------------------------*/
14
15 #ifndef MACHREGS_H
16 #define MACHREGS_H
17
18 /* This file is #included into Haskell code in the compiler: #defines
19  * only in here please.
20  */
21
22 /* 
23  * Defining NO_REGS causes no global registers to be used.  NO_REGS is
24  * typically defined by GHC, via a command-line option passed to gcc,
25  * when the -funregisterised flag is given.
26  *
27  * NB. When NO_REGS is on, calling & return conventions may be
28  * different.  For example, all function arguments will be passed on
29  * the stack, and components of an unboxed tuple will be returned on
30  * the stack rather than in registers.
31  */
32 #ifndef NO_REGS
33
34 /* NOTE: when testing the platform in this file we must test either
35  * *_HOST_ARCH and *_TARGET_ARCH, depending on whether COMPILING_GHC
36  * is set.  This is because when we're compiling the RTS and HC code,
37  * the platform we're running on is the HOST, but when compiling GHC
38  * we want to know about the register mapping on the TARGET platform.
39  */
40 #ifdef COMPILING_GHC
41 #define alpha_REGS    alpha_TARGET_ARCH
42 #define hppa1_1_REGS  hppa1_1_TARGET_ARCH
43 #define i386_REGS     i386_TARGET_ARCH
44 #define x86_64_REGS   x86_64_TARGET_ARCH
45 #define m68k_REGS     m68k_TARGET_ARCH
46 #define mips_REGS     (mipsel_TARGET_ARCH || mipseb_TARGET_ARCH)
47 #define powerpc_REGS  (powerpc_TARGET_ARCH || powerpc64_TARGET_ARCH || rs6000_TARGET_ARCH)
48 #define ia64_REGS     ia64_TARGET_ARCH
49 #define sparc_REGS    sparc_TARGET_ARCH
50 #define darwin_REGS   darwin_TARGET_OS
51 #else
52 #define alpha_REGS    alpha_HOST_ARCH
53 #define hppa1_1_REGS  hppa1_1_HOST_ARCH
54 #define i386_REGS     i386_HOST_ARCH
55 #define x86_64_REGS   x86_64_HOST_ARCH
56 #define m68k_REGS     m68k_HOST_ARCH
57 #define mips_REGS     (mipsel_HOST_ARCH || mipseb_HOST_ARCH)
58 #define powerpc_REGS  (powerpc_HOST_ARCH || powerpc64_HOST_ARCH || rs6000_HOST_ARCH)
59 #define ia64_REGS     ia64_HOST_ARCH
60 #define sparc_REGS    sparc_HOST_ARCH
61 #define darwin_REGS   darwin_HOST_OS
62 #endif
63
64 /* ----------------------------------------------------------------------------
65    Caller saves and callee-saves regs.
66    
67    Caller-saves regs have to be saved around C-calls made from STG
68    land, so this file defines CALLER_SAVES_<reg> for each <reg> that
69    is designated caller-saves in that machine's C calling convention.
70
71    As it stands, the only registers that are ever marked caller saves
72    are the RX, FX, DX and USER registers; as a result, if you
73    decide to caller save a system register (e.g. SP, HP, etc), note that
74    this code path is completely untested! -- EZY
75    -------------------------------------------------------------------------- */
76
77 /* -----------------------------------------------------------------------------
78    The DEC Alpha register mapping
79
80    Alpha registers
81    \tr{$9}--\tr{$14} are our ``prize'' callee-save registers.  
82    \tr{$15} is the frame pointer, and \tr{$16}--\tr{$21} are argument
83    registers.  (These are off-limits.)  We can steal some of the \tr{$22}-and-up 
84    caller-save registers provided we do the appropriate save/restore stuff.
85    
86    \tr{$f2}--\tr{$f9} are some callee-save floating-point registers.
87    
88    We cannot use \tr{$23} (aka t9), \tr{$24} (aka t10), \tr{$25} (aka
89    t11), \tr{$27} (aka pv), or \tr{$28} (aka at), because they are
90    occasionally required by the assembler to handle non-primitive
91    instructions (e.g. ldb, remq).  Sigh!
92    
93    Cheat sheet for GDB:
94    
95    GDB  here    Main map
96    ===  ====    ========
97    s5   $14     R1
98    t1   $2      R2
99    t2   $3      R3
100    t3   $4      R4
101    t4   $5      R5
102    t5   $6      R6
103    t6   $7      R7
104    t7   $8      R8
105    s0   $9      Sp
106    s2   $11     SpLim
107    s3   $12     Hp   
108    t8   $22     NCG_reserved
109    t12  $27     NCG_reserved
110    -------------------------------------------------------------------------- */
111
112 #if alpha_REGS
113 # define REG(x) __asm__("$" #x)
114
115 #  define CALLER_SAVES_R2
116 #  define CALLER_SAVES_R3
117 #  define CALLER_SAVES_R4
118 #  define CALLER_SAVES_R5
119 #  define CALLER_SAVES_R6
120 #  define CALLER_SAVES_R7
121 #  define CALLER_SAVES_R8
122   
123 #  define CALLER_SAVES_USER
124   
125 #  define REG_R1        14
126 #  define REG_R2        2
127 #  define REG_R3        3
128 #  define REG_R4        4
129 #  define REG_R5        5
130 #  define REG_R6        6
131 #  define REG_R7        7
132 #  define REG_R8        8
133   
134 #  define REG_F1        f2
135 #  define REG_F2        f3
136 #  define REG_F3        f4
137 #  define REG_F4        f5
138   
139 #  define REG_D1        f6
140 #  define REG_D2        f7
141   
142 #  define REG_Sp        9
143 #  define REG_SpLim     11
144
145 #  define REG_Hp        12
146   
147 #  define NCG_Reserved_I1 22
148 #  define NCG_Reserved_I2 27
149 #  define NCG_Reserved_F1 f29
150 #  define NCG_Reserved_F2 f30
151
152 #endif /* alpha_REGS */
153
154 /* -----------------------------------------------------------------------------
155    The HP-PA register mapping
156
157    We cater for HP-PA 1.1.
158    
159    \tr{%r0}--\tr{%r1} are special.
160    \tr{%r2} is the return pointer.
161    \tr{%r3} is the frame pointer.
162    \tr{%r4}--\tr{%r18} are callee-save registers.
163    \tr{%r19} is a linkage table register for HPUX 8.0 shared libraries.
164    \tr{%r20}--\tr{%r22} are caller-save registers.
165    \tr{%r23}--\tr{%r26} are parameter registers.
166    \tr{%r27} is a global data pointer.
167    \tr{%r28}--\tr{%r29} are temporaries.
168    \tr{%r30} is the stack pointer.
169    \tr{%r31} is a temporary.
170    
171    \tr{%fr12}--\tr{%fr15} are some callee-save floating-point registers.
172    \tr{%fr8}--\tr{%fr11} are some available caller-save fl-pt registers.
173    -------------------------------------------------------------------------- */
174
175 #if hppa1_1_REGS
176
177 #define REG(x) __asm__("%" #x)
178
179 #define REG_R1          r11
180 #define REG_R2          r12
181 #define REG_R3          r13
182 #define REG_R4          r14
183 #define REG_R5          r15
184 #define REG_R6          r16
185 #define REG_R7          r17
186 #define REG_R8          r18
187
188 #define REG_F1          fr12
189 #define REG_F2          fr12R
190 #define REG_F3          fr13
191 #define REG_F4          fr13R
192
193 #define REG_D1          fr20    /* L & R */
194 #define REG_D2          fr21    /* L & R */
195
196 #define REG_Sp          r4
197 #define REG_SpLim       r6
198
199 #define REG_Hp          r7
200
201 #define NCG_Reserved_I1 r28
202 #define NCG_Reserved_I2 r29
203 #define NCG_Reserved_F1 fr8
204 #define NCG_Reserved_F2 fr8R
205 #define NCG_Reserved_D1 fr10
206 #define NCG_Reserved_D2 fr11
207
208 #endif /* hppa */
209
210 /* -----------------------------------------------------------------------------
211    The x86 register mapping
212
213    Ok, we've only got 6 general purpose registers, a frame pointer and a
214    stack pointer.  \tr{%eax} and \tr{%edx} are return values from C functions,
215    hence they get trashed across ccalls and are caller saves. \tr{%ebx},
216    \tr{%esi}, \tr{%edi}, \tr{%ebp} are all callee-saves.
217
218    Reg     STG-Reg
219    ---------------
220    ebx     Base
221    ebp     Sp
222    esi     R1
223    edi     Hp
224
225    Leaving SpLim out of the picture.
226    -------------------------------------------------------------------------- */
227
228
229 #if i386_REGS
230
231 #define REG(x) __asm__("%" #x)
232
233 #ifndef not_doing_dynamic_linking
234 #define REG_Base    ebx
235 #endif
236 #define REG_Sp      ebp
237
238 #ifndef STOLEN_X86_REGS
239 #define STOLEN_X86_REGS 4
240 #endif
241
242 #if STOLEN_X86_REGS >= 3
243 # define REG_R1     esi
244 #endif
245
246 #if STOLEN_X86_REGS >= 4
247 # define REG_Hp     edi
248 #endif
249
250 #define MAX_REAL_VANILLA_REG 1  /* always, since it defines the entry conv */
251 #define MAX_REAL_FLOAT_REG   0
252 #define MAX_REAL_DOUBLE_REG  0
253 #define MAX_REAL_LONG_REG    0
254
255 #endif /* iX86 */
256
257 /* -----------------------------------------------------------------------------
258   The x86-64 register mapping
259
260   %rax          caller-saves, don't steal this one
261   %rbx          YES
262   %rcx          arg reg, caller-saves
263   %rdx          arg reg, caller-saves
264   %rsi          arg reg, caller-saves
265   %rdi          arg reg, caller-saves
266   %rbp          YES (our *prime* register)
267   %rsp          (unavailable - stack pointer)
268   %r8           arg reg, caller-saves
269   %r9           arg reg, caller-saves
270   %r10          caller-saves
271   %r11          caller-saves
272   %r12          YES
273   %r13          YES
274   %r14          YES
275   %r15          YES
276
277   %xmm0-7       arg regs, caller-saves
278   %xmm8-15      caller-saves
279
280   Use the caller-saves regs for Rn, because we don't always have to
281   save those (as opposed to Sp/Hp/SpLim etc. which always have to be
282   saved).
283
284   --------------------------------------------------------------------------- */
285
286 #if x86_64_REGS
287
288 #define REG(x) __asm__("%" #x)
289
290 #define REG_Base  r13
291 #define REG_Sp    rbp
292 #define REG_Hp    r12
293 #define REG_R1    rbx
294 #define REG_R2    r14
295 #define REG_R3    rsi
296 #define REG_R4    rdi
297 #define REG_R5    r8
298 #define REG_R6    r9
299 #define REG_SpLim r15
300
301 #define REG_F1    xmm1
302 #define REG_F2    xmm2
303 #define REG_F3    xmm3
304 #define REG_F4    xmm4
305
306 #define REG_D1    xmm5
307 #define REG_D2    xmm6
308
309 #define CALLER_SAVES_R3
310 #define CALLER_SAVES_R4
311 #define CALLER_SAVES_R5
312 #define CALLER_SAVES_R6
313
314 #define CALLER_SAVES_F1
315 #define CALLER_SAVES_F2
316 #define CALLER_SAVES_F3
317 #define CALLER_SAVES_F4
318
319 #define CALLER_SAVES_D1
320 #define CALLER_SAVES_D2
321
322 #define MAX_REAL_VANILLA_REG 6
323 #define MAX_REAL_FLOAT_REG   4
324 #define MAX_REAL_DOUBLE_REG  2
325 #define MAX_REAL_LONG_REG    0
326
327 #endif /* x86_64 */
328
329 /* -----------------------------------------------------------------------------
330    The Motorola 680x0 register mapping
331
332    A Sun3 (mc680x0) has eight address registers, \tr{a0} to \tr{a7}, and
333    eight data registers, \tr{d0} to \tr{d7}.  Address operations have to
334    be done through address registers; data registers are used for
335    comparison values and data.
336    
337    Here's the register-usage picture for m68k boxes with GCC.
338
339    \begin{tabular}{ll}
340    a0 & used directly by GCC \\
341    a1 & used directly by GCC \\
342    \\
343    a2..a5 & callee-saved: available for STG registers \\
344    & (a5 may be special, ``global'' register for PIC?) \\
345    \\
346    a6 & C-stack frame pointer \\
347    a7 & C-stack pointer \\
348    \\
349    d0 & used directly by GCC \\
350    d1 & used directly by GCC \\
351    d2 & really needed for local optimisation by GCC \\
352    \\
353    d3..d7 & callee-saved: available for STG registers
354    \\
355    fp0 & call-clobbered \\
356    fp1 & call-clobbered \\
357    fp2..fp7 & callee-saved: available for STG registers
358    \end{tabular}
359    -------------------------------------------------------------------------- */
360
361 #if m68k_REGS
362
363 #define REG(x) __asm__(#x)
364
365 #define REG_Base        a2
366
367 #define REG_Sp          a3
368 #define REG_SpLim       d3
369
370 #define REG_Hp          d4
371
372 #define REG_R1          a5
373 #define REG_R2          d6
374 #define MAX_REAL_VANILLA_REG 2
375
376 #define REG_Ret         d7
377
378 #define REG_F1          fp2
379 #define REG_F2          fp3
380 #define REG_F3          fp4
381 #define REG_F4          fp5
382
383 #define REG_D1          fp6
384 #define REG_D2          fp7
385
386 #endif /* m68k */
387
388 /* -----------------------------------------------------------------------------
389    The DECstation (MIPS) register mapping
390
391    Here's at least some simple stuff about registers on a MIPS.
392    
393    \tr{s0}--\tr{s7} are callee-save integer registers; they are our
394    ``prize'' stolen registers.  There is also a wad of callee-save
395    floating-point registers, \tr{$f20}--\tr{$f31}; we'll use some of
396    those.
397    
398    \tr{t0}--\tr{t9} are caller-save (``temporary?'') integer registers.
399    We can steal some, but we might have to save/restore around ccalls.
400    -------------------------------------------------------------------------- */
401
402 #if mips_REGS
403
404 #define REG(x) __asm__("$" #x)
405
406 #define CALLER_SAVES_R5
407 #define CALLER_SAVES_R6
408 #define CALLER_SAVES_R7
409 #define CALLER_SAVES_R8
410
411 #define CALLER_SAVES_USER
412
413 #define REG_R1          16
414 #define REG_R2          17
415 #define REG_R3          18
416 #define REG_R4          19
417 #define REG_R5          12
418 #define REG_R6          13
419 #define REG_R7          14
420 #define REG_R8          15
421
422 #define REG_F1          f20
423 #define REG_F2          f22
424 #define REG_F3          f24
425 #define REG_F4          f26
426
427 #define REG_D1          f28
428 #define REG_D2          f30
429
430 #define REG_Sp          20
431 #define REG_SpLim       21
432
433 #define REG_Hp          22
434
435 #define REG_Base        30
436
437 #endif /* mipse[lb] */
438
439 /* -----------------------------------------------------------------------------
440    The PowerPC register mapping
441
442    0            system glue?    (caller-save, volatile)
443    1            SP              (callee-save, non-volatile)
444    2            AIX, powerpc64-linux:
445                     RTOC        (a strange special case)
446                 darwin:         
447                                 (caller-save, volatile)
448                 powerpc32-linux:
449                                 reserved for use by system
450                     
451    3-10         args/return     (caller-save, volatile)
452    11,12        system glue?    (caller-save, volatile)
453    13           on 64-bit:      reserved for thread state pointer
454                 on 32-bit:      (callee-save, non-volatile)
455    14-31                        (callee-save, non-volatile)
456    
457    f0                           (caller-save, volatile)
458    f1-f13       args/return     (caller-save, volatile)
459    f14-f31                      (callee-save, non-volatile)
460    
461    \tr{14}--\tr{31} are wonderful callee-save registers on all ppc OSes.
462    \tr{0}--\tr{12} are caller-save registers.
463    
464    \tr{%f14}--\tr{%f31} are callee-save floating-point registers.
465    
466    We can do the Whole Business with callee-save registers only!
467    -------------------------------------------------------------------------- */
468
469 #if powerpc_REGS
470
471 #define REG(x) __asm__(#x)
472
473 #define REG_R1          r14
474 #define REG_R2          r15
475 #define REG_R3          r16
476 #define REG_R4          r17
477 #define REG_R5          r18
478 #define REG_R6          r19
479 #define REG_R7          r20
480 #define REG_R8          r21
481
482 #if darwin_REGS
483
484 #define REG_F1          f14
485 #define REG_F2          f15
486 #define REG_F3          f16
487 #define REG_F4          f17
488
489 #define REG_D1          f18
490 #define REG_D2          f19
491
492 #else
493
494 #define REG_F1          fr14
495 #define REG_F2          fr15
496 #define REG_F3          fr16
497 #define REG_F4          fr17
498
499 #define REG_D1          fr18
500 #define REG_D2          fr19
501
502 #endif
503
504 #define REG_Sp          r22
505 #define REG_SpLim       r24
506
507 #define REG_Hp          r25
508
509 #define REG_Base        r27
510
511 #endif /* powerpc */
512
513 /* -----------------------------------------------------------------------------
514    The IA64 register mapping
515
516    We place the general registers in the locals area of the register stack,
517    so that the call mechanism takes care of saving them for us.  We reserve
518    the first 16 for gcc's use - since gcc uses the highest used register to
519    determine the register stack frame size, this gives us a constant size
520    register stack frame.
521    
522    \tr{f16-f32} are the callee-saved floating point registers.
523    -------------------------------------------------------------------------- */
524
525 #if ia64_REGS
526
527 #define REG(x) __asm__(#x)
528
529 #define REG_R1          loc16
530 #define REG_R2          loc17
531 #define REG_R3          loc18
532 #define REG_R4          loc19
533 #define REG_R5          loc20
534 #define REG_R6          loc21
535 #define REG_R7          loc22
536 #define REG_R8          loc23
537
538 #define REG_F1          f16
539 #define REG_F2          f17
540 #define REG_F3          f18
541 #define REG_F4          f19
542
543 #define REG_D1          f20
544 #define REG_D2          f21
545
546 #define REG_Sp          loc24
547 #define REG_SpLim       loc26
548
549 #define REG_Hp          loc27
550
551 #endif /* ia64 */
552
553 /* -----------------------------------------------------------------------------
554    The Sun SPARC register mapping
555
556    !! IMPORTANT: if you change this register mapping you must also update
557                  compiler/nativeGen/SPARC/Regs.hs. That file handles the
558                  mapping for the NCG. This one only affects via-c code.
559
560    The SPARC register (window) story: Remember, within the Haskell
561    Threaded World, we essentially ``shut down'' the register-window
562    mechanism---the window doesn't move at all while in this World.  It
563    *does* move, of course, if we call out to arbitrary~C...
564    
565    The %i, %l, and %o registers (8 each) are the input, local, and
566    output registers visible in one register window.  The 8 %g (global)
567    registers are visible all the time.
568    
569       zero: always zero
570    scratch: volatile across C-fn calls. used by linker.
571        app: usable by application
572     system: reserved for system
573  
574      alloc: allocated to in the register allocator, intra-closure only
575    
576                 GHC usage     v8 ABI        v9 ABI
577    Global
578      %g0        zero        zero          zero
579      %g1        alloc       scratch       scrach
580      %g2        alloc       app           app
581      %g3        alloc       app           app
582      %g4        alloc       app           scratch
583      %g5                    system        scratch    
584      %g6                    system        system
585      %g7                    system        system
586
587    Output: can be zapped by callee
588      %o0-o5     alloc       caller saves
589      %o6                    C stack ptr
590      %o7                    C ret addr
591    
592    Local: maintained by register windowing mechanism
593      %l0        alloc        
594      %l1        R1
595      %l2        R2
596      %l3        R3
597      %l4        R4
598      %l5        R5
599      %l6        alloc
600      %l7        alloc
601
602    Input
603      %i0        Sp
604      %i1        Base
605      %i2        SpLim
606      %i3        Hp
607      %i4        alloc
608      %i5        R6
609      %i6                    C frame ptr
610      %i7                    C ret addr
611      
612    The paired nature of the floating point registers causes complications for
613    the native code generator.  For convenience, we pretend that the first 22
614    fp regs %f0 .. %f21 are actually 11 double regs, and the remaining 10 are
615    float (single) regs.  The NCG acts accordingly.  That means that the 
616    following FP assignment is rather fragile, and should only be changed
617    with extreme care.  The current scheme is:
618
619       %f0 /%f1    FP return from C
620       %f2 /%f3    D1
621       %f4 /%f5    D2
622       %f6 /%f7    ncg double spill tmp #1
623       %f8 /%f9    ncg double spill tmp #2
624       %f10/%f11   allocatable
625       %f12/%f13   allocatable
626       %f14/%f15   allocatable
627       %f16/%f17   allocatable
628       %f18/%f19   allocatable
629       %f20/%f21   allocatable
630
631       %f22        F1
632       %f23        F2
633       %f24        F3
634       %f25        F4
635       %f26        ncg single spill tmp #1
636       %f27        ncg single spill tmp #2
637       %f28        allocatable
638       %f29        allocatable
639       %f30        allocatable
640       %f31        allocatable
641
642    -------------------------------------------------------------------------- */
643
644 #if sparc_REGS
645
646 #define REG(x) __asm__("%" #x)
647
648 #define CALLER_SAVES_USER
649
650 #define CALLER_SAVES_F1
651 #define CALLER_SAVES_F2
652 #define CALLER_SAVES_F3
653 #define CALLER_SAVES_F4
654 #define CALLER_SAVES_D1
655 #define CALLER_SAVES_D2
656
657 #define REG_R1          l1
658 #define REG_R2          l2
659 #define REG_R3          l3
660 #define REG_R4          l4
661 #define REG_R5          l5
662 #define REG_R6          i5
663
664 #define REG_F1          f22
665 #define REG_F2          f23
666 #define REG_F3          f24
667 #define REG_F4          f25
668
669 /* for each of the double arg regs, 
670    Dn_2 is the high half. */
671    
672 #define REG_D1          f2
673 #define REG_D1_2        f3
674
675 #define REG_D2          f4
676 #define REG_D2_2        f5
677
678 #define REG_Sp          i0
679 #define REG_SpLim       i2
680
681 #define REG_Hp          i3
682
683 #define REG_Base        i1
684
685 /*
686 #define NCG_SpillTmp_I1 g1
687 #define NCG_SpillTmp_I2 g2
688 #define NCG_SpillTmp_F1 f26
689 #define NCG_SpillTmp_F2 f27
690 #define NCG_SpillTmp_D1 f6
691 #define NCG_SpillTmp_D2 f8
692 */
693
694 #define NCG_FirstFloatReg f22
695
696 #endif /* sparc */
697
698 #endif /* NO_REGS */
699
700 /* -----------------------------------------------------------------------------
701  * These constants define how many stg registers will be used for
702  * passing arguments (and results, in the case of an unboxed-tuple
703  * return).
704  *
705  * We usually set MAX_REAL_VANILLA_REG and co. to be the number of the
706  * highest STG register to occupy a real machine register, otherwise
707  * the calling conventions will needlessly shuffle data between the
708  * stack and memory-resident STG registers.  We might occasionally
709  * set these macros to other values for testing, though.
710  *
711  * Registers above these values might still be used, for instance to
712  * communicate with PrimOps and RTS functions.
713  */
714
715 #ifndef MAX_REAL_VANILLA_REG
716 #  if   defined(REG_R8)
717 #  define MAX_REAL_VANILLA_REG 8
718 #  elif defined(REG_R7)
719 #  define MAX_REAL_VANILLA_REG 7
720 #  elif defined(REG_R6)
721 #  define MAX_REAL_VANILLA_REG 6
722 #  elif defined(REG_R5)
723 #  define MAX_REAL_VANILLA_REG 5
724 #  elif defined(REG_R4)
725 #  define MAX_REAL_VANILLA_REG 4
726 #  elif defined(REG_R3)
727 #  define MAX_REAL_VANILLA_REG 3
728 #  elif defined(REG_R2)
729 #  define MAX_REAL_VANILLA_REG 2
730 #  elif defined(REG_R1)
731 #  define MAX_REAL_VANILLA_REG 1
732 #  else
733 #  define MAX_REAL_VANILLA_REG 0
734 #  endif
735 #endif
736
737 #ifndef MAX_REAL_FLOAT_REG
738 #  if   defined(REG_F4)
739 #  define MAX_REAL_FLOAT_REG 4
740 #  elif defined(REG_F3)
741 #  define MAX_REAL_FLOAT_REG 3
742 #  elif defined(REG_F2)
743 #  define MAX_REAL_FLOAT_REG 2
744 #  elif defined(REG_F1)
745 #  define MAX_REAL_FLOAT_REG 1
746 #  else
747 #  define MAX_REAL_FLOAT_REG 0
748 #  endif
749 #endif
750
751 #ifndef MAX_REAL_DOUBLE_REG
752 #  if   defined(REG_D2)
753 #  define MAX_REAL_DOUBLE_REG 2
754 #  elif defined(REG_D1)
755 #  define MAX_REAL_DOUBLE_REG 1
756 #  else
757 #  define MAX_REAL_DOUBLE_REG 0
758 #  endif
759 #endif
760
761 #ifndef MAX_REAL_LONG_REG
762 #  if   defined(REG_L1)
763 #  define MAX_REAL_LONG_REG 1
764 #  else
765 #  define MAX_REAL_LONG_REG 0
766 #  endif
767 #endif
768
769 /* define NO_ARG_REGS if we have no argument registers at all (we can
770  * optimise certain code paths using this predicate).
771  */
772 #if MAX_REAL_VANILLA_REG < 2
773 #define NO_ARG_REGS 
774 #else
775 #undef NO_ARG_REGS
776 #endif
777
778 #endif /* MACHREGS_H */