aboutsummaryrefslogtreecommitdiffstats
path: root/riscV/Asmgen.v
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-01-14 23:07:49 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-01-14 23:07:49 +0100
commitb92d5a32c314eee0c68a70c33f1847545aabeb19 (patch)
treee18ebcbdf377d5e3dbd7ffe1224539309baa7086 /riscV/Asmgen.v
parentd7c9c729ba52ae926238ab97650104117e488c05 (diff)
downloadcompcert-kvx-b92d5a32c314eee0c68a70c33f1847545aabeb19.tar.gz
compcert-kvx-b92d5a32c314eee0c68a70c33f1847545aabeb19.zip
64-bit signed division by two code
Diffstat (limited to 'riscV/Asmgen.v')
-rw-r--r--riscV/Asmgen.v15
1 files changed, 10 insertions, 5 deletions
diff --git a/riscV/Asmgen.v b/riscV/Asmgen.v
index 5952aa82..ffc7992c 100644
--- a/riscV/Asmgen.v
+++ b/riscV/Asmgen.v
@@ -597,11 +597,16 @@ Definition transl_op
OK (Psrlil rd rs n :: k)
| Oshrxlimm n, a1 :: nil =>
do rd <- ireg_of res; do rs <- ireg_of a1;
- OK (if Int.eq n Int.zero then Pmv rd rs :: k else
- Psrail X31 rs (Int.repr 63) ::
- Psrlil X31 X31 (Int.sub Int64.iwordsize' n) ::
- Paddl X31 rs X31 ::
- Psrail rd X31 n :: k)
+ OK (if Int.eq n Int.zero
+ then Pmv rd rs :: k
+ else if Int.eq n Int.one
+ then Psrlil X31 rs (Int.repr 63) ::
+ Paddl X31 rs X31 ::
+ Psrail rd X31 Int.one :: k
+ else Psrail X31 rs (Int.repr 63) ::
+ Psrlil X31 X31 (Int.sub Int64.iwordsize' n) ::
+ Paddl X31 rs X31 ::
+ Psrail rd X31 n :: k)
| Onegf, a1 :: nil =>
do rd <- freg_of res; do rs <- freg_of a1;