diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-11-19 13:32:09 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-11-19 13:32:09 +0000 |
commit | ef40c6d36f1c3125f3aa78ea4eaa61dcc7bcae67 (patch) | |
tree | 7bd176bb0dbf60617954fabadd8aedc64b4cf647 /cfrontend/Csem.v | |
parent | cdf83055d96e2af784a97c783c94b83ba2032ae1 (diff) | |
download | compcert-ef40c6d36f1c3125f3aa78ea4eaa61dcc7bcae67.tar.gz compcert-ef40c6d36f1c3125f3aa78ea4eaa61dcc7bcae67.zip |
Revised lib/Integers.v to make it parametric w.r.t. word size.
Introduced Int.iwordsize and used it in place of "Int.repr 32" or
"Int.repr (Z_of_nat wordsize)".
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1182 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Csem.v')
-rw-r--r-- | cfrontend/Csem.v | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cfrontend/Csem.v b/cfrontend/Csem.v index ee134875..62e9dc70 100644 --- a/cfrontend/Csem.v +++ b/cfrontend/Csem.v @@ -252,7 +252,7 @@ Function sem_xor (v1 v2: val): option val := Function sem_shl (v1 v2: val): option val := match v1, v2 with | Vint n1, Vint n2 => - if Int.ltu n2 (Int.repr 32) then Some (Vint(Int.shl n1 n2)) else None + if Int.ltu n2 Int.iwordsize then Some (Vint(Int.shl n1 n2)) else None | _, _ => None end. @@ -261,13 +261,13 @@ Function sem_shr (v1: val) (t1: type) (v2: val) (t2: type): option val := | shr_case_I32unsi => match v1,v2 with | Vint n1, Vint n2 => - if Int.ltu n2 (Int.repr 32) then Some (Vint (Int.shru n1 n2)) else None + if Int.ltu n2 Int.iwordsize then Some (Vint (Int.shru n1 n2)) else None | _,_ => None end | shr_case_ii => match v1,v2 with | Vint n1, Vint n2 => - if Int.ltu n2 (Int.repr 32) then Some (Vint (Int.shr n1 n2)) else None + if Int.ltu n2 Int.iwordsize then Some (Vint (Int.shr n1 n2)) else None | _, _ => None end | shr_default=> |