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.loader sequences system ;
8 ! EABI passes floats in integer registers.
10 [ >r >r >float r> r> set-alien-float ]
13 "to_float" <primitive-type>
14 "float" define-primitive-type
16 [ >float ] "float" c-type set-c-type-prep
19 [ >r >r >float r> r> set-alien-double ]
22 "to_double" <primitive-type> <long-long-type>
23 "double" define-primitive-type
25 [ >float ] "double" c-type set-c-type-prep
27 T{ arm-backend } compiler-backend set-global
29 ! We don't auto-detect since that would require us to support
30 ! illegal instruction traps. This works on Linux but not on
34 "ARM variant: " write "arm-variant" get 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
41 "arm3" "arm-variant" set-global
44 "arm-variant" get { "arm4" "arm4t" "arm5" } member? [
48 "arm-variant" get { "arm4t" "arm5" } member? [
52 "arm-variant" get "arm5" = [
53 t have-BLX? set-global
56 7 cells profiler-prologues set-global