]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/arm/arm.factor
641beee6c1eed99b7265a050859e6de633c8d3a9
[factor.git] / unmaintained / arm / arm.factor
1 ! Copyright (C) 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types kernel math namespaces
4 cpu.architecture cpu.arm.architecture cpu.arm.assembler
5 cpu.arm.intrinsics generator generator.registers continuations
6 compiler io vocabs sequences system ;
7
8 ! EABI passes floats in integer registers.
9 [ alien-float ]
10 [ >r >r >float r> r> set-alien-float ]
11 4
12 "box_float"
13 "to_float" <primitive-type>
14 "float" define-primitive-type
15
16 [ >float ] "float" c-type set-c-type-prep
17
18 [ alien-double ]
19 [ >r >r >float r> r> set-alien-double ]
20 8
21 "box_double"
22 "to_double" <primitive-type> <long-long-type>
23 "double" define-primitive-type
24
25 [ >float ] "double" c-type set-c-type-prep
26
27 T{ arm-backend } compiler-backend set-global
28
29 ! We don't auto-detect since that would require us to support
30 ! illegal instruction traps. This works on Linux but not on
31 ! Windows CE.
32
33 "arm-variant" get [
34     "ARM variant: " write "arm-variant" get print
35 ] [
36     "==========" print
37     "You should specify the -arm-variant=<variant> switch." print
38     "<variant> can be one of arm3, arm4, arm4t, or arm5." print
39     "Assuming arm3." print
40     "==========" print
41     "arm3" "arm-variant" set-global
42 ] if
43
44 "arm-variant" get { "arm4" "arm4t" "arm5" } member? [
45     "cpu.arm.4" require
46 ] when
47
48 "arm-variant" get { "arm4t" "arm5" } member? [
49     t have-BX? set-global
50 ] when
51
52 "arm-variant" get "arm5" = [
53     t have-BLX? set-global
54 ] when
55
56 7 cells profiler-prologues set-global