1 ! Copyright (C) 2011 Erik Charlebois
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors system kernel layouts combinators
4 compiler.cfg.builder.alien.boxing sequences arrays math
5 alien.c-types cpu.architecture cpu.ppc alien.complex ;
8 M: linux lr-save 2 cells ;
10 M: linux has-toc ( -- ? ) t ;
12 M: linux reserved-area-size ( -- n ) 6 cells ;
14 M: linux allows-null-dereference ( -- ? ) f ;
18 { int-regs { 3 4 5 6 7 8 9 10 } }
19 { float-regs { 1 2 3 4 5 6 7 8 9 10 11 12 13 } }
22 M: ppc value-struct? drop t ;
24 M: ppc dummy-stack-params? t ;
26 M: ppc dummy-int-params? t ;
28 M: ppc dummy-fp-params? f ;
30 M: ppc long-long-on-stack? f ;
32 M: ppc long-long-odd-register? f ;
34 M: ppc float-right-align-on-stack? t ;
36 M: ppc flatten-struct-type ( type -- seq )
38 { [ dup lookup-c-type complex-double lookup-c-type = ]
39 [ drop { { double-rep f f } { double-rep f f } } ] }
40 { [ dup lookup-c-type complex-float lookup-c-type = ]
41 [ drop { { float-rep f f } { float-rep f f } } ] }
42 [ heap-size cell align cell /i { int-rep f f } <repetition> ]
45 M: ppc flatten-struct-type-return ( type -- seq )
47 { [ dup lookup-c-type complex-double lookup-c-type = ]
48 [ drop { { double-rep f f } { double-rep f f } } ] }
49 { [ dup lookup-c-type complex-float lookup-c-type = ]
50 [ drop { { float-rep f f } { float-rep f f } } ] }
51 [ heap-size cell align cell /i { int-rep t f } <repetition> ]