You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/cmd/compile/internal/ssa/gen/AMD64.rules
+25-41Lines changed: 25 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -169,20 +169,20 @@
169
169
(Lsh16x(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMP(Q|L|W|B)const y [32])))
170
170
(Lsh8x(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMP(Q|L|W|B)const y [32])))
171
171
172
-
(Lsh64x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLQ [true] x y)
173
-
(Lsh32x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL [true] x y)
174
-
(Lsh16x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL [true] x y)
175
-
(Lsh8x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL [true] x y)
172
+
(Lsh64x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLQ x y)
173
+
(Lsh32x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL x y)
174
+
(Lsh16x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL x y)
175
+
(Lsh8x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL x y)
176
176
177
177
(Rsh64Ux(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (ANDQ (SHRQ <t> x y) (SBBQcarrymask <t> (CMP(Q|L|W|B)const y [64])))
178
178
(Rsh32Ux(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMP(Q|L|W|B)const y [32])))
179
179
(Rsh16Ux(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMP(Q|L|W|B)const y [16])))
180
180
(Rsh8Ux(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMP(Q|L|W|B)const y [8])))
181
181
182
-
(Rsh64Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRQ [true] x y)
183
-
(Rsh32Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRL [true] x y)
184
-
(Rsh16Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRW [true] x y)
185
-
(Rsh8Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRB [true] x y)
182
+
(Rsh64Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRQ x y)
183
+
(Rsh32Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRL x y)
184
+
(Rsh16Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRW x y)
185
+
(Rsh8Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRB x y)
186
186
187
187
// Signed right shift needs to return 0/-1 if shift amount is >= width of shifted value.
188
188
// We implement this by setting the shift value to -1 (all ones) if the shift value is >= width.
@@ -191,10 +191,10 @@
191
191
(Rsh16x(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (SARW <t> x (OR(Q|L|L|L) <y.Type> y (NOT(Q|L|L|L) <y.Type> (SBB(Q|L|L|L)carrymask <y.Type> (CMP(Q|L|W|B)const y [16])))))
192
192
(Rsh8x(64|32|16|8) <t> x y) && !shiftIsBounded(v) => (SARB <t> x (OR(Q|L|L|L) <y.Type> y (NOT(Q|L|L|L) <y.Type> (SBB(Q|L|L|L)carrymask <y.Type> (CMP(Q|L|W|B)const y [8])))))
193
193
194
-
(Rsh64x(64|32|16|8) x y) && shiftIsBounded(v) => (SARQ [true] x y)
195
-
(Rsh32x(64|32|16|8) x y) && shiftIsBounded(v) => (SARL [true] x y)
196
-
(Rsh16x(64|32|16|8) x y) && shiftIsBounded(v) => (SARW [true] x y)
197
-
(Rsh8x(64|32|16|8) x y) && shiftIsBounded(v) => (SARB [true] x y)
194
+
(Rsh64x(64|32|16|8) x y) && shiftIsBounded(v) => (SARQ x y)
195
+
(Rsh32x(64|32|16|8) x y) && shiftIsBounded(v) => (SARL x y)
196
+
(Rsh16x(64|32|16|8) x y) && shiftIsBounded(v) => (SARW x y)
197
+
(Rsh8x(64|32|16|8) x y) && shiftIsBounded(v) => (SARB x y)
198
198
199
199
// Lowering integer comparisons
200
200
(Less(64|32|16|8) x y) => (SETL (CMP(Q|L|W|B) x y))
0 commit comments