aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/mathbits.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen/mathbits.go')
-rw-r--r--test/codegen/mathbits.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go
index a9cf466780..873354b838 100644
--- a/test/codegen/mathbits.go
+++ b/test/codegen/mathbits.go
@@ -6,7 +6,10 @@
package codegen
-import "math/bits"
+import (
+ "math/bits"
+ "unsafe"
+)
// ----------------------- //
// bits.LeadingZeros //
@@ -957,6 +960,17 @@ func Mul64LoOnly(x, y uint64) uint64 {
return lo
}
+func Mul64Const() (uint64, uint64) {
+ // 7133701809754865664 == 99<<56
+ // arm64:"MOVD\t[$]7133701809754865664, R1", "MOVD\t[$]88, R0"
+ return bits.Mul64(99+88<<8, 1<<56)
+}
+
+func MulUintOverflow(p *uint64) []uint64 {
+ // arm64:"CMP\t[$]72"
+ return unsafe.Slice(p, 9)
+}
+
// --------------- //
// bits.Div* //
// --------------- //