[dev.ssa] cmd/compile/internal/ssa: implement OHMUL

Adds support for high multiply which is used by the frontend when
rewriting const division.  The frontend currently only does this for 8,
16, and 32 bit integer arithmetic.

Change-Id: I9b6c6018f3be827a50ee6c185454ebc79b3094c8
Reviewed-on: https://go-review.googlesource.com/13696
Reviewed-by: Keith Randall <khr@golang.org>
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index 90b29b9..f2dd20b 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -779,6 +779,13 @@
 	opAndType{ODIV, TFLOAT32}: ssa.OpDiv32F,
 	opAndType{ODIV, TFLOAT64}: ssa.OpDiv64F,
 
+	opAndType{OHMUL, TINT8}:   ssa.OpHmul8,
+	opAndType{OHMUL, TUINT8}:  ssa.OpHmul8u,
+	opAndType{OHMUL, TINT16}:  ssa.OpHmul16,
+	opAndType{OHMUL, TUINT16}: ssa.OpHmul16u,
+	opAndType{OHMUL, TINT32}:  ssa.OpHmul32,
+	opAndType{OHMUL, TUINT32}: ssa.OpHmul32u,
+
 	opAndType{ODIV, TINT8}:   ssa.OpDiv8,
 	opAndType{ODIV, TUINT8}:  ssa.OpDiv8u,
 	opAndType{ODIV, TINT16}:  ssa.OpDiv16,
@@ -1201,7 +1208,7 @@
 		a := s.expr(n.Left)
 		b := s.expr(n.Right)
 		return s.newValue2(s.ssaOp(n.Op, n.Left.Type), Types[TBOOL], a, b)
-	case OADD, OAND, OMUL, OOR, OSUB, ODIV, OXOR:
+	case OADD, OAND, OMUL, OOR, OSUB, ODIV, OXOR, OHMUL:
 		a := s.expr(n.Left)
 		b := s.expr(n.Right)
 		return s.newValue2(s.ssaOp(n.Op, n.Type), a.Type, a, b)
@@ -2099,6 +2106,27 @@
 			j2.To.Val = Pc
 		}
 
+	case ssa.OpAMD64HMULL, ssa.OpAMD64HMULW, ssa.OpAMD64HMULB,
+		ssa.OpAMD64HMULLU, ssa.OpAMD64HMULWU, ssa.OpAMD64HMULBU:
+		// the frontend rewrites constant division by 8/16/32 bit integers into
+		// HMUL by a constant
+
+		// Arg[0] is already in AX as it's the only register we allow
+		// and DX is the only output we care about (the high bits)
+		p := Prog(v.Op.Asm())
+		p.From.Type = obj.TYPE_REG
+		p.From.Reg = regnum(v.Args[1])
+
+		// IMULB puts the high portion in AH instead of DL,
+		// so move it to DL for consistency
+		if v.Type.Size() == 1 {
+			m := Prog(x86.AMOVB)
+			m.From.Type = obj.TYPE_REG
+			m.From.Reg = x86.REG_AH
+			m.To.Type = obj.TYPE_REG
+			m.To.Reg = x86.REG_DX
+		}
+
 	case ssa.OpAMD64SHLQ, ssa.OpAMD64SHLL, ssa.OpAMD64SHLW, ssa.OpAMD64SHLB,
 		ssa.OpAMD64SHRQ, ssa.OpAMD64SHRL, ssa.OpAMD64SHRW, ssa.OpAMD64SHRB,
 		ssa.OpAMD64SARQ, ssa.OpAMD64SARL, ssa.OpAMD64SARW, ssa.OpAMD64SARB:
diff --git a/src/cmd/compile/internal/gc/ssa_test.go b/src/cmd/compile/internal/gc/ssa_test.go
index d4dfa5d..071522b 100644
--- a/src/cmd/compile/internal/gc/ssa_test.go
+++ b/src/cmd/compile/internal/gc/ssa_test.go
@@ -51,3 +51,6 @@
 
 // TestArithmeticBoundary tests boundary results for arithmetic operations.
 func TestArithmeticBoundary(t *testing.T) { runTest(t, "arithBoundary_ssa.go") }
