[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This backend provides the following additional options:
This backend supports the following registers:
$0
through $31
for the general purpose registers and
$f0
through $f31
for the floating point registers.
The current version generates assembly output for use with the GNU assembler. The generated code should work on systems with 21064, 21066, 21164 and higher Alpha CPUs.
The registers $0-$8, $16-$28, $f0, $f1
and $f10-$f30
are used as scratch registers (i.e. they can be destroyed in function
calls), all other registers are preserved. Of course $31
and
$f31
cannot be used.
The first 6 function arguments which have arithmetic or pointer types
are passed in registers $16/$f16
through $21/$f21
.
Integers and pointers are returned in $0
, floats and doubles in
$f0
.
All other types are returned by passing the function the address
of the result as a hidden argument - so when you call such a function
without a proper declaration in scope you can expect a crash.
The elementary data types are represented like:
type size in bits alignment in bytes char 8 1 short 16 2 int 32 4 long 64 8 long long 64 8 all pointers 64 8 float 32 4 double 64 8 |
This backend defines the following macros:
__ALPHA__
A possible <stdarg.h> could look like this:
typedef struct { char *regbase; char *membase; int arg; } va_list; char *__va_start(void); int __va_fixargs(void); #define va_start(vl,dummy) \ (vl.arg=__va_fixargs(),vl.regbase=__va_start(),vl.membase=vl.regbase+(6-vl.arg)*16) #define va_end(vl) (vl.regbase=vl.membase=0) #define __va_size(type) ((sizeof(type)+7)/8*8) #define va_arg(vl,type) \ ( \ ((__typeof(type)&15)<=10&&++vl.arg<=6) ? \ ( \ ((__typeof(type)&15)>=6&&(__typeof(type)&15)<=8) ? \ (vl.regbase+=16,*(type *)(vl.regbase-8)) \ : \ (vl.regbase+=16,*(type *)(vl.regbase-16)) \ ) \ : \ (vl.membase+=__va_size(type),*(type *)(vl.membase-__va_size(type))) \ ) |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |