aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/powerpc
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2016-10-28 11:02:48 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2016-10-28 11:02:48 +0200
commit9f984867cd1b2959feb5fd11eaac55e0339a1e40 (patch)
treef445baced9c1e709e3b6447a407e203981d343a5 /runtime/powerpc
parent7d029e3037b64dca6224151ea143d23cd03a26cd (diff)
downloadcompcert-kvx-9f984867cd1b2959feb5fd11eaac55e0339a1e40.tar.gz
compcert-kvx-9f984867cd1b2959feb5fd11eaac55e0339a1e40.zip
powerpc/runtime: add comments
Diffstat (limited to 'runtime/powerpc')
-rw-r--r--runtime/powerpc/i64_smulh.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/powerpc/i64_smulh.s b/runtime/powerpc/i64_smulh.s
index 4dc97a48..f01855f3 100644
--- a/runtime/powerpc/i64_smulh.s
+++ b/runtime/powerpc/i64_smulh.s
@@ -62,7 +62,8 @@ __i64_smulh:
addc r8, r8, r0
mulhwu r0, r3, r5 # r0 = high half of XH.YH
adde r7, r7, r0
-# Test signs
+# Here r7:r8 contains the high 64 bits of the unsigned product.
+# Now, test signs and subtract if needed
srawi r0, r3, 31 # r0 = -1 if X < 0, r0 = 0 if X >= 0
srawi r9, r5, 31 # r9 = -1 if Y < 0, r9 = 0 if Y >= 0
and r3, r3, r9 # set X = 0 if Y >= 0