aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/powerpc/i64_smulh.s
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-10-28 11:05:39 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-10-28 11:05:39 +0200
commit3feee55c5fbd9274b2548625acb4b2cafdd94e56 (patch)
tree1502ed2e9b27f0bc9b95dc67c22a858afb6aa663 /runtime/powerpc/i64_smulh.s
parent263d68ee774a739f582357b5bf4c228d9da21fe0 (diff)
parent9f984867cd1b2959feb5fd11eaac55e0339a1e40 (diff)
downloadcompcert-3feee55c5fbd9274b2548625acb4b2cafdd94e56.tar.gz
compcert-3feee55c5fbd9274b2548625acb4b2cafdd94e56.zip
Merge branch 'master' of github.com:AbsInt/CompCert
Diffstat (limited to 'runtime/powerpc/i64_smulh.s')
-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