diff options
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/Asmexpand.ml | 2 | ||||
-rw-r--r-- | powerpc/Machregs.v | 33 | ||||
-rw-r--r-- | powerpc/SelectOpproof.v | 2 | ||||
-rw-r--r-- | powerpc/TargetPrinter.ml | 6 |
4 files changed, 15 insertions, 28 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index 2fedf0c7..161d12b7 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -669,7 +669,7 @@ let expand_instruction instr = | Pbuiltin(ef, args, res) -> begin match ef with | EF_builtin(name, sg) -> - expand_builtin_inline (extern_atom name) args res + expand_builtin_inline (camlstring_of_coqstring name) args res | EF_vload chunk -> expand_builtin_vload chunk args res | EF_vstore chunk -> diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v index 8d3976f4..fe209627 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 diff --git a/powerpc/SelectOpproof.v b/powerpc/SelectOpproof.v index f93b93e5..757f1fd0 100644 --- a/powerpc/SelectOpproof.v +++ b/powerpc/SelectOpproof.v @@ -838,8 +838,6 @@ Proof. intros. destruct x; simpl in H0; try discriminate. destruct (Float.to_intu f) as [n|] eqn:?; simpl in H0; inv H0. exists (Vint n); split; auto. unfold intuoffloat. - destruct Archi.ppc64. - econstructor. constructor; eauto. constructor. simpl; rewrite Heqo; auto. set (im := Int.repr Int.half_modulus). set (fm := Float.of_intu im). assert (eval_expr ge sp e m (Vfloat fm :: Vfloat f :: le) (Eletvar (S O)) (Vfloat f)). diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index 709a0d7c..73cb12f5 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -725,13 +725,13 @@ module Target (System : SYSTEM):TARGET = begin match ef with | EF_annot(txt, targs) -> fprintf oc "%s annotation: " comment; - print_annot_text preg_annot "r1" oc (extern_atom txt) args + print_annot_text preg_annot "r1" oc (camlstring_of_coqstring txt) args | EF_debug(kind, txt, targs) -> print_debug_info comment print_file_line preg_annot "r1" oc (P.to_int kind) (extern_atom txt) args | EF_inline_asm(txt, sg, clob) -> fprintf oc "%s begin inline assembly\n\t" comment; - print_inline_asm preg oc (extern_atom txt) sg args res; + print_inline_asm preg oc (camlstring_of_coqstring txt) sg args res; fprintf oc "%s end inline assembly\n" comment | _ -> assert false @@ -789,7 +789,7 @@ module Target (System : SYSTEM):TARGET = let nlo = Int64.to_int32 n and nhi = Int64.to_int32(Int64.shift_right_logical n 32) in fprintf oc "%a: .long 0x%lx, 0x%lx\n" label lbl nhi nlo - + let print_literal32 oc (lbl, n) = fprintf oc "%a: .long 0x%lx\n" label lbl n |