1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

[dev.ssa] cmd/compile: SETcc instructions do not clobber flags

This reduces the number of flags spilled during
make.bash by > 90%.

I am working (slowly) on the rest.

Change-Id: I3c08ae228c33e2f726f615962996f0350c8d592b
Reviewed-on: https://go-review.googlesource.com/13813
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Josh Bleecher Snyder 2015-08-21 10:16:35 -07:00
parent 9f954db170
commit 8f51ae8ba5
2 changed files with 14 additions and 23 deletions

View File

@ -105,9 +105,10 @@ func init() {
clobbers: ax | flags}
gp10 = regInfo{inputs: []regMask{gp}}
gp2flags = regInfo{inputs: []regMask{gpsp, gpsp}, outputs: flagsonly}
gp1flags = regInfo{inputs: []regMask{gpsp}, outputs: flagsonly}
flagsgp = regInfo{inputs: flagsonly, outputs: gponly, clobbers: flags}
gp2flags = regInfo{inputs: []regMask{gpsp, gpsp}, outputs: flagsonly}
gp1flags = regInfo{inputs: []regMask{gpsp}, outputs: flagsonly}
flagsgp = regInfo{inputs: flagsonly, outputs: gponly, clobbers: flags}
readflags = regInfo{inputs: flagsonly, outputs: gponly}
gpload = regInfo{inputs: []regMask{gpspsb, 0}, outputs: gponly}
gploadidx = regInfo{inputs: []regMask{gpspsb, gpsp, 0}, outputs: gponly}
@ -294,16 +295,16 @@ func init() {
{name: "SBBLcarrymask", reg: flagsgp, asm: "SBBL"}, // (int32)(-1) if carry is set, 0 if carry is clear.
// Note: SBBW and SBBB are subsumed by SBBL
{name: "SETEQ", reg: flagsgp, asm: "SETEQ"}, // extract == condition from arg0
{name: "SETNE", reg: flagsgp, asm: "SETNE"}, // extract != condition from arg0
{name: "SETL", reg: flagsgp, asm: "SETLT"}, // extract signed < condition from arg0
{name: "SETLE", reg: flagsgp, asm: "SETLE"}, // extract signed <= condition from arg0
{name: "SETG", reg: flagsgp, asm: "SETGT"}, // extract signed > condition from arg0
{name: "SETGE", reg: flagsgp, asm: "SETGE"}, // extract signed >= condition from arg0
{name: "SETB", reg: flagsgp, asm: "SETCS"}, // extract unsigned < condition from arg0
{name: "SETBE", reg: flagsgp, asm: "SETLS"}, // extract unsigned <= condition from arg0
{name: "SETA", reg: flagsgp, asm: "SETHI"}, // extract unsigned > condition from arg0
{name: "SETAE", reg: flagsgp, asm: "SETCC"}, // extract unsigned >= condition from arg0
{name: "SETEQ", reg: readflags, asm: "SETEQ"}, // extract == condition from arg0
{name: "SETNE", reg: readflags, asm: "SETNE"}, // extract != condition from arg0
{name: "SETL", reg: readflags, asm: "SETLT"}, // extract signed < condition from arg0
{name: "SETLE", reg: readflags, asm: "SETLE"}, // extract signed <= condition from arg0
{name: "SETG", reg: readflags, asm: "SETGT"}, // extract signed > condition from arg0
{name: "SETGE", reg: readflags, asm: "SETGE"}, // extract signed >= condition from arg0
{name: "SETB", reg: readflags, asm: "SETCS"}, // extract unsigned < condition from arg0
{name: "SETBE", reg: readflags, asm: "SETLS"}, // extract unsigned <= condition from arg0
{name: "SETA", reg: readflags, asm: "SETHI"}, // extract unsigned > condition from arg0
{name: "SETAE", reg: readflags, asm: "SETCC"}, // extract unsigned >= condition from arg0
{name: "MOVBQSX", reg: gp11, asm: "MOVBQSX"}, // sign extend arg0 from int8 to int64
{name: "MOVBQZX", reg: gp11, asm: "MOVBQZX"}, // zero extend arg0 from int8 to int64

View File

@ -2202,7 +2202,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2215,7 +2214,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2228,7 +2226,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2241,7 +2238,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2254,7 +2250,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2267,7 +2262,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2280,7 +2274,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2293,7 +2286,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2306,7 +2298,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},
@ -2319,7 +2310,6 @@ var opcodeTable = [...]opInfo{
inputs: []inputInfo{
{0, 8589934592}, // .FLAGS
},
clobbers: 8589934592, // .FLAGS
outputs: []regMask{
65519, // .AX .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
},