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/SelectLong.vp | |
parent | 28e66eb4b60c485bebb1e217bc8f50bdc2cc6ddb (diff) | |
download | compcert-kvx-146bf43966f0d0c7a1587fc4d8dab58958d621fa.tar.gz compcert-kvx-146bf43966f0d0c7a1587fc4d8dab58958d621fa.zip |
factor expressions into single file
Diffstat (limited to 'mppa_k1c/SelectLong.vp')
-rw-r--r-- | mppa_k1c/SelectLong.vp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mppa_k1c/SelectLong.vp b/mppa_k1c/SelectLong.vp index 90901e04..a2bc0587 100644 --- a/mppa_k1c/SelectLong.vp +++ b/mppa_k1c/SelectLong.vp @@ -23,6 +23,7 @@ Require Import AST Integers Floats. Require Import Op CminorSel. Require Import OpHelpers. Require Import SelectOp SplitLong. +Require Import ExtValues. Local Open Scope cminorsel_scope. Local Open Scope string_scope. @@ -158,9 +159,7 @@ Nondetfunction shrluimm (e1: expr) (n: int) := | Eop (Oshllimm n1) (t1:::Enil) => let stop := Z.sub Int64.zwordsize (Z.add (Int.unsigned n1) Z.one) in let start := Z.sub (Z.add (Z.add (Int.unsigned n) stop) Z.one) Int64.zwordsize in - if (Z.leb start stop) - && (Z.geb start Z.zero) - && (Z.ltb stop Int64.zwordsize) + if is_bitfieldl stop start then Eop (Oextfzl stop start) (t1:::Enil) else Eop (Oshrluimm n) (e1:::Enil) | _ => @@ -183,9 +182,7 @@ Nondetfunction shrlimm (e1: expr) (n: int) := | Eop (Oshllimm n1) (t1:::Enil) => let stop := Z.sub Int64.zwordsize (Z.add (Int.unsigned n1) Z.one) in let start := Z.sub (Z.add (Z.add (Int.unsigned n) stop) Z.one) Int64.zwordsize in - if (Z.leb start stop) - && (Z.geb start Z.zero) - && (Z.ltb stop Int64.zwordsize) + if is_bitfieldl stop start then Eop (Oextfsl stop start) (t1:::Enil) else Eop (Oshrlimm n) (e1:::Enil) | _ => |