github.com/goplus/gossa@v0.3.25/binop.go (about) 1 package gossa 2 3 import ( 4 "reflect" 5 6 "github.com/goplus/gossa/internal/xtype" 7 "golang.org/x/tools/go/ssa" 8 ) 9 10 func makeBinOpADD(pfn *function, instr *ssa.BinOp) func(fr *frame) { 11 ir := pfn.regIndex(instr) 12 ix, kx, vx := pfn.regIndex3(instr.X) 13 iy, ky, vy := pfn.regIndex3(instr.Y) 14 typ := pfn.Interp.preToType(instr.Type()) 15 if typ.PkgPath() == "" { 16 switch typ.Kind() { 17 case reflect.Int: 18 if kx == kindConst && ky == kindConst { 19 v := vx.(int) + vy.(int) 20 return func(fr *frame) { fr.setReg(ir, v) } 21 } else if kx == kindConst { 22 x := vx.(int) 23 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(int)) } 24 } else if ky == kindConst { 25 y := vy.(int) 26 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)+y) } 27 } else { 28 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)+fr.reg(iy).(int)) } 29 } 30 case reflect.Int8: 31 if kx == kindConst && ky == kindConst { 32 v := vx.(int8) + vy.(int8) 33 return func(fr *frame) { fr.setReg(ir, v) } 34 } else if kx == kindConst { 35 x := vx.(int8) 36 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(int8)) } 37 } else if ky == kindConst { 38 y := vy.(int8) 39 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)+y) } 40 } else { 41 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)+fr.reg(iy).(int8)) } 42 } 43 case reflect.Int16: 44 if kx == kindConst && ky == kindConst { 45 v := vx.(int16) + vy.(int16) 46 return func(fr *frame) { fr.setReg(ir, v) } 47 } else if kx == kindConst { 48 x := vx.(int16) 49 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(int16)) } 50 } else if ky == kindConst { 51 y := vy.(int16) 52 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)+y) } 53 } else { 54 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)+fr.reg(iy).(int16)) } 55 } 56 case reflect.Int32: 57 if kx == kindConst && ky == kindConst { 58 v := vx.(int32) + vy.(int32) 59 return func(fr *frame) { fr.setReg(ir, v) } 60 } else if kx == kindConst { 61 x := vx.(int32) 62 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(int32)) } 63 } else if ky == kindConst { 64 y := vy.(int32) 65 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)+y) } 66 } else { 67 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)+fr.reg(iy).(int32)) } 68 } 69 case reflect.Int64: 70 if kx == kindConst && ky == kindConst { 71 v := vx.(int64) + vy.(int64) 72 return func(fr *frame) { fr.setReg(ir, v) } 73 } else if kx == kindConst { 74 x := vx.(int64) 75 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(int64)) } 76 } else if ky == kindConst { 77 y := vy.(int64) 78 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)+y) } 79 } else { 80 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)+fr.reg(iy).(int64)) } 81 } 82 case reflect.Uint: 83 if kx == kindConst && ky == kindConst { 84 v := vx.(uint) + vy.(uint) 85 return func(fr *frame) { fr.setReg(ir, v) } 86 } else if kx == kindConst { 87 x := vx.(uint) 88 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(uint)) } 89 } else if ky == kindConst { 90 y := vy.(uint) 91 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)+y) } 92 } else { 93 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)+fr.reg(iy).(uint)) } 94 } 95 case reflect.Uint8: 96 if kx == kindConst && ky == kindConst { 97 v := vx.(uint8) + vy.(uint8) 98 return func(fr *frame) { fr.setReg(ir, v) } 99 } else if kx == kindConst { 100 x := vx.(uint8) 101 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(uint8)) } 102 } else if ky == kindConst { 103 y := vy.(uint8) 104 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)+y) } 105 } else { 106 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)+fr.reg(iy).(uint8)) } 107 } 108 case reflect.Uint16: 109 if kx == kindConst && ky == kindConst { 110 v := vx.(uint16) + vy.(uint16) 111 return func(fr *frame) { fr.setReg(ir, v) } 112 } else if kx == kindConst { 113 x := vx.(uint16) 114 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(uint16)) } 115 } else if ky == kindConst { 116 y := vy.(uint16) 117 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)+y) } 118 } else { 119 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)+fr.reg(iy).(uint16)) } 120 } 121 case reflect.Uint32: 122 if kx == kindConst && ky == kindConst { 123 v := vx.(uint32) + vy.(uint32) 124 return func(fr *frame) { fr.setReg(ir, v) } 125 } else if kx == kindConst { 126 x := vx.(uint32) 127 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(uint32)) } 128 } else if ky == kindConst { 129 y := vy.(uint32) 130 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)+y) } 131 } else { 132 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)+fr.reg(iy).(uint32)) } 133 } 134 case reflect.Uint64: 135 if kx == kindConst && ky == kindConst { 136 v := vx.(uint64) + vy.(uint64) 137 return func(fr *frame) { fr.setReg(ir, v) } 138 } else if kx == kindConst { 139 x := vx.(uint64) 140 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(uint64)) } 141 } else if ky == kindConst { 142 y := vy.(uint64) 143 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)+y) } 144 } else { 145 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)+fr.reg(iy).(uint64)) } 146 } 147 case reflect.Uintptr: 148 if kx == kindConst && ky == kindConst { 149 v := vx.(uintptr) + vy.(uintptr) 150 return func(fr *frame) { fr.setReg(ir, v) } 151 } else if kx == kindConst { 152 x := vx.(uintptr) 153 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(uintptr)) } 154 } else if ky == kindConst { 155 y := vy.(uintptr) 156 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)+y) } 157 } else { 158 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)+fr.reg(iy).(uintptr)) } 159 } 160 case reflect.Float32: 161 if kx == kindConst && ky == kindConst { 162 v := vx.(float32) + vy.(float32) 163 return func(fr *frame) { fr.setReg(ir, v) } 164 } else if kx == kindConst { 165 x := vx.(float32) 166 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(float32)) } 167 } else if ky == kindConst { 168 y := vy.(float32) 169 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)+y) } 170 } else { 171 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)+fr.reg(iy).(float32)) } 172 } 173 case reflect.Float64: 174 if kx == kindConst && ky == kindConst { 175 v := vx.(float64) + vy.(float64) 176 return func(fr *frame) { fr.setReg(ir, v) } 177 } else if kx == kindConst { 178 x := vx.(float64) 179 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(float64)) } 180 } else if ky == kindConst { 181 y := vy.(float64) 182 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)+y) } 183 } else { 184 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)+fr.reg(iy).(float64)) } 185 } 186 case reflect.Complex64: 187 if kx == kindConst && ky == kindConst { 188 v := vx.(complex64) + vy.(complex64) 189 return func(fr *frame) { fr.setReg(ir, v) } 190 } else if kx == kindConst { 191 x := vx.(complex64) 192 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(complex64)) } 193 } else if ky == kindConst { 194 y := vy.(complex64) 195 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)+y) } 196 } else { 197 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)+fr.reg(iy).(complex64)) } 198 } 199 case reflect.Complex128: 200 if kx == kindConst && ky == kindConst { 201 v := vx.(complex128) + vy.(complex128) 202 return func(fr *frame) { fr.setReg(ir, v) } 203 } else if kx == kindConst { 204 x := vx.(complex128) 205 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(complex128)) } 206 } else if ky == kindConst { 207 y := vy.(complex128) 208 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)+y) } 209 } else { 210 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)+fr.reg(iy).(complex128)) } 211 } 212 case reflect.String: 213 if kx == kindConst && ky == kindConst { 214 v := vx.(string) + vy.(string) 215 return func(fr *frame) { fr.setReg(ir, v) } 216 } else if kx == kindConst { 217 x := vx.(string) 218 return func(fr *frame) { fr.setReg(ir, x+fr.reg(iy).(string)) } 219 } else if ky == kindConst { 220 y := vy.(string) 221 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string)+y) } 222 } else { 223 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string)+fr.reg(iy).(string)) } 224 } 225 } 226 } else { 227 t := xtype.TypeOfType(typ) 228 switch typ.Kind() { 229 case reflect.Int: 230 if kx == kindConst && ky == kindConst { 231 v := xtype.Make(t, xtype.Int(vx)+xtype.Int(vy)) 232 return func(fr *frame) { fr.setReg(ir, v) } 233 } else if kx == kindConst { 234 x := xtype.Int(vx) 235 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.int(iy))) } 236 } else if ky == kindConst { 237 y := xtype.Int(vy) 238 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)+y)) } 239 } else { 240 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)+fr.int(iy))) } 241 } 242 case reflect.Int8: 243 if kx == kindConst && ky == kindConst { 244 v := xtype.Make(t, xtype.Int8(vx)+xtype.Int8(vy)) 245 return func(fr *frame) { fr.setReg(ir, v) } 246 } else if kx == kindConst { 247 x := xtype.Int8(vx) 248 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.int8(iy))) } 249 } else if ky == kindConst { 250 y := xtype.Int8(vy) 251 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)+y)) } 252 } else { 253 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)+fr.int8(iy))) } 254 } 255 case reflect.Int16: 256 if kx == kindConst && ky == kindConst { 257 v := xtype.Make(t, xtype.Int16(vx)+xtype.Int16(vy)) 258 return func(fr *frame) { fr.setReg(ir, v) } 259 } else if kx == kindConst { 260 x := xtype.Int16(vx) 261 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.int16(iy))) } 262 } else if ky == kindConst { 263 y := xtype.Int16(vy) 264 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)+y)) } 265 } else { 266 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)+fr.int16(iy))) } 267 } 268 case reflect.Int32: 269 if kx == kindConst && ky == kindConst { 270 v := xtype.Make(t, xtype.Int32(vx)+xtype.Int32(vy)) 271 return func(fr *frame) { fr.setReg(ir, v) } 272 } else if kx == kindConst { 273 x := xtype.Int32(vx) 274 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.int32(iy))) } 275 } else if ky == kindConst { 276 y := xtype.Int32(vy) 277 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)+y)) } 278 } else { 279 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)+fr.int32(iy))) } 280 } 281 case reflect.Int64: 282 if kx == kindConst && ky == kindConst { 283 v := xtype.Make(t, xtype.Int64(vx)+xtype.Int64(vy)) 284 return func(fr *frame) { fr.setReg(ir, v) } 285 } else if kx == kindConst { 286 x := xtype.Int64(vx) 287 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.int64(iy))) } 288 } else if ky == kindConst { 289 y := xtype.Int64(vy) 290 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)+y)) } 291 } else { 292 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)+fr.int64(iy))) } 293 } 294 case reflect.Uint: 295 if kx == kindConst && ky == kindConst { 296 v := xtype.Make(t, xtype.Uint(vx)+xtype.Uint(vy)) 297 return func(fr *frame) { fr.setReg(ir, v) } 298 } else if kx == kindConst { 299 x := xtype.Uint(vx) 300 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.uint(iy))) } 301 } else if ky == kindConst { 302 y := xtype.Uint(vy) 303 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)+y)) } 304 } else { 305 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)+fr.uint(iy))) } 306 } 307 case reflect.Uint8: 308 if kx == kindConst && ky == kindConst { 309 v := xtype.Make(t, xtype.Uint8(vx)+xtype.Uint8(vy)) 310 return func(fr *frame) { fr.setReg(ir, v) } 311 } else if kx == kindConst { 312 x := xtype.Uint8(vx) 313 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.uint8(iy))) } 314 } else if ky == kindConst { 315 y := xtype.Uint8(vy) 316 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)+y)) } 317 } else { 318 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)+fr.uint8(iy))) } 319 } 320 case reflect.Uint16: 321 if kx == kindConst && ky == kindConst { 322 v := xtype.Make(t, xtype.Uint16(vx)+xtype.Uint16(vy)) 323 return func(fr *frame) { fr.setReg(ir, v) } 324 } else if kx == kindConst { 325 x := xtype.Uint16(vx) 326 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.uint16(iy))) } 327 } else if ky == kindConst { 328 y := xtype.Uint16(vy) 329 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)+y)) } 330 } else { 331 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)+fr.uint16(iy))) } 332 } 333 case reflect.Uint32: 334 if kx == kindConst && ky == kindConst { 335 v := xtype.Make(t, xtype.Uint32(vx)+xtype.Uint32(vy)) 336 return func(fr *frame) { fr.setReg(ir, v) } 337 } else if kx == kindConst { 338 x := xtype.Uint32(vx) 339 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.uint32(iy))) } 340 } else if ky == kindConst { 341 y := xtype.Uint32(vy) 342 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)+y)) } 343 } else { 344 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)+fr.uint32(iy))) } 345 } 346 case reflect.Uint64: 347 if kx == kindConst && ky == kindConst { 348 v := xtype.Make(t, xtype.Uint64(vx)+xtype.Uint64(vy)) 349 return func(fr *frame) { fr.setReg(ir, v) } 350 } else if kx == kindConst { 351 x := xtype.Uint64(vx) 352 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.uint64(iy))) } 353 } else if ky == kindConst { 354 y := xtype.Uint64(vy) 355 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)+y)) } 356 } else { 357 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)+fr.uint64(iy))) } 358 } 359 case reflect.Uintptr: 360 if kx == kindConst && ky == kindConst { 361 v := xtype.Make(t, xtype.Uintptr(vx)+xtype.Uintptr(vy)) 362 return func(fr *frame) { fr.setReg(ir, v) } 363 } else if kx == kindConst { 364 x := xtype.Uintptr(vx) 365 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.uintptr(iy))) } 366 } else if ky == kindConst { 367 y := xtype.Uintptr(vy) 368 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)+y)) } 369 } else { 370 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)+fr.uintptr(iy))) } 371 } 372 case reflect.Float32: 373 if kx == kindConst && ky == kindConst { 374 v := xtype.Make(t, xtype.Float32(vx)+xtype.Float32(vy)) 375 return func(fr *frame) { fr.setReg(ir, v) } 376 } else if kx == kindConst { 377 x := xtype.Float32(vx) 378 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.float32(iy))) } 379 } else if ky == kindConst { 380 y := xtype.Float32(vy) 381 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)+y)) } 382 } else { 383 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)+fr.float32(iy))) } 384 } 385 case reflect.Float64: 386 if kx == kindConst && ky == kindConst { 387 v := xtype.Make(t, xtype.Float64(vx)+xtype.Float64(vy)) 388 return func(fr *frame) { fr.setReg(ir, v) } 389 } else if kx == kindConst { 390 x := xtype.Float64(vx) 391 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.float64(iy))) } 392 } else if ky == kindConst { 393 y := xtype.Float64(vy) 394 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)+y)) } 395 } else { 396 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)+fr.float64(iy))) } 397 } 398 case reflect.Complex64: 399 if kx == kindConst && ky == kindConst { 400 v := xtype.Make(t, xtype.Complex64(vx)+xtype.Complex64(vy)) 401 return func(fr *frame) { fr.setReg(ir, v) } 402 } else if kx == kindConst { 403 x := xtype.Complex64(vx) 404 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.complex64(iy))) } 405 } else if ky == kindConst { 406 y := xtype.Complex64(vy) 407 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)+y)) } 408 } else { 409 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)+fr.complex64(iy))) } 410 } 411 case reflect.Complex128: 412 if kx == kindConst && ky == kindConst { 413 v := xtype.Make(t, xtype.Complex128(vx)+xtype.Complex128(vy)) 414 return func(fr *frame) { fr.setReg(ir, v) } 415 } else if kx == kindConst { 416 x := xtype.Complex128(vx) 417 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.complex128(iy))) } 418 } else if ky == kindConst { 419 y := xtype.Complex128(vy) 420 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)+y)) } 421 } else { 422 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)+fr.complex128(iy))) } 423 } 424 case reflect.String: 425 if kx == kindConst && ky == kindConst { 426 v := xtype.Make(t, xtype.String(vx)+xtype.String(vy)) 427 return func(fr *frame) { fr.setReg(ir, v) } 428 } else if kx == kindConst { 429 x := xtype.String(vx) 430 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x+fr.string(iy))) } 431 } else if ky == kindConst { 432 y := xtype.String(vy) 433 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.string(ix)+y)) } 434 } else { 435 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.string(ix)+fr.string(iy))) } 436 } 437 } 438 } 439 panic("unreachable") 440 } 441 func makeBinOpSUB(pfn *function, instr *ssa.BinOp) func(fr *frame) { 442 ir := pfn.regIndex(instr) 443 ix, kx, vx := pfn.regIndex3(instr.X) 444 iy, ky, vy := pfn.regIndex3(instr.Y) 445 typ := pfn.Interp.preToType(instr.Type()) 446 if typ.PkgPath() == "" { 447 switch typ.Kind() { 448 case reflect.Int: 449 if kx == kindConst && ky == kindConst { 450 v := vx.(int) - vy.(int) 451 return func(fr *frame) { fr.setReg(ir, v) } 452 } else if kx == kindConst { 453 x := vx.(int) 454 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(int)) } 455 } else if ky == kindConst { 456 y := vy.(int) 457 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)-y) } 458 } else { 459 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)-fr.reg(iy).(int)) } 460 } 461 case reflect.Int8: 462 if kx == kindConst && ky == kindConst { 463 v := vx.(int8) - vy.(int8) 464 return func(fr *frame) { fr.setReg(ir, v) } 465 } else if kx == kindConst { 466 x := vx.(int8) 467 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(int8)) } 468 } else if ky == kindConst { 469 y := vy.(int8) 470 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)-y) } 471 } else { 472 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)-fr.reg(iy).(int8)) } 473 } 474 case reflect.Int16: 475 if kx == kindConst && ky == kindConst { 476 v := vx.(int16) - vy.(int16) 477 return func(fr *frame) { fr.setReg(ir, v) } 478 } else if kx == kindConst { 479 x := vx.(int16) 480 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(int16)) } 481 } else if ky == kindConst { 482 y := vy.(int16) 483 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)-y) } 484 } else { 485 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)-fr.reg(iy).(int16)) } 486 } 487 case reflect.Int32: 488 if kx == kindConst && ky == kindConst { 489 v := vx.(int32) - vy.(int32) 490 return func(fr *frame) { fr.setReg(ir, v) } 491 } else if kx == kindConst { 492 x := vx.(int32) 493 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(int32)) } 494 } else if ky == kindConst { 495 y := vy.(int32) 496 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)-y) } 497 } else { 498 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)-fr.reg(iy).(int32)) } 499 } 500 case reflect.Int64: 501 if kx == kindConst && ky == kindConst { 502 v := vx.(int64) - vy.(int64) 503 return func(fr *frame) { fr.setReg(ir, v) } 504 } else if kx == kindConst { 505 x := vx.(int64) 506 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(int64)) } 507 } else if ky == kindConst { 508 y := vy.(int64) 509 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)-y) } 510 } else { 511 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)-fr.reg(iy).(int64)) } 512 } 513 case reflect.Uint: 514 if kx == kindConst && ky == kindConst { 515 v := vx.(uint) - vy.(uint) 516 return func(fr *frame) { fr.setReg(ir, v) } 517 } else if kx == kindConst { 518 x := vx.(uint) 519 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(uint)) } 520 } else if ky == kindConst { 521 y := vy.(uint) 522 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)-y) } 523 } else { 524 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)-fr.reg(iy).(uint)) } 525 } 526 case reflect.Uint8: 527 if kx == kindConst && ky == kindConst { 528 v := vx.(uint8) - vy.(uint8) 529 return func(fr *frame) { fr.setReg(ir, v) } 530 } else if kx == kindConst { 531 x := vx.(uint8) 532 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(uint8)) } 533 } else if ky == kindConst { 534 y := vy.(uint8) 535 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)-y) } 536 } else { 537 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)-fr.reg(iy).(uint8)) } 538 } 539 case reflect.Uint16: 540 if kx == kindConst && ky == kindConst { 541 v := vx.(uint16) - vy.(uint16) 542 return func(fr *frame) { fr.setReg(ir, v) } 543 } else if kx == kindConst { 544 x := vx.(uint16) 545 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(uint16)) } 546 } else if ky == kindConst { 547 y := vy.(uint16) 548 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)-y) } 549 } else { 550 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)-fr.reg(iy).(uint16)) } 551 } 552 case reflect.Uint32: 553 if kx == kindConst && ky == kindConst { 554 v := vx.(uint32) - vy.(uint32) 555 return func(fr *frame) { fr.setReg(ir, v) } 556 } else if kx == kindConst { 557 x := vx.(uint32) 558 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(uint32)) } 559 } else if ky == kindConst { 560 y := vy.(uint32) 561 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)-y) } 562 } else { 563 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)-fr.reg(iy).(uint32)) } 564 } 565 case reflect.Uint64: 566 if kx == kindConst && ky == kindConst { 567 v := vx.(uint64) - vy.(uint64) 568 return func(fr *frame) { fr.setReg(ir, v) } 569 } else if kx == kindConst { 570 x := vx.(uint64) 571 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(uint64)) } 572 } else if ky == kindConst { 573 y := vy.(uint64) 574 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)-y) } 575 } else { 576 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)-fr.reg(iy).(uint64)) } 577 } 578 case reflect.Uintptr: 579 if kx == kindConst && ky == kindConst { 580 v := vx.(uintptr) - vy.(uintptr) 581 return func(fr *frame) { fr.setReg(ir, v) } 582 } else if kx == kindConst { 583 x := vx.(uintptr) 584 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(uintptr)) } 585 } else if ky == kindConst { 586 y := vy.(uintptr) 587 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)-y) } 588 } else { 589 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)-fr.reg(iy).(uintptr)) } 590 } 591 case reflect.Float32: 592 if kx == kindConst && ky == kindConst { 593 v := vx.(float32) - vy.(float32) 594 return func(fr *frame) { fr.setReg(ir, v) } 595 } else if kx == kindConst { 596 x := vx.(float32) 597 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(float32)) } 598 } else if ky == kindConst { 599 y := vy.(float32) 600 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)-y) } 601 } else { 602 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)-fr.reg(iy).(float32)) } 603 } 604 case reflect.Float64: 605 if kx == kindConst && ky == kindConst { 606 v := vx.(float64) - vy.(float64) 607 return func(fr *frame) { fr.setReg(ir, v) } 608 } else if kx == kindConst { 609 x := vx.(float64) 610 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(float64)) } 611 } else if ky == kindConst { 612 y := vy.(float64) 613 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)-y) } 614 } else { 615 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)-fr.reg(iy).(float64)) } 616 } 617 case reflect.Complex64: 618 if kx == kindConst && ky == kindConst { 619 v := vx.(complex64) - vy.(complex64) 620 return func(fr *frame) { fr.setReg(ir, v) } 621 } else if kx == kindConst { 622 x := vx.(complex64) 623 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(complex64)) } 624 } else if ky == kindConst { 625 y := vy.(complex64) 626 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)-y) } 627 } else { 628 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)-fr.reg(iy).(complex64)) } 629 } 630 case reflect.Complex128: 631 if kx == kindConst && ky == kindConst { 632 v := vx.(complex128) - vy.(complex128) 633 return func(fr *frame) { fr.setReg(ir, v) } 634 } else if kx == kindConst { 635 x := vx.(complex128) 636 return func(fr *frame) { fr.setReg(ir, x-fr.reg(iy).(complex128)) } 637 } else if ky == kindConst { 638 y := vy.(complex128) 639 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)-y) } 640 } else { 641 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)-fr.reg(iy).(complex128)) } 642 } 643 } 644 } else { 645 t := xtype.TypeOfType(typ) 646 switch typ.Kind() { 647 case reflect.Int: 648 if kx == kindConst && ky == kindConst { 649 v := xtype.Make(t, xtype.Int(vx)-xtype.Int(vy)) 650 return func(fr *frame) { fr.setReg(ir, v) } 651 } else if kx == kindConst { 652 x := xtype.Int(vx) 653 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.int(iy))) } 654 } else if ky == kindConst { 655 y := xtype.Int(vy) 656 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)-y)) } 657 } else { 658 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)-fr.int(iy))) } 659 } 660 case reflect.Int8: 661 if kx == kindConst && ky == kindConst { 662 v := xtype.Make(t, xtype.Int8(vx)-xtype.Int8(vy)) 663 return func(fr *frame) { fr.setReg(ir, v) } 664 } else if kx == kindConst { 665 x := xtype.Int8(vx) 666 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.int8(iy))) } 667 } else if ky == kindConst { 668 y := xtype.Int8(vy) 669 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)-y)) } 670 } else { 671 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)-fr.int8(iy))) } 672 } 673 case reflect.Int16: 674 if kx == kindConst && ky == kindConst { 675 v := xtype.Make(t, xtype.Int16(vx)-xtype.Int16(vy)) 676 return func(fr *frame) { fr.setReg(ir, v) } 677 } else if kx == kindConst { 678 x := xtype.Int16(vx) 679 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.int16(iy))) } 680 } else if ky == kindConst { 681 y := xtype.Int16(vy) 682 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)-y)) } 683 } else { 684 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)-fr.int16(iy))) } 685 } 686 case reflect.Int32: 687 if kx == kindConst && ky == kindConst { 688 v := xtype.Make(t, xtype.Int32(vx)-xtype.Int32(vy)) 689 return func(fr *frame) { fr.setReg(ir, v) } 690 } else if kx == kindConst { 691 x := xtype.Int32(vx) 692 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.int32(iy))) } 693 } else if ky == kindConst { 694 y := xtype.Int32(vy) 695 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)-y)) } 696 } else { 697 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)-fr.int32(iy))) } 698 } 699 case reflect.Int64: 700 if kx == kindConst && ky == kindConst { 701 v := xtype.Make(t, xtype.Int64(vx)-xtype.Int64(vy)) 702 return func(fr *frame) { fr.setReg(ir, v) } 703 } else if kx == kindConst { 704 x := xtype.Int64(vx) 705 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.int64(iy))) } 706 } else if ky == kindConst { 707 y := xtype.Int64(vy) 708 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)-y)) } 709 } else { 710 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)-fr.int64(iy))) } 711 } 712 case reflect.Uint: 713 if kx == kindConst && ky == kindConst { 714 v := xtype.Make(t, xtype.Uint(vx)-xtype.Uint(vy)) 715 return func(fr *frame) { fr.setReg(ir, v) } 716 } else if kx == kindConst { 717 x := xtype.Uint(vx) 718 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.uint(iy))) } 719 } else if ky == kindConst { 720 y := xtype.Uint(vy) 721 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)-y)) } 722 } else { 723 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)-fr.uint(iy))) } 724 } 725 case reflect.Uint8: 726 if kx == kindConst && ky == kindConst { 727 v := xtype.Make(t, xtype.Uint8(vx)-xtype.Uint8(vy)) 728 return func(fr *frame) { fr.setReg(ir, v) } 729 } else if kx == kindConst { 730 x := xtype.Uint8(vx) 731 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.uint8(iy))) } 732 } else if ky == kindConst { 733 y := xtype.Uint8(vy) 734 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)-y)) } 735 } else { 736 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)-fr.uint8(iy))) } 737 } 738 case reflect.Uint16: 739 if kx == kindConst && ky == kindConst { 740 v := xtype.Make(t, xtype.Uint16(vx)-xtype.Uint16(vy)) 741 return func(fr *frame) { fr.setReg(ir, v) } 742 } else if kx == kindConst { 743 x := xtype.Uint16(vx) 744 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.uint16(iy))) } 745 } else if ky == kindConst { 746 y := xtype.Uint16(vy) 747 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)-y)) } 748 } else { 749 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)-fr.uint16(iy))) } 750 } 751 case reflect.Uint32: 752 if kx == kindConst && ky == kindConst { 753 v := xtype.Make(t, xtype.Uint32(vx)-xtype.Uint32(vy)) 754 return func(fr *frame) { fr.setReg(ir, v) } 755 } else if kx == kindConst { 756 x := xtype.Uint32(vx) 757 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.uint32(iy))) } 758 } else if ky == kindConst { 759 y := xtype.Uint32(vy) 760 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)-y)) } 761 } else { 762 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)-fr.uint32(iy))) } 763 } 764 case reflect.Uint64: 765 if kx == kindConst && ky == kindConst { 766 v := xtype.Make(t, xtype.Uint64(vx)-xtype.Uint64(vy)) 767 return func(fr *frame) { fr.setReg(ir, v) } 768 } else if kx == kindConst { 769 x := xtype.Uint64(vx) 770 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.uint64(iy))) } 771 } else if ky == kindConst { 772 y := xtype.Uint64(vy) 773 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)-y)) } 774 } else { 775 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)-fr.uint64(iy))) } 776 } 777 case reflect.Uintptr: 778 if kx == kindConst && ky == kindConst { 779 v := xtype.Make(t, xtype.Uintptr(vx)-xtype.Uintptr(vy)) 780 return func(fr *frame) { fr.setReg(ir, v) } 781 } else if kx == kindConst { 782 x := xtype.Uintptr(vx) 783 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.uintptr(iy))) } 784 } else if ky == kindConst { 785 y := xtype.Uintptr(vy) 786 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)-y)) } 787 } else { 788 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)-fr.uintptr(iy))) } 789 } 790 case reflect.Float32: 791 if kx == kindConst && ky == kindConst { 792 v := xtype.Make(t, xtype.Float32(vx)-xtype.Float32(vy)) 793 return func(fr *frame) { fr.setReg(ir, v) } 794 } else if kx == kindConst { 795 x := xtype.Float32(vx) 796 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.float32(iy))) } 797 } else if ky == kindConst { 798 y := xtype.Float32(vy) 799 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)-y)) } 800 } else { 801 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)-fr.float32(iy))) } 802 } 803 case reflect.Float64: 804 if kx == kindConst && ky == kindConst { 805 v := xtype.Make(t, xtype.Float64(vx)-xtype.Float64(vy)) 806 return func(fr *frame) { fr.setReg(ir, v) } 807 } else if kx == kindConst { 808 x := xtype.Float64(vx) 809 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.float64(iy))) } 810 } else if ky == kindConst { 811 y := xtype.Float64(vy) 812 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)-y)) } 813 } else { 814 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)-fr.float64(iy))) } 815 } 816 case reflect.Complex64: 817 if kx == kindConst && ky == kindConst { 818 v := xtype.Make(t, xtype.Complex64(vx)-xtype.Complex64(vy)) 819 return func(fr *frame) { fr.setReg(ir, v) } 820 } else if kx == kindConst { 821 x := xtype.Complex64(vx) 822 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.complex64(iy))) } 823 } else if ky == kindConst { 824 y := xtype.Complex64(vy) 825 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)-y)) } 826 } else { 827 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)-fr.complex64(iy))) } 828 } 829 case reflect.Complex128: 830 if kx == kindConst && ky == kindConst { 831 v := xtype.Make(t, xtype.Complex128(vx)-xtype.Complex128(vy)) 832 return func(fr *frame) { fr.setReg(ir, v) } 833 } else if kx == kindConst { 834 x := xtype.Complex128(vx) 835 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x-fr.complex128(iy))) } 836 } else if ky == kindConst { 837 y := xtype.Complex128(vy) 838 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)-y)) } 839 } else { 840 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)-fr.complex128(iy))) } 841 } 842 } 843 } 844 panic("unreachable") 845 } 846 func makeBinOpMUL(pfn *function, instr *ssa.BinOp) func(fr *frame) { 847 ir := pfn.regIndex(instr) 848 ix, kx, vx := pfn.regIndex3(instr.X) 849 iy, ky, vy := pfn.regIndex3(instr.Y) 850 typ := pfn.Interp.preToType(instr.Type()) 851 if typ.PkgPath() == "" { 852 switch typ.Kind() { 853 case reflect.Int: 854 if kx == kindConst && ky == kindConst { 855 v := vx.(int) * vy.(int) 856 return func(fr *frame) { fr.setReg(ir, v) } 857 } else if kx == kindConst { 858 x := vx.(int) 859 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(int)) } 860 } else if ky == kindConst { 861 y := vy.(int) 862 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)*y) } 863 } else { 864 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)*fr.reg(iy).(int)) } 865 } 866 case reflect.Int8: 867 if kx == kindConst && ky == kindConst { 868 v := vx.(int8) * vy.(int8) 869 return func(fr *frame) { fr.setReg(ir, v) } 870 } else if kx == kindConst { 871 x := vx.(int8) 872 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(int8)) } 873 } else if ky == kindConst { 874 y := vy.(int8) 875 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)*y) } 876 } else { 877 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)*fr.reg(iy).(int8)) } 878 } 879 case reflect.Int16: 880 if kx == kindConst && ky == kindConst { 881 v := vx.(int16) * vy.(int16) 882 return func(fr *frame) { fr.setReg(ir, v) } 883 } else if kx == kindConst { 884 x := vx.(int16) 885 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(int16)) } 886 } else if ky == kindConst { 887 y := vy.(int16) 888 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)*y) } 889 } else { 890 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)*fr.reg(iy).(int16)) } 891 } 892 case reflect.Int32: 893 if kx == kindConst && ky == kindConst { 894 v := vx.(int32) * vy.(int32) 895 return func(fr *frame) { fr.setReg(ir, v) } 896 } else if kx == kindConst { 897 x := vx.(int32) 898 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(int32)) } 899 } else if ky == kindConst { 900 y := vy.(int32) 901 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)*y) } 902 } else { 903 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)*fr.reg(iy).(int32)) } 904 } 905 case reflect.Int64: 906 if kx == kindConst && ky == kindConst { 907 v := vx.(int64) * vy.(int64) 908 return func(fr *frame) { fr.setReg(ir, v) } 909 } else if kx == kindConst { 910 x := vx.(int64) 911 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(int64)) } 912 } else if ky == kindConst { 913 y := vy.(int64) 914 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)*y) } 915 } else { 916 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)*fr.reg(iy).(int64)) } 917 } 918 case reflect.Uint: 919 if kx == kindConst && ky == kindConst { 920 v := vx.(uint) * vy.(uint) 921 return func(fr *frame) { fr.setReg(ir, v) } 922 } else if kx == kindConst { 923 x := vx.(uint) 924 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(uint)) } 925 } else if ky == kindConst { 926 y := vy.(uint) 927 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)*y) } 928 } else { 929 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)*fr.reg(iy).(uint)) } 930 } 931 case reflect.Uint8: 932 if kx == kindConst && ky == kindConst { 933 v := vx.(uint8) * vy.(uint8) 934 return func(fr *frame) { fr.setReg(ir, v) } 935 } else if kx == kindConst { 936 x := vx.(uint8) 937 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(uint8)) } 938 } else if ky == kindConst { 939 y := vy.(uint8) 940 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)*y) } 941 } else { 942 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)*fr.reg(iy).(uint8)) } 943 } 944 case reflect.Uint16: 945 if kx == kindConst && ky == kindConst { 946 v := vx.(uint16) * vy.(uint16) 947 return func(fr *frame) { fr.setReg(ir, v) } 948 } else if kx == kindConst { 949 x := vx.(uint16) 950 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(uint16)) } 951 } else if ky == kindConst { 952 y := vy.(uint16) 953 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)*y) } 954 } else { 955 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)*fr.reg(iy).(uint16)) } 956 } 957 case reflect.Uint32: 958 if kx == kindConst && ky == kindConst { 959 v := vx.(uint32) * vy.(uint32) 960 return func(fr *frame) { fr.setReg(ir, v) } 961 } else if kx == kindConst { 962 x := vx.(uint32) 963 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(uint32)) } 964 } else if ky == kindConst { 965 y := vy.(uint32) 966 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)*y) } 967 } else { 968 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)*fr.reg(iy).(uint32)) } 969 } 970 case reflect.Uint64: 971 if kx == kindConst && ky == kindConst { 972 v := vx.(uint64) * vy.(uint64) 973 return func(fr *frame) { fr.setReg(ir, v) } 974 } else if kx == kindConst { 975 x := vx.(uint64) 976 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(uint64)) } 977 } else if ky == kindConst { 978 y := vy.(uint64) 979 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)*y) } 980 } else { 981 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)*fr.reg(iy).(uint64)) } 982 } 983 case reflect.Uintptr: 984 if kx == kindConst && ky == kindConst { 985 v := vx.(uintptr) * vy.(uintptr) 986 return func(fr *frame) { fr.setReg(ir, v) } 987 } else if kx == kindConst { 988 x := vx.(uintptr) 989 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(uintptr)) } 990 } else if ky == kindConst { 991 y := vy.(uintptr) 992 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)*y) } 993 } else { 994 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)*fr.reg(iy).(uintptr)) } 995 } 996 case reflect.Float32: 997 if kx == kindConst && ky == kindConst { 998 v := vx.(float32) * vy.(float32) 999 return func(fr *frame) { fr.setReg(ir, v) } 1000 } else if kx == kindConst { 1001 x := vx.(float32) 1002 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(float32)) } 1003 } else if ky == kindConst { 1004 y := vy.(float32) 1005 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)*y) } 1006 } else { 1007 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)*fr.reg(iy).(float32)) } 1008 } 1009 case reflect.Float64: 1010 if kx == kindConst && ky == kindConst { 1011 v := vx.(float64) * vy.(float64) 1012 return func(fr *frame) { fr.setReg(ir, v) } 1013 } else if kx == kindConst { 1014 x := vx.(float64) 1015 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(float64)) } 1016 } else if ky == kindConst { 1017 y := vy.(float64) 1018 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)*y) } 1019 } else { 1020 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)*fr.reg(iy).(float64)) } 1021 } 1022 case reflect.Complex64: 1023 if kx == kindConst && ky == kindConst { 1024 v := vx.(complex64) * vy.(complex64) 1025 return func(fr *frame) { fr.setReg(ir, v) } 1026 } else if kx == kindConst { 1027 x := vx.(complex64) 1028 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(complex64)) } 1029 } else if ky == kindConst { 1030 y := vy.(complex64) 1031 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)*y) } 1032 } else { 1033 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)*fr.reg(iy).(complex64)) } 1034 } 1035 case reflect.Complex128: 1036 if kx == kindConst && ky == kindConst { 1037 v := vx.(complex128) * vy.(complex128) 1038 return func(fr *frame) { fr.setReg(ir, v) } 1039 } else if kx == kindConst { 1040 x := vx.(complex128) 1041 return func(fr *frame) { fr.setReg(ir, x*fr.reg(iy).(complex128)) } 1042 } else if ky == kindConst { 1043 y := vy.(complex128) 1044 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)*y) } 1045 } else { 1046 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)*fr.reg(iy).(complex128)) } 1047 } 1048 } 1049 } else { 1050 t := xtype.TypeOfType(typ) 1051 switch typ.Kind() { 1052 case reflect.Int: 1053 if kx == kindConst && ky == kindConst { 1054 v := xtype.Make(t, xtype.Int(vx)*xtype.Int(vy)) 1055 return func(fr *frame) { fr.setReg(ir, v) } 1056 } else if kx == kindConst { 1057 x := xtype.Int(vx) 1058 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.int(iy))) } 1059 } else if ky == kindConst { 1060 y := xtype.Int(vy) 1061 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)*y)) } 1062 } else { 1063 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)*fr.int(iy))) } 1064 } 1065 case reflect.Int8: 1066 if kx == kindConst && ky == kindConst { 1067 v := xtype.Make(t, xtype.Int8(vx)*xtype.Int8(vy)) 1068 return func(fr *frame) { fr.setReg(ir, v) } 1069 } else if kx == kindConst { 1070 x := xtype.Int8(vx) 1071 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.int8(iy))) } 1072 } else if ky == kindConst { 1073 y := xtype.Int8(vy) 1074 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)*y)) } 1075 } else { 1076 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)*fr.int8(iy))) } 1077 } 1078 case reflect.Int16: 1079 if kx == kindConst && ky == kindConst { 1080 v := xtype.Make(t, xtype.Int16(vx)*xtype.Int16(vy)) 1081 return func(fr *frame) { fr.setReg(ir, v) } 1082 } else if kx == kindConst { 1083 x := xtype.Int16(vx) 1084 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.int16(iy))) } 1085 } else if ky == kindConst { 1086 y := xtype.Int16(vy) 1087 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)*y)) } 1088 } else { 1089 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)*fr.int16(iy))) } 1090 } 1091 case reflect.Int32: 1092 if kx == kindConst && ky == kindConst { 1093 v := xtype.Make(t, xtype.Int32(vx)*xtype.Int32(vy)) 1094 return func(fr *frame) { fr.setReg(ir, v) } 1095 } else if kx == kindConst { 1096 x := xtype.Int32(vx) 1097 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.int32(iy))) } 1098 } else if ky == kindConst { 1099 y := xtype.Int32(vy) 1100 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)*y)) } 1101 } else { 1102 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)*fr.int32(iy))) } 1103 } 1104 case reflect.Int64: 1105 if kx == kindConst && ky == kindConst { 1106 v := xtype.Make(t, xtype.Int64(vx)*xtype.Int64(vy)) 1107 return func(fr *frame) { fr.setReg(ir, v) } 1108 } else if kx == kindConst { 1109 x := xtype.Int64(vx) 1110 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.int64(iy))) } 1111 } else if ky == kindConst { 1112 y := xtype.Int64(vy) 1113 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)*y)) } 1114 } else { 1115 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)*fr.int64(iy))) } 1116 } 1117 case reflect.Uint: 1118 if kx == kindConst && ky == kindConst { 1119 v := xtype.Make(t, xtype.Uint(vx)*xtype.Uint(vy)) 1120 return func(fr *frame) { fr.setReg(ir, v) } 1121 } else if kx == kindConst { 1122 x := xtype.Uint(vx) 1123 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.uint(iy))) } 1124 } else if ky == kindConst { 1125 y := xtype.Uint(vy) 1126 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)*y)) } 1127 } else { 1128 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)*fr.uint(iy))) } 1129 } 1130 case reflect.Uint8: 1131 if kx == kindConst && ky == kindConst { 1132 v := xtype.Make(t, xtype.Uint8(vx)*xtype.Uint8(vy)) 1133 return func(fr *frame) { fr.setReg(ir, v) } 1134 } else if kx == kindConst { 1135 x := xtype.Uint8(vx) 1136 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.uint8(iy))) } 1137 } else if ky == kindConst { 1138 y := xtype.Uint8(vy) 1139 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)*y)) } 1140 } else { 1141 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)*fr.uint8(iy))) } 1142 } 1143 case reflect.Uint16: 1144 if kx == kindConst && ky == kindConst { 1145 v := xtype.Make(t, xtype.Uint16(vx)*xtype.Uint16(vy)) 1146 return func(fr *frame) { fr.setReg(ir, v) } 1147 } else if kx == kindConst { 1148 x := xtype.Uint16(vx) 1149 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.uint16(iy))) } 1150 } else if ky == kindConst { 1151 y := xtype.Uint16(vy) 1152 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)*y)) } 1153 } else { 1154 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)*fr.uint16(iy))) } 1155 } 1156 case reflect.Uint32: 1157 if kx == kindConst && ky == kindConst { 1158 v := xtype.Make(t, xtype.Uint32(vx)*xtype.Uint32(vy)) 1159 return func(fr *frame) { fr.setReg(ir, v) } 1160 } else if kx == kindConst { 1161 x := xtype.Uint32(vx) 1162 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.uint32(iy))) } 1163 } else if ky == kindConst { 1164 y := xtype.Uint32(vy) 1165 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)*y)) } 1166 } else { 1167 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)*fr.uint32(iy))) } 1168 } 1169 case reflect.Uint64: 1170 if kx == kindConst && ky == kindConst { 1171 v := xtype.Make(t, xtype.Uint64(vx)*xtype.Uint64(vy)) 1172 return func(fr *frame) { fr.setReg(ir, v) } 1173 } else if kx == kindConst { 1174 x := xtype.Uint64(vx) 1175 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.uint64(iy))) } 1176 } else if ky == kindConst { 1177 y := xtype.Uint64(vy) 1178 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)*y)) } 1179 } else { 1180 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)*fr.uint64(iy))) } 1181 } 1182 case reflect.Uintptr: 1183 if kx == kindConst && ky == kindConst { 1184 v := xtype.Make(t, xtype.Uintptr(vx)*xtype.Uintptr(vy)) 1185 return func(fr *frame) { fr.setReg(ir, v) } 1186 } else if kx == kindConst { 1187 x := xtype.Uintptr(vx) 1188 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.uintptr(iy))) } 1189 } else if ky == kindConst { 1190 y := xtype.Uintptr(vy) 1191 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)*y)) } 1192 } else { 1193 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)*fr.uintptr(iy))) } 1194 } 1195 case reflect.Float32: 1196 if kx == kindConst && ky == kindConst { 1197 v := xtype.Make(t, xtype.Float32(vx)*xtype.Float32(vy)) 1198 return func(fr *frame) { fr.setReg(ir, v) } 1199 } else if kx == kindConst { 1200 x := xtype.Float32(vx) 1201 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.float32(iy))) } 1202 } else if ky == kindConst { 1203 y := xtype.Float32(vy) 1204 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)*y)) } 1205 } else { 1206 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)*fr.float32(iy))) } 1207 } 1208 case reflect.Float64: 1209 if kx == kindConst && ky == kindConst { 1210 v := xtype.Make(t, xtype.Float64(vx)*xtype.Float64(vy)) 1211 return func(fr *frame) { fr.setReg(ir, v) } 1212 } else if kx == kindConst { 1213 x := xtype.Float64(vx) 1214 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.float64(iy))) } 1215 } else if ky == kindConst { 1216 y := xtype.Float64(vy) 1217 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)*y)) } 1218 } else { 1219 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)*fr.float64(iy))) } 1220 } 1221 case reflect.Complex64: 1222 if kx == kindConst && ky == kindConst { 1223 v := xtype.Make(t, xtype.Complex64(vx)*xtype.Complex64(vy)) 1224 return func(fr *frame) { fr.setReg(ir, v) } 1225 } else if kx == kindConst { 1226 x := xtype.Complex64(vx) 1227 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.complex64(iy))) } 1228 } else if ky == kindConst { 1229 y := xtype.Complex64(vy) 1230 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)*y)) } 1231 } else { 1232 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)*fr.complex64(iy))) } 1233 } 1234 case reflect.Complex128: 1235 if kx == kindConst && ky == kindConst { 1236 v := xtype.Make(t, xtype.Complex128(vx)*xtype.Complex128(vy)) 1237 return func(fr *frame) { fr.setReg(ir, v) } 1238 } else if kx == kindConst { 1239 x := xtype.Complex128(vx) 1240 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x*fr.complex128(iy))) } 1241 } else if ky == kindConst { 1242 y := xtype.Complex128(vy) 1243 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)*y)) } 1244 } else { 1245 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)*fr.complex128(iy))) } 1246 } 1247 } 1248 } 1249 panic("unreachable") 1250 } 1251 func makeBinOpQUO(pfn *function, instr *ssa.BinOp) func(fr *frame) { 1252 ir := pfn.regIndex(instr) 1253 ix, kx, vx := pfn.regIndex3(instr.X) 1254 iy, ky, vy := pfn.regIndex3(instr.Y) 1255 typ := pfn.Interp.preToType(instr.Type()) 1256 if typ.PkgPath() == "" { 1257 switch typ.Kind() { 1258 case reflect.Int: 1259 if kx == kindConst && ky == kindConst { 1260 x := vx.(int) 1261 y := vy.(int) 1262 if y == 0 { 1263 return func(fr *frame) { fr.setReg(ir, x/y) } 1264 } 1265 v := x / y 1266 return func(fr *frame) { fr.setReg(ir, v) } 1267 } else if kx == kindConst { 1268 x := vx.(int) 1269 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(int)) } 1270 } else if ky == kindConst { 1271 y := vy.(int) 1272 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)/y) } 1273 } else { 1274 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)/fr.reg(iy).(int)) } 1275 } 1276 case reflect.Int8: 1277 if kx == kindConst && ky == kindConst { 1278 x := vx.(int8) 1279 y := vy.(int8) 1280 if y == 0 { 1281 return func(fr *frame) { fr.setReg(ir, x/y) } 1282 } 1283 v := x / y 1284 return func(fr *frame) { fr.setReg(ir, v) } 1285 } else if kx == kindConst { 1286 x := vx.(int8) 1287 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(int8)) } 1288 } else if ky == kindConst { 1289 y := vy.(int8) 1290 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)/y) } 1291 } else { 1292 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)/fr.reg(iy).(int8)) } 1293 } 1294 case reflect.Int16: 1295 if kx == kindConst && ky == kindConst { 1296 x := vx.(int16) 1297 y := vy.(int16) 1298 if y == 0 { 1299 return func(fr *frame) { fr.setReg(ir, x/y) } 1300 } 1301 v := x / y 1302 return func(fr *frame) { fr.setReg(ir, v) } 1303 } else if kx == kindConst { 1304 x := vx.(int16) 1305 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(int16)) } 1306 } else if ky == kindConst { 1307 y := vy.(int16) 1308 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)/y) } 1309 } else { 1310 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)/fr.reg(iy).(int16)) } 1311 } 1312 case reflect.Int32: 1313 if kx == kindConst && ky == kindConst { 1314 x := vx.(int32) 1315 y := vy.(int32) 1316 if y == 0 { 1317 return func(fr *frame) { fr.setReg(ir, x/y) } 1318 } 1319 v := x / y 1320 return func(fr *frame) { fr.setReg(ir, v) } 1321 } else if kx == kindConst { 1322 x := vx.(int32) 1323 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(int32)) } 1324 } else if ky == kindConst { 1325 y := vy.(int32) 1326 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)/y) } 1327 } else { 1328 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)/fr.reg(iy).(int32)) } 1329 } 1330 case reflect.Int64: 1331 if kx == kindConst && ky == kindConst { 1332 x := vx.(int64) 1333 y := vy.(int64) 1334 if y == 0 { 1335 return func(fr *frame) { fr.setReg(ir, x/y) } 1336 } 1337 v := x / y 1338 return func(fr *frame) { fr.setReg(ir, v) } 1339 } else if kx == kindConst { 1340 x := vx.(int64) 1341 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(int64)) } 1342 } else if ky == kindConst { 1343 y := vy.(int64) 1344 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)/y) } 1345 } else { 1346 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)/fr.reg(iy).(int64)) } 1347 } 1348 case reflect.Uint: 1349 if kx == kindConst && ky == kindConst { 1350 x := vx.(uint) 1351 y := vy.(uint) 1352 if y == 0 { 1353 return func(fr *frame) { fr.setReg(ir, x/y) } 1354 } 1355 v := x / y 1356 return func(fr *frame) { fr.setReg(ir, v) } 1357 } else if kx == kindConst { 1358 x := vx.(uint) 1359 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(uint)) } 1360 } else if ky == kindConst { 1361 y := vy.(uint) 1362 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)/y) } 1363 } else { 1364 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)/fr.reg(iy).(uint)) } 1365 } 1366 case reflect.Uint8: 1367 if kx == kindConst && ky == kindConst { 1368 x := vx.(uint8) 1369 y := vy.(uint8) 1370 if y == 0 { 1371 return func(fr *frame) { fr.setReg(ir, x/y) } 1372 } 1373 v := x / y 1374 return func(fr *frame) { fr.setReg(ir, v) } 1375 } else if kx == kindConst { 1376 x := vx.(uint8) 1377 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(uint8)) } 1378 } else if ky == kindConst { 1379 y := vy.(uint8) 1380 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)/y) } 1381 } else { 1382 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)/fr.reg(iy).(uint8)) } 1383 } 1384 case reflect.Uint16: 1385 if kx == kindConst && ky == kindConst { 1386 x := vx.(uint16) 1387 y := vy.(uint16) 1388 if y == 0 { 1389 return func(fr *frame) { fr.setReg(ir, x/y) } 1390 } 1391 v := x / y 1392 return func(fr *frame) { fr.setReg(ir, v) } 1393 } else if kx == kindConst { 1394 x := vx.(uint16) 1395 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(uint16)) } 1396 } else if ky == kindConst { 1397 y := vy.(uint16) 1398 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)/y) } 1399 } else { 1400 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)/fr.reg(iy).(uint16)) } 1401 } 1402 case reflect.Uint32: 1403 if kx == kindConst && ky == kindConst { 1404 x := vx.(uint32) 1405 y := vy.(uint32) 1406 if y == 0 { 1407 return func(fr *frame) { fr.setReg(ir, x/y) } 1408 } 1409 v := x / y 1410 return func(fr *frame) { fr.setReg(ir, v) } 1411 } else if kx == kindConst { 1412 x := vx.(uint32) 1413 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(uint32)) } 1414 } else if ky == kindConst { 1415 y := vy.(uint32) 1416 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)/y) } 1417 } else { 1418 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)/fr.reg(iy).(uint32)) } 1419 } 1420 case reflect.Uint64: 1421 if kx == kindConst && ky == kindConst { 1422 x := vx.(uint64) 1423 y := vy.(uint64) 1424 if y == 0 { 1425 return func(fr *frame) { fr.setReg(ir, x/y) } 1426 } 1427 v := x / y 1428 return func(fr *frame) { fr.setReg(ir, v) } 1429 } else if kx == kindConst { 1430 x := vx.(uint64) 1431 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(uint64)) } 1432 } else if ky == kindConst { 1433 y := vy.(uint64) 1434 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)/y) } 1435 } else { 1436 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)/fr.reg(iy).(uint64)) } 1437 } 1438 case reflect.Uintptr: 1439 if kx == kindConst && ky == kindConst { 1440 x := vx.(uintptr) 1441 y := vy.(uintptr) 1442 if y == 0 { 1443 return func(fr *frame) { fr.setReg(ir, x/y) } 1444 } 1445 v := x / y 1446 return func(fr *frame) { fr.setReg(ir, v) } 1447 } else if kx == kindConst { 1448 x := vx.(uintptr) 1449 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(uintptr)) } 1450 } else if ky == kindConst { 1451 y := vy.(uintptr) 1452 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)/y) } 1453 } else { 1454 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)/fr.reg(iy).(uintptr)) } 1455 } 1456 case reflect.Float32: 1457 if kx == kindConst && ky == kindConst { 1458 v := vx.(float32) / vy.(float32) 1459 return func(fr *frame) { fr.setReg(ir, v) } 1460 } else if kx == kindConst { 1461 x := vx.(float32) 1462 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(float32)) } 1463 } else if ky == kindConst { 1464 y := vy.(float32) 1465 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)/y) } 1466 } else { 1467 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32)/fr.reg(iy).(float32)) } 1468 } 1469 case reflect.Float64: 1470 if kx == kindConst && ky == kindConst { 1471 v := vx.(float64) / vy.(float64) 1472 return func(fr *frame) { fr.setReg(ir, v) } 1473 } else if kx == kindConst { 1474 x := vx.(float64) 1475 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(float64)) } 1476 } else if ky == kindConst { 1477 y := vy.(float64) 1478 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)/y) } 1479 } else { 1480 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64)/fr.reg(iy).(float64)) } 1481 } 1482 case reflect.Complex64: 1483 if kx == kindConst && ky == kindConst { 1484 v := vx.(complex64) / vy.(complex64) 1485 return func(fr *frame) { fr.setReg(ir, v) } 1486 } else if kx == kindConst { 1487 x := vx.(complex64) 1488 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(complex64)) } 1489 } else if ky == kindConst { 1490 y := vy.(complex64) 1491 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)/y) } 1492 } else { 1493 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex64)/fr.reg(iy).(complex64)) } 1494 } 1495 case reflect.Complex128: 1496 if kx == kindConst && ky == kindConst { 1497 v := vx.(complex128) / vy.(complex128) 1498 return func(fr *frame) { fr.setReg(ir, v) } 1499 } else if kx == kindConst { 1500 x := vx.(complex128) 1501 return func(fr *frame) { fr.setReg(ir, x/fr.reg(iy).(complex128)) } 1502 } else if ky == kindConst { 1503 y := vy.(complex128) 1504 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)/y) } 1505 } else { 1506 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(complex128)/fr.reg(iy).(complex128)) } 1507 } 1508 } 1509 } else { 1510 t := xtype.TypeOfType(typ) 1511 switch typ.Kind() { 1512 case reflect.Int: 1513 if kx == kindConst && ky == kindConst { 1514 x := xtype.Int(vx) 1515 y := xtype.Int(vy) 1516 if y == 0 { 1517 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1518 } 1519 v := xtype.Make(t, x/y) 1520 return func(fr *frame) { fr.setReg(ir, v) } 1521 } else if kx == kindConst { 1522 x := xtype.Int(vx) 1523 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.int(iy))) } 1524 } else if ky == kindConst { 1525 y := xtype.Int(vy) 1526 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)/y)) } 1527 } else { 1528 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)/fr.int(iy))) } 1529 } 1530 case reflect.Int8: 1531 if kx == kindConst && ky == kindConst { 1532 x := xtype.Int8(vx) 1533 y := xtype.Int8(vy) 1534 if y == 0 { 1535 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1536 } 1537 v := xtype.Make(t, x/y) 1538 return func(fr *frame) { fr.setReg(ir, v) } 1539 } else if kx == kindConst { 1540 x := xtype.Int8(vx) 1541 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.int8(iy))) } 1542 } else if ky == kindConst { 1543 y := xtype.Int8(vy) 1544 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)/y)) } 1545 } else { 1546 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)/fr.int8(iy))) } 1547 } 1548 case reflect.Int16: 1549 if kx == kindConst && ky == kindConst { 1550 x := xtype.Int16(vx) 1551 y := xtype.Int16(vy) 1552 if y == 0 { 1553 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1554 } 1555 v := xtype.Make(t, x/y) 1556 return func(fr *frame) { fr.setReg(ir, v) } 1557 } else if kx == kindConst { 1558 x := xtype.Int16(vx) 1559 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.int16(iy))) } 1560 } else if ky == kindConst { 1561 y := xtype.Int16(vy) 1562 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)/y)) } 1563 } else { 1564 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)/fr.int16(iy))) } 1565 } 1566 case reflect.Int32: 1567 if kx == kindConst && ky == kindConst { 1568 x := xtype.Int32(vx) 1569 y := xtype.Int32(vy) 1570 if y == 0 { 1571 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1572 } 1573 v := xtype.Make(t, x/y) 1574 return func(fr *frame) { fr.setReg(ir, v) } 1575 } else if kx == kindConst { 1576 x := xtype.Int32(vx) 1577 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.int32(iy))) } 1578 } else if ky == kindConst { 1579 y := xtype.Int32(vy) 1580 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)/y)) } 1581 } else { 1582 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)/fr.int32(iy))) } 1583 } 1584 case reflect.Int64: 1585 if kx == kindConst && ky == kindConst { 1586 x := xtype.Int64(vx) 1587 y := xtype.Int64(vy) 1588 if y == 0 { 1589 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1590 } 1591 v := xtype.Make(t, x/y) 1592 return func(fr *frame) { fr.setReg(ir, v) } 1593 } else if kx == kindConst { 1594 x := xtype.Int64(vx) 1595 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.int64(iy))) } 1596 } else if ky == kindConst { 1597 y := xtype.Int64(vy) 1598 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)/y)) } 1599 } else { 1600 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)/fr.int64(iy))) } 1601 } 1602 case reflect.Uint: 1603 if kx == kindConst && ky == kindConst { 1604 x := xtype.Uint(vx) 1605 y := xtype.Uint(vy) 1606 if y == 0 { 1607 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1608 } 1609 v := xtype.Make(t, x/y) 1610 return func(fr *frame) { fr.setReg(ir, v) } 1611 } else if kx == kindConst { 1612 x := xtype.Uint(vx) 1613 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.uint(iy))) } 1614 } else if ky == kindConst { 1615 y := xtype.Uint(vy) 1616 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)/y)) } 1617 } else { 1618 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)/fr.uint(iy))) } 1619 } 1620 case reflect.Uint8: 1621 if kx == kindConst && ky == kindConst { 1622 x := xtype.Uint8(vx) 1623 y := xtype.Uint8(vy) 1624 if y == 0 { 1625 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1626 } 1627 v := xtype.Make(t, x/y) 1628 return func(fr *frame) { fr.setReg(ir, v) } 1629 } else if kx == kindConst { 1630 x := xtype.Uint8(vx) 1631 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.uint8(iy))) } 1632 } else if ky == kindConst { 1633 y := xtype.Uint8(vy) 1634 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)/y)) } 1635 } else { 1636 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)/fr.uint8(iy))) } 1637 } 1638 case reflect.Uint16: 1639 if kx == kindConst && ky == kindConst { 1640 x := xtype.Uint16(vx) 1641 y := xtype.Uint16(vy) 1642 if y == 0 { 1643 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1644 } 1645 v := xtype.Make(t, x/y) 1646 return func(fr *frame) { fr.setReg(ir, v) } 1647 } else if kx == kindConst { 1648 x := xtype.Uint16(vx) 1649 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.uint16(iy))) } 1650 } else if ky == kindConst { 1651 y := xtype.Uint16(vy) 1652 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)/y)) } 1653 } else { 1654 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)/fr.uint16(iy))) } 1655 } 1656 case reflect.Uint32: 1657 if kx == kindConst && ky == kindConst { 1658 x := xtype.Uint32(vx) 1659 y := xtype.Uint32(vy) 1660 if y == 0 { 1661 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1662 } 1663 v := xtype.Make(t, x/y) 1664 return func(fr *frame) { fr.setReg(ir, v) } 1665 } else if kx == kindConst { 1666 x := xtype.Uint32(vx) 1667 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.uint32(iy))) } 1668 } else if ky == kindConst { 1669 y := xtype.Uint32(vy) 1670 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)/y)) } 1671 } else { 1672 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)/fr.uint32(iy))) } 1673 } 1674 case reflect.Uint64: 1675 if kx == kindConst && ky == kindConst { 1676 x := xtype.Uint64(vx) 1677 y := xtype.Uint64(vy) 1678 if y == 0 { 1679 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1680 } 1681 v := xtype.Make(t, x/y) 1682 return func(fr *frame) { fr.setReg(ir, v) } 1683 } else if kx == kindConst { 1684 x := xtype.Uint64(vx) 1685 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.uint64(iy))) } 1686 } else if ky == kindConst { 1687 y := xtype.Uint64(vy) 1688 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)/y)) } 1689 } else { 1690 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)/fr.uint64(iy))) } 1691 } 1692 case reflect.Uintptr: 1693 if kx == kindConst && ky == kindConst { 1694 x := xtype.Uintptr(vx) 1695 y := xtype.Uintptr(vy) 1696 if y == 0 { 1697 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/y)) } 1698 } 1699 v := xtype.Make(t, x/y) 1700 return func(fr *frame) { fr.setReg(ir, v) } 1701 } else if kx == kindConst { 1702 x := xtype.Uintptr(vx) 1703 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.uintptr(iy))) } 1704 } else if ky == kindConst { 1705 y := xtype.Uintptr(vy) 1706 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)/y)) } 1707 } else { 1708 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)/fr.uintptr(iy))) } 1709 } 1710 case reflect.Float32: 1711 if kx == kindConst && ky == kindConst { 1712 v := xtype.Make(t, xtype.Float32(vx)/xtype.Float32(vy)) 1713 return func(fr *frame) { fr.setReg(ir, v) } 1714 } else if kx == kindConst { 1715 x := xtype.Float32(vx) 1716 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.float32(iy))) } 1717 } else if ky == kindConst { 1718 y := xtype.Float32(vy) 1719 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)/y)) } 1720 } else { 1721 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float32(ix)/fr.float32(iy))) } 1722 } 1723 case reflect.Float64: 1724 if kx == kindConst && ky == kindConst { 1725 v := xtype.Make(t, xtype.Float64(vx)/xtype.Float64(vy)) 1726 return func(fr *frame) { fr.setReg(ir, v) } 1727 } else if kx == kindConst { 1728 x := xtype.Float64(vx) 1729 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.float64(iy))) } 1730 } else if ky == kindConst { 1731 y := xtype.Float64(vy) 1732 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)/y)) } 1733 } else { 1734 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.float64(ix)/fr.float64(iy))) } 1735 } 1736 case reflect.Complex64: 1737 if kx == kindConst && ky == kindConst { 1738 v := xtype.Make(t, xtype.Complex64(vx)/xtype.Complex64(vy)) 1739 return func(fr *frame) { fr.setReg(ir, v) } 1740 } else if kx == kindConst { 1741 x := xtype.Complex64(vx) 1742 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.complex64(iy))) } 1743 } else if ky == kindConst { 1744 y := xtype.Complex64(vy) 1745 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)/y)) } 1746 } else { 1747 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex64(ix)/fr.complex64(iy))) } 1748 } 1749 case reflect.Complex128: 1750 if kx == kindConst && ky == kindConst { 1751 v := xtype.Make(t, xtype.Complex128(vx)/xtype.Complex128(vy)) 1752 return func(fr *frame) { fr.setReg(ir, v) } 1753 } else if kx == kindConst { 1754 x := xtype.Complex128(vx) 1755 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x/fr.complex128(iy))) } 1756 } else if ky == kindConst { 1757 y := xtype.Complex128(vy) 1758 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)/y)) } 1759 } else { 1760 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.complex128(ix)/fr.complex128(iy))) } 1761 } 1762 } 1763 } 1764 panic("unreachable") 1765 } 1766 func makeBinOpREM(pfn *function, instr *ssa.BinOp) func(fr *frame) { 1767 ir := pfn.regIndex(instr) 1768 ix, kx, vx := pfn.regIndex3(instr.X) 1769 iy, ky, vy := pfn.regIndex3(instr.Y) 1770 typ := pfn.Interp.preToType(instr.Type()) 1771 if typ.PkgPath() == "" { 1772 switch typ.Kind() { 1773 case reflect.Int: 1774 if kx == kindConst && ky == kindConst { 1775 v := vx.(int) % vy.(int) 1776 return func(fr *frame) { fr.setReg(ir, v) } 1777 } else if kx == kindConst { 1778 x := vx.(int) 1779 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(int)) } 1780 } else if ky == kindConst { 1781 y := vy.(int) 1782 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)%y) } 1783 } else { 1784 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)%fr.reg(iy).(int)) } 1785 } 1786 case reflect.Int8: 1787 if kx == kindConst && ky == kindConst { 1788 v := vx.(int8) % vy.(int8) 1789 return func(fr *frame) { fr.setReg(ir, v) } 1790 } else if kx == kindConst { 1791 x := vx.(int8) 1792 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(int8)) } 1793 } else if ky == kindConst { 1794 y := vy.(int8) 1795 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)%y) } 1796 } else { 1797 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)%fr.reg(iy).(int8)) } 1798 } 1799 case reflect.Int16: 1800 if kx == kindConst && ky == kindConst { 1801 v := vx.(int16) % vy.(int16) 1802 return func(fr *frame) { fr.setReg(ir, v) } 1803 } else if kx == kindConst { 1804 x := vx.(int16) 1805 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(int16)) } 1806 } else if ky == kindConst { 1807 y := vy.(int16) 1808 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)%y) } 1809 } else { 1810 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)%fr.reg(iy).(int16)) } 1811 } 1812 case reflect.Int32: 1813 if kx == kindConst && ky == kindConst { 1814 v := vx.(int32) % vy.(int32) 1815 return func(fr *frame) { fr.setReg(ir, v) } 1816 } else if kx == kindConst { 1817 x := vx.(int32) 1818 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(int32)) } 1819 } else if ky == kindConst { 1820 y := vy.(int32) 1821 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)%y) } 1822 } else { 1823 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)%fr.reg(iy).(int32)) } 1824 } 1825 case reflect.Int64: 1826 if kx == kindConst && ky == kindConst { 1827 v := vx.(int64) % vy.(int64) 1828 return func(fr *frame) { fr.setReg(ir, v) } 1829 } else if kx == kindConst { 1830 x := vx.(int64) 1831 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(int64)) } 1832 } else if ky == kindConst { 1833 y := vy.(int64) 1834 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)%y) } 1835 } else { 1836 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)%fr.reg(iy).(int64)) } 1837 } 1838 case reflect.Uint: 1839 if kx == kindConst && ky == kindConst { 1840 v := vx.(uint) % vy.(uint) 1841 return func(fr *frame) { fr.setReg(ir, v) } 1842 } else if kx == kindConst { 1843 x := vx.(uint) 1844 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(uint)) } 1845 } else if ky == kindConst { 1846 y := vy.(uint) 1847 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)%y) } 1848 } else { 1849 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)%fr.reg(iy).(uint)) } 1850 } 1851 case reflect.Uint8: 1852 if kx == kindConst && ky == kindConst { 1853 v := vx.(uint8) % vy.(uint8) 1854 return func(fr *frame) { fr.setReg(ir, v) } 1855 } else if kx == kindConst { 1856 x := vx.(uint8) 1857 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(uint8)) } 1858 } else if ky == kindConst { 1859 y := vy.(uint8) 1860 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)%y) } 1861 } else { 1862 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)%fr.reg(iy).(uint8)) } 1863 } 1864 case reflect.Uint16: 1865 if kx == kindConst && ky == kindConst { 1866 v := vx.(uint16) % vy.(uint16) 1867 return func(fr *frame) { fr.setReg(ir, v) } 1868 } else if kx == kindConst { 1869 x := vx.(uint16) 1870 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(uint16)) } 1871 } else if ky == kindConst { 1872 y := vy.(uint16) 1873 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)%y) } 1874 } else { 1875 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)%fr.reg(iy).(uint16)) } 1876 } 1877 case reflect.Uint32: 1878 if kx == kindConst && ky == kindConst { 1879 v := vx.(uint32) % vy.(uint32) 1880 return func(fr *frame) { fr.setReg(ir, v) } 1881 } else if kx == kindConst { 1882 x := vx.(uint32) 1883 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(uint32)) } 1884 } else if ky == kindConst { 1885 y := vy.(uint32) 1886 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)%y) } 1887 } else { 1888 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)%fr.reg(iy).(uint32)) } 1889 } 1890 case reflect.Uint64: 1891 if kx == kindConst && ky == kindConst { 1892 v := vx.(uint64) % vy.(uint64) 1893 return func(fr *frame) { fr.setReg(ir, v) } 1894 } else if kx == kindConst { 1895 x := vx.(uint64) 1896 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(uint64)) } 1897 } else if ky == kindConst { 1898 y := vy.(uint64) 1899 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)%y) } 1900 } else { 1901 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)%fr.reg(iy).(uint64)) } 1902 } 1903 case reflect.Uintptr: 1904 if kx == kindConst && ky == kindConst { 1905 v := vx.(uintptr) % vy.(uintptr) 1906 return func(fr *frame) { fr.setReg(ir, v) } 1907 } else if kx == kindConst { 1908 x := vx.(uintptr) 1909 return func(fr *frame) { fr.setReg(ir, x%fr.reg(iy).(uintptr)) } 1910 } else if ky == kindConst { 1911 y := vy.(uintptr) 1912 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)%y) } 1913 } else { 1914 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)%fr.reg(iy).(uintptr)) } 1915 } 1916 } 1917 } else { 1918 t := xtype.TypeOfType(typ) 1919 switch typ.Kind() { 1920 case reflect.Int: 1921 if kx == kindConst && ky == kindConst { 1922 v := xtype.Make(t, xtype.Int(vx)%xtype.Int(vy)) 1923 return func(fr *frame) { fr.setReg(ir, v) } 1924 } else if kx == kindConst { 1925 x := xtype.Int(vx) 1926 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.int(iy))) } 1927 } else if ky == kindConst { 1928 y := xtype.Int(vy) 1929 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)%y)) } 1930 } else { 1931 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)%fr.int(iy))) } 1932 } 1933 case reflect.Int8: 1934 if kx == kindConst && ky == kindConst { 1935 v := xtype.Make(t, xtype.Int8(vx)%xtype.Int8(vy)) 1936 return func(fr *frame) { fr.setReg(ir, v) } 1937 } else if kx == kindConst { 1938 x := xtype.Int8(vx) 1939 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.int8(iy))) } 1940 } else if ky == kindConst { 1941 y := xtype.Int8(vy) 1942 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)%y)) } 1943 } else { 1944 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)%fr.int8(iy))) } 1945 } 1946 case reflect.Int16: 1947 if kx == kindConst && ky == kindConst { 1948 v := xtype.Make(t, xtype.Int16(vx)%xtype.Int16(vy)) 1949 return func(fr *frame) { fr.setReg(ir, v) } 1950 } else if kx == kindConst { 1951 x := xtype.Int16(vx) 1952 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.int16(iy))) } 1953 } else if ky == kindConst { 1954 y := xtype.Int16(vy) 1955 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)%y)) } 1956 } else { 1957 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)%fr.int16(iy))) } 1958 } 1959 case reflect.Int32: 1960 if kx == kindConst && ky == kindConst { 1961 v := xtype.Make(t, xtype.Int32(vx)%xtype.Int32(vy)) 1962 return func(fr *frame) { fr.setReg(ir, v) } 1963 } else if kx == kindConst { 1964 x := xtype.Int32(vx) 1965 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.int32(iy))) } 1966 } else if ky == kindConst { 1967 y := xtype.Int32(vy) 1968 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)%y)) } 1969 } else { 1970 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)%fr.int32(iy))) } 1971 } 1972 case reflect.Int64: 1973 if kx == kindConst && ky == kindConst { 1974 v := xtype.Make(t, xtype.Int64(vx)%xtype.Int64(vy)) 1975 return func(fr *frame) { fr.setReg(ir, v) } 1976 } else if kx == kindConst { 1977 x := xtype.Int64(vx) 1978 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.int64(iy))) } 1979 } else if ky == kindConst { 1980 y := xtype.Int64(vy) 1981 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)%y)) } 1982 } else { 1983 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)%fr.int64(iy))) } 1984 } 1985 case reflect.Uint: 1986 if kx == kindConst && ky == kindConst { 1987 v := xtype.Make(t, xtype.Uint(vx)%xtype.Uint(vy)) 1988 return func(fr *frame) { fr.setReg(ir, v) } 1989 } else if kx == kindConst { 1990 x := xtype.Uint(vx) 1991 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.uint(iy))) } 1992 } else if ky == kindConst { 1993 y := xtype.Uint(vy) 1994 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)%y)) } 1995 } else { 1996 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)%fr.uint(iy))) } 1997 } 1998 case reflect.Uint8: 1999 if kx == kindConst && ky == kindConst { 2000 v := xtype.Make(t, xtype.Uint8(vx)%xtype.Uint8(vy)) 2001 return func(fr *frame) { fr.setReg(ir, v) } 2002 } else if kx == kindConst { 2003 x := xtype.Uint8(vx) 2004 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.uint8(iy))) } 2005 } else if ky == kindConst { 2006 y := xtype.Uint8(vy) 2007 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)%y)) } 2008 } else { 2009 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)%fr.uint8(iy))) } 2010 } 2011 case reflect.Uint16: 2012 if kx == kindConst && ky == kindConst { 2013 v := xtype.Make(t, xtype.Uint16(vx)%xtype.Uint16(vy)) 2014 return func(fr *frame) { fr.setReg(ir, v) } 2015 } else if kx == kindConst { 2016 x := xtype.Uint16(vx) 2017 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.uint16(iy))) } 2018 } else if ky == kindConst { 2019 y := xtype.Uint16(vy) 2020 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)%y)) } 2021 } else { 2022 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)%fr.uint16(iy))) } 2023 } 2024 case reflect.Uint32: 2025 if kx == kindConst && ky == kindConst { 2026 v := xtype.Make(t, xtype.Uint32(vx)%xtype.Uint32(vy)) 2027 return func(fr *frame) { fr.setReg(ir, v) } 2028 } else if kx == kindConst { 2029 x := xtype.Uint32(vx) 2030 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.uint32(iy))) } 2031 } else if ky == kindConst { 2032 y := xtype.Uint32(vy) 2033 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)%y)) } 2034 } else { 2035 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)%fr.uint32(iy))) } 2036 } 2037 case reflect.Uint64: 2038 if kx == kindConst && ky == kindConst { 2039 v := xtype.Make(t, xtype.Uint64(vx)%xtype.Uint64(vy)) 2040 return func(fr *frame) { fr.setReg(ir, v) } 2041 } else if kx == kindConst { 2042 x := xtype.Uint64(vx) 2043 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.uint64(iy))) } 2044 } else if ky == kindConst { 2045 y := xtype.Uint64(vy) 2046 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)%y)) } 2047 } else { 2048 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)%fr.uint64(iy))) } 2049 } 2050 case reflect.Uintptr: 2051 if kx == kindConst && ky == kindConst { 2052 v := xtype.Make(t, xtype.Uintptr(vx)%xtype.Uintptr(vy)) 2053 return func(fr *frame) { fr.setReg(ir, v) } 2054 } else if kx == kindConst { 2055 x := xtype.Uintptr(vx) 2056 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x%fr.uintptr(iy))) } 2057 } else if ky == kindConst { 2058 y := xtype.Uintptr(vy) 2059 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)%y)) } 2060 } else { 2061 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)%fr.uintptr(iy))) } 2062 } 2063 } 2064 } 2065 panic("unreachable") 2066 } 2067 func makeBinOpAND(pfn *function, instr *ssa.BinOp) func(fr *frame) { 2068 ir := pfn.regIndex(instr) 2069 ix, kx, vx := pfn.regIndex3(instr.X) 2070 iy, ky, vy := pfn.regIndex3(instr.Y) 2071 typ := pfn.Interp.preToType(instr.Type()) 2072 if typ.PkgPath() == "" { 2073 switch typ.Kind() { 2074 case reflect.Int: 2075 if kx == kindConst && ky == kindConst { 2076 v := vx.(int) & vy.(int) 2077 return func(fr *frame) { fr.setReg(ir, v) } 2078 } else if kx == kindConst { 2079 x := vx.(int) 2080 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(int)) } 2081 } else if ky == kindConst { 2082 y := vy.(int) 2083 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)&y) } 2084 } else { 2085 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)&fr.reg(iy).(int)) } 2086 } 2087 case reflect.Int8: 2088 if kx == kindConst && ky == kindConst { 2089 v := vx.(int8) & vy.(int8) 2090 return func(fr *frame) { fr.setReg(ir, v) } 2091 } else if kx == kindConst { 2092 x := vx.(int8) 2093 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(int8)) } 2094 } else if ky == kindConst { 2095 y := vy.(int8) 2096 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)&y) } 2097 } else { 2098 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)&fr.reg(iy).(int8)) } 2099 } 2100 case reflect.Int16: 2101 if kx == kindConst && ky == kindConst { 2102 v := vx.(int16) & vy.(int16) 2103 return func(fr *frame) { fr.setReg(ir, v) } 2104 } else if kx == kindConst { 2105 x := vx.(int16) 2106 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(int16)) } 2107 } else if ky == kindConst { 2108 y := vy.(int16) 2109 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)&y) } 2110 } else { 2111 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)&fr.reg(iy).(int16)) } 2112 } 2113 case reflect.Int32: 2114 if kx == kindConst && ky == kindConst { 2115 v := vx.(int32) & vy.(int32) 2116 return func(fr *frame) { fr.setReg(ir, v) } 2117 } else if kx == kindConst { 2118 x := vx.(int32) 2119 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(int32)) } 2120 } else if ky == kindConst { 2121 y := vy.(int32) 2122 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)&y) } 2123 } else { 2124 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)&fr.reg(iy).(int32)) } 2125 } 2126 case reflect.Int64: 2127 if kx == kindConst && ky == kindConst { 2128 v := vx.(int64) & vy.(int64) 2129 return func(fr *frame) { fr.setReg(ir, v) } 2130 } else if kx == kindConst { 2131 x := vx.(int64) 2132 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(int64)) } 2133 } else if ky == kindConst { 2134 y := vy.(int64) 2135 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)&y) } 2136 } else { 2137 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)&fr.reg(iy).(int64)) } 2138 } 2139 case reflect.Uint: 2140 if kx == kindConst && ky == kindConst { 2141 v := vx.(uint) & vy.(uint) 2142 return func(fr *frame) { fr.setReg(ir, v) } 2143 } else if kx == kindConst { 2144 x := vx.(uint) 2145 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(uint)) } 2146 } else if ky == kindConst { 2147 y := vy.(uint) 2148 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)&y) } 2149 } else { 2150 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)&fr.reg(iy).(uint)) } 2151 } 2152 case reflect.Uint8: 2153 if kx == kindConst && ky == kindConst { 2154 v := vx.(uint8) & vy.(uint8) 2155 return func(fr *frame) { fr.setReg(ir, v) } 2156 } else if kx == kindConst { 2157 x := vx.(uint8) 2158 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(uint8)) } 2159 } else if ky == kindConst { 2160 y := vy.(uint8) 2161 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)&y) } 2162 } else { 2163 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)&fr.reg(iy).(uint8)) } 2164 } 2165 case reflect.Uint16: 2166 if kx == kindConst && ky == kindConst { 2167 v := vx.(uint16) & vy.(uint16) 2168 return func(fr *frame) { fr.setReg(ir, v) } 2169 } else if kx == kindConst { 2170 x := vx.(uint16) 2171 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(uint16)) } 2172 } else if ky == kindConst { 2173 y := vy.(uint16) 2174 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)&y) } 2175 } else { 2176 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)&fr.reg(iy).(uint16)) } 2177 } 2178 case reflect.Uint32: 2179 if kx == kindConst && ky == kindConst { 2180 v := vx.(uint32) & vy.(uint32) 2181 return func(fr *frame) { fr.setReg(ir, v) } 2182 } else if kx == kindConst { 2183 x := vx.(uint32) 2184 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(uint32)) } 2185 } else if ky == kindConst { 2186 y := vy.(uint32) 2187 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)&y) } 2188 } else { 2189 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)&fr.reg(iy).(uint32)) } 2190 } 2191 case reflect.Uint64: 2192 if kx == kindConst && ky == kindConst { 2193 v := vx.(uint64) & vy.(uint64) 2194 return func(fr *frame) { fr.setReg(ir, v) } 2195 } else if kx == kindConst { 2196 x := vx.(uint64) 2197 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(uint64)) } 2198 } else if ky == kindConst { 2199 y := vy.(uint64) 2200 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)&y) } 2201 } else { 2202 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)&fr.reg(iy).(uint64)) } 2203 } 2204 case reflect.Uintptr: 2205 if kx == kindConst && ky == kindConst { 2206 v := vx.(uintptr) & vy.(uintptr) 2207 return func(fr *frame) { fr.setReg(ir, v) } 2208 } else if kx == kindConst { 2209 x := vx.(uintptr) 2210 return func(fr *frame) { fr.setReg(ir, x&fr.reg(iy).(uintptr)) } 2211 } else if ky == kindConst { 2212 y := vy.(uintptr) 2213 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)&y) } 2214 } else { 2215 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)&fr.reg(iy).(uintptr)) } 2216 } 2217 } 2218 } else { 2219 t := xtype.TypeOfType(typ) 2220 switch typ.Kind() { 2221 case reflect.Int: 2222 if kx == kindConst && ky == kindConst { 2223 v := xtype.Make(t, xtype.Int(vx)&xtype.Int(vy)) 2224 return func(fr *frame) { fr.setReg(ir, v) } 2225 } else if kx == kindConst { 2226 x := xtype.Int(vx) 2227 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.int(iy))) } 2228 } else if ky == kindConst { 2229 y := xtype.Int(vy) 2230 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)&y)) } 2231 } else { 2232 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)&fr.int(iy))) } 2233 } 2234 case reflect.Int8: 2235 if kx == kindConst && ky == kindConst { 2236 v := xtype.Make(t, xtype.Int8(vx)&xtype.Int8(vy)) 2237 return func(fr *frame) { fr.setReg(ir, v) } 2238 } else if kx == kindConst { 2239 x := xtype.Int8(vx) 2240 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.int8(iy))) } 2241 } else if ky == kindConst { 2242 y := xtype.Int8(vy) 2243 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)&y)) } 2244 } else { 2245 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)&fr.int8(iy))) } 2246 } 2247 case reflect.Int16: 2248 if kx == kindConst && ky == kindConst { 2249 v := xtype.Make(t, xtype.Int16(vx)&xtype.Int16(vy)) 2250 return func(fr *frame) { fr.setReg(ir, v) } 2251 } else if kx == kindConst { 2252 x := xtype.Int16(vx) 2253 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.int16(iy))) } 2254 } else if ky == kindConst { 2255 y := xtype.Int16(vy) 2256 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)&y)) } 2257 } else { 2258 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)&fr.int16(iy))) } 2259 } 2260 case reflect.Int32: 2261 if kx == kindConst && ky == kindConst { 2262 v := xtype.Make(t, xtype.Int32(vx)&xtype.Int32(vy)) 2263 return func(fr *frame) { fr.setReg(ir, v) } 2264 } else if kx == kindConst { 2265 x := xtype.Int32(vx) 2266 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.int32(iy))) } 2267 } else if ky == kindConst { 2268 y := xtype.Int32(vy) 2269 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)&y)) } 2270 } else { 2271 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)&fr.int32(iy))) } 2272 } 2273 case reflect.Int64: 2274 if kx == kindConst && ky == kindConst { 2275 v := xtype.Make(t, xtype.Int64(vx)&xtype.Int64(vy)) 2276 return func(fr *frame) { fr.setReg(ir, v) } 2277 } else if kx == kindConst { 2278 x := xtype.Int64(vx) 2279 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.int64(iy))) } 2280 } else if ky == kindConst { 2281 y := xtype.Int64(vy) 2282 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)&y)) } 2283 } else { 2284 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)&fr.int64(iy))) } 2285 } 2286 case reflect.Uint: 2287 if kx == kindConst && ky == kindConst { 2288 v := xtype.Make(t, xtype.Uint(vx)&xtype.Uint(vy)) 2289 return func(fr *frame) { fr.setReg(ir, v) } 2290 } else if kx == kindConst { 2291 x := xtype.Uint(vx) 2292 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.uint(iy))) } 2293 } else if ky == kindConst { 2294 y := xtype.Uint(vy) 2295 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)&y)) } 2296 } else { 2297 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)&fr.uint(iy))) } 2298 } 2299 case reflect.Uint8: 2300 if kx == kindConst && ky == kindConst { 2301 v := xtype.Make(t, xtype.Uint8(vx)&xtype.Uint8(vy)) 2302 return func(fr *frame) { fr.setReg(ir, v) } 2303 } else if kx == kindConst { 2304 x := xtype.Uint8(vx) 2305 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.uint8(iy))) } 2306 } else if ky == kindConst { 2307 y := xtype.Uint8(vy) 2308 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)&y)) } 2309 } else { 2310 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)&fr.uint8(iy))) } 2311 } 2312 case reflect.Uint16: 2313 if kx == kindConst && ky == kindConst { 2314 v := xtype.Make(t, xtype.Uint16(vx)&xtype.Uint16(vy)) 2315 return func(fr *frame) { fr.setReg(ir, v) } 2316 } else if kx == kindConst { 2317 x := xtype.Uint16(vx) 2318 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.uint16(iy))) } 2319 } else if ky == kindConst { 2320 y := xtype.Uint16(vy) 2321 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)&y)) } 2322 } else { 2323 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)&fr.uint16(iy))) } 2324 } 2325 case reflect.Uint32: 2326 if kx == kindConst && ky == kindConst { 2327 v := xtype.Make(t, xtype.Uint32(vx)&xtype.Uint32(vy)) 2328 return func(fr *frame) { fr.setReg(ir, v) } 2329 } else if kx == kindConst { 2330 x := xtype.Uint32(vx) 2331 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.uint32(iy))) } 2332 } else if ky == kindConst { 2333 y := xtype.Uint32(vy) 2334 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)&y)) } 2335 } else { 2336 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)&fr.uint32(iy))) } 2337 } 2338 case reflect.Uint64: 2339 if kx == kindConst && ky == kindConst { 2340 v := xtype.Make(t, xtype.Uint64(vx)&xtype.Uint64(vy)) 2341 return func(fr *frame) { fr.setReg(ir, v) } 2342 } else if kx == kindConst { 2343 x := xtype.Uint64(vx) 2344 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.uint64(iy))) } 2345 } else if ky == kindConst { 2346 y := xtype.Uint64(vy) 2347 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)&y)) } 2348 } else { 2349 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)&fr.uint64(iy))) } 2350 } 2351 case reflect.Uintptr: 2352 if kx == kindConst && ky == kindConst { 2353 v := xtype.Make(t, xtype.Uintptr(vx)&xtype.Uintptr(vy)) 2354 return func(fr *frame) { fr.setReg(ir, v) } 2355 } else if kx == kindConst { 2356 x := xtype.Uintptr(vx) 2357 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&fr.uintptr(iy))) } 2358 } else if ky == kindConst { 2359 y := xtype.Uintptr(vy) 2360 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)&y)) } 2361 } else { 2362 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)&fr.uintptr(iy))) } 2363 } 2364 } 2365 } 2366 panic("unreachable") 2367 } 2368 func makeBinOpOR(pfn *function, instr *ssa.BinOp) func(fr *frame) { 2369 ir := pfn.regIndex(instr) 2370 ix, kx, vx := pfn.regIndex3(instr.X) 2371 iy, ky, vy := pfn.regIndex3(instr.Y) 2372 typ := pfn.Interp.preToType(instr.Type()) 2373 if typ.PkgPath() == "" { 2374 switch typ.Kind() { 2375 case reflect.Int: 2376 if kx == kindConst && ky == kindConst { 2377 v := vx.(int) | vy.(int) 2378 return func(fr *frame) { fr.setReg(ir, v) } 2379 } else if kx == kindConst { 2380 x := vx.(int) 2381 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(int)) } 2382 } else if ky == kindConst { 2383 y := vy.(int) 2384 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)|y) } 2385 } else { 2386 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)|fr.reg(iy).(int)) } 2387 } 2388 case reflect.Int8: 2389 if kx == kindConst && ky == kindConst { 2390 v := vx.(int8) | vy.(int8) 2391 return func(fr *frame) { fr.setReg(ir, v) } 2392 } else if kx == kindConst { 2393 x := vx.(int8) 2394 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(int8)) } 2395 } else if ky == kindConst { 2396 y := vy.(int8) 2397 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)|y) } 2398 } else { 2399 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)|fr.reg(iy).(int8)) } 2400 } 2401 case reflect.Int16: 2402 if kx == kindConst && ky == kindConst { 2403 v := vx.(int16) | vy.(int16) 2404 return func(fr *frame) { fr.setReg(ir, v) } 2405 } else if kx == kindConst { 2406 x := vx.(int16) 2407 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(int16)) } 2408 } else if ky == kindConst { 2409 y := vy.(int16) 2410 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)|y) } 2411 } else { 2412 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)|fr.reg(iy).(int16)) } 2413 } 2414 case reflect.Int32: 2415 if kx == kindConst && ky == kindConst { 2416 v := vx.(int32) | vy.(int32) 2417 return func(fr *frame) { fr.setReg(ir, v) } 2418 } else if kx == kindConst { 2419 x := vx.(int32) 2420 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(int32)) } 2421 } else if ky == kindConst { 2422 y := vy.(int32) 2423 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)|y) } 2424 } else { 2425 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)|fr.reg(iy).(int32)) } 2426 } 2427 case reflect.Int64: 2428 if kx == kindConst && ky == kindConst { 2429 v := vx.(int64) | vy.(int64) 2430 return func(fr *frame) { fr.setReg(ir, v) } 2431 } else if kx == kindConst { 2432 x := vx.(int64) 2433 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(int64)) } 2434 } else if ky == kindConst { 2435 y := vy.(int64) 2436 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)|y) } 2437 } else { 2438 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)|fr.reg(iy).(int64)) } 2439 } 2440 case reflect.Uint: 2441 if kx == kindConst && ky == kindConst { 2442 v := vx.(uint) | vy.(uint) 2443 return func(fr *frame) { fr.setReg(ir, v) } 2444 } else if kx == kindConst { 2445 x := vx.(uint) 2446 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(uint)) } 2447 } else if ky == kindConst { 2448 y := vy.(uint) 2449 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)|y) } 2450 } else { 2451 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)|fr.reg(iy).(uint)) } 2452 } 2453 case reflect.Uint8: 2454 if kx == kindConst && ky == kindConst { 2455 v := vx.(uint8) | vy.(uint8) 2456 return func(fr *frame) { fr.setReg(ir, v) } 2457 } else if kx == kindConst { 2458 x := vx.(uint8) 2459 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(uint8)) } 2460 } else if ky == kindConst { 2461 y := vy.(uint8) 2462 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)|y) } 2463 } else { 2464 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)|fr.reg(iy).(uint8)) } 2465 } 2466 case reflect.Uint16: 2467 if kx == kindConst && ky == kindConst { 2468 v := vx.(uint16) | vy.(uint16) 2469 return func(fr *frame) { fr.setReg(ir, v) } 2470 } else if kx == kindConst { 2471 x := vx.(uint16) 2472 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(uint16)) } 2473 } else if ky == kindConst { 2474 y := vy.(uint16) 2475 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)|y) } 2476 } else { 2477 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)|fr.reg(iy).(uint16)) } 2478 } 2479 case reflect.Uint32: 2480 if kx == kindConst && ky == kindConst { 2481 v := vx.(uint32) | vy.(uint32) 2482 return func(fr *frame) { fr.setReg(ir, v) } 2483 } else if kx == kindConst { 2484 x := vx.(uint32) 2485 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(uint32)) } 2486 } else if ky == kindConst { 2487 y := vy.(uint32) 2488 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)|y) } 2489 } else { 2490 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)|fr.reg(iy).(uint32)) } 2491 } 2492 case reflect.Uint64: 2493 if kx == kindConst && ky == kindConst { 2494 v := vx.(uint64) | vy.(uint64) 2495 return func(fr *frame) { fr.setReg(ir, v) } 2496 } else if kx == kindConst { 2497 x := vx.(uint64) 2498 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(uint64)) } 2499 } else if ky == kindConst { 2500 y := vy.(uint64) 2501 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)|y) } 2502 } else { 2503 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)|fr.reg(iy).(uint64)) } 2504 } 2505 case reflect.Uintptr: 2506 if kx == kindConst && ky == kindConst { 2507 v := vx.(uintptr) | vy.(uintptr) 2508 return func(fr *frame) { fr.setReg(ir, v) } 2509 } else if kx == kindConst { 2510 x := vx.(uintptr) 2511 return func(fr *frame) { fr.setReg(ir, x|fr.reg(iy).(uintptr)) } 2512 } else if ky == kindConst { 2513 y := vy.(uintptr) 2514 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)|y) } 2515 } else { 2516 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)|fr.reg(iy).(uintptr)) } 2517 } 2518 } 2519 } else { 2520 t := xtype.TypeOfType(typ) 2521 switch typ.Kind() { 2522 case reflect.Int: 2523 if kx == kindConst && ky == kindConst { 2524 v := xtype.Make(t, xtype.Int(vx)|xtype.Int(vy)) 2525 return func(fr *frame) { fr.setReg(ir, v) } 2526 } else if kx == kindConst { 2527 x := xtype.Int(vx) 2528 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.int(iy))) } 2529 } else if ky == kindConst { 2530 y := xtype.Int(vy) 2531 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)|y)) } 2532 } else { 2533 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)|fr.int(iy))) } 2534 } 2535 case reflect.Int8: 2536 if kx == kindConst && ky == kindConst { 2537 v := xtype.Make(t, xtype.Int8(vx)|xtype.Int8(vy)) 2538 return func(fr *frame) { fr.setReg(ir, v) } 2539 } else if kx == kindConst { 2540 x := xtype.Int8(vx) 2541 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.int8(iy))) } 2542 } else if ky == kindConst { 2543 y := xtype.Int8(vy) 2544 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)|y)) } 2545 } else { 2546 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)|fr.int8(iy))) } 2547 } 2548 case reflect.Int16: 2549 if kx == kindConst && ky == kindConst { 2550 v := xtype.Make(t, xtype.Int16(vx)|xtype.Int16(vy)) 2551 return func(fr *frame) { fr.setReg(ir, v) } 2552 } else if kx == kindConst { 2553 x := xtype.Int16(vx) 2554 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.int16(iy))) } 2555 } else if ky == kindConst { 2556 y := xtype.Int16(vy) 2557 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)|y)) } 2558 } else { 2559 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)|fr.int16(iy))) } 2560 } 2561 case reflect.Int32: 2562 if kx == kindConst && ky == kindConst { 2563 v := xtype.Make(t, xtype.Int32(vx)|xtype.Int32(vy)) 2564 return func(fr *frame) { fr.setReg(ir, v) } 2565 } else if kx == kindConst { 2566 x := xtype.Int32(vx) 2567 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.int32(iy))) } 2568 } else if ky == kindConst { 2569 y := xtype.Int32(vy) 2570 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)|y)) } 2571 } else { 2572 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)|fr.int32(iy))) } 2573 } 2574 case reflect.Int64: 2575 if kx == kindConst && ky == kindConst { 2576 v := xtype.Make(t, xtype.Int64(vx)|xtype.Int64(vy)) 2577 return func(fr *frame) { fr.setReg(ir, v) } 2578 } else if kx == kindConst { 2579 x := xtype.Int64(vx) 2580 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.int64(iy))) } 2581 } else if ky == kindConst { 2582 y := xtype.Int64(vy) 2583 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)|y)) } 2584 } else { 2585 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)|fr.int64(iy))) } 2586 } 2587 case reflect.Uint: 2588 if kx == kindConst && ky == kindConst { 2589 v := xtype.Make(t, xtype.Uint(vx)|xtype.Uint(vy)) 2590 return func(fr *frame) { fr.setReg(ir, v) } 2591 } else if kx == kindConst { 2592 x := xtype.Uint(vx) 2593 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.uint(iy))) } 2594 } else if ky == kindConst { 2595 y := xtype.Uint(vy) 2596 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)|y)) } 2597 } else { 2598 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)|fr.uint(iy))) } 2599 } 2600 case reflect.Uint8: 2601 if kx == kindConst && ky == kindConst { 2602 v := xtype.Make(t, xtype.Uint8(vx)|xtype.Uint8(vy)) 2603 return func(fr *frame) { fr.setReg(ir, v) } 2604 } else if kx == kindConst { 2605 x := xtype.Uint8(vx) 2606 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.uint8(iy))) } 2607 } else if ky == kindConst { 2608 y := xtype.Uint8(vy) 2609 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)|y)) } 2610 } else { 2611 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)|fr.uint8(iy))) } 2612 } 2613 case reflect.Uint16: 2614 if kx == kindConst && ky == kindConst { 2615 v := xtype.Make(t, xtype.Uint16(vx)|xtype.Uint16(vy)) 2616 return func(fr *frame) { fr.setReg(ir, v) } 2617 } else if kx == kindConst { 2618 x := xtype.Uint16(vx) 2619 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.uint16(iy))) } 2620 } else if ky == kindConst { 2621 y := xtype.Uint16(vy) 2622 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)|y)) } 2623 } else { 2624 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)|fr.uint16(iy))) } 2625 } 2626 case reflect.Uint32: 2627 if kx == kindConst && ky == kindConst { 2628 v := xtype.Make(t, xtype.Uint32(vx)|xtype.Uint32(vy)) 2629 return func(fr *frame) { fr.setReg(ir, v) } 2630 } else if kx == kindConst { 2631 x := xtype.Uint32(vx) 2632 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.uint32(iy))) } 2633 } else if ky == kindConst { 2634 y := xtype.Uint32(vy) 2635 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)|y)) } 2636 } else { 2637 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)|fr.uint32(iy))) } 2638 } 2639 case reflect.Uint64: 2640 if kx == kindConst && ky == kindConst { 2641 v := xtype.Make(t, xtype.Uint64(vx)|xtype.Uint64(vy)) 2642 return func(fr *frame) { fr.setReg(ir, v) } 2643 } else if kx == kindConst { 2644 x := xtype.Uint64(vx) 2645 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.uint64(iy))) } 2646 } else if ky == kindConst { 2647 y := xtype.Uint64(vy) 2648 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)|y)) } 2649 } else { 2650 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)|fr.uint64(iy))) } 2651 } 2652 case reflect.Uintptr: 2653 if kx == kindConst && ky == kindConst { 2654 v := xtype.Make(t, xtype.Uintptr(vx)|xtype.Uintptr(vy)) 2655 return func(fr *frame) { fr.setReg(ir, v) } 2656 } else if kx == kindConst { 2657 x := xtype.Uintptr(vx) 2658 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x|fr.uintptr(iy))) } 2659 } else if ky == kindConst { 2660 y := xtype.Uintptr(vy) 2661 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)|y)) } 2662 } else { 2663 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)|fr.uintptr(iy))) } 2664 } 2665 } 2666 } 2667 panic("unreachable") 2668 } 2669 func makeBinOpXOR(pfn *function, instr *ssa.BinOp) func(fr *frame) { 2670 ir := pfn.regIndex(instr) 2671 ix, kx, vx := pfn.regIndex3(instr.X) 2672 iy, ky, vy := pfn.regIndex3(instr.Y) 2673 typ := pfn.Interp.preToType(instr.Type()) 2674 if typ.PkgPath() == "" { 2675 switch typ.Kind() { 2676 case reflect.Int: 2677 if kx == kindConst && ky == kindConst { 2678 v := vx.(int) ^ vy.(int) 2679 return func(fr *frame) { fr.setReg(ir, v) } 2680 } else if kx == kindConst { 2681 x := vx.(int) 2682 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(int)) } 2683 } else if ky == kindConst { 2684 y := vy.(int) 2685 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)^y) } 2686 } else { 2687 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)^fr.reg(iy).(int)) } 2688 } 2689 case reflect.Int8: 2690 if kx == kindConst && ky == kindConst { 2691 v := vx.(int8) ^ vy.(int8) 2692 return func(fr *frame) { fr.setReg(ir, v) } 2693 } else if kx == kindConst { 2694 x := vx.(int8) 2695 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(int8)) } 2696 } else if ky == kindConst { 2697 y := vy.(int8) 2698 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)^y) } 2699 } else { 2700 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)^fr.reg(iy).(int8)) } 2701 } 2702 case reflect.Int16: 2703 if kx == kindConst && ky == kindConst { 2704 v := vx.(int16) ^ vy.(int16) 2705 return func(fr *frame) { fr.setReg(ir, v) } 2706 } else if kx == kindConst { 2707 x := vx.(int16) 2708 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(int16)) } 2709 } else if ky == kindConst { 2710 y := vy.(int16) 2711 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)^y) } 2712 } else { 2713 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)^fr.reg(iy).(int16)) } 2714 } 2715 case reflect.Int32: 2716 if kx == kindConst && ky == kindConst { 2717 v := vx.(int32) ^ vy.(int32) 2718 return func(fr *frame) { fr.setReg(ir, v) } 2719 } else if kx == kindConst { 2720 x := vx.(int32) 2721 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(int32)) } 2722 } else if ky == kindConst { 2723 y := vy.(int32) 2724 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)^y) } 2725 } else { 2726 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)^fr.reg(iy).(int32)) } 2727 } 2728 case reflect.Int64: 2729 if kx == kindConst && ky == kindConst { 2730 v := vx.(int64) ^ vy.(int64) 2731 return func(fr *frame) { fr.setReg(ir, v) } 2732 } else if kx == kindConst { 2733 x := vx.(int64) 2734 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(int64)) } 2735 } else if ky == kindConst { 2736 y := vy.(int64) 2737 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)^y) } 2738 } else { 2739 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)^fr.reg(iy).(int64)) } 2740 } 2741 case reflect.Uint: 2742 if kx == kindConst && ky == kindConst { 2743 v := vx.(uint) ^ vy.(uint) 2744 return func(fr *frame) { fr.setReg(ir, v) } 2745 } else if kx == kindConst { 2746 x := vx.(uint) 2747 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(uint)) } 2748 } else if ky == kindConst { 2749 y := vy.(uint) 2750 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)^y) } 2751 } else { 2752 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)^fr.reg(iy).(uint)) } 2753 } 2754 case reflect.Uint8: 2755 if kx == kindConst && ky == kindConst { 2756 v := vx.(uint8) ^ vy.(uint8) 2757 return func(fr *frame) { fr.setReg(ir, v) } 2758 } else if kx == kindConst { 2759 x := vx.(uint8) 2760 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(uint8)) } 2761 } else if ky == kindConst { 2762 y := vy.(uint8) 2763 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)^y) } 2764 } else { 2765 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)^fr.reg(iy).(uint8)) } 2766 } 2767 case reflect.Uint16: 2768 if kx == kindConst && ky == kindConst { 2769 v := vx.(uint16) ^ vy.(uint16) 2770 return func(fr *frame) { fr.setReg(ir, v) } 2771 } else if kx == kindConst { 2772 x := vx.(uint16) 2773 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(uint16)) } 2774 } else if ky == kindConst { 2775 y := vy.(uint16) 2776 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)^y) } 2777 } else { 2778 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)^fr.reg(iy).(uint16)) } 2779 } 2780 case reflect.Uint32: 2781 if kx == kindConst && ky == kindConst { 2782 v := vx.(uint32) ^ vy.(uint32) 2783 return func(fr *frame) { fr.setReg(ir, v) } 2784 } else if kx == kindConst { 2785 x := vx.(uint32) 2786 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(uint32)) } 2787 } else if ky == kindConst { 2788 y := vy.(uint32) 2789 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)^y) } 2790 } else { 2791 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)^fr.reg(iy).(uint32)) } 2792 } 2793 case reflect.Uint64: 2794 if kx == kindConst && ky == kindConst { 2795 v := vx.(uint64) ^ vy.(uint64) 2796 return func(fr *frame) { fr.setReg(ir, v) } 2797 } else if kx == kindConst { 2798 x := vx.(uint64) 2799 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(uint64)) } 2800 } else if ky == kindConst { 2801 y := vy.(uint64) 2802 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)^y) } 2803 } else { 2804 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)^fr.reg(iy).(uint64)) } 2805 } 2806 case reflect.Uintptr: 2807 if kx == kindConst && ky == kindConst { 2808 v := vx.(uintptr) ^ vy.(uintptr) 2809 return func(fr *frame) { fr.setReg(ir, v) } 2810 } else if kx == kindConst { 2811 x := vx.(uintptr) 2812 return func(fr *frame) { fr.setReg(ir, x^fr.reg(iy).(uintptr)) } 2813 } else if ky == kindConst { 2814 y := vy.(uintptr) 2815 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)^y) } 2816 } else { 2817 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)^fr.reg(iy).(uintptr)) } 2818 } 2819 } 2820 } else { 2821 t := xtype.TypeOfType(typ) 2822 switch typ.Kind() { 2823 case reflect.Int: 2824 if kx == kindConst && ky == kindConst { 2825 v := xtype.Make(t, xtype.Int(vx)^xtype.Int(vy)) 2826 return func(fr *frame) { fr.setReg(ir, v) } 2827 } else if kx == kindConst { 2828 x := xtype.Int(vx) 2829 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.int(iy))) } 2830 } else if ky == kindConst { 2831 y := xtype.Int(vy) 2832 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)^y)) } 2833 } else { 2834 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)^fr.int(iy))) } 2835 } 2836 case reflect.Int8: 2837 if kx == kindConst && ky == kindConst { 2838 v := xtype.Make(t, xtype.Int8(vx)^xtype.Int8(vy)) 2839 return func(fr *frame) { fr.setReg(ir, v) } 2840 } else if kx == kindConst { 2841 x := xtype.Int8(vx) 2842 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.int8(iy))) } 2843 } else if ky == kindConst { 2844 y := xtype.Int8(vy) 2845 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)^y)) } 2846 } else { 2847 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)^fr.int8(iy))) } 2848 } 2849 case reflect.Int16: 2850 if kx == kindConst && ky == kindConst { 2851 v := xtype.Make(t, xtype.Int16(vx)^xtype.Int16(vy)) 2852 return func(fr *frame) { fr.setReg(ir, v) } 2853 } else if kx == kindConst { 2854 x := xtype.Int16(vx) 2855 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.int16(iy))) } 2856 } else if ky == kindConst { 2857 y := xtype.Int16(vy) 2858 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)^y)) } 2859 } else { 2860 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)^fr.int16(iy))) } 2861 } 2862 case reflect.Int32: 2863 if kx == kindConst && ky == kindConst { 2864 v := xtype.Make(t, xtype.Int32(vx)^xtype.Int32(vy)) 2865 return func(fr *frame) { fr.setReg(ir, v) } 2866 } else if kx == kindConst { 2867 x := xtype.Int32(vx) 2868 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.int32(iy))) } 2869 } else if ky == kindConst { 2870 y := xtype.Int32(vy) 2871 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)^y)) } 2872 } else { 2873 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)^fr.int32(iy))) } 2874 } 2875 case reflect.Int64: 2876 if kx == kindConst && ky == kindConst { 2877 v := xtype.Make(t, xtype.Int64(vx)^xtype.Int64(vy)) 2878 return func(fr *frame) { fr.setReg(ir, v) } 2879 } else if kx == kindConst { 2880 x := xtype.Int64(vx) 2881 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.int64(iy))) } 2882 } else if ky == kindConst { 2883 y := xtype.Int64(vy) 2884 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)^y)) } 2885 } else { 2886 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)^fr.int64(iy))) } 2887 } 2888 case reflect.Uint: 2889 if kx == kindConst && ky == kindConst { 2890 v := xtype.Make(t, xtype.Uint(vx)^xtype.Uint(vy)) 2891 return func(fr *frame) { fr.setReg(ir, v) } 2892 } else if kx == kindConst { 2893 x := xtype.Uint(vx) 2894 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.uint(iy))) } 2895 } else if ky == kindConst { 2896 y := xtype.Uint(vy) 2897 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)^y)) } 2898 } else { 2899 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)^fr.uint(iy))) } 2900 } 2901 case reflect.Uint8: 2902 if kx == kindConst && ky == kindConst { 2903 v := xtype.Make(t, xtype.Uint8(vx)^xtype.Uint8(vy)) 2904 return func(fr *frame) { fr.setReg(ir, v) } 2905 } else if kx == kindConst { 2906 x := xtype.Uint8(vx) 2907 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.uint8(iy))) } 2908 } else if ky == kindConst { 2909 y := xtype.Uint8(vy) 2910 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)^y)) } 2911 } else { 2912 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)^fr.uint8(iy))) } 2913 } 2914 case reflect.Uint16: 2915 if kx == kindConst && ky == kindConst { 2916 v := xtype.Make(t, xtype.Uint16(vx)^xtype.Uint16(vy)) 2917 return func(fr *frame) { fr.setReg(ir, v) } 2918 } else if kx == kindConst { 2919 x := xtype.Uint16(vx) 2920 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.uint16(iy))) } 2921 } else if ky == kindConst { 2922 y := xtype.Uint16(vy) 2923 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)^y)) } 2924 } else { 2925 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)^fr.uint16(iy))) } 2926 } 2927 case reflect.Uint32: 2928 if kx == kindConst && ky == kindConst { 2929 v := xtype.Make(t, xtype.Uint32(vx)^xtype.Uint32(vy)) 2930 return func(fr *frame) { fr.setReg(ir, v) } 2931 } else if kx == kindConst { 2932 x := xtype.Uint32(vx) 2933 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.uint32(iy))) } 2934 } else if ky == kindConst { 2935 y := xtype.Uint32(vy) 2936 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)^y)) } 2937 } else { 2938 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)^fr.uint32(iy))) } 2939 } 2940 case reflect.Uint64: 2941 if kx == kindConst && ky == kindConst { 2942 v := xtype.Make(t, xtype.Uint64(vx)^xtype.Uint64(vy)) 2943 return func(fr *frame) { fr.setReg(ir, v) } 2944 } else if kx == kindConst { 2945 x := xtype.Uint64(vx) 2946 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.uint64(iy))) } 2947 } else if ky == kindConst { 2948 y := xtype.Uint64(vy) 2949 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)^y)) } 2950 } else { 2951 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)^fr.uint64(iy))) } 2952 } 2953 case reflect.Uintptr: 2954 if kx == kindConst && ky == kindConst { 2955 v := xtype.Make(t, xtype.Uintptr(vx)^xtype.Uintptr(vy)) 2956 return func(fr *frame) { fr.setReg(ir, v) } 2957 } else if kx == kindConst { 2958 x := xtype.Uintptr(vx) 2959 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x^fr.uintptr(iy))) } 2960 } else if ky == kindConst { 2961 y := xtype.Uintptr(vy) 2962 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)^y)) } 2963 } else { 2964 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)^fr.uintptr(iy))) } 2965 } 2966 } 2967 } 2968 panic("unreachable") 2969 } 2970 func makeBinOpANDNOT(pfn *function, instr *ssa.BinOp) func(fr *frame) { 2971 ir := pfn.regIndex(instr) 2972 ix, kx, vx := pfn.regIndex3(instr.X) 2973 iy, ky, vy := pfn.regIndex3(instr.Y) 2974 typ := pfn.Interp.preToType(instr.Type()) 2975 if typ.PkgPath() == "" { 2976 switch typ.Kind() { 2977 case reflect.Int: 2978 if kx == kindConst && ky == kindConst { 2979 v := vx.(int) &^ vy.(int) 2980 return func(fr *frame) { fr.setReg(ir, v) } 2981 } else if kx == kindConst { 2982 x := vx.(int) 2983 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(int)) } 2984 } else if ky == kindConst { 2985 y := vy.(int) 2986 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)&^y) } 2987 } else { 2988 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int)&^fr.reg(iy).(int)) } 2989 } 2990 case reflect.Int8: 2991 if kx == kindConst && ky == kindConst { 2992 v := vx.(int8) &^ vy.(int8) 2993 return func(fr *frame) { fr.setReg(ir, v) } 2994 } else if kx == kindConst { 2995 x := vx.(int8) 2996 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(int8)) } 2997 } else if ky == kindConst { 2998 y := vy.(int8) 2999 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)&^y) } 3000 } else { 3001 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8)&^fr.reg(iy).(int8)) } 3002 } 3003 case reflect.Int16: 3004 if kx == kindConst && ky == kindConst { 3005 v := vx.(int16) &^ vy.(int16) 3006 return func(fr *frame) { fr.setReg(ir, v) } 3007 } else if kx == kindConst { 3008 x := vx.(int16) 3009 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(int16)) } 3010 } else if ky == kindConst { 3011 y := vy.(int16) 3012 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)&^y) } 3013 } else { 3014 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16)&^fr.reg(iy).(int16)) } 3015 } 3016 case reflect.Int32: 3017 if kx == kindConst && ky == kindConst { 3018 v := vx.(int32) &^ vy.(int32) 3019 return func(fr *frame) { fr.setReg(ir, v) } 3020 } else if kx == kindConst { 3021 x := vx.(int32) 3022 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(int32)) } 3023 } else if ky == kindConst { 3024 y := vy.(int32) 3025 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)&^y) } 3026 } else { 3027 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32)&^fr.reg(iy).(int32)) } 3028 } 3029 case reflect.Int64: 3030 if kx == kindConst && ky == kindConst { 3031 v := vx.(int64) &^ vy.(int64) 3032 return func(fr *frame) { fr.setReg(ir, v) } 3033 } else if kx == kindConst { 3034 x := vx.(int64) 3035 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(int64)) } 3036 } else if ky == kindConst { 3037 y := vy.(int64) 3038 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)&^y) } 3039 } else { 3040 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64)&^fr.reg(iy).(int64)) } 3041 } 3042 case reflect.Uint: 3043 if kx == kindConst && ky == kindConst { 3044 v := vx.(uint) &^ vy.(uint) 3045 return func(fr *frame) { fr.setReg(ir, v) } 3046 } else if kx == kindConst { 3047 x := vx.(uint) 3048 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(uint)) } 3049 } else if ky == kindConst { 3050 y := vy.(uint) 3051 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)&^y) } 3052 } else { 3053 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint)&^fr.reg(iy).(uint)) } 3054 } 3055 case reflect.Uint8: 3056 if kx == kindConst && ky == kindConst { 3057 v := vx.(uint8) &^ vy.(uint8) 3058 return func(fr *frame) { fr.setReg(ir, v) } 3059 } else if kx == kindConst { 3060 x := vx.(uint8) 3061 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(uint8)) } 3062 } else if ky == kindConst { 3063 y := vy.(uint8) 3064 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)&^y) } 3065 } else { 3066 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8)&^fr.reg(iy).(uint8)) } 3067 } 3068 case reflect.Uint16: 3069 if kx == kindConst && ky == kindConst { 3070 v := vx.(uint16) &^ vy.(uint16) 3071 return func(fr *frame) { fr.setReg(ir, v) } 3072 } else if kx == kindConst { 3073 x := vx.(uint16) 3074 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(uint16)) } 3075 } else if ky == kindConst { 3076 y := vy.(uint16) 3077 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)&^y) } 3078 } else { 3079 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16)&^fr.reg(iy).(uint16)) } 3080 } 3081 case reflect.Uint32: 3082 if kx == kindConst && ky == kindConst { 3083 v := vx.(uint32) &^ vy.(uint32) 3084 return func(fr *frame) { fr.setReg(ir, v) } 3085 } else if kx == kindConst { 3086 x := vx.(uint32) 3087 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(uint32)) } 3088 } else if ky == kindConst { 3089 y := vy.(uint32) 3090 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)&^y) } 3091 } else { 3092 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32)&^fr.reg(iy).(uint32)) } 3093 } 3094 case reflect.Uint64: 3095 if kx == kindConst && ky == kindConst { 3096 v := vx.(uint64) &^ vy.(uint64) 3097 return func(fr *frame) { fr.setReg(ir, v) } 3098 } else if kx == kindConst { 3099 x := vx.(uint64) 3100 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(uint64)) } 3101 } else if ky == kindConst { 3102 y := vy.(uint64) 3103 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)&^y) } 3104 } else { 3105 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64)&^fr.reg(iy).(uint64)) } 3106 } 3107 case reflect.Uintptr: 3108 if kx == kindConst && ky == kindConst { 3109 v := vx.(uintptr) &^ vy.(uintptr) 3110 return func(fr *frame) { fr.setReg(ir, v) } 3111 } else if kx == kindConst { 3112 x := vx.(uintptr) 3113 return func(fr *frame) { fr.setReg(ir, x&^fr.reg(iy).(uintptr)) } 3114 } else if ky == kindConst { 3115 y := vy.(uintptr) 3116 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)&^y) } 3117 } else { 3118 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr)&^fr.reg(iy).(uintptr)) } 3119 } 3120 } 3121 } else { 3122 t := xtype.TypeOfType(typ) 3123 switch typ.Kind() { 3124 case reflect.Int: 3125 if kx == kindConst && ky == kindConst { 3126 v := xtype.Make(t, xtype.Int(vx)&^xtype.Int(vy)) 3127 return func(fr *frame) { fr.setReg(ir, v) } 3128 } else if kx == kindConst { 3129 x := xtype.Int(vx) 3130 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.int(iy))) } 3131 } else if ky == kindConst { 3132 y := xtype.Int(vy) 3133 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)&^y)) } 3134 } else { 3135 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int(ix)&^fr.int(iy))) } 3136 } 3137 case reflect.Int8: 3138 if kx == kindConst && ky == kindConst { 3139 v := xtype.Make(t, xtype.Int8(vx)&^xtype.Int8(vy)) 3140 return func(fr *frame) { fr.setReg(ir, v) } 3141 } else if kx == kindConst { 3142 x := xtype.Int8(vx) 3143 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.int8(iy))) } 3144 } else if ky == kindConst { 3145 y := xtype.Int8(vy) 3146 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)&^y)) } 3147 } else { 3148 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int8(ix)&^fr.int8(iy))) } 3149 } 3150 case reflect.Int16: 3151 if kx == kindConst && ky == kindConst { 3152 v := xtype.Make(t, xtype.Int16(vx)&^xtype.Int16(vy)) 3153 return func(fr *frame) { fr.setReg(ir, v) } 3154 } else if kx == kindConst { 3155 x := xtype.Int16(vx) 3156 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.int16(iy))) } 3157 } else if ky == kindConst { 3158 y := xtype.Int16(vy) 3159 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)&^y)) } 3160 } else { 3161 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int16(ix)&^fr.int16(iy))) } 3162 } 3163 case reflect.Int32: 3164 if kx == kindConst && ky == kindConst { 3165 v := xtype.Make(t, xtype.Int32(vx)&^xtype.Int32(vy)) 3166 return func(fr *frame) { fr.setReg(ir, v) } 3167 } else if kx == kindConst { 3168 x := xtype.Int32(vx) 3169 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.int32(iy))) } 3170 } else if ky == kindConst { 3171 y := xtype.Int32(vy) 3172 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)&^y)) } 3173 } else { 3174 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int32(ix)&^fr.int32(iy))) } 3175 } 3176 case reflect.Int64: 3177 if kx == kindConst && ky == kindConst { 3178 v := xtype.Make(t, xtype.Int64(vx)&^xtype.Int64(vy)) 3179 return func(fr *frame) { fr.setReg(ir, v) } 3180 } else if kx == kindConst { 3181 x := xtype.Int64(vx) 3182 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.int64(iy))) } 3183 } else if ky == kindConst { 3184 y := xtype.Int64(vy) 3185 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)&^y)) } 3186 } else { 3187 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.int64(ix)&^fr.int64(iy))) } 3188 } 3189 case reflect.Uint: 3190 if kx == kindConst && ky == kindConst { 3191 v := xtype.Make(t, xtype.Uint(vx)&^xtype.Uint(vy)) 3192 return func(fr *frame) { fr.setReg(ir, v) } 3193 } else if kx == kindConst { 3194 x := xtype.Uint(vx) 3195 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.uint(iy))) } 3196 } else if ky == kindConst { 3197 y := xtype.Uint(vy) 3198 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)&^y)) } 3199 } else { 3200 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint(ix)&^fr.uint(iy))) } 3201 } 3202 case reflect.Uint8: 3203 if kx == kindConst && ky == kindConst { 3204 v := xtype.Make(t, xtype.Uint8(vx)&^xtype.Uint8(vy)) 3205 return func(fr *frame) { fr.setReg(ir, v) } 3206 } else if kx == kindConst { 3207 x := xtype.Uint8(vx) 3208 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.uint8(iy))) } 3209 } else if ky == kindConst { 3210 y := xtype.Uint8(vy) 3211 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)&^y)) } 3212 } else { 3213 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint8(ix)&^fr.uint8(iy))) } 3214 } 3215 case reflect.Uint16: 3216 if kx == kindConst && ky == kindConst { 3217 v := xtype.Make(t, xtype.Uint16(vx)&^xtype.Uint16(vy)) 3218 return func(fr *frame) { fr.setReg(ir, v) } 3219 } else if kx == kindConst { 3220 x := xtype.Uint16(vx) 3221 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.uint16(iy))) } 3222 } else if ky == kindConst { 3223 y := xtype.Uint16(vy) 3224 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)&^y)) } 3225 } else { 3226 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint16(ix)&^fr.uint16(iy))) } 3227 } 3228 case reflect.Uint32: 3229 if kx == kindConst && ky == kindConst { 3230 v := xtype.Make(t, xtype.Uint32(vx)&^xtype.Uint32(vy)) 3231 return func(fr *frame) { fr.setReg(ir, v) } 3232 } else if kx == kindConst { 3233 x := xtype.Uint32(vx) 3234 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.uint32(iy))) } 3235 } else if ky == kindConst { 3236 y := xtype.Uint32(vy) 3237 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)&^y)) } 3238 } else { 3239 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint32(ix)&^fr.uint32(iy))) } 3240 } 3241 case reflect.Uint64: 3242 if kx == kindConst && ky == kindConst { 3243 v := xtype.Make(t, xtype.Uint64(vx)&^xtype.Uint64(vy)) 3244 return func(fr *frame) { fr.setReg(ir, v) } 3245 } else if kx == kindConst { 3246 x := xtype.Uint64(vx) 3247 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.uint64(iy))) } 3248 } else if ky == kindConst { 3249 y := xtype.Uint64(vy) 3250 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)&^y)) } 3251 } else { 3252 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uint64(ix)&^fr.uint64(iy))) } 3253 } 3254 case reflect.Uintptr: 3255 if kx == kindConst && ky == kindConst { 3256 v := xtype.Make(t, xtype.Uintptr(vx)&^xtype.Uintptr(vy)) 3257 return func(fr *frame) { fr.setReg(ir, v) } 3258 } else if kx == kindConst { 3259 x := xtype.Uintptr(vx) 3260 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, x&^fr.uintptr(iy))) } 3261 } else if ky == kindConst { 3262 y := xtype.Uintptr(vy) 3263 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)&^y)) } 3264 } else { 3265 return func(fr *frame) { fr.setReg(ir, xtype.Make(t, fr.uintptr(ix)&^fr.uintptr(iy))) } 3266 } 3267 } 3268 } 3269 panic("unreachable") 3270 } 3271 func makeBinOpLSS(pfn *function, instr *ssa.BinOp) func(fr *frame) { 3272 ir := pfn.regIndex(instr) 3273 ix, kx, vx := pfn.regIndex3(instr.X) 3274 iy, ky, vy := pfn.regIndex3(instr.Y) 3275 typ := pfn.Interp.preToType(instr.X.Type()) 3276 if typ.PkgPath() == "" { 3277 switch typ.Kind() { 3278 case reflect.Int: 3279 if kx == kindConst && ky == kindConst { 3280 v := vx.(int) < vy.(int) 3281 return func(fr *frame) { fr.setReg(ir, v) } 3282 } else if kx == kindConst { 3283 x := vx.(int) 3284 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(int)) } 3285 } else if ky == kindConst { 3286 y := vy.(int) 3287 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) < y) } 3288 } else { 3289 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) < fr.reg(iy).(int)) } 3290 } 3291 case reflect.Int8: 3292 if kx == kindConst && ky == kindConst { 3293 v := vx.(int8) < vy.(int8) 3294 return func(fr *frame) { fr.setReg(ir, v) } 3295 } else if kx == kindConst { 3296 x := vx.(int8) 3297 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(int8)) } 3298 } else if ky == kindConst { 3299 y := vy.(int8) 3300 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) < y) } 3301 } else { 3302 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) < fr.reg(iy).(int8)) } 3303 } 3304 case reflect.Int16: 3305 if kx == kindConst && ky == kindConst { 3306 v := vx.(int16) < vy.(int16) 3307 return func(fr *frame) { fr.setReg(ir, v) } 3308 } else if kx == kindConst { 3309 x := vx.(int16) 3310 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(int16)) } 3311 } else if ky == kindConst { 3312 y := vy.(int16) 3313 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) < y) } 3314 } else { 3315 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) < fr.reg(iy).(int16)) } 3316 } 3317 case reflect.Int32: 3318 if kx == kindConst && ky == kindConst { 3319 v := vx.(int32) < vy.(int32) 3320 return func(fr *frame) { fr.setReg(ir, v) } 3321 } else if kx == kindConst { 3322 x := vx.(int32) 3323 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(int32)) } 3324 } else if ky == kindConst { 3325 y := vy.(int32) 3326 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) < y) } 3327 } else { 3328 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) < fr.reg(iy).(int32)) } 3329 } 3330 case reflect.Int64: 3331 if kx == kindConst && ky == kindConst { 3332 v := vx.(int64) < vy.(int64) 3333 return func(fr *frame) { fr.setReg(ir, v) } 3334 } else if kx == kindConst { 3335 x := vx.(int64) 3336 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(int64)) } 3337 } else if ky == kindConst { 3338 y := vy.(int64) 3339 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) < y) } 3340 } else { 3341 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) < fr.reg(iy).(int64)) } 3342 } 3343 case reflect.Uint: 3344 if kx == kindConst && ky == kindConst { 3345 v := vx.(uint) < vy.(uint) 3346 return func(fr *frame) { fr.setReg(ir, v) } 3347 } else if kx == kindConst { 3348 x := vx.(uint) 3349 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(uint)) } 3350 } else if ky == kindConst { 3351 y := vy.(uint) 3352 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) < y) } 3353 } else { 3354 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) < fr.reg(iy).(uint)) } 3355 } 3356 case reflect.Uint8: 3357 if kx == kindConst && ky == kindConst { 3358 v := vx.(uint8) < vy.(uint8) 3359 return func(fr *frame) { fr.setReg(ir, v) } 3360 } else if kx == kindConst { 3361 x := vx.(uint8) 3362 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(uint8)) } 3363 } else if ky == kindConst { 3364 y := vy.(uint8) 3365 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) < y) } 3366 } else { 3367 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) < fr.reg(iy).(uint8)) } 3368 } 3369 case reflect.Uint16: 3370 if kx == kindConst && ky == kindConst { 3371 v := vx.(uint16) < vy.(uint16) 3372 return func(fr *frame) { fr.setReg(ir, v) } 3373 } else if kx == kindConst { 3374 x := vx.(uint16) 3375 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(uint16)) } 3376 } else if ky == kindConst { 3377 y := vy.(uint16) 3378 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) < y) } 3379 } else { 3380 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) < fr.reg(iy).(uint16)) } 3381 } 3382 case reflect.Uint32: 3383 if kx == kindConst && ky == kindConst { 3384 v := vx.(uint32) < vy.(uint32) 3385 return func(fr *frame) { fr.setReg(ir, v) } 3386 } else if kx == kindConst { 3387 x := vx.(uint32) 3388 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(uint32)) } 3389 } else if ky == kindConst { 3390 y := vy.(uint32) 3391 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) < y) } 3392 } else { 3393 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) < fr.reg(iy).(uint32)) } 3394 } 3395 case reflect.Uint64: 3396 if kx == kindConst && ky == kindConst { 3397 v := vx.(uint64) < vy.(uint64) 3398 return func(fr *frame) { fr.setReg(ir, v) } 3399 } else if kx == kindConst { 3400 x := vx.(uint64) 3401 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(uint64)) } 3402 } else if ky == kindConst { 3403 y := vy.(uint64) 3404 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) < y) } 3405 } else { 3406 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) < fr.reg(iy).(uint64)) } 3407 } 3408 case reflect.Uintptr: 3409 if kx == kindConst && ky == kindConst { 3410 v := vx.(uintptr) < vy.(uintptr) 3411 return func(fr *frame) { fr.setReg(ir, v) } 3412 } else if kx == kindConst { 3413 x := vx.(uintptr) 3414 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(uintptr)) } 3415 } else if ky == kindConst { 3416 y := vy.(uintptr) 3417 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) < y) } 3418 } else { 3419 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) < fr.reg(iy).(uintptr)) } 3420 } 3421 case reflect.Float32: 3422 if kx == kindConst && ky == kindConst { 3423 v := vx.(float32) < vy.(float32) 3424 return func(fr *frame) { fr.setReg(ir, v) } 3425 } else if kx == kindConst { 3426 x := vx.(float32) 3427 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(float32)) } 3428 } else if ky == kindConst { 3429 y := vy.(float32) 3430 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) < y) } 3431 } else { 3432 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) < fr.reg(iy).(float32)) } 3433 } 3434 case reflect.Float64: 3435 if kx == kindConst && ky == kindConst { 3436 v := vx.(float64) < vy.(float64) 3437 return func(fr *frame) { fr.setReg(ir, v) } 3438 } else if kx == kindConst { 3439 x := vx.(float64) 3440 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(float64)) } 3441 } else if ky == kindConst { 3442 y := vy.(float64) 3443 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) < y) } 3444 } else { 3445 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) < fr.reg(iy).(float64)) } 3446 } 3447 case reflect.String: 3448 if kx == kindConst && ky == kindConst { 3449 v := vx.(string) < vy.(string) 3450 return func(fr *frame) { fr.setReg(ir, v) } 3451 } else if kx == kindConst { 3452 x := vx.(string) 3453 return func(fr *frame) { fr.setReg(ir, x < fr.reg(iy).(string)) } 3454 } else if ky == kindConst { 3455 y := vy.(string) 3456 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) < y) } 3457 } else { 3458 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) < fr.reg(iy).(string)) } 3459 } 3460 } 3461 } else { 3462 switch typ.Kind() { 3463 case reflect.Int: 3464 if kx == kindConst && ky == kindConst { 3465 v := xtype.Int(vx) < xtype.Int(vy) 3466 return func(fr *frame) { fr.setReg(ir, v) } 3467 } else if kx == kindConst { 3468 x := xtype.Int(vx) 3469 return func(fr *frame) { fr.setReg(ir, x < fr.int(iy)) } 3470 } else if ky == kindConst { 3471 y := xtype.Int(vy) 3472 return func(fr *frame) { fr.setReg(ir, fr.int(ix) < y) } 3473 } else { 3474 return func(fr *frame) { fr.setReg(ir, fr.int(ix) < fr.int(iy)) } 3475 } 3476 case reflect.Int8: 3477 if kx == kindConst && ky == kindConst { 3478 v := xtype.Int8(vx) < xtype.Int8(vy) 3479 return func(fr *frame) { fr.setReg(ir, v) } 3480 } else if kx == kindConst { 3481 x := xtype.Int8(vx) 3482 return func(fr *frame) { fr.setReg(ir, x < fr.int8(iy)) } 3483 } else if ky == kindConst { 3484 y := xtype.Int8(vy) 3485 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) < y) } 3486 } else { 3487 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) < fr.int8(iy)) } 3488 } 3489 case reflect.Int16: 3490 if kx == kindConst && ky == kindConst { 3491 v := xtype.Int16(vx) < xtype.Int16(vy) 3492 return func(fr *frame) { fr.setReg(ir, v) } 3493 } else if kx == kindConst { 3494 x := xtype.Int16(vx) 3495 return func(fr *frame) { fr.setReg(ir, x < fr.int16(iy)) } 3496 } else if ky == kindConst { 3497 y := xtype.Int16(vy) 3498 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) < y) } 3499 } else { 3500 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) < fr.int16(iy)) } 3501 } 3502 case reflect.Int32: 3503 if kx == kindConst && ky == kindConst { 3504 v := xtype.Int32(vx) < xtype.Int32(vy) 3505 return func(fr *frame) { fr.setReg(ir, v) } 3506 } else if kx == kindConst { 3507 x := xtype.Int32(vx) 3508 return func(fr *frame) { fr.setReg(ir, x < fr.int32(iy)) } 3509 } else if ky == kindConst { 3510 y := xtype.Int32(vy) 3511 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) < y) } 3512 } else { 3513 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) < fr.int32(iy)) } 3514 } 3515 case reflect.Int64: 3516 if kx == kindConst && ky == kindConst { 3517 v := xtype.Int64(vx) < xtype.Int64(vy) 3518 return func(fr *frame) { fr.setReg(ir, v) } 3519 } else if kx == kindConst { 3520 x := xtype.Int64(vx) 3521 return func(fr *frame) { fr.setReg(ir, x < fr.int64(iy)) } 3522 } else if ky == kindConst { 3523 y := xtype.Int64(vy) 3524 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) < y) } 3525 } else { 3526 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) < fr.int64(iy)) } 3527 } 3528 case reflect.Uint: 3529 if kx == kindConst && ky == kindConst { 3530 v := xtype.Uint(vx) < xtype.Uint(vy) 3531 return func(fr *frame) { fr.setReg(ir, v) } 3532 } else if kx == kindConst { 3533 x := xtype.Uint(vx) 3534 return func(fr *frame) { fr.setReg(ir, x < fr.uint(iy)) } 3535 } else if ky == kindConst { 3536 y := xtype.Uint(vy) 3537 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) < y) } 3538 } else { 3539 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) < fr.uint(iy)) } 3540 } 3541 case reflect.Uint8: 3542 if kx == kindConst && ky == kindConst { 3543 v := xtype.Uint8(vx) < xtype.Uint8(vy) 3544 return func(fr *frame) { fr.setReg(ir, v) } 3545 } else if kx == kindConst { 3546 x := xtype.Uint8(vx) 3547 return func(fr *frame) { fr.setReg(ir, x < fr.uint8(iy)) } 3548 } else if ky == kindConst { 3549 y := xtype.Uint8(vy) 3550 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) < y) } 3551 } else { 3552 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) < fr.uint8(iy)) } 3553 } 3554 case reflect.Uint16: 3555 if kx == kindConst && ky == kindConst { 3556 v := xtype.Uint16(vx) < xtype.Uint16(vy) 3557 return func(fr *frame) { fr.setReg(ir, v) } 3558 } else if kx == kindConst { 3559 x := xtype.Uint16(vx) 3560 return func(fr *frame) { fr.setReg(ir, x < fr.uint16(iy)) } 3561 } else if ky == kindConst { 3562 y := xtype.Uint16(vy) 3563 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) < y) } 3564 } else { 3565 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) < fr.uint16(iy)) } 3566 } 3567 case reflect.Uint32: 3568 if kx == kindConst && ky == kindConst { 3569 v := xtype.Uint32(vx) < xtype.Uint32(vy) 3570 return func(fr *frame) { fr.setReg(ir, v) } 3571 } else if kx == kindConst { 3572 x := xtype.Uint32(vx) 3573 return func(fr *frame) { fr.setReg(ir, x < fr.uint32(iy)) } 3574 } else if ky == kindConst { 3575 y := xtype.Uint32(vy) 3576 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) < y) } 3577 } else { 3578 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) < fr.uint32(iy)) } 3579 } 3580 case reflect.Uint64: 3581 if kx == kindConst && ky == kindConst { 3582 v := xtype.Uint64(vx) < xtype.Uint64(vy) 3583 return func(fr *frame) { fr.setReg(ir, v) } 3584 } else if kx == kindConst { 3585 x := xtype.Uint64(vx) 3586 return func(fr *frame) { fr.setReg(ir, x < fr.uint64(iy)) } 3587 } else if ky == kindConst { 3588 y := xtype.Uint64(vy) 3589 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) < y) } 3590 } else { 3591 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) < fr.uint64(iy)) } 3592 } 3593 case reflect.Uintptr: 3594 if kx == kindConst && ky == kindConst { 3595 v := xtype.Uintptr(vx) < xtype.Uintptr(vy) 3596 return func(fr *frame) { fr.setReg(ir, v) } 3597 } else if kx == kindConst { 3598 x := xtype.Uintptr(vx) 3599 return func(fr *frame) { fr.setReg(ir, x < fr.uintptr(iy)) } 3600 } else if ky == kindConst { 3601 y := xtype.Uintptr(vy) 3602 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) < y) } 3603 } else { 3604 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) < fr.uintptr(iy)) } 3605 } 3606 case reflect.Float32: 3607 if kx == kindConst && ky == kindConst { 3608 v := xtype.Float32(vx) < xtype.Float32(vy) 3609 return func(fr *frame) { fr.setReg(ir, v) } 3610 } else if kx == kindConst { 3611 x := xtype.Float32(vx) 3612 return func(fr *frame) { fr.setReg(ir, x < fr.float32(iy)) } 3613 } else if ky == kindConst { 3614 y := xtype.Float32(vy) 3615 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) < y) } 3616 } else { 3617 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) < fr.float32(iy)) } 3618 } 3619 case reflect.Float64: 3620 if kx == kindConst && ky == kindConst { 3621 v := xtype.Float64(vx) < xtype.Float64(vy) 3622 return func(fr *frame) { fr.setReg(ir, v) } 3623 } else if kx == kindConst { 3624 x := xtype.Float64(vx) 3625 return func(fr *frame) { fr.setReg(ir, x < fr.float64(iy)) } 3626 } else if ky == kindConst { 3627 y := xtype.Float64(vy) 3628 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) < y) } 3629 } else { 3630 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) < fr.float64(iy)) } 3631 } 3632 case reflect.String: 3633 if kx == kindConst && ky == kindConst { 3634 v := xtype.String(vx) < xtype.String(vy) 3635 return func(fr *frame) { fr.setReg(ir, v) } 3636 } else if kx == kindConst { 3637 x := xtype.String(vx) 3638 return func(fr *frame) { fr.setReg(ir, x < fr.string(iy)) } 3639 } else if ky == kindConst { 3640 y := xtype.String(vy) 3641 return func(fr *frame) { fr.setReg(ir, fr.string(ix) < y) } 3642 } else { 3643 return func(fr *frame) { fr.setReg(ir, fr.string(ix) < fr.string(iy)) } 3644 } 3645 } 3646 } 3647 panic("unreachable") 3648 } 3649 func makeBinOpLEQ(pfn *function, instr *ssa.BinOp) func(fr *frame) { 3650 ir := pfn.regIndex(instr) 3651 ix, kx, vx := pfn.regIndex3(instr.X) 3652 iy, ky, vy := pfn.regIndex3(instr.Y) 3653 typ := pfn.Interp.preToType(instr.X.Type()) 3654 if typ.PkgPath() == "" { 3655 switch typ.Kind() { 3656 case reflect.Int: 3657 if kx == kindConst && ky == kindConst { 3658 v := vx.(int) <= vy.(int) 3659 return func(fr *frame) { fr.setReg(ir, v) } 3660 } else if kx == kindConst { 3661 x := vx.(int) 3662 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(int)) } 3663 } else if ky == kindConst { 3664 y := vy.(int) 3665 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) <= y) } 3666 } else { 3667 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) <= fr.reg(iy).(int)) } 3668 } 3669 case reflect.Int8: 3670 if kx == kindConst && ky == kindConst { 3671 v := vx.(int8) <= vy.(int8) 3672 return func(fr *frame) { fr.setReg(ir, v) } 3673 } else if kx == kindConst { 3674 x := vx.(int8) 3675 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(int8)) } 3676 } else if ky == kindConst { 3677 y := vy.(int8) 3678 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) <= y) } 3679 } else { 3680 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) <= fr.reg(iy).(int8)) } 3681 } 3682 case reflect.Int16: 3683 if kx == kindConst && ky == kindConst { 3684 v := vx.(int16) <= vy.(int16) 3685 return func(fr *frame) { fr.setReg(ir, v) } 3686 } else if kx == kindConst { 3687 x := vx.(int16) 3688 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(int16)) } 3689 } else if ky == kindConst { 3690 y := vy.(int16) 3691 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) <= y) } 3692 } else { 3693 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) <= fr.reg(iy).(int16)) } 3694 } 3695 case reflect.Int32: 3696 if kx == kindConst && ky == kindConst { 3697 v := vx.(int32) <= vy.(int32) 3698 return func(fr *frame) { fr.setReg(ir, v) } 3699 } else if kx == kindConst { 3700 x := vx.(int32) 3701 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(int32)) } 3702 } else if ky == kindConst { 3703 y := vy.(int32) 3704 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) <= y) } 3705 } else { 3706 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) <= fr.reg(iy).(int32)) } 3707 } 3708 case reflect.Int64: 3709 if kx == kindConst && ky == kindConst { 3710 v := vx.(int64) <= vy.(int64) 3711 return func(fr *frame) { fr.setReg(ir, v) } 3712 } else if kx == kindConst { 3713 x := vx.(int64) 3714 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(int64)) } 3715 } else if ky == kindConst { 3716 y := vy.(int64) 3717 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) <= y) } 3718 } else { 3719 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) <= fr.reg(iy).(int64)) } 3720 } 3721 case reflect.Uint: 3722 if kx == kindConst && ky == kindConst { 3723 v := vx.(uint) <= vy.(uint) 3724 return func(fr *frame) { fr.setReg(ir, v) } 3725 } else if kx == kindConst { 3726 x := vx.(uint) 3727 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(uint)) } 3728 } else if ky == kindConst { 3729 y := vy.(uint) 3730 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) <= y) } 3731 } else { 3732 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) <= fr.reg(iy).(uint)) } 3733 } 3734 case reflect.Uint8: 3735 if kx == kindConst && ky == kindConst { 3736 v := vx.(uint8) <= vy.(uint8) 3737 return func(fr *frame) { fr.setReg(ir, v) } 3738 } else if kx == kindConst { 3739 x := vx.(uint8) 3740 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(uint8)) } 3741 } else if ky == kindConst { 3742 y := vy.(uint8) 3743 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) <= y) } 3744 } else { 3745 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) <= fr.reg(iy).(uint8)) } 3746 } 3747 case reflect.Uint16: 3748 if kx == kindConst && ky == kindConst { 3749 v := vx.(uint16) <= vy.(uint16) 3750 return func(fr *frame) { fr.setReg(ir, v) } 3751 } else if kx == kindConst { 3752 x := vx.(uint16) 3753 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(uint16)) } 3754 } else if ky == kindConst { 3755 y := vy.(uint16) 3756 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) <= y) } 3757 } else { 3758 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) <= fr.reg(iy).(uint16)) } 3759 } 3760 case reflect.Uint32: 3761 if kx == kindConst && ky == kindConst { 3762 v := vx.(uint32) <= vy.(uint32) 3763 return func(fr *frame) { fr.setReg(ir, v) } 3764 } else if kx == kindConst { 3765 x := vx.(uint32) 3766 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(uint32)) } 3767 } else if ky == kindConst { 3768 y := vy.(uint32) 3769 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) <= y) } 3770 } else { 3771 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) <= fr.reg(iy).(uint32)) } 3772 } 3773 case reflect.Uint64: 3774 if kx == kindConst && ky == kindConst { 3775 v := vx.(uint64) <= vy.(uint64) 3776 return func(fr *frame) { fr.setReg(ir, v) } 3777 } else if kx == kindConst { 3778 x := vx.(uint64) 3779 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(uint64)) } 3780 } else if ky == kindConst { 3781 y := vy.(uint64) 3782 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) <= y) } 3783 } else { 3784 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) <= fr.reg(iy).(uint64)) } 3785 } 3786 case reflect.Uintptr: 3787 if kx == kindConst && ky == kindConst { 3788 v := vx.(uintptr) <= vy.(uintptr) 3789 return func(fr *frame) { fr.setReg(ir, v) } 3790 } else if kx == kindConst { 3791 x := vx.(uintptr) 3792 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(uintptr)) } 3793 } else if ky == kindConst { 3794 y := vy.(uintptr) 3795 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) <= y) } 3796 } else { 3797 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) <= fr.reg(iy).(uintptr)) } 3798 } 3799 case reflect.Float32: 3800 if kx == kindConst && ky == kindConst { 3801 v := vx.(float32) <= vy.(float32) 3802 return func(fr *frame) { fr.setReg(ir, v) } 3803 } else if kx == kindConst { 3804 x := vx.(float32) 3805 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(float32)) } 3806 } else if ky == kindConst { 3807 y := vy.(float32) 3808 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) <= y) } 3809 } else { 3810 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) <= fr.reg(iy).(float32)) } 3811 } 3812 case reflect.Float64: 3813 if kx == kindConst && ky == kindConst { 3814 v := vx.(float64) <= vy.(float64) 3815 return func(fr *frame) { fr.setReg(ir, v) } 3816 } else if kx == kindConst { 3817 x := vx.(float64) 3818 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(float64)) } 3819 } else if ky == kindConst { 3820 y := vy.(float64) 3821 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) <= y) } 3822 } else { 3823 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) <= fr.reg(iy).(float64)) } 3824 } 3825 case reflect.String: 3826 if kx == kindConst && ky == kindConst { 3827 v := vx.(string) <= vy.(string) 3828 return func(fr *frame) { fr.setReg(ir, v) } 3829 } else if kx == kindConst { 3830 x := vx.(string) 3831 return func(fr *frame) { fr.setReg(ir, x <= fr.reg(iy).(string)) } 3832 } else if ky == kindConst { 3833 y := vy.(string) 3834 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) <= y) } 3835 } else { 3836 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) <= fr.reg(iy).(string)) } 3837 } 3838 } 3839 } else { 3840 switch typ.Kind() { 3841 case reflect.Int: 3842 if kx == kindConst && ky == kindConst { 3843 v := xtype.Int(vx) <= xtype.Int(vy) 3844 return func(fr *frame) { fr.setReg(ir, v) } 3845 } else if kx == kindConst { 3846 x := xtype.Int(vx) 3847 return func(fr *frame) { fr.setReg(ir, x <= fr.int(iy)) } 3848 } else if ky == kindConst { 3849 y := xtype.Int(vy) 3850 return func(fr *frame) { fr.setReg(ir, fr.int(ix) <= y) } 3851 } else { 3852 return func(fr *frame) { fr.setReg(ir, fr.int(ix) <= fr.int(iy)) } 3853 } 3854 case reflect.Int8: 3855 if kx == kindConst && ky == kindConst { 3856 v := xtype.Int8(vx) <= xtype.Int8(vy) 3857 return func(fr *frame) { fr.setReg(ir, v) } 3858 } else if kx == kindConst { 3859 x := xtype.Int8(vx) 3860 return func(fr *frame) { fr.setReg(ir, x <= fr.int8(iy)) } 3861 } else if ky == kindConst { 3862 y := xtype.Int8(vy) 3863 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) <= y) } 3864 } else { 3865 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) <= fr.int8(iy)) } 3866 } 3867 case reflect.Int16: 3868 if kx == kindConst && ky == kindConst { 3869 v := xtype.Int16(vx) <= xtype.Int16(vy) 3870 return func(fr *frame) { fr.setReg(ir, v) } 3871 } else if kx == kindConst { 3872 x := xtype.Int16(vx) 3873 return func(fr *frame) { fr.setReg(ir, x <= fr.int16(iy)) } 3874 } else if ky == kindConst { 3875 y := xtype.Int16(vy) 3876 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) <= y) } 3877 } else { 3878 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) <= fr.int16(iy)) } 3879 } 3880 case reflect.Int32: 3881 if kx == kindConst && ky == kindConst { 3882 v := xtype.Int32(vx) <= xtype.Int32(vy) 3883 return func(fr *frame) { fr.setReg(ir, v) } 3884 } else if kx == kindConst { 3885 x := xtype.Int32(vx) 3886 return func(fr *frame) { fr.setReg(ir, x <= fr.int32(iy)) } 3887 } else if ky == kindConst { 3888 y := xtype.Int32(vy) 3889 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) <= y) } 3890 } else { 3891 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) <= fr.int32(iy)) } 3892 } 3893 case reflect.Int64: 3894 if kx == kindConst && ky == kindConst { 3895 v := xtype.Int64(vx) <= xtype.Int64(vy) 3896 return func(fr *frame) { fr.setReg(ir, v) } 3897 } else if kx == kindConst { 3898 x := xtype.Int64(vx) 3899 return func(fr *frame) { fr.setReg(ir, x <= fr.int64(iy)) } 3900 } else if ky == kindConst { 3901 y := xtype.Int64(vy) 3902 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) <= y) } 3903 } else { 3904 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) <= fr.int64(iy)) } 3905 } 3906 case reflect.Uint: 3907 if kx == kindConst && ky == kindConst { 3908 v := xtype.Uint(vx) <= xtype.Uint(vy) 3909 return func(fr *frame) { fr.setReg(ir, v) } 3910 } else if kx == kindConst { 3911 x := xtype.Uint(vx) 3912 return func(fr *frame) { fr.setReg(ir, x <= fr.uint(iy)) } 3913 } else if ky == kindConst { 3914 y := xtype.Uint(vy) 3915 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) <= y) } 3916 } else { 3917 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) <= fr.uint(iy)) } 3918 } 3919 case reflect.Uint8: 3920 if kx == kindConst && ky == kindConst { 3921 v := xtype.Uint8(vx) <= xtype.Uint8(vy) 3922 return func(fr *frame) { fr.setReg(ir, v) } 3923 } else if kx == kindConst { 3924 x := xtype.Uint8(vx) 3925 return func(fr *frame) { fr.setReg(ir, x <= fr.uint8(iy)) } 3926 } else if ky == kindConst { 3927 y := xtype.Uint8(vy) 3928 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) <= y) } 3929 } else { 3930 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) <= fr.uint8(iy)) } 3931 } 3932 case reflect.Uint16: 3933 if kx == kindConst && ky == kindConst { 3934 v := xtype.Uint16(vx) <= xtype.Uint16(vy) 3935 return func(fr *frame) { fr.setReg(ir, v) } 3936 } else if kx == kindConst { 3937 x := xtype.Uint16(vx) 3938 return func(fr *frame) { fr.setReg(ir, x <= fr.uint16(iy)) } 3939 } else if ky == kindConst { 3940 y := xtype.Uint16(vy) 3941 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) <= y) } 3942 } else { 3943 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) <= fr.uint16(iy)) } 3944 } 3945 case reflect.Uint32: 3946 if kx == kindConst && ky == kindConst { 3947 v := xtype.Uint32(vx) <= xtype.Uint32(vy) 3948 return func(fr *frame) { fr.setReg(ir, v) } 3949 } else if kx == kindConst { 3950 x := xtype.Uint32(vx) 3951 return func(fr *frame) { fr.setReg(ir, x <= fr.uint32(iy)) } 3952 } else if ky == kindConst { 3953 y := xtype.Uint32(vy) 3954 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) <= y) } 3955 } else { 3956 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) <= fr.uint32(iy)) } 3957 } 3958 case reflect.Uint64: 3959 if kx == kindConst && ky == kindConst { 3960 v := xtype.Uint64(vx) <= xtype.Uint64(vy) 3961 return func(fr *frame) { fr.setReg(ir, v) } 3962 } else if kx == kindConst { 3963 x := xtype.Uint64(vx) 3964 return func(fr *frame) { fr.setReg(ir, x <= fr.uint64(iy)) } 3965 } else if ky == kindConst { 3966 y := xtype.Uint64(vy) 3967 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) <= y) } 3968 } else { 3969 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) <= fr.uint64(iy)) } 3970 } 3971 case reflect.Uintptr: 3972 if kx == kindConst && ky == kindConst { 3973 v := xtype.Uintptr(vx) <= xtype.Uintptr(vy) 3974 return func(fr *frame) { fr.setReg(ir, v) } 3975 } else if kx == kindConst { 3976 x := xtype.Uintptr(vx) 3977 return func(fr *frame) { fr.setReg(ir, x <= fr.uintptr(iy)) } 3978 } else if ky == kindConst { 3979 y := xtype.Uintptr(vy) 3980 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) <= y) } 3981 } else { 3982 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) <= fr.uintptr(iy)) } 3983 } 3984 case reflect.Float32: 3985 if kx == kindConst && ky == kindConst { 3986 v := xtype.Float32(vx) <= xtype.Float32(vy) 3987 return func(fr *frame) { fr.setReg(ir, v) } 3988 } else if kx == kindConst { 3989 x := xtype.Float32(vx) 3990 return func(fr *frame) { fr.setReg(ir, x <= fr.float32(iy)) } 3991 } else if ky == kindConst { 3992 y := xtype.Float32(vy) 3993 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) <= y) } 3994 } else { 3995 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) <= fr.float32(iy)) } 3996 } 3997 case reflect.Float64: 3998 if kx == kindConst && ky == kindConst { 3999 v := xtype.Float64(vx) <= xtype.Float64(vy) 4000 return func(fr *frame) { fr.setReg(ir, v) } 4001 } else if kx == kindConst { 4002 x := xtype.Float64(vx) 4003 return func(fr *frame) { fr.setReg(ir, x <= fr.float64(iy)) } 4004 } else if ky == kindConst { 4005 y := xtype.Float64(vy) 4006 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) <= y) } 4007 } else { 4008 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) <= fr.float64(iy)) } 4009 } 4010 case reflect.String: 4011 if kx == kindConst && ky == kindConst { 4012 v := xtype.String(vx) <= xtype.String(vy) 4013 return func(fr *frame) { fr.setReg(ir, v) } 4014 } else if kx == kindConst { 4015 x := xtype.String(vx) 4016 return func(fr *frame) { fr.setReg(ir, x <= fr.string(iy)) } 4017 } else if ky == kindConst { 4018 y := xtype.String(vy) 4019 return func(fr *frame) { fr.setReg(ir, fr.string(ix) <= y) } 4020 } else { 4021 return func(fr *frame) { fr.setReg(ir, fr.string(ix) <= fr.string(iy)) } 4022 } 4023 } 4024 } 4025 panic("unreachable") 4026 } 4027 func makeBinOpGTR(pfn *function, instr *ssa.BinOp) func(fr *frame) { 4028 ir := pfn.regIndex(instr) 4029 ix, kx, vx := pfn.regIndex3(instr.X) 4030 iy, ky, vy := pfn.regIndex3(instr.Y) 4031 typ := pfn.Interp.preToType(instr.X.Type()) 4032 if typ.PkgPath() == "" { 4033 switch typ.Kind() { 4034 case reflect.Int: 4035 if kx == kindConst && ky == kindConst { 4036 v := vx.(int) > vy.(int) 4037 return func(fr *frame) { fr.setReg(ir, v) } 4038 } else if kx == kindConst { 4039 x := vx.(int) 4040 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(int)) } 4041 } else if ky == kindConst { 4042 y := vy.(int) 4043 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) > y) } 4044 } else { 4045 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) > fr.reg(iy).(int)) } 4046 } 4047 case reflect.Int8: 4048 if kx == kindConst && ky == kindConst { 4049 v := vx.(int8) > vy.(int8) 4050 return func(fr *frame) { fr.setReg(ir, v) } 4051 } else if kx == kindConst { 4052 x := vx.(int8) 4053 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(int8)) } 4054 } else if ky == kindConst { 4055 y := vy.(int8) 4056 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) > y) } 4057 } else { 4058 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) > fr.reg(iy).(int8)) } 4059 } 4060 case reflect.Int16: 4061 if kx == kindConst && ky == kindConst { 4062 v := vx.(int16) > vy.(int16) 4063 return func(fr *frame) { fr.setReg(ir, v) } 4064 } else if kx == kindConst { 4065 x := vx.(int16) 4066 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(int16)) } 4067 } else if ky == kindConst { 4068 y := vy.(int16) 4069 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) > y) } 4070 } else { 4071 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) > fr.reg(iy).(int16)) } 4072 } 4073 case reflect.Int32: 4074 if kx == kindConst && ky == kindConst { 4075 v := vx.(int32) > vy.(int32) 4076 return func(fr *frame) { fr.setReg(ir, v) } 4077 } else if kx == kindConst { 4078 x := vx.(int32) 4079 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(int32)) } 4080 } else if ky == kindConst { 4081 y := vy.(int32) 4082 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) > y) } 4083 } else { 4084 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) > fr.reg(iy).(int32)) } 4085 } 4086 case reflect.Int64: 4087 if kx == kindConst && ky == kindConst { 4088 v := vx.(int64) > vy.(int64) 4089 return func(fr *frame) { fr.setReg(ir, v) } 4090 } else if kx == kindConst { 4091 x := vx.(int64) 4092 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(int64)) } 4093 } else if ky == kindConst { 4094 y := vy.(int64) 4095 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) > y) } 4096 } else { 4097 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) > fr.reg(iy).(int64)) } 4098 } 4099 case reflect.Uint: 4100 if kx == kindConst && ky == kindConst { 4101 v := vx.(uint) > vy.(uint) 4102 return func(fr *frame) { fr.setReg(ir, v) } 4103 } else if kx == kindConst { 4104 x := vx.(uint) 4105 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(uint)) } 4106 } else if ky == kindConst { 4107 y := vy.(uint) 4108 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) > y) } 4109 } else { 4110 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) > fr.reg(iy).(uint)) } 4111 } 4112 case reflect.Uint8: 4113 if kx == kindConst && ky == kindConst { 4114 v := vx.(uint8) > vy.(uint8) 4115 return func(fr *frame) { fr.setReg(ir, v) } 4116 } else if kx == kindConst { 4117 x := vx.(uint8) 4118 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(uint8)) } 4119 } else if ky == kindConst { 4120 y := vy.(uint8) 4121 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) > y) } 4122 } else { 4123 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) > fr.reg(iy).(uint8)) } 4124 } 4125 case reflect.Uint16: 4126 if kx == kindConst && ky == kindConst { 4127 v := vx.(uint16) > vy.(uint16) 4128 return func(fr *frame) { fr.setReg(ir, v) } 4129 } else if kx == kindConst { 4130 x := vx.(uint16) 4131 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(uint16)) } 4132 } else if ky == kindConst { 4133 y := vy.(uint16) 4134 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) > y) } 4135 } else { 4136 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) > fr.reg(iy).(uint16)) } 4137 } 4138 case reflect.Uint32: 4139 if kx == kindConst && ky == kindConst { 4140 v := vx.(uint32) > vy.(uint32) 4141 return func(fr *frame) { fr.setReg(ir, v) } 4142 } else if kx == kindConst { 4143 x := vx.(uint32) 4144 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(uint32)) } 4145 } else if ky == kindConst { 4146 y := vy.(uint32) 4147 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) > y) } 4148 } else { 4149 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) > fr.reg(iy).(uint32)) } 4150 } 4151 case reflect.Uint64: 4152 if kx == kindConst && ky == kindConst { 4153 v := vx.(uint64) > vy.(uint64) 4154 return func(fr *frame) { fr.setReg(ir, v) } 4155 } else if kx == kindConst { 4156 x := vx.(uint64) 4157 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(uint64)) } 4158 } else if ky == kindConst { 4159 y := vy.(uint64) 4160 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) > y) } 4161 } else { 4162 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) > fr.reg(iy).(uint64)) } 4163 } 4164 case reflect.Uintptr: 4165 if kx == kindConst && ky == kindConst { 4166 v := vx.(uintptr) > vy.(uintptr) 4167 return func(fr *frame) { fr.setReg(ir, v) } 4168 } else if kx == kindConst { 4169 x := vx.(uintptr) 4170 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(uintptr)) } 4171 } else if ky == kindConst { 4172 y := vy.(uintptr) 4173 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) > y) } 4174 } else { 4175 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) > fr.reg(iy).(uintptr)) } 4176 } 4177 case reflect.Float32: 4178 if kx == kindConst && ky == kindConst { 4179 v := vx.(float32) > vy.(float32) 4180 return func(fr *frame) { fr.setReg(ir, v) } 4181 } else if kx == kindConst { 4182 x := vx.(float32) 4183 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(float32)) } 4184 } else if ky == kindConst { 4185 y := vy.(float32) 4186 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) > y) } 4187 } else { 4188 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) > fr.reg(iy).(float32)) } 4189 } 4190 case reflect.Float64: 4191 if kx == kindConst && ky == kindConst { 4192 v := vx.(float64) > vy.(float64) 4193 return func(fr *frame) { fr.setReg(ir, v) } 4194 } else if kx == kindConst { 4195 x := vx.(float64) 4196 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(float64)) } 4197 } else if ky == kindConst { 4198 y := vy.(float64) 4199 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) > y) } 4200 } else { 4201 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) > fr.reg(iy).(float64)) } 4202 } 4203 case reflect.String: 4204 if kx == kindConst && ky == kindConst { 4205 v := vx.(string) > vy.(string) 4206 return func(fr *frame) { fr.setReg(ir, v) } 4207 } else if kx == kindConst { 4208 x := vx.(string) 4209 return func(fr *frame) { fr.setReg(ir, x > fr.reg(iy).(string)) } 4210 } else if ky == kindConst { 4211 y := vy.(string) 4212 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) > y) } 4213 } else { 4214 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) > fr.reg(iy).(string)) } 4215 } 4216 } 4217 } else { 4218 switch typ.Kind() { 4219 case reflect.Int: 4220 if kx == kindConst && ky == kindConst { 4221 v := xtype.Int(vx) > xtype.Int(vy) 4222 return func(fr *frame) { fr.setReg(ir, v) } 4223 } else if kx == kindConst { 4224 x := xtype.Int(vx) 4225 return func(fr *frame) { fr.setReg(ir, x > fr.int(iy)) } 4226 } else if ky == kindConst { 4227 y := xtype.Int(vy) 4228 return func(fr *frame) { fr.setReg(ir, fr.int(ix) > y) } 4229 } else { 4230 return func(fr *frame) { fr.setReg(ir, fr.int(ix) > fr.int(iy)) } 4231 } 4232 case reflect.Int8: 4233 if kx == kindConst && ky == kindConst { 4234 v := xtype.Int8(vx) > xtype.Int8(vy) 4235 return func(fr *frame) { fr.setReg(ir, v) } 4236 } else if kx == kindConst { 4237 x := xtype.Int8(vx) 4238 return func(fr *frame) { fr.setReg(ir, x > fr.int8(iy)) } 4239 } else if ky == kindConst { 4240 y := xtype.Int8(vy) 4241 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) > y) } 4242 } else { 4243 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) > fr.int8(iy)) } 4244 } 4245 case reflect.Int16: 4246 if kx == kindConst && ky == kindConst { 4247 v := xtype.Int16(vx) > xtype.Int16(vy) 4248 return func(fr *frame) { fr.setReg(ir, v) } 4249 } else if kx == kindConst { 4250 x := xtype.Int16(vx) 4251 return func(fr *frame) { fr.setReg(ir, x > fr.int16(iy)) } 4252 } else if ky == kindConst { 4253 y := xtype.Int16(vy) 4254 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) > y) } 4255 } else { 4256 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) > fr.int16(iy)) } 4257 } 4258 case reflect.Int32: 4259 if kx == kindConst && ky == kindConst { 4260 v := xtype.Int32(vx) > xtype.Int32(vy) 4261 return func(fr *frame) { fr.setReg(ir, v) } 4262 } else if kx == kindConst { 4263 x := xtype.Int32(vx) 4264 return func(fr *frame) { fr.setReg(ir, x > fr.int32(iy)) } 4265 } else if ky == kindConst { 4266 y := xtype.Int32(vy) 4267 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) > y) } 4268 } else { 4269 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) > fr.int32(iy)) } 4270 } 4271 case reflect.Int64: 4272 if kx == kindConst && ky == kindConst { 4273 v := xtype.Int64(vx) > xtype.Int64(vy) 4274 return func(fr *frame) { fr.setReg(ir, v) } 4275 } else if kx == kindConst { 4276 x := xtype.Int64(vx) 4277 return func(fr *frame) { fr.setReg(ir, x > fr.int64(iy)) } 4278 } else if ky == kindConst { 4279 y := xtype.Int64(vy) 4280 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) > y) } 4281 } else { 4282 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) > fr.int64(iy)) } 4283 } 4284 case reflect.Uint: 4285 if kx == kindConst && ky == kindConst { 4286 v := xtype.Uint(vx) > xtype.Uint(vy) 4287 return func(fr *frame) { fr.setReg(ir, v) } 4288 } else if kx == kindConst { 4289 x := xtype.Uint(vx) 4290 return func(fr *frame) { fr.setReg(ir, x > fr.uint(iy)) } 4291 } else if ky == kindConst { 4292 y := xtype.Uint(vy) 4293 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) > y) } 4294 } else { 4295 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) > fr.uint(iy)) } 4296 } 4297 case reflect.Uint8: 4298 if kx == kindConst && ky == kindConst { 4299 v := xtype.Uint8(vx) > xtype.Uint8(vy) 4300 return func(fr *frame) { fr.setReg(ir, v) } 4301 } else if kx == kindConst { 4302 x := xtype.Uint8(vx) 4303 return func(fr *frame) { fr.setReg(ir, x > fr.uint8(iy)) } 4304 } else if ky == kindConst { 4305 y := xtype.Uint8(vy) 4306 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) > y) } 4307 } else { 4308 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) > fr.uint8(iy)) } 4309 } 4310 case reflect.Uint16: 4311 if kx == kindConst && ky == kindConst { 4312 v := xtype.Uint16(vx) > xtype.Uint16(vy) 4313 return func(fr *frame) { fr.setReg(ir, v) } 4314 } else if kx == kindConst { 4315 x := xtype.Uint16(vx) 4316 return func(fr *frame) { fr.setReg(ir, x > fr.uint16(iy)) } 4317 } else if ky == kindConst { 4318 y := xtype.Uint16(vy) 4319 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) > y) } 4320 } else { 4321 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) > fr.uint16(iy)) } 4322 } 4323 case reflect.Uint32: 4324 if kx == kindConst && ky == kindConst { 4325 v := xtype.Uint32(vx) > xtype.Uint32(vy) 4326 return func(fr *frame) { fr.setReg(ir, v) } 4327 } else if kx == kindConst { 4328 x := xtype.Uint32(vx) 4329 return func(fr *frame) { fr.setReg(ir, x > fr.uint32(iy)) } 4330 } else if ky == kindConst { 4331 y := xtype.Uint32(vy) 4332 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) > y) } 4333 } else { 4334 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) > fr.uint32(iy)) } 4335 } 4336 case reflect.Uint64: 4337 if kx == kindConst && ky == kindConst { 4338 v := xtype.Uint64(vx) > xtype.Uint64(vy) 4339 return func(fr *frame) { fr.setReg(ir, v) } 4340 } else if kx == kindConst { 4341 x := xtype.Uint64(vx) 4342 return func(fr *frame) { fr.setReg(ir, x > fr.uint64(iy)) } 4343 } else if ky == kindConst { 4344 y := xtype.Uint64(vy) 4345 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) > y) } 4346 } else { 4347 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) > fr.uint64(iy)) } 4348 } 4349 case reflect.Uintptr: 4350 if kx == kindConst && ky == kindConst { 4351 v := xtype.Uintptr(vx) > xtype.Uintptr(vy) 4352 return func(fr *frame) { fr.setReg(ir, v) } 4353 } else if kx == kindConst { 4354 x := xtype.Uintptr(vx) 4355 return func(fr *frame) { fr.setReg(ir, x > fr.uintptr(iy)) } 4356 } else if ky == kindConst { 4357 y := xtype.Uintptr(vy) 4358 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) > y) } 4359 } else { 4360 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) > fr.uintptr(iy)) } 4361 } 4362 case reflect.Float32: 4363 if kx == kindConst && ky == kindConst { 4364 v := xtype.Float32(vx) > xtype.Float32(vy) 4365 return func(fr *frame) { fr.setReg(ir, v) } 4366 } else if kx == kindConst { 4367 x := xtype.Float32(vx) 4368 return func(fr *frame) { fr.setReg(ir, x > fr.float32(iy)) } 4369 } else if ky == kindConst { 4370 y := xtype.Float32(vy) 4371 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) > y) } 4372 } else { 4373 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) > fr.float32(iy)) } 4374 } 4375 case reflect.Float64: 4376 if kx == kindConst && ky == kindConst { 4377 v := xtype.Float64(vx) > xtype.Float64(vy) 4378 return func(fr *frame) { fr.setReg(ir, v) } 4379 } else if kx == kindConst { 4380 x := xtype.Float64(vx) 4381 return func(fr *frame) { fr.setReg(ir, x > fr.float64(iy)) } 4382 } else if ky == kindConst { 4383 y := xtype.Float64(vy) 4384 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) > y) } 4385 } else { 4386 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) > fr.float64(iy)) } 4387 } 4388 case reflect.String: 4389 if kx == kindConst && ky == kindConst { 4390 v := xtype.String(vx) > xtype.String(vy) 4391 return func(fr *frame) { fr.setReg(ir, v) } 4392 } else if kx == kindConst { 4393 x := xtype.String(vx) 4394 return func(fr *frame) { fr.setReg(ir, x > fr.string(iy)) } 4395 } else if ky == kindConst { 4396 y := xtype.String(vy) 4397 return func(fr *frame) { fr.setReg(ir, fr.string(ix) > y) } 4398 } else { 4399 return func(fr *frame) { fr.setReg(ir, fr.string(ix) > fr.string(iy)) } 4400 } 4401 } 4402 } 4403 panic("unreachable") 4404 } 4405 func makeBinOpGEQ(pfn *function, instr *ssa.BinOp) func(fr *frame) { 4406 ir := pfn.regIndex(instr) 4407 ix, kx, vx := pfn.regIndex3(instr.X) 4408 iy, ky, vy := pfn.regIndex3(instr.Y) 4409 typ := pfn.Interp.preToType(instr.X.Type()) 4410 if typ.PkgPath() == "" { 4411 switch typ.Kind() { 4412 case reflect.Int: 4413 if kx == kindConst && ky == kindConst { 4414 v := vx.(int) >= vy.(int) 4415 return func(fr *frame) { fr.setReg(ir, v) } 4416 } else if kx == kindConst { 4417 x := vx.(int) 4418 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(int)) } 4419 } else if ky == kindConst { 4420 y := vy.(int) 4421 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) >= y) } 4422 } else { 4423 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int) >= fr.reg(iy).(int)) } 4424 } 4425 case reflect.Int8: 4426 if kx == kindConst && ky == kindConst { 4427 v := vx.(int8) >= vy.(int8) 4428 return func(fr *frame) { fr.setReg(ir, v) } 4429 } else if kx == kindConst { 4430 x := vx.(int8) 4431 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(int8)) } 4432 } else if ky == kindConst { 4433 y := vy.(int8) 4434 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) >= y) } 4435 } else { 4436 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int8) >= fr.reg(iy).(int8)) } 4437 } 4438 case reflect.Int16: 4439 if kx == kindConst && ky == kindConst { 4440 v := vx.(int16) >= vy.(int16) 4441 return func(fr *frame) { fr.setReg(ir, v) } 4442 } else if kx == kindConst { 4443 x := vx.(int16) 4444 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(int16)) } 4445 } else if ky == kindConst { 4446 y := vy.(int16) 4447 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) >= y) } 4448 } else { 4449 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int16) >= fr.reg(iy).(int16)) } 4450 } 4451 case reflect.Int32: 4452 if kx == kindConst && ky == kindConst { 4453 v := vx.(int32) >= vy.(int32) 4454 return func(fr *frame) { fr.setReg(ir, v) } 4455 } else if kx == kindConst { 4456 x := vx.(int32) 4457 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(int32)) } 4458 } else if ky == kindConst { 4459 y := vy.(int32) 4460 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) >= y) } 4461 } else { 4462 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int32) >= fr.reg(iy).(int32)) } 4463 } 4464 case reflect.Int64: 4465 if kx == kindConst && ky == kindConst { 4466 v := vx.(int64) >= vy.(int64) 4467 return func(fr *frame) { fr.setReg(ir, v) } 4468 } else if kx == kindConst { 4469 x := vx.(int64) 4470 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(int64)) } 4471 } else if ky == kindConst { 4472 y := vy.(int64) 4473 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) >= y) } 4474 } else { 4475 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(int64) >= fr.reg(iy).(int64)) } 4476 } 4477 case reflect.Uint: 4478 if kx == kindConst && ky == kindConst { 4479 v := vx.(uint) >= vy.(uint) 4480 return func(fr *frame) { fr.setReg(ir, v) } 4481 } else if kx == kindConst { 4482 x := vx.(uint) 4483 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(uint)) } 4484 } else if ky == kindConst { 4485 y := vy.(uint) 4486 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) >= y) } 4487 } else { 4488 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint) >= fr.reg(iy).(uint)) } 4489 } 4490 case reflect.Uint8: 4491 if kx == kindConst && ky == kindConst { 4492 v := vx.(uint8) >= vy.(uint8) 4493 return func(fr *frame) { fr.setReg(ir, v) } 4494 } else if kx == kindConst { 4495 x := vx.(uint8) 4496 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(uint8)) } 4497 } else if ky == kindConst { 4498 y := vy.(uint8) 4499 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) >= y) } 4500 } else { 4501 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint8) >= fr.reg(iy).(uint8)) } 4502 } 4503 case reflect.Uint16: 4504 if kx == kindConst && ky == kindConst { 4505 v := vx.(uint16) >= vy.(uint16) 4506 return func(fr *frame) { fr.setReg(ir, v) } 4507 } else if kx == kindConst { 4508 x := vx.(uint16) 4509 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(uint16)) } 4510 } else if ky == kindConst { 4511 y := vy.(uint16) 4512 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) >= y) } 4513 } else { 4514 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint16) >= fr.reg(iy).(uint16)) } 4515 } 4516 case reflect.Uint32: 4517 if kx == kindConst && ky == kindConst { 4518 v := vx.(uint32) >= vy.(uint32) 4519 return func(fr *frame) { fr.setReg(ir, v) } 4520 } else if kx == kindConst { 4521 x := vx.(uint32) 4522 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(uint32)) } 4523 } else if ky == kindConst { 4524 y := vy.(uint32) 4525 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) >= y) } 4526 } else { 4527 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint32) >= fr.reg(iy).(uint32)) } 4528 } 4529 case reflect.Uint64: 4530 if kx == kindConst && ky == kindConst { 4531 v := vx.(uint64) >= vy.(uint64) 4532 return func(fr *frame) { fr.setReg(ir, v) } 4533 } else if kx == kindConst { 4534 x := vx.(uint64) 4535 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(uint64)) } 4536 } else if ky == kindConst { 4537 y := vy.(uint64) 4538 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) >= y) } 4539 } else { 4540 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uint64) >= fr.reg(iy).(uint64)) } 4541 } 4542 case reflect.Uintptr: 4543 if kx == kindConst && ky == kindConst { 4544 v := vx.(uintptr) >= vy.(uintptr) 4545 return func(fr *frame) { fr.setReg(ir, v) } 4546 } else if kx == kindConst { 4547 x := vx.(uintptr) 4548 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(uintptr)) } 4549 } else if ky == kindConst { 4550 y := vy.(uintptr) 4551 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) >= y) } 4552 } else { 4553 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(uintptr) >= fr.reg(iy).(uintptr)) } 4554 } 4555 case reflect.Float32: 4556 if kx == kindConst && ky == kindConst { 4557 v := vx.(float32) >= vy.(float32) 4558 return func(fr *frame) { fr.setReg(ir, v) } 4559 } else if kx == kindConst { 4560 x := vx.(float32) 4561 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(float32)) } 4562 } else if ky == kindConst { 4563 y := vy.(float32) 4564 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) >= y) } 4565 } else { 4566 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float32) >= fr.reg(iy).(float32)) } 4567 } 4568 case reflect.Float64: 4569 if kx == kindConst && ky == kindConst { 4570 v := vx.(float64) >= vy.(float64) 4571 return func(fr *frame) { fr.setReg(ir, v) } 4572 } else if kx == kindConst { 4573 x := vx.(float64) 4574 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(float64)) } 4575 } else if ky == kindConst { 4576 y := vy.(float64) 4577 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) >= y) } 4578 } else { 4579 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(float64) >= fr.reg(iy).(float64)) } 4580 } 4581 case reflect.String: 4582 if kx == kindConst && ky == kindConst { 4583 v := vx.(string) >= vy.(string) 4584 return func(fr *frame) { fr.setReg(ir, v) } 4585 } else if kx == kindConst { 4586 x := vx.(string) 4587 return func(fr *frame) { fr.setReg(ir, x >= fr.reg(iy).(string)) } 4588 } else if ky == kindConst { 4589 y := vy.(string) 4590 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) >= y) } 4591 } else { 4592 return func(fr *frame) { fr.setReg(ir, fr.reg(ix).(string) >= fr.reg(iy).(string)) } 4593 } 4594 } 4595 } else { 4596 switch typ.Kind() { 4597 case reflect.Int: 4598 if kx == kindConst && ky == kindConst { 4599 v := xtype.Int(vx) >= xtype.Int(vy) 4600 return func(fr *frame) { fr.setReg(ir, v) } 4601 } else if kx == kindConst { 4602 x := xtype.Int(vx) 4603 return func(fr *frame) { fr.setReg(ir, x >= fr.int(iy)) } 4604 } else if ky == kindConst { 4605 y := xtype.Int(vy) 4606 return func(fr *frame) { fr.setReg(ir, fr.int(ix) >= y) } 4607 } else { 4608 return func(fr *frame) { fr.setReg(ir, fr.int(ix) >= fr.int(iy)) } 4609 } 4610 case reflect.Int8: 4611 if kx == kindConst && ky == kindConst { 4612 v := xtype.Int8(vx) >= xtype.Int8(vy) 4613 return func(fr *frame) { fr.setReg(ir, v) } 4614 } else if kx == kindConst { 4615 x := xtype.Int8(vx) 4616 return func(fr *frame) { fr.setReg(ir, x >= fr.int8(iy)) } 4617 } else if ky == kindConst { 4618 y := xtype.Int8(vy) 4619 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) >= y) } 4620 } else { 4621 return func(fr *frame) { fr.setReg(ir, fr.int8(ix) >= fr.int8(iy)) } 4622 } 4623 case reflect.Int16: 4624 if kx == kindConst && ky == kindConst { 4625 v := xtype.Int16(vx) >= xtype.Int16(vy) 4626 return func(fr *frame) { fr.setReg(ir, v) } 4627 } else if kx == kindConst { 4628 x := xtype.Int16(vx) 4629 return func(fr *frame) { fr.setReg(ir, x >= fr.int16(iy)) } 4630 } else if ky == kindConst { 4631 y := xtype.Int16(vy) 4632 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) >= y) } 4633 } else { 4634 return func(fr *frame) { fr.setReg(ir, fr.int16(ix) >= fr.int16(iy)) } 4635 } 4636 case reflect.Int32: 4637 if kx == kindConst && ky == kindConst { 4638 v := xtype.Int32(vx) >= xtype.Int32(vy) 4639 return func(fr *frame) { fr.setReg(ir, v) } 4640 } else if kx == kindConst { 4641 x := xtype.Int32(vx) 4642 return func(fr *frame) { fr.setReg(ir, x >= fr.int32(iy)) } 4643 } else if ky == kindConst { 4644 y := xtype.Int32(vy) 4645 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) >= y) } 4646 } else { 4647 return func(fr *frame) { fr.setReg(ir, fr.int32(ix) >= fr.int32(iy)) } 4648 } 4649 case reflect.Int64: 4650 if kx == kindConst && ky == kindConst { 4651 v := xtype.Int64(vx) >= xtype.Int64(vy) 4652 return func(fr *frame) { fr.setReg(ir, v) } 4653 } else if kx == kindConst { 4654 x := xtype.Int64(vx) 4655 return func(fr *frame) { fr.setReg(ir, x >= fr.int64(iy)) } 4656 } else if ky == kindConst { 4657 y := xtype.Int64(vy) 4658 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) >= y) } 4659 } else { 4660 return func(fr *frame) { fr.setReg(ir, fr.int64(ix) >= fr.int64(iy)) } 4661 } 4662 case reflect.Uint: 4663 if kx == kindConst && ky == kindConst { 4664 v := xtype.Uint(vx) >= xtype.Uint(vy) 4665 return func(fr *frame) { fr.setReg(ir, v) } 4666 } else if kx == kindConst { 4667 x := xtype.Uint(vx) 4668 return func(fr *frame) { fr.setReg(ir, x >= fr.uint(iy)) } 4669 } else if ky == kindConst { 4670 y := xtype.Uint(vy) 4671 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) >= y) } 4672 } else { 4673 return func(fr *frame) { fr.setReg(ir, fr.uint(ix) >= fr.uint(iy)) } 4674 } 4675 case reflect.Uint8: 4676 if kx == kindConst && ky == kindConst { 4677 v := xtype.Uint8(vx) >= xtype.Uint8(vy) 4678 return func(fr *frame) { fr.setReg(ir, v) } 4679 } else if kx == kindConst { 4680 x := xtype.Uint8(vx) 4681 return func(fr *frame) { fr.setReg(ir, x >= fr.uint8(iy)) } 4682 } else if ky == kindConst { 4683 y := xtype.Uint8(vy) 4684 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) >= y) } 4685 } else { 4686 return func(fr *frame) { fr.setReg(ir, fr.uint8(ix) >= fr.uint8(iy)) } 4687 } 4688 case reflect.Uint16: 4689 if kx == kindConst && ky == kindConst { 4690 v := xtype.Uint16(vx) >= xtype.Uint16(vy) 4691 return func(fr *frame) { fr.setReg(ir, v) } 4692 } else if kx == kindConst { 4693 x := xtype.Uint16(vx) 4694 return func(fr *frame) { fr.setReg(ir, x >= fr.uint16(iy)) } 4695 } else if ky == kindConst { 4696 y := xtype.Uint16(vy) 4697 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) >= y) } 4698 } else { 4699 return func(fr *frame) { fr.setReg(ir, fr.uint16(ix) >= fr.uint16(iy)) } 4700 } 4701 case reflect.Uint32: 4702 if kx == kindConst && ky == kindConst { 4703 v := xtype.Uint32(vx) >= xtype.Uint32(vy) 4704 return func(fr *frame) { fr.setReg(ir, v) } 4705 } else if kx == kindConst { 4706 x := xtype.Uint32(vx) 4707 return func(fr *frame) { fr.setReg(ir, x >= fr.uint32(iy)) } 4708 } else if ky == kindConst { 4709 y := xtype.Uint32(vy) 4710 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) >= y) } 4711 } else { 4712 return func(fr *frame) { fr.setReg(ir, fr.uint32(ix) >= fr.uint32(iy)) } 4713 } 4714 case reflect.Uint64: 4715 if kx == kindConst && ky == kindConst { 4716 v := xtype.Uint64(vx) >= xtype.Uint64(vy) 4717 return func(fr *frame) { fr.setReg(ir, v) } 4718 } else if kx == kindConst { 4719 x := xtype.Uint64(vx) 4720 return func(fr *frame) { fr.setReg(ir, x >= fr.uint64(iy)) } 4721 } else if ky == kindConst { 4722 y := xtype.Uint64(vy) 4723 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) >= y) } 4724 } else { 4725 return func(fr *frame) { fr.setReg(ir, fr.uint64(ix) >= fr.uint64(iy)) } 4726 } 4727 case reflect.Uintptr: 4728 if kx == kindConst && ky == kindConst { 4729 v := xtype.Uintptr(vx) >= xtype.Uintptr(vy) 4730 return func(fr *frame) { fr.setReg(ir, v) } 4731 } else if kx == kindConst { 4732 x := xtype.Uintptr(vx) 4733 return func(fr *frame) { fr.setReg(ir, x >= fr.uintptr(iy)) } 4734 } else if ky == kindConst { 4735 y := xtype.Uintptr(vy) 4736 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) >= y) } 4737 } else { 4738 return func(fr *frame) { fr.setReg(ir, fr.uintptr(ix) >= fr.uintptr(iy)) } 4739 } 4740 case reflect.Float32: 4741 if kx == kindConst && ky == kindConst { 4742 v := xtype.Float32(vx) >= xtype.Float32(vy) 4743 return func(fr *frame) { fr.setReg(ir, v) } 4744 } else if kx == kindConst { 4745 x := xtype.Float32(vx) 4746 return func(fr *frame) { fr.setReg(ir, x >= fr.float32(iy)) } 4747 } else if ky == kindConst { 4748 y := xtype.Float32(vy) 4749 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) >= y) } 4750 } else { 4751 return func(fr *frame) { fr.setReg(ir, fr.float32(ix) >= fr.float32(iy)) } 4752 } 4753 case reflect.Float64: 4754 if kx == kindConst && ky == kindConst { 4755 v := xtype.Float64(vx) >= xtype.Float64(vy) 4756 return func(fr *frame) { fr.setReg(ir, v) } 4757 } else if kx == kindConst { 4758 x := xtype.Float64(vx) 4759 return func(fr *frame) { fr.setReg(ir, x >= fr.float64(iy)) } 4760 } else if ky == kindConst { 4761 y := xtype.Float64(vy) 4762 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) >= y) } 4763 } else { 4764 return func(fr *frame) { fr.setReg(ir, fr.float64(ix) >= fr.float64(iy)) } 4765 } 4766 case reflect.String: 4767 if kx == kindConst && ky == kindConst { 4768 v := xtype.String(vx) >= xtype.String(vy) 4769 return func(fr *frame) { fr.setReg(ir, v) } 4770 } else if kx == kindConst { 4771 x := xtype.String(vx) 4772 return func(fr *frame) { fr.setReg(ir, x >= fr.string(iy)) } 4773 } else if ky == kindConst { 4774 y := xtype.String(vy) 4775 return func(fr *frame) { fr.setReg(ir, fr.string(ix) >= y) } 4776 } else { 4777 return func(fr *frame) { fr.setReg(ir, fr.string(ix) >= fr.string(iy)) } 4778 } 4779 } 4780 } 4781 panic("unreachable") 4782 }