Skip to content

Commit f9da938

Browse files
committed
cmd/compile: remove unused ISELB PPC64 ssa opcode
The usage of ISELB has been removed as part of changes made to support Power10 SETBC instructions. Change-Id: I2fce4370f48c1eeee65d411dfd1bea4201f45b45 Reviewed-on: https://go-review.googlesource.com/c/go/+/465575 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Paul Murphy <[email protected]> Reviewed-by: Archana Ravindar <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Lynn Boger <[email protected]>
1 parent 9ddf748 commit f9da938

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

src/cmd/compile/internal/ppc64/ssa.go

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -963,9 +963,8 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
963963
p.To.Type = obj.TYPE_MEM
964964
p.To.Reg = v.Args[0].Reg()
965965

966-
case ssa.OpPPC64ISEL, ssa.OpPPC64ISELB, ssa.OpPPC64ISELZ:
966+
case ssa.OpPPC64ISEL, ssa.OpPPC64ISELZ:
967967
// ISEL AuxInt ? arg0 : arg1
968-
// ISELB is a special case of ISEL where AuxInt ? $1 (arg0) : $0.
969968
// ISELZ is a special case of ISEL where arg1 is implicitly $0.
970969
//
971970
// AuxInt value indicates conditions 0=LT 1=GT 2=EQ 3=SO 4=GE 5=LE 6=NE 7=NSO.
@@ -974,24 +973,18 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
974973
//
975974
// AuxInt&3 ? arg0 : arg1 for conditions LT, GT, EQ, SO
976975
// AuxInt&3 ? arg1 : arg0 for conditions GE, LE, NE, NSO
977-
p := s.Prog(ppc64.AISEL)
978-
p.To.Type = obj.TYPE_REG
979-
p.To.Reg = v.Reg()
980-
// For ISELB/ISELZ Use R0 for 0 operand to avoid load.
981-
r := obj.Addr{Type: obj.TYPE_REG, Reg: ppc64.REG_R0}
976+
p := s.Prog(v.Op.Asm())
977+
p.To = obj.Addr{Type: obj.TYPE_REG, Reg: v.Reg()}
978+
p.Reg = v.Args[0].Reg()
979+
p.SetFrom3Reg(ppc64.REG_R0)
982980
if v.Op == ssa.OpPPC64ISEL {
983-
r.Reg = v.Args[1].Reg()
981+
p.SetFrom3Reg(v.Args[1].Reg())
984982
}
985983
// AuxInt values 4,5,6 implemented with reverse operand order from 0,1,2
986984
if v.AuxInt > 3 {
987-
p.Reg = r.Reg
988-
p.SetFrom3Reg(v.Args[0].Reg())
989-
} else {
990-
p.Reg = v.Args[0].Reg()
991-
p.SetFrom3(r)
985+
p.Reg, p.GetFrom3().Reg = p.GetFrom3().Reg, p.Reg
992986
}
993-
p.From.Type = obj.TYPE_CONST
994-
p.From.Offset = v.AuxInt & 3
987+
p.From.SetConst(v.AuxInt & 3)
995988

996989
case ssa.OpPPC64SETBC, ssa.OpPPC64SETBCR:
997990
p := s.Prog(v.Op.Asm())

src/cmd/compile/internal/ssa/_gen/PPC64Ops.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,10 @@ func init() {
408408
{name: "CMPWUconst", argLength: 1, reg: gp1cr, asm: "CMPWU", aux: "Int32", typ: "Flags"},
409409

410410
// ISEL arg2 ? arg0 : arg1
411-
// ISELB arg1 ? arg0 : $0. arg0 is some register holding $1.
412411
// ISELZ arg1 ? arg0 : $0
413412
// auxInt values 0=LT 1=GT 2=EQ 3=SO (summary overflow/unordered) 4=GE 5=LE 6=NE 7=NSO (not summary overflow/not unordered)
414413
// Note, auxInt^4 inverts the comparison condition. For example, LT^4 becomes GE, and "ISEL [a] x y z" is equivalent to ISEL [a^4] y x z".
415414
{name: "ISEL", argLength: 3, reg: crgp21, asm: "ISEL", aux: "Int32", typ: "Int32"},
416-
{name: "ISELB", argLength: 2, reg: crgp11, asm: "ISEL", aux: "Int32", typ: "Int32"},
417415
{name: "ISELZ", argLength: 2, reg: crgp11, asm: "ISEL", aux: "Int32"},
418416

419417
// SETBC auxInt values 0=LT 1=GT 2=EQ (CRbit=1)? 1 : 0

src/cmd/compile/internal/ssa/opGen.go

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)