]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/codegen/arithmetic.go
cmd/compile/internal/ssa: on PPC64, generate large constant paddi
[gostls13.git] / test / codegen / arithmetic.go
index b91a904be9a1843ab834a46277c748e8ff2105ed..0d6d9690000ebe05f6ba53a00e676ce41126d812 100644 (file)
@@ -10,6 +10,21 @@ package codegen
 // simplifications and optimizations on integer types.
 // For codegen tests on float types, see floats.go.
 
+// ----------------- //
+//    Addition       //
+// ----------------- //
+
+func AddLargeConst(a uint64, out []uint64) {
+       // ppc64x/power10:"ADD\t[$]4294967296,"
+       // ppc64x/power9:"MOVD\t[$]i64.0000000100000000[(]SB[)]", "ADD\tR[0-9]*"
+       // ppc64x/power8:"MOVD\t[$]i64.0000000100000000[(]SB[)]", "ADD\tR[0-9]*"
+       out[0] = a + 0x100000000
+       // ppc64x/power10:"ADD\t[$]-8589934592,"
+       // ppc64x/power9:"MOVD\t[$]i64.fffffffe00000000[(]SB[)]", "ADD\tR[0-9]*"
+       // ppc64x/power8:"MOVD\t[$]i64.fffffffe00000000[(]SB[)]", "ADD\tR[0-9]*"
+       out[1] = a + 0xFFFFFFFE00000000
+}
+
 // ----------------- //
 //    Subtraction    //
 // ----------------- //