From 378ac3925503e6efd24cc34796e85d95c031e72d Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 13 Sep 2015 11:44:32 +0200 Subject: Use PowerPC 64 bits instructions (when available) for int<->FP conversions. Also: implement __builtin_isel on non-EREF platforms with a branch-free instruction sequence. Also: extend ./configure so that it recognizes "ppc64-" and "e5500-" platforms in addition to "ppc-". --- powerpc/Machregs.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'powerpc/Machregs.v') diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v index a2017dca..e4006523 100644 --- a/powerpc/Machregs.v +++ b/powerpc/Machregs.v @@ -134,7 +134,7 @@ Definition destroyed_by_op (op: operation): list mreg := match op with | Ofloatconst _ => R12 :: nil | Osingleconst _ => R12 :: nil - | Ointoffloat => F13 :: nil + | Ointoffloat | Ointuoffloat => F13 :: nil | _ => nil end. -- cgit From 7a6bb90048db7a254e959b1e3c308bac5fe6c418 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 11 Oct 2015 17:43:59 +0200 Subject: Use Coq strings instead of idents to name external and builtin functions. The AST.ident type represents source-level identifiers as unique positive numbers. However, the mapping identifiers <-> AST.ident differs between runs of CompCert on different source files. This is problematic when we need to produce or recognize external functions and builtin functions with fixed names, for example: * in $ARCH/Machregs.v to define the register conventions for builtin functions; * in the VST program logic from Princeton to treat thread primitives specially. So far, we used AST.ident_of_string to recover the ident associated with a string. However, this function is defined in OCaml and doesn't execute within Coq. This is a problem both for VST and for future executability of CompCert within Coq. This commit replaces "ident" by "string" in the arguments of EF_external, EF_builtin, EF_inline_asm, EF_annot, and EF_annot_val. This provides stable names for externals and builtins, as needed. For inline asm and annotations, it's a matter of taste, but using strings feels more natural. EF_debug keeps using idents, since some kinds of EF_debug annotations talk about program variables. --- powerpc/Machregs.v | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'powerpc/Machregs.v') diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v index f94c3b64..ec721a16 100644 --- a/powerpc/Machregs.v +++ b/powerpc/Machregs.v @@ -160,15 +160,11 @@ Fixpoint destroyed_by_clobber (cl: list string): list mreg := end end. -Definition builtin_atomic_exchange := ident_of_string "__builtin_atomic_exchange". -Definition builtin_sync_and_fetch := ident_of_string "__builtin_sync_fetch_and_add". -Definition builtin_atomic_compare_exchange := ident_of_string "__builtin_atomic_compare_exchange". - Definition destroyed_by_builtin (ef: external_function): list mreg := match ef with | EF_builtin id sg => - if ident_eq id builtin_atomic_exchange then R10::nil - else if ident_eq id builtin_atomic_compare_exchange then R10::R11::nil + if string_dec id "__builtin_atomic_exchange" then R10::nil + else if string_dec id "__builtin_atomic_compare_exchange" then R10::R11::nil else F13 :: nil | EF_vload _ => R11 :: nil | EF_vstore Mint64 => R10 :: R11 :: R12 :: nil @@ -194,9 +190,9 @@ Definition mregs_for_operation (op: operation): list (option mreg) * option mreg Definition mregs_for_builtin (ef: external_function): list (option mreg) * list (option mreg) := match ef with | EF_builtin id sg => - if ident_eq id builtin_atomic_exchange then ((Some R3)::(Some R4)::(Some R5)::nil,nil) - else if ident_eq id builtin_sync_and_fetch then ((Some R4)::(Some R5)::nil,(Some R3)::nil) - else if ident_eq id builtin_atomic_compare_exchange then ((Some R4)::(Some R5)::(Some R6)::nil, (Some R3):: nil) + if string_dec id "__builtin_atomic_exchange" then ((Some R3)::(Some R4)::(Some R5)::nil,nil) + else if string_dec id "__builtin_sync_fetch_and_add" then ((Some R4)::(Some R5)::nil,(Some R3)::nil) + else if string_dec id "___builtin_atomic_compare_exchange" then ((Some R4)::(Some R5)::(Some R6)::nil, (Some R3):: nil) else (nil, nil) | _ => (nil, nil) end. @@ -219,23 +215,16 @@ Definition two_address_op (op: operation) : bool := (* Constraints on constant propagation for builtins *) -Definition builtin_get_spr := ident_of_string "__builtin_get_spr". -Definition builtin_set_spr := ident_of_string "__builtin_set_spr". -Definition builtin_prefetch := ident_of_string "__builtin_prefetch". -Definition builtin_dcbtls := ident_of_string "__builtin_dcbtls". -Definition builtin_icbtls := ident_of_string "__builtin_icbtls". -Definition builtin_mbar := ident_of_string "__builtin_mbar". - Definition builtin_constraints (ef: external_function) : list builtin_arg_constraint := match ef with | EF_builtin id sg => - if ident_eq id builtin_get_spr then OK_const :: nil - else if ident_eq id builtin_set_spr then OK_const :: OK_default :: nil - else if ident_eq id builtin_prefetch then OK_default :: OK_const :: OK_const :: nil - else if ident_eq id builtin_dcbtls then OK_default::OK_const::nil - else if ident_eq id builtin_icbtls then OK_default::OK_const::nil - else if ident_eq id builtin_mbar then OK_const::nil + if string_dec id "__builtin_get_spr" then OK_const :: nil + else if string_dec id "__builtin_set_spr" then OK_const :: OK_default :: nil + else if string_dec id "__builtin_prefetch" then OK_default :: OK_const :: OK_const :: nil + else if string_dec id "__builtin_dcbtls" then OK_default::OK_const::nil + else if string_dec id "__builtin_icbtls" then OK_default::OK_const::nil + else if string_dec id "__builtin_mbar" then OK_const::nil else nil | EF_vload _ => OK_addrany :: nil | EF_vstore _ => OK_addrany :: OK_default :: nil -- cgit From f5bb397acd12292f6b41438778f2df7391d6f2fe Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Wed, 14 Oct 2015 15:26:56 +0200 Subject: bug 17392: remove trailing whitespace in source files --- powerpc/Machregs.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'powerpc/Machregs.v') diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v index 20bec532..8d3976f4 100644 --- a/powerpc/Machregs.v +++ b/powerpc/Machregs.v @@ -21,7 +21,7 @@ Require Import Op. (** The following type defines the machine registers that can be referenced as locations. These include: - Integer registers that can be allocated to RTL pseudo-registers ([Rxx]). -- Floating-point registers that can be allocated to RTL pseudo-registers +- Floating-point registers that can be allocated to RTL pseudo-registers ([Fxx]). The type [mreg] does not include special-purpose or reserved -- cgit From 4d542bc7eafadb16b845cf05d1eb4988eb55ed0f Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 20 Oct 2015 13:32:18 +0200 Subject: Updated PR by removing whitespaces. Bug 17450. --- powerpc/Machregs.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'powerpc/Machregs.v') diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v index ec721a16..a8aa94c5 100644 --- a/powerpc/Machregs.v +++ b/powerpc/Machregs.v @@ -21,7 +21,7 @@ Require Import Op. (** The following type defines the machine registers that can be referenced as locations. These include: - Integer registers that can be allocated to RTL pseudo-registers ([Rxx]). -- Floating-point registers that can be allocated to RTL pseudo-registers +- Floating-point registers that can be allocated to RTL pseudo-registers ([Fxx]). The type [mreg] does not include special-purpose or reserved -- cgit