Skip to content

Commit

Permalink
Better conversion to 32-bit for bedrock2
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGross committed Oct 15, 2019
1 parent 0c63685 commit 344e403
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Rewriter/Rules.v
Expand Up @@ -851,14 +851,16 @@ Section with_bitwidth.
; (forall xl xh offset,
0 < offset < bitwidth
-> doublewidth (cstZsingle_to_double xl xh >> singlewidth ('offset))
= cstZsingle_to_double
(Z.lor (singlewidth (singlewidth xl >> singlewidth ('offset)))
(singlewidth
(Z.truncating_shiftl
(singlewidth ('bitwidth))
(singlewidth xh)
(singlewidth ('(bitwidth - offset))))))
(singlewidth xh >> singlewidth ('offset)))
= (dlet l := singlewidth
(Z.lor (singlewidth (singlewidth xl >> singlewidth ('offset)))
(singlewidth
(Z.truncating_shiftl
(singlewidth ('bitwidth))
(singlewidth xh)
(singlewidth ('(bitwidth - offset)))))) in
dlet h := singlewidth
(singlewidth xh >> singlewidth ('offset)) in
cstZsingle_to_double l h))
]
].
End with_bitwidth.

0 comments on commit 344e403

Please sign in to comment.