diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-09-10 17:57:40 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-09-10 17:57:40 +0200 |
commit | 2ba6daf409c2427767a3d2dd74aa53d9242da4ae (patch) | |
tree | 78bcc676f877c582154b4fd161313944719f48d8 | |
parent | d398f6fba2cd9abc875842a21b7c63b952808298 (diff) | |
parent | d3eba50731c23546c6e9ccb14230460fc1da592e (diff) | |
download | compcert-kvx-2ba6daf409c2427767a3d2dd74aa53d9242da4ae.tar.gz compcert-kvx-2ba6daf409c2427767a3d2dd74aa53d9242da4ae.zip |
Merge branch 'master' of https://github.com/AbsInt/CompCert into mppa-non-trapping-load
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | arm/Asmexpand.ml | 27 | ||||
-rw-r--r-- | doc/ccomp.1 | 2 | ||||
-rw-r--r-- | powerpc/Asmexpand.ml | 37 |
4 files changed, 35 insertions, 32 deletions
@@ -88,6 +88,7 @@ BACKEND=\ NeedDomain.v NeedOp.v Deadcode.v Deadcodeproof.v \ Unusedglob.v Unusedglobproof.v \ Machregs.v Locations.v Conventions1.v Conventions.v LTL.v \ + Allnontrap.v Allnontrapproof.v \ Allocation.v Allocproof.v \ Tunneling.v Tunnelingproof.v \ Linear.v Lineartyping.v \ diff --git a/arm/Asmexpand.ml b/arm/Asmexpand.ml index 5d5779d4..89aab5c7 100644 --- a/arm/Asmexpand.ml +++ b/arm/Asmexpand.ml @@ -18,6 +18,7 @@ open Asm open Asmexpandaux open AST open Camlcoq +open! Integers exception Error of string @@ -103,7 +104,7 @@ let memcpy_small_arg sz arg tmp = (r, _0) | BA_addrstack ofs -> if offset_in_range ofs - && offset_in_range (Integers.Int.add ofs (Integers.Int.repr (Z.of_uint sz))) + && offset_in_range (Int.add ofs (Int.repr (Z.of_uint sz))) then (IR13, ofs) else begin expand_addimm tmp IR13 ofs; (tmp, _0) end | _ -> @@ -118,19 +119,19 @@ let expand_builtin_memcpy_small sz al src dst = if sz >= 8 && al >= 4 && !Clflags.option_ffpu then begin emit (Pfldd (FR7,rsrc,osrc)); emit (Pfstd (FR7,rdst,odst)); - copy (Integers.Int.add osrc _8) (Integers.Int.add odst _8) (sz - 8) + copy (Int.add osrc _8) (Int.add odst _8) (sz - 8) end else if sz >= 4 && al >= 4 then begin emit (Pldr (IR14,rsrc,SOimm osrc)); emit (Pstr (IR14,rdst,SOimm odst)); - copy (Integers.Int.add osrc _4) (Integers.Int.add odst _4) (sz - 4) + copy (Int.add osrc _4) (Int.add odst _4) (sz - 4) end else if sz >= 2 && al >= 2 then begin emit (Pldrh (IR14,rsrc,SOimm osrc)); emit (Pstrh (IR14,rdst,SOimm odst)); - copy (Integers.Int.add osrc _2) (Integers.Int.add odst _2) (sz - 2) + copy (Int.add osrc _2) (Int.add odst _2) (sz - 2) end else if sz >= 1 then begin emit (Pldrb (IR14,rsrc,SOimm osrc)); emit (Pstrb (IR14,rdst,SOimm odst)); - copy (Integers.Int.add osrc _1) (Integers.Int.add odst _1) (sz - 1) + copy (Int.add osrc _1) (Int.add odst _1) (sz - 1) end in copy osrc odst sz @@ -187,8 +188,8 @@ let expand_builtin_vload_common chunk base ofs res = | Mint32, BR(IR res) -> emit (Pldr (res, base, SOimm ofs)) | Mint64, BR_splitlong(BR(IR res1), BR(IR res2)) -> - let ofs_hi = if Archi.big_endian then ofs else Integers.Int.add ofs _4 in - let ofs_lo = if Archi.big_endian then Integers.Int.add ofs _4 else ofs in + let ofs_hi = if Archi.big_endian then ofs else Int.add ofs _4 in + let ofs_lo = if Archi.big_endian then Int.add ofs _4 else ofs in if base <> res2 then begin emit (Pldr (res2, base, SOimm ofs_lo)); emit (Pldr (res1, base, SOimm ofs_hi)) @@ -208,7 +209,7 @@ let expand_builtin_vload chunk args res = | [BA(IR addr)] -> expand_builtin_vload_common chunk addr _0 res | [BA_addrstack ofs] -> - if offset_in_range (Integers.Int.add ofs (Memdata.size_chunk chunk)) then + if offset_in_range (Int.add ofs (Memdata.size_chunk chunk)) then expand_builtin_vload_common chunk IR13 ofs res else begin expand_addimm IR14 IR13 ofs; @@ -218,7 +219,7 @@ let expand_builtin_vload chunk args res = emit (Ploadsymbol (IR14,id,ofs)); expand_builtin_vload_common chunk IR14 _0 res | [BA_addptr(BA(IR addr), BA_int ofs)] -> - if offset_in_range (Integers.Int.add ofs (Memdata.size_chunk chunk)) then + if offset_in_range (Int.add ofs (Memdata.size_chunk chunk)) then expand_builtin_vload_common chunk addr ofs res else begin expand_addimm IR14 addr ofs; @@ -236,8 +237,8 @@ let expand_builtin_vstore_common chunk base ofs src = | Mint32, BA(IR src) -> emit (Pstr (src, base, SOimm ofs)) | Mint64, BA_splitlong(BA(IR src1), BA(IR src2)) -> - let ofs_hi = if Archi.big_endian then ofs else Integers.Int.add ofs _4 in - let ofs_lo = if Archi.big_endian then Integers.Int.add ofs _4 else ofs in + let ofs_hi = if Archi.big_endian then ofs else Int.add ofs _4 in + let ofs_lo = if Archi.big_endian then Int.add ofs _4 else ofs in emit (Pstr (src2, base, SOimm ofs_lo)); emit (Pstr (src1, base, SOimm ofs_hi)) | Mfloat32, BA(FR src) -> @@ -252,7 +253,7 @@ let expand_builtin_vstore chunk args = | [BA(IR addr); src] -> expand_builtin_vstore_common chunk addr _0 src | [BA_addrstack ofs; src] -> - if offset_in_range (Integers.Int.add ofs (Memdata.size_chunk chunk)) then + if offset_in_range (Int.add ofs (Memdata.size_chunk chunk)) then expand_builtin_vstore_common chunk IR13 ofs src else begin expand_addimm IR14 IR13 ofs; @@ -262,7 +263,7 @@ let expand_builtin_vstore chunk args = emit (Ploadsymbol (IR14,id,ofs)); expand_builtin_vstore_common chunk IR14 _0 src | [BA_addptr(BA(IR addr), BA_int ofs); src] -> - if offset_in_range (Integers.Int.add ofs (Memdata.size_chunk chunk)) then + if offset_in_range (Int.add ofs (Memdata.size_chunk chunk)) then expand_builtin_vstore_common chunk addr ofs src else begin expand_addimm IR14 addr ofs; diff --git a/doc/ccomp.1 b/doc/ccomp.1 index f4919867..89e8c823 100644 --- a/doc/ccomp.1 +++ b/doc/ccomp.1 @@ -485,7 +485,7 @@ Disabled by default. .sp \fIunused\-variable\fP: Unused local variables. -Enabled by default. +Disabled by default. .sp \fIvarargs\fP: Promotable vararg arguments. diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index 0ef0a21e..704b0aba 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -14,6 +14,7 @@ of the PPC assembly code. *) open Camlcoq +open! Integers open AST open Asm open Asmexpandaux @@ -29,8 +30,8 @@ let eref = (* Useful constants and helper functions *) -let _0 = Integers.Int.zero -let _1 = Integers.Int.one +let _0 = Int.zero +let _1 = Int.one let _2 = coqint_of_camlint 2l let _4 = coqint_of_camlint 4l let _6 = coqint_of_camlint 6l @@ -44,7 +45,7 @@ let _m4 = coqint_of_camlint (-4l) let _m8 = coqint_of_camlint (-8l) let _m16 = coqint_of_camlint (-16l) -let _0L = Integers.Int64.zero +let _0L = Int64.zero let _32L = coqint_of_camlint64 32L let _64L = coqint_of_camlint64 64L let _m1L = coqint_of_camlint64 (-1L) @@ -88,7 +89,7 @@ let expand_annot_val kind txt targ args res = Note that lfd and stfd cannot trap on ill-formed floats. *) let offset_in_range ofs = - Integers.Int.eq (Asmgen.high_s ofs) _0 + Int.eq (Asmgen.high_s ofs) _0 let memcpy_small_arg sz arg tmp = match arg with @@ -96,7 +97,7 @@ let memcpy_small_arg sz arg tmp = (r, _0) | BA_addrstack ofs -> if offset_in_range ofs - && offset_in_range (Integers.Int.add ofs (Integers.Int.repr (Z.of_uint sz))) + && offset_in_range (Int.add ofs (Int.repr (Z.of_uint sz))) then (GPR1, ofs) else begin emit_addimm tmp GPR1 ofs; (tmp, _0) end | _ -> @@ -111,19 +112,19 @@ let expand_builtin_memcpy_small sz al src dst = if sz >= 8 && al >= 4 && !Clflags.option_ffpu then begin emit (Plfd(FPR13, Cint osrc, rsrc)); emit (Pstfd(FPR13, Cint odst, rdst)); - copy (Integers.Int.add osrc _8) (Integers.Int.add odst _8) (sz - 8) + copy (Int.add osrc _8) (Int.add odst _8) (sz - 8) end else if sz >= 4 then begin emit (Plwz(GPR0, Cint osrc, rsrc)); emit (Pstw(GPR0, Cint odst, rdst)); - copy (Integers.Int.add osrc _4) (Integers.Int.add odst _4) (sz - 4) + copy (Int.add osrc _4) (Int.add odst _4) (sz - 4) end else if sz >= 2 then begin emit (Plhz(GPR0, Cint osrc, rsrc)); emit (Psth(GPR0, Cint odst, rdst)); - copy (Integers.Int.add osrc _2) (Integers.Int.add odst _2) (sz - 2) + copy (Int.add osrc _2) (Int.add odst _2) (sz - 2) end else if sz >= 1 then begin emit (Plbz(GPR0, Cint osrc, rsrc)); emit (Pstb(GPR0, Cint odst, rdst)); - copy (Integers.Int.add osrc _1) (Integers.Int.add odst _1) (sz - 1) + copy (Int.add osrc _1) (Int.add odst _1) (sz - 1) end in copy osrc odst sz @@ -133,7 +134,7 @@ let memcpy_big_arg arg tmp = | BA (IR r) -> emit (Paddi(tmp, r, Cint _m4)) | BA_addrstack ofs -> - emit_addimm tmp GPR1 (Integers.Int.add ofs _m4) + emit_addimm tmp GPR1 (Int.add ofs _m4) | _ -> assert false @@ -226,10 +227,10 @@ let expand_volatile_access let offset_constant cst delta = match cst with | Cint n -> - let n' = Integers.Int.add n delta in + let n' = Int.add n delta in if offset_in_range n' then Some (Cint n') else None | Csymbol_sda(id, ofs) -> - Some (Csymbol_sda(id, Integers.Int.add ofs delta)) + Some (Csymbol_sda(id, Int.add ofs delta)) | _ -> None let expand_load_int64 hi lo base ofs_hi ofs_lo = @@ -437,7 +438,7 @@ let expand_integer_cond_move a1 a2 a3 res = if a2 = a3 then emit (Pmr (res, a2)) else if eref then begin - emit (Pcmpwi (a1,Cint (Integers.Int.zero))); + emit (Pcmpwi (a1,Cint (Int.zero))); emit (Pisel (res,a3,a2,CRbit_2)) end else begin (* a1 has type _Bool, hence it is 0 or 1 *) @@ -682,23 +683,23 @@ let expand_builtin_inline name args res = | "__builtin_icbi", [BA(IR a1)],_ -> emit (Picbi(GPR0,a1)) | "__builtin_dcbtls", [BA (IR a1); BA_int loc],_ -> - if not ((Integers.Int.eq loc _0) || (Integers.Int.eq loc _2)) then + if not ((Int.eq loc _0) || (Int.eq loc _2)) then raise (Error "the second argument of __builtin_dcbtls must be 0 or 2"); emit (Pdcbtls (loc,GPR0,a1)) | "__builtin_dcbtls",_,_ -> raise (Error "the second argument of __builtin_dcbtls must be a constant") | "__builtin_icbtls", [BA (IR a1); BA_int loc],_ -> - if not ((Integers.Int.eq loc _0) || (Integers.Int.eq loc _2)) then + if not ((Int.eq loc _0) || (Int.eq loc _2)) then raise (Error "the second argument of __builtin_icbtls must be 0 or 2"); emit (Picbtls (loc,GPR0,a1)) | "__builtin_icbtls",_,_ -> raise (Error "the second argument of __builtin_icbtls must be a constant") | "__builtin_prefetch" , [BA (IR a1) ;BA_int rw; BA_int loc],_ -> - if not (Integers.Int.ltu loc _4) then + if not (Int.ltu loc _4) then raise (Error "the last argument of __builtin_prefetch must be 0, 1 or 2"); - if Integers.Int.eq rw _0 then begin + if Int.eq rw _0 then begin emit (Pdcbt (loc,GPR0,a1)); - end else if Integers.Int.eq rw _1 then begin + end else if Int.eq rw _1 then begin emit (Pdcbtst (loc,GPR0,a1)); end else raise (Error "the second argument of __builtin_prefetch must be 0 or 1") |