Just a missed case in in the handling of branches.
Fixes #10065
Change-Id: I6be054d30bf1f383c12b4c7626abd5f8ae22b22e
Reviewed-on: https://go-review.googlesource.com/6631
Reviewed-by: Minux Ma <minux@golang.org>
"cmd/internal/obj/ppc64"
"cmd/internal/obj/x86" // == amd64
"fmt"
+ "strings"
)
// Pseudo-registers whose names are the constant name without the leading R.
}
func jump386(word string) bool {
- return word[0] == 'J' || word == "CALL"
+ return word[0] == 'J' || word == "CALL" || strings.HasPrefix(word, "LOOP")
}
func arch386() *Arch {
75 00045 (testdata/386.s:75) CMPPD X0,foo+4(SB)
78 00046 (testdata/386.s:78) PINSRD (AX),$1,X0
79 00047 (testdata/386.s:79) PINSRD foo+4(FP),$2,X0
-82 00048 (testdata/386.s:82) RET ,
+83 00048 (testdata/386.s:83) LOOP ,
+86 00049 (testdata/386.s:86) RET ,
PINSRD $1, (AX), X0
PINSRD $2, foo+4(FP), X0
+// Was bug: LOOP is a branch instruction.
+loop:
+ LOOP loop
+
// LTYPE0 nonnon { outcode(int($1), &$2); }
RET
86 00053 (testdata/amd64.s:86) PINSRW R11,$4,AX
87 00054 (testdata/amd64.s:87) PINSRW foo+4(SB),$4,AX
90 00055 (testdata/amd64.s:90) RETFL $4,
-93 00056 (testdata/amd64.s:93) RET ,
+94 00056 (testdata/amd64.s:94) LOOP ,
+97 00057 (testdata/amd64.s:97) RET ,
// LTYPERT spec10 { outcode($1, &$2); }
RETFL $4
+// Was bug: LOOP is a branch instruction.
+loop:
+ LOOP loop
+
// LTYPE0 nonnon { outcode($1, &$2); }
RET