aboutsummaryrefslogtreecommitdiffstats
path: root/checklink/Safe32.ml
diff options
context:
space:
mode:
authorFrançois Pottier <francois.pottier@inria.fr>2015-10-23 15:08:33 +0200
committerFrançois Pottier <francois.pottier@inria.fr>2015-10-23 15:17:50 +0200
commit136986c204af19341aeb455d72fe817b16fa6fff (patch)
tree02e9178d9f2cf942bd32366891d480ff161406f6 /checklink/Safe32.ml
parentc46723c0169145d41d1879c236f53314456f1ba1 (diff)
parent1cb3d93ff278ebbd0c6967c5f9401a97f9b618b4 (diff)
downloadcompcert-136986c204af19341aeb455d72fe817b16fa6fff.tar.gz
compcert-136986c204af19341aeb455d72fe817b16fa6fff.zip
Merge remote branch 'upstream/master' into clean
Conflicts: Makefile.extr
Diffstat (limited to 'checklink/Safe32.ml')
-rw-r--r--checklink/Safe32.ml34
1 files changed, 0 insertions, 34 deletions
diff --git a/checklink/Safe32.ml b/checklink/Safe32.ml
deleted file mode 100644
index e72563d7..00000000
--- a/checklink/Safe32.ml
+++ /dev/null
@@ -1,34 +0,0 @@
-(* "Hacker's Delight", section 2.12 *)
-
-let ( + ) x y = Int32.(
- let z = add x y in
- (* Overflow occurs iff x and y have same sign and z's sign is different *)
- if logand (logxor z x) (logxor z y) < 0l
- then raise Exc.Int32Overflow
- else z
-)
-
-let ( - ) x y = Int32.(
- let z = sub x y in
- (* Overflow occurs iff x and y have opposite signs and z and x have
- opposite signs *)
- if logand (logxor x y) (logxor z x) < 0l
- then raise Exc.Int32Overflow
- else z
-)
-
-let ( * ) x y = Int32.(
- let z = mul x y in
- if (x = min_int && y < 0l) || (y <> 0l && div z y <> x)
- then raise Exc.Int32Overflow
- else z
-)
-
-let to_int i32 = Int32.(
- let i = to_int i32 in
- if i32 = of_int i
- then i
- else raise Exc.IntOverflow
-)
-
-let of_int = Int32.of_int