[arm] Fix arch selection with ARMv6. Rename EABI_VFP to EABI_HF.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13169 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Benedikt Meurer 2012-12-29 00:49:57 +00:00
parent 9ae458499e
commit 25343aa241
2 changed files with 22 additions and 22 deletions

View File

@ -15,14 +15,14 @@
open Format
type abi = EABI | EABI_VFP
type abi = EABI | EABI_HF
type arch = ARMv4 | ARMv5 | ARMv5TE | ARMv6 | ARMv6T2 | ARMv7
type fpu = Soft | VFPv2 | VFPv3_D16 | VFPv3
let abi =
match Config.system with
"linux_eabi" -> EABI
| "linux_eabihf" -> EABI_VFP
| "linux_eabihf" -> EABI_HF
| _ -> assert false
let string_of_arch = function
@ -45,14 +45,14 @@ let (arch, fpu, thumb) =
let (def_arch, def_fpu, def_thumb) =
begin match abi, Config.model with
(* Defaults for architecture, FPU and Thumb *)
EABI, "armv5" -> ARMv5, Soft, false
| EABI, "armv5te" -> ARMv5TE, Soft, false
| EABI, "armv6" -> ARMv6, Soft, false
| EABI, "armv6t2" -> ARMv6T2, Soft, false
| EABI, "armv7" -> ARMv7, Soft, false
| EABI, _ -> ARMv4, Soft, false
| EABI_VFP, "armv6" -> ARMv6, VFPv2, false
| EABI_VFP, _ -> ARMv7, VFPv3_D16, true
EABI, "armv5" -> ARMv5, Soft, false
| EABI, "armv5te" -> ARMv5TE, Soft, false
| EABI, "armv6" -> ARMv6, Soft, false
| EABI, "armv6t2" -> ARMv6T2, Soft, false
| EABI, "armv7" -> ARMv7, Soft, false
| EABI, _ -> ARMv4, Soft, false
| EABI_HF, "armv6" -> ARMv6, VFPv2, false
| EABI_HF, _ -> ARMv7, VFPv3_D16, true
end in
(ref def_arch, ref def_fpu, ref def_thumb)
@ -60,20 +60,20 @@ let pic_code = ref false
let farch spec =
arch := (match spec with
"armv4" when abi <> EABI_VFP -> ARMv4
| "armv5" when abi <> EABI_VFP -> ARMv5
| "armv5te" when abi <> EABI_VFP -> ARMv5TE
| "armv6" when abi <> EABI_VFP -> ARMv6
| "armv6t2" when abi <> EABI_VFP -> ARMv6T2
| "armv7" -> ARMv7
"armv4" when abi <> EABI_HF -> ARMv4
| "armv5" when abi <> EABI_HF -> ARMv5
| "armv5te" when abi <> EABI_HF -> ARMv5TE
| "armv6" -> ARMv6
| "armv6t2" -> ARMv6T2
| "armv7" -> ARMv7
| spec -> raise (Arg.Bad spec))
let ffpu spec =
fpu := (match spec with
"soft" when abi <> EABI_VFP -> Soft
| "vfpv2" when abi = EABI_VFP -> VFPv2
| "vfpv3-d16" when abi = EABI_VFP -> VFPv3_D16
| "vfpv3" when abi = EABI_VFP -> VFPv3
"soft" when abi <> EABI_HF -> Soft
| "vfpv2" when abi = EABI_HF -> VFPv2
| "vfpv3-d16" when abi = EABI_HF -> VFPv3_D16
| "vfpv3" when abi = EABI_HF -> VFPv3
| spec -> raise (Arg.Bad spec))
let command_line_options =

View File

@ -123,7 +123,7 @@ let calling_conventions
ofs := !ofs + size_int
end
| Float ->
assert (abi = EABI_VFP);
assert (abi = EABI_HF);
assert (!fpu >= VFPv2);
if !float <= last_float then begin
loc.(i) <- phys_reg !float;
@ -185,7 +185,7 @@ let destroyed_at_c_call =
108;109;110;111;112;113;114;115;
116;116;118;119;120;121;122;123;
124;125;126;127;128;129;130;131]
| EABI_VFP -> (* r4-r7, d8-d15 preserved *)
| EABI_HF -> (* r4-r7, d8-d15 preserved *)
[0;1;2;3;8;
100;101;102;103;104;105;106;107;
116;116;118;119;120;121;122;123;