[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-0dff7051ff02master
parent
9ae458499e
commit
25343aa241
|
@ -15,14 +15,14 @@
|
||||||
|
|
||||||
open Format
|
open Format
|
||||||
|
|
||||||
type abi = EABI | EABI_VFP
|
type abi = EABI | EABI_HF
|
||||||
type arch = ARMv4 | ARMv5 | ARMv5TE | ARMv6 | ARMv6T2 | ARMv7
|
type arch = ARMv4 | ARMv5 | ARMv5TE | ARMv6 | ARMv6T2 | ARMv7
|
||||||
type fpu = Soft | VFPv2 | VFPv3_D16 | VFPv3
|
type fpu = Soft | VFPv2 | VFPv3_D16 | VFPv3
|
||||||
|
|
||||||
let abi =
|
let abi =
|
||||||
match Config.system with
|
match Config.system with
|
||||||
"linux_eabi" -> EABI
|
"linux_eabi" -> EABI
|
||||||
| "linux_eabihf" -> EABI_VFP
|
| "linux_eabihf" -> EABI_HF
|
||||||
| _ -> assert false
|
| _ -> assert false
|
||||||
|
|
||||||
let string_of_arch = function
|
let string_of_arch = function
|
||||||
|
@ -45,14 +45,14 @@ let (arch, fpu, thumb) =
|
||||||
let (def_arch, def_fpu, def_thumb) =
|
let (def_arch, def_fpu, def_thumb) =
|
||||||
begin match abi, Config.model with
|
begin match abi, Config.model with
|
||||||
(* Defaults for architecture, FPU and Thumb *)
|
(* Defaults for architecture, FPU and Thumb *)
|
||||||
EABI, "armv5" -> ARMv5, Soft, false
|
EABI, "armv5" -> ARMv5, Soft, false
|
||||||
| EABI, "armv5te" -> ARMv5TE, Soft, false
|
| EABI, "armv5te" -> ARMv5TE, Soft, false
|
||||||
| EABI, "armv6" -> ARMv6, Soft, false
|
| EABI, "armv6" -> ARMv6, Soft, false
|
||||||
| EABI, "armv6t2" -> ARMv6T2, Soft, false
|
| EABI, "armv6t2" -> ARMv6T2, Soft, false
|
||||||
| EABI, "armv7" -> ARMv7, Soft, false
|
| EABI, "armv7" -> ARMv7, Soft, false
|
||||||
| EABI, _ -> ARMv4, Soft, false
|
| EABI, _ -> ARMv4, Soft, false
|
||||||
| EABI_VFP, "armv6" -> ARMv6, VFPv2, false
|
| EABI_HF, "armv6" -> ARMv6, VFPv2, false
|
||||||
| EABI_VFP, _ -> ARMv7, VFPv3_D16, true
|
| EABI_HF, _ -> ARMv7, VFPv3_D16, true
|
||||||
end in
|
end in
|
||||||
(ref def_arch, ref def_fpu, ref def_thumb)
|
(ref def_arch, ref def_fpu, ref def_thumb)
|
||||||
|
|
||||||
|
@ -60,20 +60,20 @@ let pic_code = ref false
|
||||||
|
|
||||||
let farch spec =
|
let farch spec =
|
||||||
arch := (match spec with
|
arch := (match spec with
|
||||||
"armv4" when abi <> EABI_VFP -> ARMv4
|
"armv4" when abi <> EABI_HF -> ARMv4
|
||||||
| "armv5" when abi <> EABI_VFP -> ARMv5
|
| "armv5" when abi <> EABI_HF -> ARMv5
|
||||||
| "armv5te" when abi <> EABI_VFP -> ARMv5TE
|
| "armv5te" when abi <> EABI_HF -> ARMv5TE
|
||||||
| "armv6" when abi <> EABI_VFP -> ARMv6
|
| "armv6" -> ARMv6
|
||||||
| "armv6t2" when abi <> EABI_VFP -> ARMv6T2
|
| "armv6t2" -> ARMv6T2
|
||||||
| "armv7" -> ARMv7
|
| "armv7" -> ARMv7
|
||||||
| spec -> raise (Arg.Bad spec))
|
| spec -> raise (Arg.Bad spec))
|
||||||
|
|
||||||
let ffpu spec =
|
let ffpu spec =
|
||||||
fpu := (match spec with
|
fpu := (match spec with
|
||||||
"soft" when abi <> EABI_VFP -> Soft
|
"soft" when abi <> EABI_HF -> Soft
|
||||||
| "vfpv2" when abi = EABI_VFP -> VFPv2
|
| "vfpv2" when abi = EABI_HF -> VFPv2
|
||||||
| "vfpv3-d16" when abi = EABI_VFP -> VFPv3_D16
|
| "vfpv3-d16" when abi = EABI_HF -> VFPv3_D16
|
||||||
| "vfpv3" when abi = EABI_VFP -> VFPv3
|
| "vfpv3" when abi = EABI_HF -> VFPv3
|
||||||
| spec -> raise (Arg.Bad spec))
|
| spec -> raise (Arg.Bad spec))
|
||||||
|
|
||||||
let command_line_options =
|
let command_line_options =
|
||||||
|
|
|
@ -123,7 +123,7 @@ let calling_conventions
|
||||||
ofs := !ofs + size_int
|
ofs := !ofs + size_int
|
||||||
end
|
end
|
||||||
| Float ->
|
| Float ->
|
||||||
assert (abi = EABI_VFP);
|
assert (abi = EABI_HF);
|
||||||
assert (!fpu >= VFPv2);
|
assert (!fpu >= VFPv2);
|
||||||
if !float <= last_float then begin
|
if !float <= last_float then begin
|
||||||
loc.(i) <- phys_reg !float;
|
loc.(i) <- phys_reg !float;
|
||||||
|
@ -185,7 +185,7 @@ let destroyed_at_c_call =
|
||||||
108;109;110;111;112;113;114;115;
|
108;109;110;111;112;113;114;115;
|
||||||
116;116;118;119;120;121;122;123;
|
116;116;118;119;120;121;122;123;
|
||||||
124;125;126;127;128;129;130;131]
|
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;
|
[0;1;2;3;8;
|
||||||
100;101;102;103;104;105;106;107;
|
100;101;102;103;104;105;106;107;
|
||||||
116;116;118;119;120;121;122;123;
|
116;116;118;119;120;121;122;123;
|
||||||
|
|
Loading…
Reference in New Issue