+
+// TestArithmeticConst tests results for arithmetic operations against constants.
+func TestArithmeticConst(t *testing.T) { runTest(t, "arithConst_ssa.go") }
diff --git a/src/cmd/compile/internal/gc/testdata/arithConst_ssa.go b/src/cmd/compile/internal/gc/testdata/arithConst_ssa.go
new file mode 100644
index 0000000..93420ae
--- /dev/null
+++ b/src/cmd/compile/internal/gc/testdata/arithConst_ssa.go
@@ -0,0 +1,3979 @@
+package main
+
+import "fmt"
+
+func add_uint64_0_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_uint64_1_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_uint64_4294967296_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a + 4294967296
+}
+func add_4294967296_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 4294967296 + a
+}
+
+func add_uint64_18446744073709551615_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a + 18446744073709551615
+}
+func add_18446744073709551615_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 18446744073709551615 + a
+}
+
+func sub_uint64_0_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_uint64_1_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_uint64_4294967296_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a - 4294967296
+}
+func sub_4294967296_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 4294967296 - a
+}
+
+func sub_uint64_18446744073709551615_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a - 18446744073709551615
+}
+func sub_18446744073709551615_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 18446744073709551615 - a
+}
+
+func div_0_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_uint64_1_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_uint64_4294967296_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a / 4294967296
+}
+func div_4294967296_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 4294967296 / a
+}
+
+func div_uint64_18446744073709551615_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a / 18446744073709551615
+}
+func div_18446744073709551615_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 18446744073709551615 / a
+}
+
+func mul_uint64_0_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_uint64_1_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_uint64_4294967296_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a * 4294967296
+}
+func mul_4294967296_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 4294967296 * a
+}
+
+func mul_uint64_18446744073709551615_ssa(a uint64) uint64 {
+	switch {
+	}
+	return a * 18446744073709551615
+}
+func mul_18446744073709551615_uint64_ssa(a uint64) uint64 {
+	switch {
+	}
+	return 18446744073709551615 * a
+}
+
+func add_int64_Neg9223372036854775808_ssa(a int64) int64 {
+	switch {
+	}
+	return a + -9223372036854775808
+}
+func add_Neg9223372036854775808_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775808 + a
+}
+
+func add_int64_Neg9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a + -9223372036854775807
+}
+func add_Neg9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775807 + a
+}
+
+func add_int64_Neg4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a + -4294967296
+}
+func add_Neg4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -4294967296 + a
+}
+
+func add_int64_Neg1_ssa(a int64) int64 {
+	switch {
+	}
+	return a + -1
+}
+func add_Neg1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -1 + a
+}
+
+func add_int64_0_ssa(a int64) int64 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_int64_1_ssa(a int64) int64 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_int64_4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a + 4294967296
+}
+func add_4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 4294967296 + a
+}
+
+func add_int64_9223372036854775806_ssa(a int64) int64 {
+	switch {
+	}
+	return a + 9223372036854775806
+}
+func add_9223372036854775806_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775806 + a
+}
+
+func add_int64_9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a + 9223372036854775807
+}
+func add_9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775807 + a
+}
+
+func sub_int64_Neg9223372036854775808_ssa(a int64) int64 {
+	switch {
+	}
+	return a - -9223372036854775808
+}
+func sub_Neg9223372036854775808_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775808 - a
+}
+
+func sub_int64_Neg9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a - -9223372036854775807
+}
+func sub_Neg9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775807 - a
+}
+
+func sub_int64_Neg4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a - -4294967296
+}
+func sub_Neg4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -4294967296 - a
+}
+
+func sub_int64_Neg1_ssa(a int64) int64 {
+	switch {
+	}
+	return a - -1
+}
+func sub_Neg1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -1 - a
+}
+
+func sub_int64_0_ssa(a int64) int64 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_int64_1_ssa(a int64) int64 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_int64_4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a - 4294967296
+}
+func sub_4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 4294967296 - a
+}
+
+func sub_int64_9223372036854775806_ssa(a int64) int64 {
+	switch {
+	}
+	return a - 9223372036854775806
+}
+func sub_9223372036854775806_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775806 - a
+}
+
+func sub_int64_9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a - 9223372036854775807
+}
+func sub_9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775807 - a
+}
+
+func div_int64_Neg9223372036854775808_ssa(a int64) int64 {
+	switch {
+	}
+	return a / -9223372036854775808
+}
+func div_Neg9223372036854775808_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775808 / a
+}
+
+func div_int64_Neg9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a / -9223372036854775807
+}
+func div_Neg9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775807 / a
+}
+
+func div_int64_Neg4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a / -4294967296
+}
+func div_Neg4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -4294967296 / a
+}
+
+func div_int64_Neg1_ssa(a int64) int64 {
+	switch {
+	}
+	return a / -1
+}
+func div_Neg1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -1 / a
+}
+
+func div_0_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_int64_1_ssa(a int64) int64 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_int64_4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a / 4294967296
+}
+func div_4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 4294967296 / a
+}
+
+func div_int64_9223372036854775806_ssa(a int64) int64 {
+	switch {
+	}
+	return a / 9223372036854775806
+}
+func div_9223372036854775806_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775806 / a
+}
+
+func div_int64_9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a / 9223372036854775807
+}
+func div_9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775807 / a
+}
+
+func mul_int64_Neg9223372036854775808_ssa(a int64) int64 {
+	switch {
+	}
+	return a * -9223372036854775808
+}
+func mul_Neg9223372036854775808_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775808 * a
+}
+
+func mul_int64_Neg9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a * -9223372036854775807
+}
+func mul_Neg9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -9223372036854775807 * a
+}
+
+func mul_int64_Neg4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a * -4294967296
+}
+func mul_Neg4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -4294967296 * a
+}
+
+func mul_int64_Neg1_ssa(a int64) int64 {
+	switch {
+	}
+	return a * -1
+}
+func mul_Neg1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return -1 * a
+}
+
+func mul_int64_0_ssa(a int64) int64 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_int64_1_ssa(a int64) int64 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_int64_4294967296_ssa(a int64) int64 {
+	switch {
+	}
+	return a * 4294967296
+}
+func mul_4294967296_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 4294967296 * a
+}
+
+func mul_int64_9223372036854775806_ssa(a int64) int64 {
+	switch {
+	}
+	return a * 9223372036854775806
+}
+func mul_9223372036854775806_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775806 * a
+}
+
+func mul_int64_9223372036854775807_ssa(a int64) int64 {
+	switch {
+	}
+	return a * 9223372036854775807
+}
+func mul_9223372036854775807_int64_ssa(a int64) int64 {
+	switch {
+	}
+	return 9223372036854775807 * a
+}
+
+func add_uint32_0_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_uint32_1_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_uint32_4294967295_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a + 4294967295
+}
+func add_4294967295_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 4294967295 + a
+}
+
+func sub_uint32_0_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_uint32_1_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_uint32_4294967295_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a - 4294967295
+}
+func sub_4294967295_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 4294967295 - a
+}
+
+func div_0_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_uint32_1_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_uint32_4294967295_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a / 4294967295
+}
+func div_4294967295_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 4294967295 / a
+}
+
+func mul_uint32_0_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_uint32_1_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_uint32_4294967295_ssa(a uint32) uint32 {
+	switch {
+	}
+	return a * 4294967295
+}
+func mul_4294967295_uint32_ssa(a uint32) uint32 {
+	switch {
+	}
+	return 4294967295 * a
+}
+
+func add_int32_Neg2147483648_ssa(a int32) int32 {
+	switch {
+	}
+	return a + -2147483648
+}
+func add_Neg2147483648_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483648 + a
+}
+
+func add_int32_Neg2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a + -2147483647
+}
+func add_Neg2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483647 + a
+}
+
+func add_int32_Neg1_ssa(a int32) int32 {
+	switch {
+	}
+	return a + -1
+}
+func add_Neg1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -1 + a
+}
+
+func add_int32_0_ssa(a int32) int32 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_int32_1_ssa(a int32) int32 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_int32_2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a + 2147483647
+}
+func add_2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 2147483647 + a
+}
+
+func sub_int32_Neg2147483648_ssa(a int32) int32 {
+	switch {
+	}
+	return a - -2147483648
+}
+func sub_Neg2147483648_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483648 - a
+}
+
+func sub_int32_Neg2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a - -2147483647
+}
+func sub_Neg2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483647 - a
+}
+
+func sub_int32_Neg1_ssa(a int32) int32 {
+	switch {
+	}
+	return a - -1
+}
+func sub_Neg1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -1 - a
+}
+
+func sub_int32_0_ssa(a int32) int32 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_int32_1_ssa(a int32) int32 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_int32_2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a - 2147483647
+}
+func sub_2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 2147483647 - a
+}
+
+func div_int32_Neg2147483648_ssa(a int32) int32 {
+	switch {
+	}
+	return a / -2147483648
+}
+func div_Neg2147483648_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483648 / a
+}
+
+func div_int32_Neg2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a / -2147483647
+}
+func div_Neg2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483647 / a
+}
+
+func div_int32_Neg1_ssa(a int32) int32 {
+	switch {
+	}
+	return a / -1
+}
+func div_Neg1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -1 / a
+}
+
+func div_0_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_int32_1_ssa(a int32) int32 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_int32_2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a / 2147483647
+}
+func div_2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 2147483647 / a
+}
+
+func mul_int32_Neg2147483648_ssa(a int32) int32 {
+	switch {
+	}
+	return a * -2147483648
+}
+func mul_Neg2147483648_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483648 * a
+}
+
+func mul_int32_Neg2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a * -2147483647
+}
+func mul_Neg2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -2147483647 * a
+}
+
+func mul_int32_Neg1_ssa(a int32) int32 {
+	switch {
+	}
+	return a * -1
+}
+func mul_Neg1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return -1 * a
+}
+
+func mul_int32_0_ssa(a int32) int32 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_int32_1_ssa(a int32) int32 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_int32_2147483647_ssa(a int32) int32 {
+	switch {
+	}
+	return a * 2147483647
+}
+func mul_2147483647_int32_ssa(a int32) int32 {
+	switch {
+	}
+	return 2147483647 * a
+}
+
+func add_uint16_0_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_uint16_1_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_uint16_65535_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a + 65535
+}
+func add_65535_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 65535 + a
+}
+
+func sub_uint16_0_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_uint16_1_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_uint16_65535_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a - 65535
+}
+func sub_65535_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 65535 - a
+}
+
+func div_0_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_uint16_1_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_uint16_65535_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a / 65535
+}
+func div_65535_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 65535 / a
+}
+
+func mul_uint16_0_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_uint16_1_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_uint16_65535_ssa(a uint16) uint16 {
+	switch {
+	}
+	return a * 65535
+}
+func mul_65535_uint16_ssa(a uint16) uint16 {
+	switch {
+	}
+	return 65535 * a
+}
+
+func add_int16_Neg32768_ssa(a int16) int16 {
+	switch {
+	}
+	return a + -32768
+}
+func add_Neg32768_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32768 + a
+}
+
+func add_int16_Neg32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a + -32767
+}
+func add_Neg32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32767 + a
+}
+
+func add_int16_Neg1_ssa(a int16) int16 {
+	switch {
+	}
+	return a + -1
+}
+func add_Neg1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -1 + a
+}
+
+func add_int16_0_ssa(a int16) int16 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_int16_1_ssa(a int16) int16 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_int16_32766_ssa(a int16) int16 {
+	switch {
+	}
+	return a + 32766
+}
+func add_32766_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32766 + a
+}
+
+func add_int16_32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a + 32767
+}
+func add_32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32767 + a
+}
+
+func sub_int16_Neg32768_ssa(a int16) int16 {
+	switch {
+	}
+	return a - -32768
+}
+func sub_Neg32768_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32768 - a
+}
+
+func sub_int16_Neg32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a - -32767
+}
+func sub_Neg32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32767 - a
+}
+
+func sub_int16_Neg1_ssa(a int16) int16 {
+	switch {
+	}
+	return a - -1
+}
+func sub_Neg1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -1 - a
+}
+
+func sub_int16_0_ssa(a int16) int16 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_int16_1_ssa(a int16) int16 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_int16_32766_ssa(a int16) int16 {
+	switch {
+	}
+	return a - 32766
+}
+func sub_32766_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32766 - a
+}
+
+func sub_int16_32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a - 32767
+}
+func sub_32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32767 - a
+}
+
+func div_int16_Neg32768_ssa(a int16) int16 {
+	switch {
+	}
+	return a / -32768
+}
+func div_Neg32768_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32768 / a
+}
+
+func div_int16_Neg32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a / -32767
+}
+func div_Neg32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32767 / a
+}
+
+func div_int16_Neg1_ssa(a int16) int16 {
+	switch {
+	}
+	return a / -1
+}
+func div_Neg1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -1 / a
+}
+
+func div_0_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_int16_1_ssa(a int16) int16 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_int16_32766_ssa(a int16) int16 {
+	switch {
+	}
+	return a / 32766
+}
+func div_32766_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32766 / a
+}
+
+func div_int16_32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a / 32767
+}
+func div_32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32767 / a
+}
+
+func mul_int16_Neg32768_ssa(a int16) int16 {
+	switch {
+	}
+	return a * -32768
+}
+func mul_Neg32768_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32768 * a
+}
+
+func mul_int16_Neg32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a * -32767
+}
+func mul_Neg32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -32767 * a
+}
+
+func mul_int16_Neg1_ssa(a int16) int16 {
+	switch {
+	}
+	return a * -1
+}
+func mul_Neg1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return -1 * a
+}
+
+func mul_int16_0_ssa(a int16) int16 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_int16_1_ssa(a int16) int16 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_int16_32766_ssa(a int16) int16 {
+	switch {
+	}
+	return a * 32766
+}
+func mul_32766_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32766 * a
+}
+
+func mul_int16_32767_ssa(a int16) int16 {
+	switch {
+	}
+	return a * 32767
+}
+func mul_32767_int16_ssa(a int16) int16 {
+	switch {
+	}
+	return 32767 * a
+}
+
+func add_uint8_0_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_uint8_1_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_uint8_255_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a + 255
+}
+func add_255_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 255 + a
+}
+
+func sub_uint8_0_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_uint8_1_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_uint8_255_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a - 255
+}
+func sub_255_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 255 - a
+}
+
+func div_0_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_uint8_1_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_uint8_255_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a / 255
+}
+func div_255_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 255 / a
+}
+
+func mul_uint8_0_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_uint8_1_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_uint8_255_ssa(a uint8) uint8 {
+	switch {
+	}
+	return a * 255
+}
+func mul_255_uint8_ssa(a uint8) uint8 {
+	switch {
+	}
+	return 255 * a
+}
+
+func add_int8_Neg128_ssa(a int8) int8 {
+	switch {
+	}
+	return a + -128
+}
+func add_Neg128_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -128 + a
+}
+
+func add_int8_Neg127_ssa(a int8) int8 {
+	switch {
+	}
+	return a + -127
+}
+func add_Neg127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -127 + a
+}
+
+func add_int8_Neg1_ssa(a int8) int8 {
+	switch {
+	}
+	return a + -1
+}
+func add_Neg1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -1 + a
+}
+
+func add_int8_0_ssa(a int8) int8 {
+	switch {
+	}
+	return a + 0
+}
+func add_0_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 0 + a
+}
+
+func add_int8_1_ssa(a int8) int8 {
+	switch {
+	}
+	return a + 1
+}
+func add_1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 1 + a
+}
+
+func add_int8_126_ssa(a int8) int8 {
+	switch {
+	}
+	return a + 126
+}
+func add_126_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 126 + a
+}
+
+func add_int8_127_ssa(a int8) int8 {
+	switch {
+	}
+	return a + 127
+}
+func add_127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 127 + a
+}
+
+func sub_int8_Neg128_ssa(a int8) int8 {
+	switch {
+	}
+	return a - -128
+}
+func sub_Neg128_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -128 - a
+}
+
+func sub_int8_Neg127_ssa(a int8) int8 {
+	switch {
+	}
+	return a - -127
+}
+func sub_Neg127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -127 - a
+}
+
+func sub_int8_Neg1_ssa(a int8) int8 {
+	switch {
+	}
+	return a - -1
+}
+func sub_Neg1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -1 - a
+}
+
+func sub_int8_0_ssa(a int8) int8 {
+	switch {
+	}
+	return a - 0
+}
+func sub_0_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 0 - a
+}
+
+func sub_int8_1_ssa(a int8) int8 {
+	switch {
+	}
+	return a - 1
+}
+func sub_1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 1 - a
+}
+
+func sub_int8_126_ssa(a int8) int8 {
+	switch {
+	}
+	return a - 126
+}
+func sub_126_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 126 - a
+}
+
+func sub_int8_127_ssa(a int8) int8 {
+	switch {
+	}
+	return a - 127
+}
+func sub_127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 127 - a
+}
+
+func div_int8_Neg128_ssa(a int8) int8 {
+	switch {
+	}
+	return a / -128
+}
+func div_Neg128_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -128 / a
+}
+
+func div_int8_Neg127_ssa(a int8) int8 {
+	switch {
+	}
+	return a / -127
+}
+func div_Neg127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -127 / a
+}
+
+func div_int8_Neg1_ssa(a int8) int8 {
+	switch {
+	}
+	return a / -1
+}
+func div_Neg1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -1 / a
+}
+
+func div_0_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 0 / a
+}
+
+func div_int8_1_ssa(a int8) int8 {
+	switch {
+	}
+	return a / 1
+}
+func div_1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 1 / a
+}
+
+func div_int8_126_ssa(a int8) int8 {
+	switch {
+	}
+	return a / 126
+}
+func div_126_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 126 / a
+}
+
+func div_int8_127_ssa(a int8) int8 {
+	switch {
+	}
+	return a / 127
+}
+func div_127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 127 / a
+}
+
+func mul_int8_Neg128_ssa(a int8) int8 {
+	switch {
+	}
+	return a * -128
+}
+func mul_Neg128_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -128 * a
+}
+
+func mul_int8_Neg127_ssa(a int8) int8 {
+	switch {
+	}
+	return a * -127
+}
+func mul_Neg127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -127 * a
+}
+
+func mul_int8_Neg1_ssa(a int8) int8 {
+	switch {
+	}
+	return a * -1
+}
+func mul_Neg1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return -1 * a
+}
+
+func mul_int8_0_ssa(a int8) int8 {
+	switch {
+	}
+	return a * 0
+}
+func mul_0_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 0 * a
+}
+
+func mul_int8_1_ssa(a int8) int8 {
+	switch {
+	}
+	return a * 1
+}
+func mul_1_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 1 * a
+}
+
+func mul_int8_126_ssa(a int8) int8 {
+	switch {
+	}
+	return a * 126
+}
+func mul_126_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 126 * a
+}
+
+func mul_int8_127_ssa(a int8) int8 {
+	switch {
+	}
+	return a * 127
+}
+func mul_127_int8_ssa(a int8) int8 {
+	switch {
+	}
+	return 127 * a
+}
+
+var failed bool
+
+func main() {
+
+	if got := div_0_uint64_ssa(1); got != 0 {
+		fmt.Printf("div_uint64 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint64_ssa(4294967296); got != 0 {
+		fmt.Printf("div_uint64 0/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint64_ssa(18446744073709551615); got != 0 {
+		fmt.Printf("div_uint64 0/18446744073709551615 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_1_ssa(0); got != 0 {
+		fmt.Printf("div_uint64 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint64_ssa(1); got != 1 {
+		fmt.Printf("div_uint64 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_1_ssa(1); got != 1 {
+		fmt.Printf("div_uint64 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint64_ssa(4294967296); got != 0 {
+		fmt.Printf("div_uint64 1/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_1_ssa(4294967296); got != 4294967296 {
+		fmt.Printf("div_uint64 4294967296/1 = %d, wanted 4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint64_ssa(18446744073709551615); got != 0 {
+		fmt.Printf("div_uint64 1/18446744073709551615 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_1_ssa(18446744073709551615); got != 18446744073709551615 {
+		fmt.Printf("div_uint64 18446744073709551615/1 = %d, wanted 18446744073709551615\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_4294967296_ssa(0); got != 0 {
+		fmt.Printf("div_uint64 0/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_uint64_ssa(1); got != 4294967296 {
+		fmt.Printf("div_uint64 4294967296/1 = %d, wanted 4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_4294967296_ssa(1); got != 0 {
+		fmt.Printf("div_uint64 1/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_uint64_ssa(4294967296); got != 1 {
+		fmt.Printf("div_uint64 4294967296/4294967296 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_4294967296_ssa(4294967296); got != 1 {
+		fmt.Printf("div_uint64 4294967296/4294967296 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_uint64_ssa(18446744073709551615); got != 0 {
+		fmt.Printf("div_uint64 4294967296/18446744073709551615 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_4294967296_ssa(18446744073709551615); got != 4294967295 {
+		fmt.Printf("div_uint64 18446744073709551615/4294967296 = %d, wanted 4294967295\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_18446744073709551615_ssa(0); got != 0 {
+		fmt.Printf("div_uint64 0/18446744073709551615 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_18446744073709551615_uint64_ssa(1); got != 18446744073709551615 {
+		fmt.Printf("div_uint64 18446744073709551615/1 = %d, wanted 18446744073709551615\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_18446744073709551615_ssa(1); got != 0 {
+		fmt.Printf("div_uint64 1/18446744073709551615 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_18446744073709551615_uint64_ssa(4294967296); got != 4294967295 {
+		fmt.Printf("div_uint64 18446744073709551615/4294967296 = %d, wanted 4294967295\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_18446744073709551615_ssa(4294967296); got != 0 {
+		fmt.Printf("div_uint64 4294967296/18446744073709551615 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_18446744073709551615_uint64_ssa(18446744073709551615); got != 1 {
+		fmt.Printf("div_uint64 18446744073709551615/18446744073709551615 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint64_18446744073709551615_ssa(18446744073709551615); got != 1 {
+		fmt.Printf("div_uint64 18446744073709551615/18446744073709551615 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(-9223372036854775808); got != 1 {
+		fmt.Printf("div_int64 -9223372036854775808/-9223372036854775808 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(-9223372036854775808); got != 1 {
+		fmt.Printf("div_int64 -9223372036854775808/-9223372036854775808 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(-9223372036854775807); got != 1 {
+		fmt.Printf("div_int64 -9223372036854775808/-9223372036854775807 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 -9223372036854775807/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(-4294967296); got != 2147483648 {
+		fmt.Printf("div_int64 -9223372036854775808/-4294967296 = %d, wanted 2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 -4294967296/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(-1); got != -9223372036854775808 {
+		fmt.Printf("div_int64 -9223372036854775808/-1 = %d, wanted -9223372036854775808\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 -1/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(1); got != -9223372036854775808 {
+		fmt.Printf("div_int64 -9223372036854775808/1 = %d, wanted -9223372036854775808\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(1); got != 0 {
+		fmt.Printf("div_int64 1/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(4294967296); got != -2147483648 {
+		fmt.Printf("div_int64 -9223372036854775808/4294967296 = %d, wanted -2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 4294967296/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(9223372036854775806); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775808/9223372036854775806 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 9223372036854775806/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775808_int64_ssa(9223372036854775807); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775808/9223372036854775807 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775808_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 9223372036854775807/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 -9223372036854775807/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(-9223372036854775808); got != 1 {
+		fmt.Printf("div_int64 -9223372036854775808/-9223372036854775807 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(-9223372036854775807); got != 1 {
+		fmt.Printf("div_int64 -9223372036854775807/-9223372036854775807 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(-9223372036854775807); got != 1 {
+		fmt.Printf("div_int64 -9223372036854775807/-9223372036854775807 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(-4294967296); got != 2147483647 {
+		fmt.Printf("div_int64 -9223372036854775807/-4294967296 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 -4294967296/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(-1); got != 9223372036854775807 {
+		fmt.Printf("div_int64 -9223372036854775807/-1 = %d, wanted 9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 -1/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(1); got != -9223372036854775807 {
+		fmt.Printf("div_int64 -9223372036854775807/1 = %d, wanted -9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(1); got != 0 {
+		fmt.Printf("div_int64 1/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(4294967296); got != -2147483647 {
+		fmt.Printf("div_int64 -9223372036854775807/4294967296 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 4294967296/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(9223372036854775806); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775807/9223372036854775806 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 9223372036854775806/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg9223372036854775807_int64_ssa(9223372036854775807); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775807/9223372036854775807 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg9223372036854775807_ssa(9223372036854775807); got != -1 {
+		fmt.Printf("div_int64 9223372036854775807/-9223372036854775807 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 -4294967296/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(-9223372036854775808); got != 2147483648 {
+		fmt.Printf("div_int64 -9223372036854775808/-4294967296 = %d, wanted 2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 -4294967296/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(-9223372036854775807); got != 2147483647 {
+		fmt.Printf("div_int64 -9223372036854775807/-4294967296 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(-4294967296); got != 1 {
+		fmt.Printf("div_int64 -4294967296/-4294967296 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(-4294967296); got != 1 {
+		fmt.Printf("div_int64 -4294967296/-4294967296 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(-1); got != 4294967296 {
+		fmt.Printf("div_int64 -4294967296/-1 = %d, wanted 4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 -1/-4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/-4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(1); got != -4294967296 {
+		fmt.Printf("div_int64 -4294967296/1 = %d, wanted -4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(1); got != 0 {
+		fmt.Printf("div_int64 1/-4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(4294967296); got != -1 {
+		fmt.Printf("div_int64 -4294967296/4294967296 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(4294967296); got != -1 {
+		fmt.Printf("div_int64 4294967296/-4294967296 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 -4294967296/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(9223372036854775806); got != -2147483647 {
+		fmt.Printf("div_int64 9223372036854775806/-4294967296 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_Neg4294967296_int64_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 -4294967296/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg4294967296_ssa(9223372036854775807); got != -2147483647 {
+		fmt.Printf("div_int64 9223372036854775807/-4294967296 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 -1/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(-9223372036854775808); got != -9223372036854775808 {
+		fmt.Printf("div_int64 -9223372036854775808/-1 = %d, wanted -9223372036854775808\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 -1/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(-9223372036854775807); got != 9223372036854775807 {
+		fmt.Printf("div_int64 -9223372036854775807/-1 = %d, wanted 9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 -1/-4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(-4294967296); got != 4294967296 {
+		fmt.Printf("div_int64 -4294967296/-1 = %d, wanted 4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(-1); got != 1 {
+		fmt.Printf("div_int64 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(-1); got != 1 {
+		fmt.Printf("div_int64 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(1); got != -1 {
+		fmt.Printf("div_int64 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(1); got != -1 {
+		fmt.Printf("div_int64 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 -1/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(4294967296); got != -4294967296 {
+		fmt.Printf("div_int64 4294967296/-1 = %d, wanted -4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 -1/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(9223372036854775806); got != -9223372036854775806 {
+		fmt.Printf("div_int64 9223372036854775806/-1 = %d, wanted -9223372036854775806\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int64_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 -1/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_Neg1_ssa(9223372036854775807); got != -9223372036854775807 {
+		fmt.Printf("div_int64 9223372036854775807/-1 = %d, wanted -9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 0/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 0/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 0/-4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(1); got != 0 {
+		fmt.Printf("div_int64 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 0/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 0/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int64_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 0/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 1/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(-9223372036854775808); got != -9223372036854775808 {
+		fmt.Printf("div_int64 -9223372036854775808/1 = %d, wanted -9223372036854775808\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 1/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(-9223372036854775807); got != -9223372036854775807 {
+		fmt.Printf("div_int64 -9223372036854775807/1 = %d, wanted -9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 1/-4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(-4294967296); got != -4294967296 {
+		fmt.Printf("div_int64 -4294967296/1 = %d, wanted -4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(-1); got != -1 {
+		fmt.Printf("div_int64 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(-1); got != -1 {
+		fmt.Printf("div_int64 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(1); got != 1 {
+		fmt.Printf("div_int64 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(1); got != 1 {
+		fmt.Printf("div_int64 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 1/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(4294967296); got != 4294967296 {
+		fmt.Printf("div_int64 4294967296/1 = %d, wanted 4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 1/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(9223372036854775806); got != 9223372036854775806 {
+		fmt.Printf("div_int64 9223372036854775806/1 = %d, wanted 9223372036854775806\n", got)
+		failed = true
+	}
+
+	if got := div_1_int64_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 1/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_1_ssa(9223372036854775807); got != 9223372036854775807 {
+		fmt.Printf("div_int64 9223372036854775807/1 = %d, wanted 9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 4294967296/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(-9223372036854775808); got != -2147483648 {
+		fmt.Printf("div_int64 -9223372036854775808/4294967296 = %d, wanted -2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 4294967296/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(-9223372036854775807); got != -2147483647 {
+		fmt.Printf("div_int64 -9223372036854775807/4294967296 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(-4294967296); got != -1 {
+		fmt.Printf("div_int64 4294967296/-4294967296 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(-4294967296); got != -1 {
+		fmt.Printf("div_int64 -4294967296/4294967296 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(-1); got != -4294967296 {
+		fmt.Printf("div_int64 4294967296/-1 = %d, wanted -4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 -1/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(1); got != 4294967296 {
+		fmt.Printf("div_int64 4294967296/1 = %d, wanted 4294967296\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(1); got != 0 {
+		fmt.Printf("div_int64 1/4294967296 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(4294967296); got != 1 {
+		fmt.Printf("div_int64 4294967296/4294967296 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(4294967296); got != 1 {
+		fmt.Printf("div_int64 4294967296/4294967296 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 4294967296/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(9223372036854775806); got != 2147483647 {
+		fmt.Printf("div_int64 9223372036854775806/4294967296 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_4294967296_int64_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 4294967296/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_4294967296_ssa(9223372036854775807); got != 2147483647 {
+		fmt.Printf("div_int64 9223372036854775807/4294967296 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 9223372036854775806/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(-9223372036854775808); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775808/9223372036854775806 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(-9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 9223372036854775806/-9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(-9223372036854775807); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775807/9223372036854775806 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(-4294967296); got != -2147483647 {
+		fmt.Printf("div_int64 9223372036854775806/-4294967296 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 -4294967296/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(-1); got != -9223372036854775806 {
+		fmt.Printf("div_int64 9223372036854775806/-1 = %d, wanted -9223372036854775806\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 -1/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(1); got != 9223372036854775806 {
+		fmt.Printf("div_int64 9223372036854775806/1 = %d, wanted 9223372036854775806\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(1); got != 0 {
+		fmt.Printf("div_int64 1/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(4294967296); got != 2147483647 {
+		fmt.Printf("div_int64 9223372036854775806/4294967296 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 4294967296/9223372036854775806 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(9223372036854775806); got != 1 {
+		fmt.Printf("div_int64 9223372036854775806/9223372036854775806 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(9223372036854775806); got != 1 {
+		fmt.Printf("div_int64 9223372036854775806/9223372036854775806 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775806_int64_ssa(9223372036854775807); got != 0 {
+		fmt.Printf("div_int64 9223372036854775806/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775806_ssa(9223372036854775807); got != 1 {
+		fmt.Printf("div_int64 9223372036854775807/9223372036854775806 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(-9223372036854775808); got != 0 {
+		fmt.Printf("div_int64 9223372036854775807/-9223372036854775808 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(-9223372036854775808); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775808/9223372036854775807 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(-9223372036854775807); got != -1 {
+		fmt.Printf("div_int64 9223372036854775807/-9223372036854775807 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(-9223372036854775807); got != -1 {
+		fmt.Printf("div_int64 -9223372036854775807/9223372036854775807 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(-4294967296); got != -2147483647 {
+		fmt.Printf("div_int64 9223372036854775807/-4294967296 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(-4294967296); got != 0 {
+		fmt.Printf("div_int64 -4294967296/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(-1); got != -9223372036854775807 {
+		fmt.Printf("div_int64 9223372036854775807/-1 = %d, wanted -9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(-1); got != 0 {
+		fmt.Printf("div_int64 -1/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(0); got != 0 {
+		fmt.Printf("div_int64 0/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(1); got != 9223372036854775807 {
+		fmt.Printf("div_int64 9223372036854775807/1 = %d, wanted 9223372036854775807\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(1); got != 0 {
+		fmt.Printf("div_int64 1/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(4294967296); got != 2147483647 {
+		fmt.Printf("div_int64 9223372036854775807/4294967296 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(4294967296); got != 0 {
+		fmt.Printf("div_int64 4294967296/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(9223372036854775806); got != 1 {
+		fmt.Printf("div_int64 9223372036854775807/9223372036854775806 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(9223372036854775806); got != 0 {
+		fmt.Printf("div_int64 9223372036854775806/9223372036854775807 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_9223372036854775807_int64_ssa(9223372036854775807); got != 1 {
+		fmt.Printf("div_int64 9223372036854775807/9223372036854775807 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int64_9223372036854775807_ssa(9223372036854775807); got != 1 {
+		fmt.Printf("div_int64 9223372036854775807/9223372036854775807 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint32_ssa(1); got != 0 {
+		fmt.Printf("div_uint32 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint32_ssa(4294967295); got != 0 {
+		fmt.Printf("div_uint32 0/4294967295 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint32_1_ssa(0); got != 0 {
+		fmt.Printf("div_uint32 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint32_ssa(1); got != 1 {
+		fmt.Printf("div_uint32 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint32_1_ssa(1); got != 1 {
+		fmt.Printf("div_uint32 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint32_ssa(4294967295); got != 0 {
+		fmt.Printf("div_uint32 1/4294967295 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint32_1_ssa(4294967295); got != 4294967295 {
+		fmt.Printf("div_uint32 4294967295/1 = %d, wanted 4294967295\n", got)
+		failed = true
+	}
+
+	if got := div_uint32_4294967295_ssa(0); got != 0 {
+		fmt.Printf("div_uint32 0/4294967295 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_4294967295_uint32_ssa(1); got != 4294967295 {
+		fmt.Printf("div_uint32 4294967295/1 = %d, wanted 4294967295\n", got)
+		failed = true
+	}
+
+	if got := div_uint32_4294967295_ssa(1); got != 0 {
+		fmt.Printf("div_uint32 1/4294967295 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_4294967295_uint32_ssa(4294967295); got != 1 {
+		fmt.Printf("div_uint32 4294967295/4294967295 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint32_4294967295_ssa(4294967295); got != 1 {
+		fmt.Printf("div_uint32 4294967295/4294967295 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483648_int32_ssa(-2147483648); got != 1 {
+		fmt.Printf("div_int32 -2147483648/-2147483648 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483648_ssa(-2147483648); got != 1 {
+		fmt.Printf("div_int32 -2147483648/-2147483648 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483648_int32_ssa(-2147483647); got != 1 {
+		fmt.Printf("div_int32 -2147483648/-2147483647 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483648_ssa(-2147483647); got != 0 {
+		fmt.Printf("div_int32 -2147483647/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483648_int32_ssa(-1); got != -2147483648 {
+		fmt.Printf("div_int32 -2147483648/-1 = %d, wanted -2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483648_ssa(-1); got != 0 {
+		fmt.Printf("div_int32 -1/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483648_ssa(0); got != 0 {
+		fmt.Printf("div_int32 0/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483648_int32_ssa(1); got != -2147483648 {
+		fmt.Printf("div_int32 -2147483648/1 = %d, wanted -2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483648_ssa(1); got != 0 {
+		fmt.Printf("div_int32 1/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483648_int32_ssa(2147483647); got != -1 {
+		fmt.Printf("div_int32 -2147483648/2147483647 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483648_ssa(2147483647); got != 0 {
+		fmt.Printf("div_int32 2147483647/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483647_int32_ssa(-2147483648); got != 0 {
+		fmt.Printf("div_int32 -2147483647/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483647_ssa(-2147483648); got != 1 {
+		fmt.Printf("div_int32 -2147483648/-2147483647 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483647_int32_ssa(-2147483647); got != 1 {
+		fmt.Printf("div_int32 -2147483647/-2147483647 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483647_ssa(-2147483647); got != 1 {
+		fmt.Printf("div_int32 -2147483647/-2147483647 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483647_int32_ssa(-1); got != 2147483647 {
+		fmt.Printf("div_int32 -2147483647/-1 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483647_ssa(-1); got != 0 {
+		fmt.Printf("div_int32 -1/-2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483647_ssa(0); got != 0 {
+		fmt.Printf("div_int32 0/-2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483647_int32_ssa(1); got != -2147483647 {
+		fmt.Printf("div_int32 -2147483647/1 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483647_ssa(1); got != 0 {
+		fmt.Printf("div_int32 1/-2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg2147483647_int32_ssa(2147483647); got != -1 {
+		fmt.Printf("div_int32 -2147483647/2147483647 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg2147483647_ssa(2147483647); got != -1 {
+		fmt.Printf("div_int32 2147483647/-2147483647 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int32_ssa(-2147483648); got != 0 {
+		fmt.Printf("div_int32 -1/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg1_ssa(-2147483648); got != -2147483648 {
+		fmt.Printf("div_int32 -2147483648/-1 = %d, wanted -2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int32_ssa(-2147483647); got != 0 {
+		fmt.Printf("div_int32 -1/-2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg1_ssa(-2147483647); got != 2147483647 {
+		fmt.Printf("div_int32 -2147483647/-1 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int32_ssa(-1); got != 1 {
+		fmt.Printf("div_int32 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg1_ssa(-1); got != 1 {
+		fmt.Printf("div_int32 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg1_ssa(0); got != 0 {
+		fmt.Printf("div_int32 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int32_ssa(1); got != -1 {
+		fmt.Printf("div_int32 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg1_ssa(1); got != -1 {
+		fmt.Printf("div_int32 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int32_ssa(2147483647); got != 0 {
+		fmt.Printf("div_int32 -1/2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_Neg1_ssa(2147483647); got != -2147483647 {
+		fmt.Printf("div_int32 2147483647/-1 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_0_int32_ssa(-2147483648); got != 0 {
+		fmt.Printf("div_int32 0/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int32_ssa(-2147483647); got != 0 {
+		fmt.Printf("div_int32 0/-2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int32_ssa(-1); got != 0 {
+		fmt.Printf("div_int32 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int32_ssa(1); got != 0 {
+		fmt.Printf("div_int32 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int32_ssa(2147483647); got != 0 {
+		fmt.Printf("div_int32 0/2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int32_ssa(-2147483648); got != 0 {
+		fmt.Printf("div_int32 1/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_1_ssa(-2147483648); got != -2147483648 {
+		fmt.Printf("div_int32 -2147483648/1 = %d, wanted -2147483648\n", got)
+		failed = true
+	}
+
+	if got := div_1_int32_ssa(-2147483647); got != 0 {
+		fmt.Printf("div_int32 1/-2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_1_ssa(-2147483647); got != -2147483647 {
+		fmt.Printf("div_int32 -2147483647/1 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_1_int32_ssa(-1); got != -1 {
+		fmt.Printf("div_int32 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_1_ssa(-1); got != -1 {
+		fmt.Printf("div_int32 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_1_ssa(0); got != 0 {
+		fmt.Printf("div_int32 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int32_ssa(1); got != 1 {
+		fmt.Printf("div_int32 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_1_ssa(1); got != 1 {
+		fmt.Printf("div_int32 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_int32_ssa(2147483647); got != 0 {
+		fmt.Printf("div_int32 1/2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_1_ssa(2147483647); got != 2147483647 {
+		fmt.Printf("div_int32 2147483647/1 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_2147483647_int32_ssa(-2147483648); got != 0 {
+		fmt.Printf("div_int32 2147483647/-2147483648 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_2147483647_ssa(-2147483648); got != -1 {
+		fmt.Printf("div_int32 -2147483648/2147483647 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_2147483647_int32_ssa(-2147483647); got != -1 {
+		fmt.Printf("div_int32 2147483647/-2147483647 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_2147483647_ssa(-2147483647); got != -1 {
+		fmt.Printf("div_int32 -2147483647/2147483647 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_2147483647_int32_ssa(-1); got != -2147483647 {
+		fmt.Printf("div_int32 2147483647/-1 = %d, wanted -2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int32_2147483647_ssa(-1); got != 0 {
+		fmt.Printf("div_int32 -1/2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int32_2147483647_ssa(0); got != 0 {
+		fmt.Printf("div_int32 0/2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_2147483647_int32_ssa(1); got != 2147483647 {
+		fmt.Printf("div_int32 2147483647/1 = %d, wanted 2147483647\n", got)
+		failed = true
+	}
+
+	if got := div_int32_2147483647_ssa(1); got != 0 {
+		fmt.Printf("div_int32 1/2147483647 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_2147483647_int32_ssa(2147483647); got != 1 {
+		fmt.Printf("div_int32 2147483647/2147483647 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int32_2147483647_ssa(2147483647); got != 1 {
+		fmt.Printf("div_int32 2147483647/2147483647 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint16_ssa(1); got != 0 {
+		fmt.Printf("div_uint16 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint16_ssa(65535); got != 0 {
+		fmt.Printf("div_uint16 0/65535 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint16_1_ssa(0); got != 0 {
+		fmt.Printf("div_uint16 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint16_ssa(1); got != 1 {
+		fmt.Printf("div_uint16 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint16_1_ssa(1); got != 1 {
+		fmt.Printf("div_uint16 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint16_ssa(65535); got != 0 {
+		fmt.Printf("div_uint16 1/65535 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint16_1_ssa(65535); got != 65535 {
+		fmt.Printf("div_uint16 65535/1 = %d, wanted 65535\n", got)
+		failed = true
+	}
+
+	if got := div_uint16_65535_ssa(0); got != 0 {
+		fmt.Printf("div_uint16 0/65535 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_65535_uint16_ssa(1); got != 65535 {
+		fmt.Printf("div_uint16 65535/1 = %d, wanted 65535\n", got)
+		failed = true
+	}
+
+	if got := div_uint16_65535_ssa(1); got != 0 {
+		fmt.Printf("div_uint16 1/65535 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_65535_uint16_ssa(65535); got != 1 {
+		fmt.Printf("div_uint16 65535/65535 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint16_65535_ssa(65535); got != 1 {
+		fmt.Printf("div_uint16 65535/65535 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32768_int16_ssa(-32768); got != 1 {
+		fmt.Printf("div_int16 -32768/-32768 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(-32768); got != 1 {
+		fmt.Printf("div_int16 -32768/-32768 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32768_int16_ssa(-32767); got != 1 {
+		fmt.Printf("div_int16 -32768/-32767 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(-32767); got != 0 {
+		fmt.Printf("div_int16 -32767/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32768_int16_ssa(-1); got != -32768 {
+		fmt.Printf("div_int16 -32768/-1 = %d, wanted -32768\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(-1); got != 0 {
+		fmt.Printf("div_int16 -1/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(0); got != 0 {
+		fmt.Printf("div_int16 0/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32768_int16_ssa(1); got != -32768 {
+		fmt.Printf("div_int16 -32768/1 = %d, wanted -32768\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(1); got != 0 {
+		fmt.Printf("div_int16 1/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32768_int16_ssa(32766); got != -1 {
+		fmt.Printf("div_int16 -32768/32766 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(32766); got != 0 {
+		fmt.Printf("div_int16 32766/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32768_int16_ssa(32767); got != -1 {
+		fmt.Printf("div_int16 -32768/32767 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32768_ssa(32767); got != 0 {
+		fmt.Printf("div_int16 32767/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32767_int16_ssa(-32768); got != 0 {
+		fmt.Printf("div_int16 -32767/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(-32768); got != 1 {
+		fmt.Printf("div_int16 -32768/-32767 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32767_int16_ssa(-32767); got != 1 {
+		fmt.Printf("div_int16 -32767/-32767 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(-32767); got != 1 {
+		fmt.Printf("div_int16 -32767/-32767 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32767_int16_ssa(-1); got != 32767 {
+		fmt.Printf("div_int16 -32767/-1 = %d, wanted 32767\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(-1); got != 0 {
+		fmt.Printf("div_int16 -1/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(0); got != 0 {
+		fmt.Printf("div_int16 0/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32767_int16_ssa(1); got != -32767 {
+		fmt.Printf("div_int16 -32767/1 = %d, wanted -32767\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(1); got != 0 {
+		fmt.Printf("div_int16 1/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32767_int16_ssa(32766); got != -1 {
+		fmt.Printf("div_int16 -32767/32766 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(32766); got != 0 {
+		fmt.Printf("div_int16 32766/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg32767_int16_ssa(32767); got != -1 {
+		fmt.Printf("div_int16 -32767/32767 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg32767_ssa(32767); got != -1 {
+		fmt.Printf("div_int16 32767/-32767 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int16_ssa(-32768); got != 0 {
+		fmt.Printf("div_int16 -1/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(-32768); got != -32768 {
+		fmt.Printf("div_int16 -32768/-1 = %d, wanted -32768\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int16_ssa(-32767); got != 0 {
+		fmt.Printf("div_int16 -1/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(-32767); got != 32767 {
+		fmt.Printf("div_int16 -32767/-1 = %d, wanted 32767\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int16_ssa(-1); got != 1 {
+		fmt.Printf("div_int16 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(-1); got != 1 {
+		fmt.Printf("div_int16 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(0); got != 0 {
+		fmt.Printf("div_int16 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int16_ssa(1); got != -1 {
+		fmt.Printf("div_int16 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(1); got != -1 {
+		fmt.Printf("div_int16 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int16_ssa(32766); got != 0 {
+		fmt.Printf("div_int16 -1/32766 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(32766); got != -32766 {
+		fmt.Printf("div_int16 32766/-1 = %d, wanted -32766\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int16_ssa(32767); got != 0 {
+		fmt.Printf("div_int16 -1/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_Neg1_ssa(32767); got != -32767 {
+		fmt.Printf("div_int16 32767/-1 = %d, wanted -32767\n", got)
+		failed = true
+	}
+
+	if got := div_0_int16_ssa(-32768); got != 0 {
+		fmt.Printf("div_int16 0/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int16_ssa(-32767); got != 0 {
+		fmt.Printf("div_int16 0/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int16_ssa(-1); got != 0 {
+		fmt.Printf("div_int16 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int16_ssa(1); got != 0 {
+		fmt.Printf("div_int16 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int16_ssa(32766); got != 0 {
+		fmt.Printf("div_int16 0/32766 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int16_ssa(32767); got != 0 {
+		fmt.Printf("div_int16 0/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int16_ssa(-32768); got != 0 {
+		fmt.Printf("div_int16 1/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(-32768); got != -32768 {
+		fmt.Printf("div_int16 -32768/1 = %d, wanted -32768\n", got)
+		failed = true
+	}
+
+	if got := div_1_int16_ssa(-32767); got != 0 {
+		fmt.Printf("div_int16 1/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(-32767); got != -32767 {
+		fmt.Printf("div_int16 -32767/1 = %d, wanted -32767\n", got)
+		failed = true
+	}
+
+	if got := div_1_int16_ssa(-1); got != -1 {
+		fmt.Printf("div_int16 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(-1); got != -1 {
+		fmt.Printf("div_int16 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(0); got != 0 {
+		fmt.Printf("div_int16 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int16_ssa(1); got != 1 {
+		fmt.Printf("div_int16 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(1); got != 1 {
+		fmt.Printf("div_int16 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_int16_ssa(32766); got != 0 {
+		fmt.Printf("div_int16 1/32766 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(32766); got != 32766 {
+		fmt.Printf("div_int16 32766/1 = %d, wanted 32766\n", got)
+		failed = true
+	}
+
+	if got := div_1_int16_ssa(32767); got != 0 {
+		fmt.Printf("div_int16 1/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_1_ssa(32767); got != 32767 {
+		fmt.Printf("div_int16 32767/1 = %d, wanted 32767\n", got)
+		failed = true
+	}
+
+	if got := div_32766_int16_ssa(-32768); got != 0 {
+		fmt.Printf("div_int16 32766/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(-32768); got != -1 {
+		fmt.Printf("div_int16 -32768/32766 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_32766_int16_ssa(-32767); got != 0 {
+		fmt.Printf("div_int16 32766/-32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(-32767); got != -1 {
+		fmt.Printf("div_int16 -32767/32766 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_32766_int16_ssa(-1); got != -32766 {
+		fmt.Printf("div_int16 32766/-1 = %d, wanted -32766\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(-1); got != 0 {
+		fmt.Printf("div_int16 -1/32766 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(0); got != 0 {
+		fmt.Printf("div_int16 0/32766 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_32766_int16_ssa(1); got != 32766 {
+		fmt.Printf("div_int16 32766/1 = %d, wanted 32766\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(1); got != 0 {
+		fmt.Printf("div_int16 1/32766 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_32766_int16_ssa(32766); got != 1 {
+		fmt.Printf("div_int16 32766/32766 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(32766); got != 1 {
+		fmt.Printf("div_int16 32766/32766 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_32766_int16_ssa(32767); got != 0 {
+		fmt.Printf("div_int16 32766/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32766_ssa(32767); got != 1 {
+		fmt.Printf("div_int16 32767/32766 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_32767_int16_ssa(-32768); got != 0 {
+		fmt.Printf("div_int16 32767/-32768 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(-32768); got != -1 {
+		fmt.Printf("div_int16 -32768/32767 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_32767_int16_ssa(-32767); got != -1 {
+		fmt.Printf("div_int16 32767/-32767 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(-32767); got != -1 {
+		fmt.Printf("div_int16 -32767/32767 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_32767_int16_ssa(-1); got != -32767 {
+		fmt.Printf("div_int16 32767/-1 = %d, wanted -32767\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(-1); got != 0 {
+		fmt.Printf("div_int16 -1/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(0); got != 0 {
+		fmt.Printf("div_int16 0/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_32767_int16_ssa(1); got != 32767 {
+		fmt.Printf("div_int16 32767/1 = %d, wanted 32767\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(1); got != 0 {
+		fmt.Printf("div_int16 1/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_32767_int16_ssa(32766); got != 1 {
+		fmt.Printf("div_int16 32767/32766 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(32766); got != 0 {
+		fmt.Printf("div_int16 32766/32767 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_32767_int16_ssa(32767); got != 1 {
+		fmt.Printf("div_int16 32767/32767 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int16_32767_ssa(32767); got != 1 {
+		fmt.Printf("div_int16 32767/32767 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint8_ssa(1); got != 0 {
+		fmt.Printf("div_uint8 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_uint8_ssa(255); got != 0 {
+		fmt.Printf("div_uint8 0/255 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint8_1_ssa(0); got != 0 {
+		fmt.Printf("div_uint8 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint8_ssa(1); got != 1 {
+		fmt.Printf("div_uint8 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint8_1_ssa(1); got != 1 {
+		fmt.Printf("div_uint8 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_uint8_ssa(255); got != 0 {
+		fmt.Printf("adiv_uint8 1/255 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_uint8_1_ssa(255); got != 255 {
+		fmt.Printf("div_uint8 255/1 = %d, wanted 255\n", got)
+		failed = true
+	}
+
+	if got := div_uint8_255_ssa(0); got != 0 {
+		fmt.Printf("div_uint8 0/255 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_255_uint8_ssa(1); got != 255 {
+		fmt.Printf("div_uint8 255/1 = %d, wanted 255\n", got)
+		failed = true
+	}
+
+	if got := div_uint8_255_ssa(1); got != 0 {
+		fmt.Printf("bdiv_uint8 1/255 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_255_uint8_ssa(255); got != 1 {
+		fmt.Printf("div_uint8 255/255 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_uint8_255_ssa(255); got != 1 {
+		fmt.Printf("div_uint8 255/255 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg128_int8_ssa(-128); got != 1 {
+		fmt.Printf("div_int8 -128/-128 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(-128); got != 1 {
+		fmt.Printf("div_int8 -128/-128 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg128_int8_ssa(-127); got != 1 {
+		fmt.Printf("div_int8 -128/-127 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(-127); got != 0 {
+		fmt.Printf("div_int8 -127/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg128_int8_ssa(-1); got != -128 {
+		fmt.Printf("div_int8 -128/-1 = %d, wanted -128\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(-1); got != 0 {
+		fmt.Printf("div_int8 -1/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(0); got != 0 {
+		fmt.Printf("div_int8 0/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg128_int8_ssa(1); got != -128 {
+		fmt.Printf("div_int8 -128/1 = %d, wanted -128\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(1); got != 0 {
+		fmt.Printf("div_int8 1/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg128_int8_ssa(126); got != -1 {
+		fmt.Printf("div_int8 -128/126 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(126); got != 0 {
+		fmt.Printf("div_int8 126/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg128_int8_ssa(127); got != -1 {
+		fmt.Printf("div_int8 -128/127 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg128_ssa(127); got != 0 {
+		fmt.Printf("div_int8 127/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg127_int8_ssa(-128); got != 0 {
+		fmt.Printf("div_int8 -127/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(-128); got != 1 {
+		fmt.Printf("div_int8 -128/-127 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg127_int8_ssa(-127); got != 1 {
+		fmt.Printf("div_int8 -127/-127 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(-127); got != 1 {
+		fmt.Printf("div_int8 -127/-127 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg127_int8_ssa(-1); got != 127 {
+		fmt.Printf("div_int8 -127/-1 = %d, wanted 127\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(-1); got != 0 {
+		fmt.Printf("div_int8 -1/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(0); got != 0 {
+		fmt.Printf("div_int8 0/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg127_int8_ssa(1); got != -127 {
+		fmt.Printf("div_int8 -127/1 = %d, wanted -127\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(1); got != 0 {
+		fmt.Printf("div_int8 1/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg127_int8_ssa(126); got != -1 {
+		fmt.Printf("div_int8 -127/126 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(126); got != 0 {
+		fmt.Printf("div_int8 126/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg127_int8_ssa(127); got != -1 {
+		fmt.Printf("div_int8 -127/127 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg127_ssa(127); got != -1 {
+		fmt.Printf("div_int8 127/-127 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int8_ssa(-128); got != 0 {
+		fmt.Printf("div_int8 -1/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(-128); got != -128 {
+		fmt.Printf("div_int8 -128/-1 = %d, wanted -128\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int8_ssa(-127); got != 0 {
+		fmt.Printf("div_int8 -1/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(-127); got != 127 {
+		fmt.Printf("div_int8 -127/-1 = %d, wanted 127\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int8_ssa(-1); got != 1 {
+		fmt.Printf("div_int8 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(-1); got != 1 {
+		fmt.Printf("div_int8 -1/-1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(0); got != 0 {
+		fmt.Printf("div_int8 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int8_ssa(1); got != -1 {
+		fmt.Printf("div_int8 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(1); got != -1 {
+		fmt.Printf("div_int8 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int8_ssa(126); got != 0 {
+		fmt.Printf("div_int8 -1/126 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(126); got != -126 {
+		fmt.Printf("div_int8 126/-1 = %d, wanted -126\n", got)
+		failed = true
+	}
+
+	if got := div_Neg1_int8_ssa(127); got != 0 {
+		fmt.Printf("div_int8 -1/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_Neg1_ssa(127); got != -127 {
+		fmt.Printf("div_int8 127/-1 = %d, wanted -127\n", got)
+		failed = true
+	}
+
+	if got := div_0_int8_ssa(-128); got != 0 {
+		fmt.Printf("div_int8 0/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int8_ssa(-127); got != 0 {
+		fmt.Printf("div_int8 0/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int8_ssa(-1); got != 0 {
+		fmt.Printf("div_int8 0/-1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int8_ssa(1); got != 0 {
+		fmt.Printf("div_int8 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int8_ssa(126); got != 0 {
+		fmt.Printf("div_int8 0/126 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_0_int8_ssa(127); got != 0 {
+		fmt.Printf("div_int8 0/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int8_ssa(-128); got != 0 {
+		fmt.Printf("div_int8 1/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(-128); got != -128 {
+		fmt.Printf("div_int8 -128/1 = %d, wanted -128\n", got)
+		failed = true
+	}
+
+	if got := div_1_int8_ssa(-127); got != 0 {
+		fmt.Printf("div_int8 1/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(-127); got != -127 {
+		fmt.Printf("div_int8 -127/1 = %d, wanted -127\n", got)
+		failed = true
+	}
+
+	if got := div_1_int8_ssa(-1); got != -1 {
+		fmt.Printf("div_int8 1/-1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(-1); got != -1 {
+		fmt.Printf("div_int8 -1/1 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(0); got != 0 {
+		fmt.Printf("div_int8 0/1 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_1_int8_ssa(1); got != 1 {
+		fmt.Printf("div_int8 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(1); got != 1 {
+		fmt.Printf("div_int8 1/1 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_1_int8_ssa(126); got != 0 {
+		fmt.Printf("div_int8 1/126 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(126); got != 126 {
+		fmt.Printf("div_int8 126/1 = %d, wanted 126\n", got)
+		failed = true
+	}
+
+	if got := div_1_int8_ssa(127); got != 0 {
+		fmt.Printf("div_int8 1/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_1_ssa(127); got != 127 {
+		fmt.Printf("div_int8 127/1 = %d, wanted 127\n", got)
+		failed = true
+	}
+
+	if got := div_126_int8_ssa(-128); got != 0 {
+		fmt.Printf("div_int8 126/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(-128); got != -1 {
+		fmt.Printf("div_int8 -128/126 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_126_int8_ssa(-127); got != 0 {
+		fmt.Printf("div_int8 126/-127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(-127); got != -1 {
+		fmt.Printf("div_int8 -127/126 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_126_int8_ssa(-1); got != -126 {
+		fmt.Printf("div_int8 126/-1 = %d, wanted -126\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(-1); got != 0 {
+		fmt.Printf("div_int8 -1/126 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(0); got != 0 {
+		fmt.Printf("div_int8 0/126 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_126_int8_ssa(1); got != 126 {
+		fmt.Printf("div_int8 126/1 = %d, wanted 126\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(1); got != 0 {
+		fmt.Printf("div_int8 1/126 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_126_int8_ssa(126); got != 1 {
+		fmt.Printf("div_int8 126/126 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(126); got != 1 {
+		fmt.Printf("div_int8 126/126 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_126_int8_ssa(127); got != 0 {
+		fmt.Printf("div_int8 126/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_126_ssa(127); got != 1 {
+		fmt.Printf("div_int8 127/126 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_127_int8_ssa(-128); got != 0 {
+		fmt.Printf("div_int8 127/-128 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(-128); got != -1 {
+		fmt.Printf("div_int8 -128/127 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_127_int8_ssa(-127); got != -1 {
+		fmt.Printf("div_int8 127/-127 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(-127); got != -1 {
+		fmt.Printf("div_int8 -127/127 = %d, wanted -1\n", got)
+		failed = true
+	}
+
+	if got := div_127_int8_ssa(-1); got != -127 {
+		fmt.Printf("div_int8 127/-1 = %d, wanted -127\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(-1); got != 0 {
+		fmt.Printf("div_int8 -1/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(0); got != 0 {
+		fmt.Printf("div_int8 0/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_127_int8_ssa(1); got != 127 {
+		fmt.Printf("div_int8 127/1 = %d, wanted 127\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(1); got != 0 {
+		fmt.Printf("div_int8 1/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_127_int8_ssa(126); got != 1 {
+		fmt.Printf("div_int8 127/126 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(126); got != 0 {
+		fmt.Printf("div_int8 126/127 = %d, wanted 0\n", got)
+		failed = true
+	}
+
+	if got := div_127_int8_ssa(127); got != 1 {
+		fmt.Printf("div_int8 127/127 = %d, wanted 1\n", got)
+		failed = true
+	}
+
+	if got := div_int8_127_ssa(127); got != 1 {
+		fmt.Printf("div_int8 127/127 = %d, wanted 1\n", got)
+		failed = true
+	}
+	if failed {
+		panic("tests failed")
+	}
+}
diff --git a/src/cmd/compile/internal/gc/testdata/arith_ssa.go b/src/cmd/compile/internal/gc/testdata/arith_ssa.go
index 2a56e21..f6f123c 100644
--- a/src/cmd/compile/internal/gc/testdata/arith_ssa.go
+++ b/src/cmd/compile/internal/gc/testdata/arith_ssa.go
@@ -8,7 +8,7 @@
 
 package main
 
-// test64BitConstMulti tests that rewrite rules don't fold 64 bit constants
+// test64BitConstMult tests that rewrite rules don't fold 64 bit constants
 // into multiply instructions.
 func test64BitConstMult() {
 	want := int64(103079215109)