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