Skip to content

Commit 3adbdb6

Browse files
committed
cmd/compile: disable mem+op operations on 386
Rolling back portions of CL 222782 to see if that helps issue #37881 any. Update #37881 Change-Id: I9cc3ff8c469fa5e4b22daec715d04148033f46f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/224837 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 5c9bd49 commit 3adbdb6

File tree

3 files changed

+19
-61
lines changed

3 files changed

+19
-61
lines changed

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,23 @@ var combine = map[[2]Op]Op{
204204
[2]Op{Op386MOVWstoreconst, Op386LEAL2}: Op386MOVWstoreconstidx2,
205205
[2]Op{Op386MOVLstoreconst, Op386LEAL1}: Op386MOVLstoreconstidx1,
206206
[2]Op{Op386MOVLstoreconst, Op386LEAL4}: Op386MOVLstoreconstidx4,
207-
208-
[2]Op{Op386ADDLload, Op386LEAL4}: Op386ADDLloadidx4,
209-
[2]Op{Op386SUBLload, Op386LEAL4}: Op386SUBLloadidx4,
210-
[2]Op{Op386MULLload, Op386LEAL4}: Op386MULLloadidx4,
211-
[2]Op{Op386ANDLload, Op386LEAL4}: Op386ANDLloadidx4,
212-
[2]Op{Op386ORLload, Op386LEAL4}: Op386ORLloadidx4,
213-
[2]Op{Op386XORLload, Op386LEAL4}: Op386XORLloadidx4,
214-
215-
[2]Op{Op386ADDLmodify, Op386LEAL4}: Op386ADDLmodifyidx4,
216-
[2]Op{Op386SUBLmodify, Op386LEAL4}: Op386SUBLmodifyidx4,
217-
[2]Op{Op386ANDLmodify, Op386LEAL4}: Op386ANDLmodifyidx4,
218-
[2]Op{Op386ORLmodify, Op386LEAL4}: Op386ORLmodifyidx4,
219-
[2]Op{Op386XORLmodify, Op386LEAL4}: Op386XORLmodifyidx4,
220-
221-
[2]Op{Op386ADDLconstmodify, Op386LEAL4}: Op386ADDLconstmodifyidx4,
222-
[2]Op{Op386ANDLconstmodify, Op386LEAL4}: Op386ANDLconstmodifyidx4,
223-
[2]Op{Op386ORLconstmodify, Op386LEAL4}: Op386ORLconstmodifyidx4,
224-
[2]Op{Op386XORLconstmodify, Op386LEAL4}: Op386XORLconstmodifyidx4,
207+
/*
208+
[2]Op{Op386ADDLload, Op386LEAL4}: Op386ADDLloadidx4,
209+
[2]Op{Op386SUBLload, Op386LEAL4}: Op386SUBLloadidx4,
210+
[2]Op{Op386MULLload, Op386LEAL4}: Op386MULLloadidx4,
211+
[2]Op{Op386ANDLload, Op386LEAL4}: Op386ANDLloadidx4,
212+
[2]Op{Op386ORLload, Op386LEAL4}: Op386ORLloadidx4,
213+
[2]Op{Op386XORLload, Op386LEAL4}: Op386XORLloadidx4,
214+
215+
[2]Op{Op386ADDLmodify, Op386LEAL4}: Op386ADDLmodifyidx4,
216+
[2]Op{Op386SUBLmodify, Op386LEAL4}: Op386SUBLmodifyidx4,
217+
[2]Op{Op386ANDLmodify, Op386LEAL4}: Op386ANDLmodifyidx4,
218+
[2]Op{Op386ORLmodify, Op386LEAL4}: Op386ORLmodifyidx4,
219+
[2]Op{Op386XORLmodify, Op386LEAL4}: Op386XORLmodifyidx4,
220+
221+
[2]Op{Op386ADDLconstmodify, Op386LEAL4}: Op386ADDLconstmodifyidx4,
222+
[2]Op{Op386ANDLconstmodify, Op386LEAL4}: Op386ANDLconstmodifyidx4,
223+
[2]Op{Op386ORLconstmodify, Op386LEAL4}: Op386ORLconstmodifyidx4,
224+
[2]Op{Op386XORLconstmodify, Op386LEAL4}: Op386XORLconstmodifyidx4,
225+
*/
225226
}

