diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-04-27 19:23:04 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-04-27 19:23:04 +0200 |
commit | 146bf43966f0d0c7a1587fc4d8dab58958d621fa (patch) | |
tree | b95de34ff87fcbd679056a744e915c3a31e4e25c /mppa_k1c/SelectOp.vp | |
parent | 28e66eb4b60c485bebb1e217bc8f50bdc2cc6ddb (diff) | |
download | compcert-kvx-146bf43966f0d0c7a1587fc4d8dab58958d621fa.tar.gz compcert-kvx-146bf43966f0d0c7a1587fc4d8dab58958d621fa.zip |
factor expressions into single file
Diffstat (limited to 'mppa_k1c/SelectOp.vp')
-rw-r--r-- | mppa_k1c/SelectOp.vp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mppa_k1c/SelectOp.vp b/mppa_k1c/SelectOp.vp index 6bb5ee56..aad6249a 100644 --- a/mppa_k1c/SelectOp.vp +++ b/mppa_k1c/SelectOp.vp @@ -51,6 +51,7 @@ Require Import Floats. Require Import Op. Require Import CminorSel. Require Import OpHelpers. +Require Import ExtValues. Local Open Scope cminorsel_scope. @@ -189,9 +190,7 @@ Nondetfunction shruimm (e1: expr) (n: int) := | Eop (Oshlimm n1) (t1:::Enil) => let stop := Z.sub Int.zwordsize (Z.add (Int.unsigned n1) Z.one) in let start := Z.sub (Z.add (Z.add (Int.unsigned n) stop) Z.one) Int.zwordsize in - if (Z.leb start stop) - && (Z.geb start Z.zero) - && (Z.ltb stop Int.zwordsize) + if is_bitfield stop start then Eop (Oextfz stop start) (t1:::Enil) else Eop (Oshruimm n) (e1:::Enil) | _ => @@ -213,9 +212,7 @@ Nondetfunction shrimm (e1: expr) (n: int) := | Eop (Oshlimm n1) (t1:::Enil) => let stop := Z.sub Int.zwordsize (Z.add (Int.unsigned n1) Z.one) in let start := Z.sub (Z.add (Z.add (Int.unsigned n) stop) Z.one) Int.zwordsize in - if (Z.leb start stop) - && (Z.geb start Z.zero) - && (Z.ltb stop Int.zwordsize) + if is_bitfield stop start then Eop (Oextfs stop start) (t1:::Enil) else Eop (Oshrimm n) (e1:::Enil) | _ => |