1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
// Code generated from _gen/PPC64latelower.rules using 'go generate'; DO NOT EDIT.
package ssa
import "internal/buildcfg"
func rewriteValuePPC64latelower(v *Value) bool {
switch v.Op {
case OpPPC64ISEL:
return rewriteValuePPC64latelower_OpPPC64ISEL(v)
case OpPPC64SETBC:
return rewriteValuePPC64latelower_OpPPC64SETBC(v)
case OpPPC64SETBCR:
return rewriteValuePPC64latelower_OpPPC64SETBCR(v)
}
return false
}
func rewriteValuePPC64latelower_OpPPC64ISEL(v *Value) bool {
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (ISEL [a] x (MOVDconst [0]) z)
// result: (ISELZ [a] x z)
for {
a := auxIntToInt32(v.AuxInt)
x := v_0
if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
break
}
z := v_2
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(a)
v.AddArg2(x, z)
return true
}
// match: (ISEL [a] (MOVDconst [0]) y z)
// result: (ISELZ [a^0x4] y z)
for {
a := auxIntToInt32(v.AuxInt)
if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
break
}
y := v_1
z := v_2
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(a ^ 0x4)
v.AddArg2(y, z)
return true
}
return false
}
func rewriteValuePPC64latelower_OpPPC64SETBC(v *Value) bool {
v_0 := v.Args[0]
b := v.Block
typ := &b.Func.Config.Types
// match: (SETBC [2] cmp)
// cond: buildcfg.GOPPC64 <= 9
// result: (ISELZ [2] (MOVDconst [1]) cmp)
for {
if auxIntToInt32(v.AuxInt) != 2 {
break
}
cmp := v_0
if !(buildcfg.GOPPC64 <= 9) {
break
}
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(2)
v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
v0.AuxInt = int64ToAuxInt(1)
v.AddArg2(v0, cmp)
return true
}
// match: (SETBC [0] cmp)
// cond: buildcfg.GOPPC64 <= 9
// result: (ISELZ [0] (MOVDconst [1]) cmp)
for {
if auxIntToInt32(v.AuxInt) != 0 {
break
}
cmp := v_0
if !(buildcfg.GOPPC64 <= 9) {
break
}
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(0)
v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
v0.AuxInt = int64ToAuxInt(1)
v.AddArg2(v0, cmp)
return true
}
// match: (SETBC [1] cmp)
// cond: buildcfg.GOPPC64 <= 9
// result: (ISELZ [1] (MOVDconst [1]) cmp)
for {
if auxIntToInt32(v.AuxInt) != 1 {
break
}
cmp := v_0
if !(buildcfg.GOPPC64 <= 9) {
break
}
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(1)
v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
v0.AuxInt = int64ToAuxInt(1)
v.AddArg2(v0, cmp)
return true
}
return false
}
func rewriteValuePPC64latelower_OpPPC64SETBCR(v *Value) bool {
v_0 := v.Args[0]
b := v.Block
typ := &b.Func.Config.Types
// match: (SETBCR [2] cmp)
// cond: buildcfg.GOPPC64 <= 9
// result: (ISELZ [6] (MOVDconst [1]) cmp)
for {
if auxIntToInt32(v.AuxInt) != 2 {
break
}
cmp := v_0
if !(buildcfg.GOPPC64 <= 9) {
break
}
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(6)
v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
v0.AuxInt = int64ToAuxInt(1)
v.AddArg2(v0, cmp)
return true
}
// match: (SETBCR [0] cmp)
// cond: buildcfg.GOPPC64 <= 9
// result: (ISELZ [4] (MOVDconst [1]) cmp)
for {
if auxIntToInt32(v.AuxInt) != 0 {
break
}
cmp := v_0
if !(buildcfg.GOPPC64 <= 9) {
break
}
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(4)
v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
v0.AuxInt = int64ToAuxInt(1)
v.AddArg2(v0, cmp)
return true
}
// match: (SETBCR [1] cmp)
// cond: buildcfg.GOPPC64 <= 9
// result: (ISELZ [5] (MOVDconst [1]) cmp)
for {
if auxIntToInt32(v.AuxInt) != 1 {
break
}
cmp := v_0
if !(buildcfg.GOPPC64 <= 9) {
break
}
v.reset(OpPPC64ISELZ)
v.AuxInt = int32ToAuxInt(5)
v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
v0.AuxInt = int64ToAuxInt(1)
v.AddArg2(v0, cmp)
return true
}
return false
}
func rewriteBlockPPC64latelower(b *Block) bool {
return false
}
|