diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-10-20 14:45:56 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-10-20 14:45:56 +0200 |
commit | ed6043fe910f7a320f7af6d3f9d35f39f5cf7ee1 (patch) | |
tree | 3fab134f5444f0472a1ff8c06e5b7686a40648dc /checklink/Safe.ml | |
parent | 4d542bc7eafadb16b845cf05d1eb4988eb55ed0f (diff) | |
parent | 8a95c3e07fd02eaa87f8cca447bc7d7c2642eb22 (diff) | |
download | compcert-ed6043fe910f7a320f7af6d3f9d35f39f5cf7ee1.tar.gz compcert-ed6043fe910f7a320f7af6d3f9d35f39f5cf7ee1.zip |
Merge remote-tracking branch 'origin/master' into named-externals
Conflicts:
arm/TargetPrinter.ml
backend/CMparser.mly
backend/SelectLongproof.v
backend/Selectionproof.v
cfrontend/C2C.ml
checklink/Asm_printers.ml
checklink/Check.ml
checklink/Fuzz.ml
common/AST.v
debug/DebugInformation.ml
debug/DebugInit.ml
debug/DwarfPrinter.ml
debug/DwarfTypes.mli
debug/Dwarfgen.ml
exportclight/ExportClight.ml
ia32/TargetPrinter.ml
powerpc/Asm.v
powerpc/SelectOpproof.v
powerpc/TargetPrinter.ml
Diffstat (limited to 'checklink/Safe.ml')
-rw-r--r-- | checklink/Safe.ml | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/checklink/Safe.ml b/checklink/Safe.ml deleted file mode 100644 index efcd3bd6..00000000 --- a/checklink/Safe.ml +++ /dev/null @@ -1,25 +0,0 @@ -(* "Hacker's Delight", section 2.12 *) - -let ( + ) x y = - let z = x + y in - (* Overflow occurs iff x and y have same sign and z's sign is different *) - if (z lxor x) land (z lxor y) < 0 - then raise Exc.IntOverflow - else z - -let ( - ) x y = - let z = x - y in - (* Overflow occurs iff x and y have opposite signs and z and x have - opposite signs *) - if (x lxor y) land (z lxor x) < 0 - then raise Exc.IntOverflow - else z - -let ( * ) x y = - let z = x * y in - if (x = min_int && y < 0) || (y <> 0 && z / y <> x) - then raise Exc.IntOverflow - else z - -let of_int32 = Safe32.to_int -let to_int32 = Safe32.of_int |