• Josh Bleecher Snyder's avatar
    runtime: prevent pointless jmp in amd64 and 386 memmove · bc9e1604
    Josh Bleecher Snyder authored
    6a and 8a rearrange memmove such that the fallthrough from move_1or2 to move_0 ends up being a JMP to a RET. Insert an explicit RET to prevent such silliness.
    
    Do the same for memclr as prophylaxis.
    
    benchmark                old ns/op     new ns/op     delta
    BenchmarkMemmove1        4.59          4.13          -10.02%
    BenchmarkMemmove2        4.58          4.13          -9.83%
    
    LGTM=khr
    R=golang-codereviews, dvyukov, minux, ruiu, bradfitz, khr
    CC=golang-codereviews
    https://golang.org/cl/120930043
    bc9e1604
memmove_386.s 3.91 KB