1 package main 2 3 import "fmt" 4 5 type utd64 struct { 6 a, b uint64 7 add, sub, mul, div, mod uint64 8 } 9 type itd64 struct { 10 a, b int64 11 add, sub, mul, div, mod int64 12 } 13 type utd32 struct { 14 a, b uint32 15 add, sub, mul, div, mod uint32 16 } 17 type itd32 struct { 18 a, b int32 19 add, sub, mul, div, mod int32 20 } 21 type utd16 struct { 22 a, b uint16 23 add, sub, mul, div, mod uint16 24 } 25 type itd16 struct { 26 a, b int16 27 add, sub, mul, div, mod int16 28 } 29 type utd8 struct { 30 a, b uint8 31 add, sub, mul, div, mod uint8 32 } 33 type itd8 struct { 34 a, b int8 35 add, sub, mul, div, mod int8 36 } 37 38 //go:noinline 39 func add_uint64_ssa(a, b uint64) uint64 { 40 return a + b 41 } 42 43 //go:noinline 44 func sub_uint64_ssa(a, b uint64) uint64 { 45 return a - b 46 } 47 48 //go:noinline 49 func div_uint64_ssa(a, b uint64) uint64 { 50 return a / b 51 } 52 53 //go:noinline 54 func mod_uint64_ssa(a, b uint64) uint64 { 55 return a % b 56 } 57 58 //go:noinline 59 func mul_uint64_ssa(a, b uint64) uint64 { 60 return a * b 61 } 62 63 //go:noinline 64 func add_int64_ssa(a, b int64) int64 { 65 return a + b 66 } 67 68 //go:noinline 69 func sub_int64_ssa(a, b int64) int64 { 70 return a - b 71 } 72 73 //go:noinline 74 func div_int64_ssa(a, b int64) int64 { 75 return a / b 76 } 77 78 //go:noinline 79 func mod_int64_ssa(a, b int64) int64 { 80 return a % b 81 } 82 83 //go:noinline 84 func mul_int64_ssa(a, b int64) int64 { 85 return a * b 86 } 87 88 //go:noinline 89 func add_uint32_ssa(a, b uint32) uint32 { 90 return a + b 91 } 92 93 //go:noinline 94 func sub_uint32_ssa(a, b uint32) uint32 { 95 return a - b 96 } 97 98 //go:noinline 99 func div_uint32_ssa(a, b uint32) uint32 { 100 return a / b 101 } 102 103 //go:noinline 104 func mod_uint32_ssa(a, b uint32) uint32 { 105 return a % b 106 } 107 108 //go:noinline 109 func mul_uint32_ssa(a, b uint32) uint32 { 110 return a * b 111 } 112 113 //go:noinline 114 func add_int32_ssa(a, b int32) int32 { 115 return a + b 116 } 117 118 //go:noinline 119 func sub_int32_ssa(a, b int32) int32 { 120 return a - b 121 } 122 123 //go:noinline 124 func div_int32_ssa(a, b int32) int32 { 125 return a / b 126 } 127 128 //go:noinline 129 func mod_int32_ssa(a, b int32) int32 { 130 return a % b 131 } 132 133 //go:noinline 134 func mul_int32_ssa(a, b int32) int32 { 135 return a * b 136 } 137 138 //go:noinline 139 func add_uint16_ssa(a, b uint16) uint16 { 140 return a + b 141 } 142 143 //go:noinline 144 func sub_uint16_ssa(a, b uint16) uint16 { 145 return a - b 146 } 147 148 //go:noinline 149 func div_uint16_ssa(a, b uint16) uint16 { 150 return a / b 151 } 152 153 //go:noinline 154 func mod_uint16_ssa(a, b uint16) uint16 { 155 return a % b 156 } 157 158 //go:noinline 159 func mul_uint16_ssa(a, b uint16) uint16 { 160 return a * b 161 } 162 163 //go:noinline 164 func add_int16_ssa(a, b int16) int16 { 165 return a + b 166 } 167 168 //go:noinline 169 func sub_int16_ssa(a, b int16) int16 { 170 return a - b 171 } 172 173 //go:noinline 174 func div_int16_ssa(a, b int16) int16 { 175 return a / b 176 } 177 178 //go:noinline 179 func mod_int16_ssa(a, b int16) int16 { 180 return a % b 181 } 182 183 //go:noinline 184 func mul_int16_ssa(a, b int16) int16 { 185 return a * b 186 } 187 188 //go:noinline 189 func add_uint8_ssa(a, b uint8) uint8 { 190 return a + b 191 } 192 193 //go:noinline 194 func sub_uint8_ssa(a, b uint8) uint8 { 195 return a - b 196 } 197 198 //go:noinline 199 func div_uint8_ssa(a, b uint8) uint8 { 200 return a / b 201 } 202 203 //go:noinline 204 func mod_uint8_ssa(a, b uint8) uint8 { 205 return a % b 206 } 207 208 //go:noinline 209 func mul_uint8_ssa(a, b uint8) uint8 { 210 return a * b 211 } 212 213 //go:noinline 214 func add_int8_ssa(a, b int8) int8 { 215 return a + b 216 } 217 218 //go:noinline 219 func sub_int8_ssa(a, b int8) int8 { 220 return a - b 221 } 222 223 //go:noinline 224 func div_int8_ssa(a, b int8) int8 { 225 return a / b 226 } 227 228 //go:noinline 229 func mod_int8_ssa(a, b int8) int8 { 230 return a % b 231 } 232 233 //go:noinline 234 func mul_int8_ssa(a, b int8) int8 { 235 return a * b 236 } 237 238 var uint64_data []utd64 = []utd64{utd64{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 239 utd64{a: 0, b: 1, add: 1, sub: 18446744073709551615, mul: 0, div: 0, mod: 0}, 240 utd64{a: 0, b: 4294967296, add: 4294967296, sub: 18446744069414584320, mul: 0, div: 0, mod: 0}, 241 utd64{a: 0, b: 18446744073709551615, add: 18446744073709551615, sub: 1, mul: 0, div: 0, mod: 0}, 242 utd64{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 243 utd64{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 244 utd64{a: 1, b: 4294967296, add: 4294967297, sub: 18446744069414584321, mul: 4294967296, div: 0, mod: 1}, 245 utd64{a: 1, b: 18446744073709551615, add: 0, sub: 2, mul: 18446744073709551615, div: 0, mod: 1}, 246 utd64{a: 4294967296, b: 0, add: 4294967296, sub: 4294967296, mul: 0}, 247 utd64{a: 4294967296, b: 1, add: 4294967297, sub: 4294967295, mul: 4294967296, div: 4294967296, mod: 0}, 248 utd64{a: 4294967296, b: 4294967296, add: 8589934592, sub: 0, mul: 0, div: 1, mod: 0}, 249 utd64{a: 4294967296, b: 18446744073709551615, add: 4294967295, sub: 4294967297, mul: 18446744069414584320, div: 0, mod: 4294967296}, 250 utd64{a: 18446744073709551615, b: 0, add: 18446744073709551615, sub: 18446744073709551615, mul: 0}, 251 utd64{a: 18446744073709551615, b: 1, add: 0, sub: 18446744073709551614, mul: 18446744073709551615, div: 18446744073709551615, mod: 0}, 252 utd64{a: 18446744073709551615, b: 4294967296, add: 4294967295, sub: 18446744069414584319, mul: 18446744069414584320, div: 4294967295, mod: 4294967295}, 253 utd64{a: 18446744073709551615, b: 18446744073709551615, add: 18446744073709551614, sub: 0, mul: 1, div: 1, mod: 0}, 254 } 255 var int64_data []itd64 = []itd64{itd64{a: -9223372036854775808, b: -9223372036854775808, add: 0, sub: 0, mul: 0, div: 1, mod: 0}, 256 itd64{a: -9223372036854775808, b: -9223372036854775807, add: 1, sub: -1, mul: -9223372036854775808, div: 1, mod: -1}, 257 itd64{a: -9223372036854775808, b: -4294967296, add: 9223372032559808512, sub: -9223372032559808512, mul: 0, div: 2147483648, mod: 0}, 258 itd64{a: -9223372036854775808, b: -1, add: 9223372036854775807, sub: -9223372036854775807, mul: -9223372036854775808, div: -9223372036854775808, mod: 0}, 259 itd64{a: -9223372036854775808, b: 0, add: -9223372036854775808, sub: -9223372036854775808, mul: 0}, 260 itd64{a: -9223372036854775808, b: 1, add: -9223372036854775807, sub: 9223372036854775807, mul: -9223372036854775808, div: -9223372036854775808, mod: 0}, 261 itd64{a: -9223372036854775808, b: 4294967296, add: -9223372032559808512, sub: 9223372032559808512, mul: 0, div: -2147483648, mod: 0}, 262 itd64{a: -9223372036854775808, b: 9223372036854775806, add: -2, sub: 2, mul: 0, div: -1, mod: -2}, 263 itd64{a: -9223372036854775808, b: 9223372036854775807, add: -1, sub: 1, mul: -9223372036854775808, div: -1, mod: -1}, 264 itd64{a: -9223372036854775807, b: -9223372036854775808, add: 1, sub: 1, mul: -9223372036854775808, div: 0, mod: -9223372036854775807}, 265 itd64{a: -9223372036854775807, b: -9223372036854775807, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 266 itd64{a: -9223372036854775807, b: -4294967296, add: 9223372032559808513, sub: -9223372032559808511, mul: -4294967296, div: 2147483647, mod: -4294967295}, 267 itd64{a: -9223372036854775807, b: -1, add: -9223372036854775808, sub: -9223372036854775806, mul: 9223372036854775807, div: 9223372036854775807, mod: 0}, 268 itd64{a: -9223372036854775807, b: 0, add: -9223372036854775807, sub: -9223372036854775807, mul: 0}, 269 itd64{a: -9223372036854775807, b: 1, add: -9223372036854775806, sub: -9223372036854775808, mul: -9223372036854775807, div: -9223372036854775807, mod: 0}, 270 itd64{a: -9223372036854775807, b: 4294967296, add: -9223372032559808511, sub: 9223372032559808513, mul: 4294967296, div: -2147483647, mod: -4294967295}, 271 itd64{a: -9223372036854775807, b: 9223372036854775806, add: -1, sub: 3, mul: 9223372036854775806, div: -1, mod: -1}, 272 itd64{a: -9223372036854775807, b: 9223372036854775807, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 273 itd64{a: -4294967296, b: -9223372036854775808, add: 9223372032559808512, sub: 9223372032559808512, mul: 0, div: 0, mod: -4294967296}, 274 itd64{a: -4294967296, b: -9223372036854775807, add: 9223372032559808513, sub: 9223372032559808511, mul: -4294967296, div: 0, mod: -4294967296}, 275 itd64{a: -4294967296, b: -4294967296, add: -8589934592, sub: 0, mul: 0, div: 1, mod: 0}, 276 itd64{a: -4294967296, b: -1, add: -4294967297, sub: -4294967295, mul: 4294967296, div: 4294967296, mod: 0}, 277 itd64{a: -4294967296, b: 0, add: -4294967296, sub: -4294967296, mul: 0}, 278 itd64{a: -4294967296, b: 1, add: -4294967295, sub: -4294967297, mul: -4294967296, div: -4294967296, mod: 0}, 279 itd64{a: -4294967296, b: 4294967296, add: 0, sub: -8589934592, mul: 0, div: -1, mod: 0}, 280 itd64{a: -4294967296, b: 9223372036854775806, add: 9223372032559808510, sub: 9223372032559808514, mul: 8589934592, div: 0, mod: -4294967296}, 281 itd64{a: -4294967296, b: 9223372036854775807, add: 9223372032559808511, sub: 9223372032559808513, mul: 4294967296, div: 0, mod: -4294967296}, 282 itd64{a: -1, b: -9223372036854775808, add: 9223372036854775807, sub: 9223372036854775807, mul: -9223372036854775808, div: 0, mod: -1}, 283 itd64{a: -1, b: -9223372036854775807, add: -9223372036854775808, sub: 9223372036854775806, mul: 9223372036854775807, div: 0, mod: -1}, 284 itd64{a: -1, b: -4294967296, add: -4294967297, sub: 4294967295, mul: 4294967296, div: 0, mod: -1}, 285 itd64{a: -1, b: -1, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 286 itd64{a: -1, b: 0, add: -1, sub: -1, mul: 0}, 287 itd64{a: -1, b: 1, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 288 itd64{a: -1, b: 4294967296, add: 4294967295, sub: -4294967297, mul: -4294967296, div: 0, mod: -1}, 289 itd64{a: -1, b: 9223372036854775806, add: 9223372036854775805, sub: -9223372036854775807, mul: -9223372036854775806, div: 0, mod: -1}, 290 itd64{a: -1, b: 9223372036854775807, add: 9223372036854775806, sub: -9223372036854775808, mul: -9223372036854775807, div: 0, mod: -1}, 291 itd64{a: 0, b: -9223372036854775808, add: -9223372036854775808, sub: -9223372036854775808, mul: 0, div: 0, mod: 0}, 292 itd64{a: 0, b: -9223372036854775807, add: -9223372036854775807, sub: 9223372036854775807, mul: 0, div: 0, mod: 0}, 293 itd64{a: 0, b: -4294967296, add: -4294967296, sub: 4294967296, mul: 0, div: 0, mod: 0}, 294 itd64{a: 0, b: -1, add: -1, sub: 1, mul: 0, div: 0, mod: 0}, 295 itd64{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 296 itd64{a: 0, b: 1, add: 1, sub: -1, mul: 0, div: 0, mod: 0}, 297 itd64{a: 0, b: 4294967296, add: 4294967296, sub: -4294967296, mul: 0, div: 0, mod: 0}, 298 itd64{a: 0, b: 9223372036854775806, add: 9223372036854775806, sub: -9223372036854775806, mul: 0, div: 0, mod: 0}, 299 itd64{a: 0, b: 9223372036854775807, add: 9223372036854775807, sub: -9223372036854775807, mul: 0, div: 0, mod: 0}, 300 itd64{a: 1, b: -9223372036854775808, add: -9223372036854775807, sub: -9223372036854775807, mul: -9223372036854775808, div: 0, mod: 1}, 301 itd64{a: 1, b: -9223372036854775807, add: -9223372036854775806, sub: -9223372036854775808, mul: -9223372036854775807, div: 0, mod: 1}, 302 itd64{a: 1, b: -4294967296, add: -4294967295, sub: 4294967297, mul: -4294967296, div: 0, mod: 1}, 303 itd64{a: 1, b: -1, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 304 itd64{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 305 itd64{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 306 itd64{a: 1, b: 4294967296, add: 4294967297, sub: -4294967295, mul: 4294967296, div: 0, mod: 1}, 307 itd64{a: 1, b: 9223372036854775806, add: 9223372036854775807, sub: -9223372036854775805, mul: 9223372036854775806, div: 0, mod: 1}, 308 itd64{a: 1, b: 9223372036854775807, add: -9223372036854775808, sub: -9223372036854775806, mul: 9223372036854775807, div: 0, mod: 1}, 309 itd64{a: 4294967296, b: -9223372036854775808, add: -9223372032559808512, sub: -9223372032559808512, mul: 0, div: 0, mod: 4294967296}, 310 itd64{a: 4294967296, b: -9223372036854775807, add: -9223372032559808511, sub: -9223372032559808513, mul: 4294967296, div: 0, mod: 4294967296}, 311 itd64{a: 4294967296, b: -4294967296, add: 0, sub: 8589934592, mul: 0, div: -1, mod: 0}, 312 itd64{a: 4294967296, b: -1, add: 4294967295, sub: 4294967297, mul: -4294967296, div: -4294967296, mod: 0}, 313 itd64{a: 4294967296, b: 0, add: 4294967296, sub: 4294967296, mul: 0}, 314 itd64{a: 4294967296, b: 1, add: 4294967297, sub: 4294967295, mul: 4294967296, div: 4294967296, mod: 0}, 315 itd64{a: 4294967296, b: 4294967296, add: 8589934592, sub: 0, mul: 0, div: 1, mod: 0}, 316 itd64{a: 4294967296, b: 9223372036854775806, add: -9223372032559808514, sub: -9223372032559808510, mul: -8589934592, div: 0, mod: 4294967296}, 317 itd64{a: 4294967296, b: 9223372036854775807, add: -9223372032559808513, sub: -9223372032559808511, mul: -4294967296, div: 0, mod: 4294967296}, 318 itd64{a: 9223372036854775806, b: -9223372036854775808, add: -2, sub: -2, mul: 0, div: 0, mod: 9223372036854775806}, 319 itd64{a: 9223372036854775806, b: -9223372036854775807, add: -1, sub: -3, mul: 9223372036854775806, div: 0, mod: 9223372036854775806}, 320 itd64{a: 9223372036854775806, b: -4294967296, add: 9223372032559808510, sub: -9223372032559808514, mul: 8589934592, div: -2147483647, mod: 4294967294}, 321 itd64{a: 9223372036854775806, b: -1, add: 9223372036854775805, sub: 9223372036854775807, mul: -9223372036854775806, div: -9223372036854775806, mod: 0}, 322 itd64{a: 9223372036854775806, b: 0, add: 9223372036854775806, sub: 9223372036854775806, mul: 0}, 323 itd64{a: 9223372036854775806, b: 1, add: 9223372036854775807, sub: 9223372036854775805, mul: 9223372036854775806, div: 9223372036854775806, mod: 0}, 324 itd64{a: 9223372036854775806, b: 4294967296, add: -9223372032559808514, sub: 9223372032559808510, mul: -8589934592, div: 2147483647, mod: 4294967294}, 325 itd64{a: 9223372036854775806, b: 9223372036854775806, add: -4, sub: 0, mul: 4, div: 1, mod: 0}, 326 itd64{a: 9223372036854775806, b: 9223372036854775807, add: -3, sub: -1, mul: -9223372036854775806, div: 0, mod: 9223372036854775806}, 327 itd64{a: 9223372036854775807, b: -9223372036854775808, add: -1, sub: -1, mul: -9223372036854775808, div: 0, mod: 9223372036854775807}, 328 itd64{a: 9223372036854775807, b: -9223372036854775807, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 329 itd64{a: 9223372036854775807, b: -4294967296, add: 9223372032559808511, sub: -9223372032559808513, mul: 4294967296, div: -2147483647, mod: 4294967295}, 330 itd64{a: 9223372036854775807, b: -1, add: 9223372036854775806, sub: -9223372036854775808, mul: -9223372036854775807, div: -9223372036854775807, mod: 0}, 331 itd64{a: 9223372036854775807, b: 0, add: 9223372036854775807, sub: 9223372036854775807, mul: 0}, 332 itd64{a: 9223372036854775807, b: 1, add: -9223372036854775808, sub: 9223372036854775806, mul: 9223372036854775807, div: 9223372036854775807, mod: 0}, 333 itd64{a: 9223372036854775807, b: 4294967296, add: -9223372032559808513, sub: 9223372032559808511, mul: -4294967296, div: 2147483647, mod: 4294967295}, 334 itd64{a: 9223372036854775807, b: 9223372036854775806, add: -3, sub: 1, mul: -9223372036854775806, div: 1, mod: 1}, 335 itd64{a: 9223372036854775807, b: 9223372036854775807, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 336 } 337 var uint32_data []utd32 = []utd32{utd32{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 338 utd32{a: 0, b: 1, add: 1, sub: 4294967295, mul: 0, div: 0, mod: 0}, 339 utd32{a: 0, b: 4294967295, add: 4294967295, sub: 1, mul: 0, div: 0, mod: 0}, 340 utd32{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 341 utd32{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 342 utd32{a: 1, b: 4294967295, add: 0, sub: 2, mul: 4294967295, div: 0, mod: 1}, 343 utd32{a: 4294967295, b: 0, add: 4294967295, sub: 4294967295, mul: 0}, 344 utd32{a: 4294967295, b: 1, add: 0, sub: 4294967294, mul: 4294967295, div: 4294967295, mod: 0}, 345 utd32{a: 4294967295, b: 4294967295, add: 4294967294, sub: 0, mul: 1, div: 1, mod: 0}, 346 } 347 var int32_data []itd32 = []itd32{itd32{a: -2147483648, b: -2147483648, add: 0, sub: 0, mul: 0, div: 1, mod: 0}, 348 itd32{a: -2147483648, b: -2147483647, add: 1, sub: -1, mul: -2147483648, div: 1, mod: -1}, 349 itd32{a: -2147483648, b: -1, add: 2147483647, sub: -2147483647, mul: -2147483648, div: -2147483648, mod: 0}, 350 itd32{a: -2147483648, b: 0, add: -2147483648, sub: -2147483648, mul: 0}, 351 itd32{a: -2147483648, b: 1, add: -2147483647, sub: 2147483647, mul: -2147483648, div: -2147483648, mod: 0}, 352 itd32{a: -2147483648, b: 2147483647, add: -1, sub: 1, mul: -2147483648, div: -1, mod: -1}, 353 itd32{a: -2147483647, b: -2147483648, add: 1, sub: 1, mul: -2147483648, div: 0, mod: -2147483647}, 354 itd32{a: -2147483647, b: -2147483647, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 355 itd32{a: -2147483647, b: -1, add: -2147483648, sub: -2147483646, mul: 2147483647, div: 2147483647, mod: 0}, 356 itd32{a: -2147483647, b: 0, add: -2147483647, sub: -2147483647, mul: 0}, 357 itd32{a: -2147483647, b: 1, add: -2147483646, sub: -2147483648, mul: -2147483647, div: -2147483647, mod: 0}, 358 itd32{a: -2147483647, b: 2147483647, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 359 itd32{a: -1, b: -2147483648, add: 2147483647, sub: 2147483647, mul: -2147483648, div: 0, mod: -1}, 360 itd32{a: -1, b: -2147483647, add: -2147483648, sub: 2147483646, mul: 2147483647, div: 0, mod: -1}, 361 itd32{a: -1, b: -1, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 362 itd32{a: -1, b: 0, add: -1, sub: -1, mul: 0}, 363 itd32{a: -1, b: 1, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 364 itd32{a: -1, b: 2147483647, add: 2147483646, sub: -2147483648, mul: -2147483647, div: 0, mod: -1}, 365 itd32{a: 0, b: -2147483648, add: -2147483648, sub: -2147483648, mul: 0, div: 0, mod: 0}, 366 itd32{a: 0, b: -2147483647, add: -2147483647, sub: 2147483647, mul: 0, div: 0, mod: 0}, 367 itd32{a: 0, b: -1, add: -1, sub: 1, mul: 0, div: 0, mod: 0}, 368 itd32{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 369 itd32{a: 0, b: 1, add: 1, sub: -1, mul: 0, div: 0, mod: 0}, 370 itd32{a: 0, b: 2147483647, add: 2147483647, sub: -2147483647, mul: 0, div: 0, mod: 0}, 371 itd32{a: 1, b: -2147483648, add: -2147483647, sub: -2147483647, mul: -2147483648, div: 0, mod: 1}, 372 itd32{a: 1, b: -2147483647, add: -2147483646, sub: -2147483648, mul: -2147483647, div: 0, mod: 1}, 373 itd32{a: 1, b: -1, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 374 itd32{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 375 itd32{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 376 itd32{a: 1, b: 2147483647, add: -2147483648, sub: -2147483646, mul: 2147483647, div: 0, mod: 1}, 377 itd32{a: 2147483647, b: -2147483648, add: -1, sub: -1, mul: -2147483648, div: 0, mod: 2147483647}, 378 itd32{a: 2147483647, b: -2147483647, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 379 itd32{a: 2147483647, b: -1, add: 2147483646, sub: -2147483648, mul: -2147483647, div: -2147483647, mod: 0}, 380 itd32{a: 2147483647, b: 0, add: 2147483647, sub: 2147483647, mul: 0}, 381 itd32{a: 2147483647, b: 1, add: -2147483648, sub: 2147483646, mul: 2147483647, div: 2147483647, mod: 0}, 382 itd32{a: 2147483647, b: 2147483647, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 383 } 384 var uint16_data []utd16 = []utd16{utd16{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 385 utd16{a: 0, b: 1, add: 1, sub: 65535, mul: 0, div: 0, mod: 0}, 386 utd16{a: 0, b: 65535, add: 65535, sub: 1, mul: 0, div: 0, mod: 0}, 387 utd16{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 388 utd16{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 389 utd16{a: 1, b: 65535, add: 0, sub: 2, mul: 65535, div: 0, mod: 1}, 390 utd16{a: 65535, b: 0, add: 65535, sub: 65535, mul: 0}, 391 utd16{a: 65535, b: 1, add: 0, sub: 65534, mul: 65535, div: 65535, mod: 0}, 392 utd16{a: 65535, b: 65535, add: 65534, sub: 0, mul: 1, div: 1, mod: 0}, 393 } 394 var int16_data []itd16 = []itd16{itd16{a: -32768, b: -32768, add: 0, sub: 0, mul: 0, div: 1, mod: 0}, 395 itd16{a: -32768, b: -32767, add: 1, sub: -1, mul: -32768, div: 1, mod: -1}, 396 itd16{a: -32768, b: -1, add: 32767, sub: -32767, mul: -32768, div: -32768, mod: 0}, 397 itd16{a: -32768, b: 0, add: -32768, sub: -32768, mul: 0}, 398 itd16{a: -32768, b: 1, add: -32767, sub: 32767, mul: -32768, div: -32768, mod: 0}, 399 itd16{a: -32768, b: 32766, add: -2, sub: 2, mul: 0, div: -1, mod: -2}, 400 itd16{a: -32768, b: 32767, add: -1, sub: 1, mul: -32768, div: -1, mod: -1}, 401 itd16{a: -32767, b: -32768, add: 1, sub: 1, mul: -32768, div: 0, mod: -32767}, 402 itd16{a: -32767, b: -32767, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 403 itd16{a: -32767, b: -1, add: -32768, sub: -32766, mul: 32767, div: 32767, mod: 0}, 404 itd16{a: -32767, b: 0, add: -32767, sub: -32767, mul: 0}, 405 itd16{a: -32767, b: 1, add: -32766, sub: -32768, mul: -32767, div: -32767, mod: 0}, 406 itd16{a: -32767, b: 32766, add: -1, sub: 3, mul: 32766, div: -1, mod: -1}, 407 itd16{a: -32767, b: 32767, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 408 itd16{a: -1, b: -32768, add: 32767, sub: 32767, mul: -32768, div: 0, mod: -1}, 409 itd16{a: -1, b: -32767, add: -32768, sub: 32766, mul: 32767, div: 0, mod: -1}, 410 itd16{a: -1, b: -1, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 411 itd16{a: -1, b: 0, add: -1, sub: -1, mul: 0}, 412 itd16{a: -1, b: 1, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 413 itd16{a: -1, b: 32766, add: 32765, sub: -32767, mul: -32766, div: 0, mod: -1}, 414 itd16{a: -1, b: 32767, add: 32766, sub: -32768, mul: -32767, div: 0, mod: -1}, 415 itd16{a: 0, b: -32768, add: -32768, sub: -32768, mul: 0, div: 0, mod: 0}, 416 itd16{a: 0, b: -32767, add: -32767, sub: 32767, mul: 0, div: 0, mod: 0}, 417 itd16{a: 0, b: -1, add: -1, sub: 1, mul: 0, div: 0, mod: 0}, 418 itd16{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 419 itd16{a: 0, b: 1, add: 1, sub: -1, mul: 0, div: 0, mod: 0}, 420 itd16{a: 0, b: 32766, add: 32766, sub: -32766, mul: 0, div: 0, mod: 0}, 421 itd16{a: 0, b: 32767, add: 32767, sub: -32767, mul: 0, div: 0, mod: 0}, 422 itd16{a: 1, b: -32768, add: -32767, sub: -32767, mul: -32768, div: 0, mod: 1}, 423 itd16{a: 1, b: -32767, add: -32766, sub: -32768, mul: -32767, div: 0, mod: 1}, 424 itd16{a: 1, b: -1, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 425 itd16{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 426 itd16{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 427 itd16{a: 1, b: 32766, add: 32767, sub: -32765, mul: 32766, div: 0, mod: 1}, 428 itd16{a: 1, b: 32767, add: -32768, sub: -32766, mul: 32767, div: 0, mod: 1}, 429 itd16{a: 32766, b: -32768, add: -2, sub: -2, mul: 0, div: 0, mod: 32766}, 430 itd16{a: 32766, b: -32767, add: -1, sub: -3, mul: 32766, div: 0, mod: 32766}, 431 itd16{a: 32766, b: -1, add: 32765, sub: 32767, mul: -32766, div: -32766, mod: 0}, 432 itd16{a: 32766, b: 0, add: 32766, sub: 32766, mul: 0}, 433 itd16{a: 32766, b: 1, add: 32767, sub: 32765, mul: 32766, div: 32766, mod: 0}, 434 itd16{a: 32766, b: 32766, add: -4, sub: 0, mul: 4, div: 1, mod: 0}, 435 itd16{a: 32766, b: 32767, add: -3, sub: -1, mul: -32766, div: 0, mod: 32766}, 436 itd16{a: 32767, b: -32768, add: -1, sub: -1, mul: -32768, div: 0, mod: 32767}, 437 itd16{a: 32767, b: -32767, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 438 itd16{a: 32767, b: -1, add: 32766, sub: -32768, mul: -32767, div: -32767, mod: 0}, 439 itd16{a: 32767, b: 0, add: 32767, sub: 32767, mul: 0}, 440 itd16{a: 32767, b: 1, add: -32768, sub: 32766, mul: 32767, div: 32767, mod: 0}, 441 itd16{a: 32767, b: 32766, add: -3, sub: 1, mul: -32766, div: 1, mod: 1}, 442 itd16{a: 32767, b: 32767, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 443 } 444 var uint8_data []utd8 = []utd8{utd8{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 445 utd8{a: 0, b: 1, add: 1, sub: 255, mul: 0, div: 0, mod: 0}, 446 utd8{a: 0, b: 255, add: 255, sub: 1, mul: 0, div: 0, mod: 0}, 447 utd8{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 448 utd8{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 449 utd8{a: 1, b: 255, add: 0, sub: 2, mul: 255, div: 0, mod: 1}, 450 utd8{a: 255, b: 0, add: 255, sub: 255, mul: 0}, 451 utd8{a: 255, b: 1, add: 0, sub: 254, mul: 255, div: 255, mod: 0}, 452 utd8{a: 255, b: 255, add: 254, sub: 0, mul: 1, div: 1, mod: 0}, 453 } 454 var int8_data []itd8 = []itd8{itd8{a: -128, b: -128, add: 0, sub: 0, mul: 0, div: 1, mod: 0}, 455 itd8{a: -128, b: -127, add: 1, sub: -1, mul: -128, div: 1, mod: -1}, 456 itd8{a: -128, b: -1, add: 127, sub: -127, mul: -128, div: -128, mod: 0}, 457 itd8{a: -128, b: 0, add: -128, sub: -128, mul: 0}, 458 itd8{a: -128, b: 1, add: -127, sub: 127, mul: -128, div: -128, mod: 0}, 459 itd8{a: -128, b: 126, add: -2, sub: 2, mul: 0, div: -1, mod: -2}, 460 itd8{a: -128, b: 127, add: -1, sub: 1, mul: -128, div: -1, mod: -1}, 461 itd8{a: -127, b: -128, add: 1, sub: 1, mul: -128, div: 0, mod: -127}, 462 itd8{a: -127, b: -127, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 463 itd8{a: -127, b: -1, add: -128, sub: -126, mul: 127, div: 127, mod: 0}, 464 itd8{a: -127, b: 0, add: -127, sub: -127, mul: 0}, 465 itd8{a: -127, b: 1, add: -126, sub: -128, mul: -127, div: -127, mod: 0}, 466 itd8{a: -127, b: 126, add: -1, sub: 3, mul: 126, div: -1, mod: -1}, 467 itd8{a: -127, b: 127, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 468 itd8{a: -1, b: -128, add: 127, sub: 127, mul: -128, div: 0, mod: -1}, 469 itd8{a: -1, b: -127, add: -128, sub: 126, mul: 127, div: 0, mod: -1}, 470 itd8{a: -1, b: -1, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 471 itd8{a: -1, b: 0, add: -1, sub: -1, mul: 0}, 472 itd8{a: -1, b: 1, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 473 itd8{a: -1, b: 126, add: 125, sub: -127, mul: -126, div: 0, mod: -1}, 474 itd8{a: -1, b: 127, add: 126, sub: -128, mul: -127, div: 0, mod: -1}, 475 itd8{a: 0, b: -128, add: -128, sub: -128, mul: 0, div: 0, mod: 0}, 476 itd8{a: 0, b: -127, add: -127, sub: 127, mul: 0, div: 0, mod: 0}, 477 itd8{a: 0, b: -1, add: -1, sub: 1, mul: 0, div: 0, mod: 0}, 478 itd8{a: 0, b: 0, add: 0, sub: 0, mul: 0}, 479 itd8{a: 0, b: 1, add: 1, sub: -1, mul: 0, div: 0, mod: 0}, 480 itd8{a: 0, b: 126, add: 126, sub: -126, mul: 0, div: 0, mod: 0}, 481 itd8{a: 0, b: 127, add: 127, sub: -127, mul: 0, div: 0, mod: 0}, 482 itd8{a: 1, b: -128, add: -127, sub: -127, mul: -128, div: 0, mod: 1}, 483 itd8{a: 1, b: -127, add: -126, sub: -128, mul: -127, div: 0, mod: 1}, 484 itd8{a: 1, b: -1, add: 0, sub: 2, mul: -1, div: -1, mod: 0}, 485 itd8{a: 1, b: 0, add: 1, sub: 1, mul: 0}, 486 itd8{a: 1, b: 1, add: 2, sub: 0, mul: 1, div: 1, mod: 0}, 487 itd8{a: 1, b: 126, add: 127, sub: -125, mul: 126, div: 0, mod: 1}, 488 itd8{a: 1, b: 127, add: -128, sub: -126, mul: 127, div: 0, mod: 1}, 489 itd8{a: 126, b: -128, add: -2, sub: -2, mul: 0, div: 0, mod: 126}, 490 itd8{a: 126, b: -127, add: -1, sub: -3, mul: 126, div: 0, mod: 126}, 491 itd8{a: 126, b: -1, add: 125, sub: 127, mul: -126, div: -126, mod: 0}, 492 itd8{a: 126, b: 0, add: 126, sub: 126, mul: 0}, 493 itd8{a: 126, b: 1, add: 127, sub: 125, mul: 126, div: 126, mod: 0}, 494 itd8{a: 126, b: 126, add: -4, sub: 0, mul: 4, div: 1, mod: 0}, 495 itd8{a: 126, b: 127, add: -3, sub: -1, mul: -126, div: 0, mod: 126}, 496 itd8{a: 127, b: -128, add: -1, sub: -1, mul: -128, div: 0, mod: 127}, 497 itd8{a: 127, b: -127, add: 0, sub: -2, mul: -1, div: -1, mod: 0}, 498 itd8{a: 127, b: -1, add: 126, sub: -128, mul: -127, div: -127, mod: 0}, 499 itd8{a: 127, b: 0, add: 127, sub: 127, mul: 0}, 500 itd8{a: 127, b: 1, add: -128, sub: 126, mul: 127, div: 127, mod: 0}, 501 itd8{a: 127, b: 126, add: -3, sub: 1, mul: -126, div: 1, mod: 1}, 502 itd8{a: 127, b: 127, add: -2, sub: 0, mul: 1, div: 1, mod: 0}, 503 } 504 var failed bool 505 506 func main() { 507 508 for _, v := range uint64_data { 509 if got := add_uint64_ssa(v.a, v.b); got != v.add { 510 fmt.Printf("add_uint64 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 511 failed = true 512 } 513 if got := sub_uint64_ssa(v.a, v.b); got != v.sub { 514 fmt.Printf("sub_uint64 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 515 failed = true 516 } 517 if v.b != 0 { 518 if got := div_uint64_ssa(v.a, v.b); got != v.div { 519 fmt.Printf("div_uint64 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 520 failed = true 521 } 522 523 } 524 if v.b != 0 { 525 if got := mod_uint64_ssa(v.a, v.b); got != v.mod { 526 fmt.Printf("mod_uint64 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 527 failed = true 528 } 529 530 } 531 if got := mul_uint64_ssa(v.a, v.b); got != v.mul { 532 fmt.Printf("mul_uint64 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 533 failed = true 534 } 535 } 536 for _, v := range int64_data { 537 if got := add_int64_ssa(v.a, v.b); got != v.add { 538 fmt.Printf("add_int64 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 539 failed = true 540 } 541 if got := sub_int64_ssa(v.a, v.b); got != v.sub { 542 fmt.Printf("sub_int64 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 543 failed = true 544 } 545 if v.b != 0 { 546 if got := div_int64_ssa(v.a, v.b); got != v.div { 547 fmt.Printf("div_int64 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 548 failed = true 549 } 550 551 } 552 if v.b != 0 { 553 if got := mod_int64_ssa(v.a, v.b); got != v.mod { 554 fmt.Printf("mod_int64 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 555 failed = true 556 } 557 558 } 559 if got := mul_int64_ssa(v.a, v.b); got != v.mul { 560 fmt.Printf("mul_int64 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 561 failed = true 562 } 563 } 564 for _, v := range uint32_data { 565 if got := add_uint32_ssa(v.a, v.b); got != v.add { 566 fmt.Printf("add_uint32 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 567 failed = true 568 } 569 if got := sub_uint32_ssa(v.a, v.b); got != v.sub { 570 fmt.Printf("sub_uint32 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 571 failed = true 572 } 573 if v.b != 0 { 574 if got := div_uint32_ssa(v.a, v.b); got != v.div { 575 fmt.Printf("div_uint32 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 576 failed = true 577 } 578 579 } 580 if v.b != 0 { 581 if got := mod_uint32_ssa(v.a, v.b); got != v.mod { 582 fmt.Printf("mod_uint32 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 583 failed = true 584 } 585 586 } 587 if got := mul_uint32_ssa(v.a, v.b); got != v.mul { 588 fmt.Printf("mul_uint32 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 589 failed = true 590 } 591 } 592 for _, v := range int32_data { 593 if got := add_int32_ssa(v.a, v.b); got != v.add { 594 fmt.Printf("add_int32 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 595 failed = true 596 } 597 if got := sub_int32_ssa(v.a, v.b); got != v.sub { 598 fmt.Printf("sub_int32 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 599 failed = true 600 } 601 if v.b != 0 { 602 if got := div_int32_ssa(v.a, v.b); got != v.div { 603 fmt.Printf("div_int32 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 604 failed = true 605 } 606 607 } 608 if v.b != 0 { 609 if got := mod_int32_ssa(v.a, v.b); got != v.mod { 610 fmt.Printf("mod_int32 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 611 failed = true 612 } 613 614 } 615 if got := mul_int32_ssa(v.a, v.b); got != v.mul { 616 fmt.Printf("mul_int32 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 617 failed = true 618 } 619 } 620 for _, v := range uint16_data { 621 if got := add_uint16_ssa(v.a, v.b); got != v.add { 622 fmt.Printf("add_uint16 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 623 failed = true 624 } 625 if got := sub_uint16_ssa(v.a, v.b); got != v.sub { 626 fmt.Printf("sub_uint16 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 627 failed = true 628 } 629 if v.b != 0 { 630 if got := div_uint16_ssa(v.a, v.b); got != v.div { 631 fmt.Printf("div_uint16 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 632 failed = true 633 } 634 635 } 636 if v.b != 0 { 637 if got := mod_uint16_ssa(v.a, v.b); got != v.mod { 638 fmt.Printf("mod_uint16 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 639 failed = true 640 } 641 642 } 643 if got := mul_uint16_ssa(v.a, v.b); got != v.mul { 644 fmt.Printf("mul_uint16 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 645 failed = true 646 } 647 } 648 for _, v := range int16_data { 649 if got := add_int16_ssa(v.a, v.b); got != v.add { 650 fmt.Printf("add_int16 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 651 failed = true 652 } 653 if got := sub_int16_ssa(v.a, v.b); got != v.sub { 654 fmt.Printf("sub_int16 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 655 failed = true 656 } 657 if v.b != 0 { 658 if got := div_int16_ssa(v.a, v.b); got != v.div { 659 fmt.Printf("div_int16 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 660 failed = true 661 } 662 663 } 664 if v.b != 0 { 665 if got := mod_int16_ssa(v.a, v.b); got != v.mod { 666 fmt.Printf("mod_int16 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 667 failed = true 668 } 669 670 } 671 if got := mul_int16_ssa(v.a, v.b); got != v.mul { 672 fmt.Printf("mul_int16 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 673 failed = true 674 } 675 } 676 for _, v := range uint8_data { 677 if got := add_uint8_ssa(v.a, v.b); got != v.add { 678 fmt.Printf("add_uint8 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 679 failed = true 680 } 681 if got := sub_uint8_ssa(v.a, v.b); got != v.sub { 682 fmt.Printf("sub_uint8 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 683 failed = true 684 } 685 if v.b != 0 { 686 if got := div_uint8_ssa(v.a, v.b); got != v.div { 687 fmt.Printf("div_uint8 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 688 failed = true 689 } 690 691 } 692 if v.b != 0 { 693 if got := mod_uint8_ssa(v.a, v.b); got != v.mod { 694 fmt.Printf("mod_uint8 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 695 failed = true 696 } 697 698 } 699 if got := mul_uint8_ssa(v.a, v.b); got != v.mul { 700 fmt.Printf("mul_uint8 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 701 failed = true 702 } 703 } 704 for _, v := range int8_data { 705 if got := add_int8_ssa(v.a, v.b); got != v.add { 706 fmt.Printf("add_int8 %d+%d = %d, wanted %d\n", v.a, v.b, got, v.add) 707 failed = true 708 } 709 if got := sub_int8_ssa(v.a, v.b); got != v.sub { 710 fmt.Printf("sub_int8 %d-%d = %d, wanted %d\n", v.a, v.b, got, v.sub) 711 failed = true 712 } 713 if v.b != 0 { 714 if got := div_int8_ssa(v.a, v.b); got != v.div { 715 fmt.Printf("div_int8 %d/%d = %d, wanted %d\n", v.a, v.b, got, v.div) 716 failed = true 717 } 718 719 } 720 if v.b != 0 { 721 if got := mod_int8_ssa(v.a, v.b); got != v.mod { 722 fmt.Printf("mod_int8 %d%%%d = %d, wanted %d\n", v.a, v.b, got, v.mod) 723 failed = true 724 } 725 726 } 727 if got := mul_int8_ssa(v.a, v.b); got != v.mul { 728 fmt.Printf("mul_int8 %d*%d = %d, wanted %d\n", v.a, v.b, got, v.mul) 729 failed = true 730 } 731 } 732 if failed { 733 panic("tests failed") 734 } 735 } 736