test/codegen/arithmetic.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ func SubMem(arr []int, b, c, d int) int {
2727
arr[4]--
2828
// 386:`ADDL\s[$]-20,\s20\([A-Z]+\)`
2929
arr[5] -= 20
30-
// 386:`SUBL\s\([A-Z]+\)\([A-Z]+\*4\),\s[A-Z]+`
3130
ef -= arr[b]
32-
// 386:`SUBL\s[A-Z]+,\s\([A-Z]+\)\([A-Z]+\*4\)`
3331
arr[c] -= b
34-
// 386:`ADDL\s[$]-15,\s\([A-Z]+\)\([A-Z]+\*4\)`
3532
arr[d] -= 15
36-
// 386:`DECL\s\([A-Z]+\)\([A-Z]+\*4\)`
3733
arr[b]--
3834
// amd64:`DECQ\s64\([A-Z]+\)`
3935
arr[8]--

test/codegen/memops.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -204,42 +204,3 @@ func idxFloat64(x, y []float64, i int) {
204204
// 386/sse2: `MOVSD\tX[0-9]+, 8\([A-Z]+[0-9]*\)\([A-Z]+[0-9]*\*[18]\)`
205205
y[16*i+1] = t
206206
}
207-
208-
func idxLoadPlusOp(x []int32, i int) int32 {
209-
s := x[0]
210-
// 386: `ADDL\t4\([A-Z]+\)\([A-Z]+\*4\), [A-Z]+`
211-
s += x[i+1]
212-
// 386: `SUBL\t8\([A-Z]+\)\([A-Z]+\*4\), [A-Z]+`
213-
s -= x[i+2]
214-
// 386: `IMULL\t12\([A-Z]+\)\([A-Z]+\*4\), [A-Z]+`
215-
s *= x[i+3]
216-
// 386: `ANDL\t16\([A-Z]+\)\([A-Z]+\*4\), [A-Z]+`
217-
s &= x[i+4]
218-
// 386: `ORL\t20\([A-Z]+\)\([A-Z]+\*4\), [A-Z]+`
219-
s |= x[i+5]
220-
// 386: `XORL\t24\([A-Z]+\)\([A-Z]+\*4\), [A-Z]+`
221-
s ^= x[i+6]
222-
return s
223-
}
224-
225-
func idxStorePlusOp(x []int32, i int, v int32) {
226-
// 386: `ADDL\t[A-Z]+, 4\([A-Z]+\)\([A-Z]+\*4\)`
227-
x[i+1] += v
228-
// 386: `SUBL\t[A-Z]+, 8\([A-Z]+\)\([A-Z]+\*4\)`
229-
x[i+2] -= v
230-
// 386: `ANDL\t[A-Z]+, 12\([A-Z]+\)\([A-Z]+\*4\)`
231-
x[i+3] &= v
232-
// 386: `ORL\t[A-Z]+, 16\([A-Z]+\)\([A-Z]+\*4\)`
233-
x[i+4] |= v
234-
// 386: `XORL\t[A-Z]+, 20\([A-Z]+\)\([A-Z]+\*4\)`
235-
x[i+5] ^= v
236-
237-
// 386: `ADDL\t[$]77, 24\([A-Z]+\)\([A-Z]+\*4\)`
238-
x[i+6] += 77
239-
// 386: `ANDL\t[$]77, 28\([A-Z]+\)\([A-Z]+\*4\)`
240-
x[i+7] &= 77
241-
// 386: `ORL\t[$]77, 32\([A-Z]+\)\([A-Z]+\*4\)`
242-
x[i+8] |= 77
243-
// 386: `XORL\t[$]77, 36\([A-Z]+\)\([A-Z]+\*4\)`
244-
x[i+9] ^= 77
245-
}

0 commit comments

Comments
 (0)