func f(x, y int) bool {
return x < y
}
generates the assembly:
0x0000 00000 (tmp5.go:3) MOVQ "".x+8(SP), AX
0x0005 00005 (tmp5.go:3) MOVQ "".y+16(SP), CX
0x000a 00010 (tmp5.go:4) CMPQ AX, CX
0x000d 00013 (tmp5.go:4) LEAQ "".~r2+24(SP), AX
0x0012 00018 (tmp5.go:4) SETLT (AX)
We should fold the LEAQ into the SETLT. We do so in many other cases, the SETXX cases were missed. We should audit to make sure that all ops for which we can fold address computations into, we do so.
generates the assembly:
We should fold the LEAQ into the SETLT. We do so in many other cases, the SETXX cases were missed. We should audit to make sure that all ops for which we can fold address computations into, we do so.