3 // Copyright 2019 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
12 // Signed 64-bit compare-and-branch.
13 func si64(x, y chan int64) {
14 // s390x:"CGRJ\t[$](2|4), R[0-9]+, R[0-9]+, "
19 // s390x:"CL?GRJ\t[$]8, R[0-9]+, R[0-9]+, "
25 // Signed 64-bit compare-and-branch with 8-bit immediate.
26 func si64x8(doNotOptimize int64) {
27 // take in doNotOptimize as an argument to avoid the loops being rewritten to count down
28 // s390x:"CGIJ\t[$]12, R[0-9]+, [$]127, "
29 for i := doNotOptimize; i < 128; i++ {
33 // s390x:"CGIJ\t[$]10, R[0-9]+, [$]-128, "
34 for i := doNotOptimize; i > -129; i-- {
38 // s390x:"CGIJ\t[$]2, R[0-9]+, [$]127, "
39 for i := doNotOptimize; i >= 128; i++ {
43 // s390x:"CGIJ\t[$]4, R[0-9]+, [$]-128, "
44 for i := doNotOptimize; i <= -129; i-- {
49 // Unsigned 64-bit compare-and-branch.
50 func ui64(x, y chan uint64) {
51 // s390x:"CLGRJ\t[$](2|4), R[0-9]+, R[0-9]+, "
56 // s390x:"CL?GRJ\t[$]6, R[0-9]+, R[0-9]+, "
62 // Unsigned 64-bit comparison with 8-bit immediate.
64 // s390x:"CLGIJ\t[$]4, R[0-9]+, [$]128, "
65 for i := uint64(0); i < 128; i++ {
69 // s390x:"CLGIJ\t[$]12, R[0-9]+, [$]255, "
70 for i := uint64(0); i < 256; i++ {
74 // s390x:"CLGIJ\t[$]2, R[0-9]+, [$]255, "
75 for i := uint64(0); i >= 256; i-- {
79 // s390x:"CLGIJ\t[$]2, R[0-9]+, [$]0, "
80 for i := uint64(1024); i > 0; i-- {
85 // Signed 32-bit compare-and-branch.
86 func si32(x, y chan int32) {
87 // s390x:"CRJ\t[$](2|4), R[0-9]+, R[0-9]+, "
92 // s390x:"CL?RJ\t[$]8, R[0-9]+, R[0-9]+, "
98 // Signed 32-bit compare-and-branch with 8-bit immediate.
99 func si32x8(doNotOptimize int32) {
100 // take in doNotOptimize as an argument to avoid the loops being rewritten to count down
101 // s390x:"CIJ\t[$]12, R[0-9]+, [$]127, "
102 for i := doNotOptimize; i < 128; i++ {
106 // s390x:"CIJ\t[$]10, R[0-9]+, [$]-128, "
107 for i := doNotOptimize; i > -129; i-- {
111 // s390x:"CIJ\t[$]2, R[0-9]+, [$]127, "
112 for i := doNotOptimize; i >= 128; i++ {
116 // s390x:"CIJ\t[$]4, R[0-9]+, [$]-128, "
117 for i := doNotOptimize; i <= -129; i-- {
122 // Unsigned 32-bit compare-and-branch.
123 func ui32(x, y chan uint32) {
124 // s390x:"CLRJ\t[$](2|4), R[0-9]+, R[0-9]+, "
129 // s390x:"CL?RJ\t[$]6, R[0-9]+, R[0-9]+, "
135 // Unsigned 32-bit comparison with 8-bit immediate.
137 // s390x:"CLIJ\t[$]4, R[0-9]+, [$]128, "
138 for i := uint32(0); i < 128; i++ {
142 // s390x:"CLIJ\t[$]12, R[0-9]+, [$]255, "
143 for i := uint32(0); i < 256; i++ {
147 // s390x:"CLIJ\t[$]2, R[0-9]+, [$]255, "
148 for i := uint32(0); i >= 256; i-- {
152 // s390x:"CLIJ\t[$]2, R[0-9]+, [$]0, "
153 for i := uint32(1024); i > 0; i-- {
158 // Signed 64-bit comparison with unsigned 8-bit immediate.
159 func si64xu8(x chan int64) {
160 // s390x:"CLGIJ\t[$]8, R[0-9]+, [$]128, "
165 // s390x:"CLGIJ\t[$]6, R[0-9]+, [$]255, "
171 // Signed 32-bit comparison with unsigned 8-bit immediate.
172 func si32xu8(x chan int32) {
173 // s390x:"CLIJ\t[$]8, R[0-9]+, [$]255, "
178 // s390x:"CLIJ\t[$]6, R[0-9]+, [$]128, "
184 // Unsigned 64-bit comparison with signed 8-bit immediate.
185 func ui64xu8(x chan uint64) {
186 // s390x:"CGIJ\t[$]8, R[0-9]+, [$]-1, "
187 for <-x == ^uint64(0) {
191 // s390x:"CGIJ\t[$]6, R[0-9]+, [$]-128, "
192 for <-x != ^uint64(127) {
197 // Unsigned 32-bit comparison with signed 8-bit immediate.
198 func ui32xu8(x chan uint32) {
199 // s390x:"CIJ\t[$]8, R[0-9]+, [$]-128, "
200 for <-x == ^uint32(127) {
204 // s390x:"CIJ\t[$]6, R[0-9]+, [$]-1, "
205 for <-x != ^uint32(0) {
210 // Signed 64-bit comparison with 1/-1 to comparison with 0.
211 func si64x0(x chan int64) {
233 // Unsigned 64-bit comparison with 1 to comparison with 0.
234 func ui64x0(x chan uint64) {