• David Chase's avatar
    [dev.ssa] cmd/compile: replace storeconst w/ storezero, fold addressing · 806cacc7
    David Chase authored
    Because PPC lacks store-immediate, remove the instruction
    that implies that it exists.  Replace it with storezero for
    the special case of storing zero, because R0 is reserved zero
    for Go (though the assembler knows this, do it in SSA).
    
    Also added address folding for storezero.
    (Now corrected to use right-sized stores in bulk-zero code.)
    
    Hello.go now compiles to
    genssa main
        00000 (...hello.go:7) TEXT "".main(SB), $0
        00001 (...hello.go:7) FUNCDATA $0, "".gcargs·0(SB)
        00002 (...hello.go:7) FUNCDATA $1, "".gclocals·1(SB)
    v23 00003 (...hello.go:8) MOVD $go.string."Hello, World!\n"(SB), R3
    v11 00004 (...hello.go:8) MOVD R3, 32(R1)
    v22 00005 (...hello.go:8) MOVD $14, R3
    v6  00006 (...hello.go:8) MOVD R3, 40(R1)
    v20 00007 (...hello.go:8) MOVD R0, 48(R1)
    v18 00008 (...hello.go:8) MOVD R0, 56(R1)
    v9  00009 (...hello.go:8) MOVD R0, 64(R1)
    v10 00010 (...hello.go:8) CALL fmt.Printf(SB)
    b2  00011 (...hello.go:9) RET
        00012 (<unknown line number>) END
    
    Updates #16010
    
    Change-Id: I33cfd98c21a1617502260ac753fa8cad68c8d85a
    Reviewed-on: https://go-review.googlesource.com/25151Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
    Run-TryBot: David Chase <drchase@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    806cacc7
rewritePPC64.go 70 KB