1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:05:00 -07:00

cmd/internal/obj/arm64: fix assemble stxr/stxrw/stxrb/stxrh bug

The stxr/stxrw/stxrb/stxrh instructions belong to STLXR-like instructions
set and they require special handling. The current code has no special
handling for those instructions.

The fix adds the special handling for those instructions.

Uncomment stxr/stxrw/stxrb/stxrh test cases.

Fixes #21397
Change-Id: I31cee29dd6b30b1c25badd5c7574dda7a01bf016
Reviewed-on: https://go-review.googlesource.com/54951
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
fanzha02 2017-06-14 06:24:18 +00:00 committed by Cherry Zhang
parent 4282ba0a65
commit 6e8b10397b
2 changed files with 6 additions and 5 deletions

View File

@ -67,7 +67,8 @@ func IsARM64CMP(op obj.As) bool {
// handling.
func IsARM64STLXR(op obj.As) bool {
switch op {
case arm64.ASTLXRB, arm64.ASTLXRH, arm64.ASTLXRW, arm64.ASTLXR:
case arm64.ASTLXRB, arm64.ASTLXRH, arm64.ASTLXRW, arm64.ASTLXR,
arm64.ASTXRB, arm64.ASTXRH, arm64.ASTXRW, arm64.ASTXR:
return true
}
return false

View File

@ -345,10 +345,10 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
//TODO STTRH 9(R10), R18 // 52990078
//TODO STXP (R20), R18, R5, ZR // 854a3f88
//TODO STXP (R22), R9, R17, R0 // d12620c8
// STXRW R2, (R19), R18 // 627e1288
// STXR R15, (R21), R13 // af7e0dc8
// STXRB R7, (R9), R24 // 277d1808
// STXRH R12, (R3), R8 // 6c7c0848
STXRW R2, (R19), R18 // 627e1288
STXR R15, (R21), R13 // af7e0dc8
STXRB R7, (R9), R24 // 277d1808
STXRH R12, (R3), R8 // 6c7c0848
//TODO SUBW R20.UXTW<<7, R23, R18 // f25e344b
//TODO SUB R5.SXTW<<2, R1, R26 // 3ac825cb
SUB $(1923<<12), R4, R27 // SUB $7876608, R4, R27 // 9b0c5ed1