From ef40c6d36f1c3125f3aa78ea4eaa61dcc7bcae67 Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 19 Nov 2009 13:32:09 +0000 Subject: 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 --- cfrontend/Csem.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cfrontend/Csem.v') diff --git a/cfrontend/Csem.v b/cfrontend/Csem.v index ee13487..62e9dc7 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=> -- cgit v1.2.3