Commit 6e8b1039 authored by fanzha02's avatar fanzha02 Committed by Cherry Zhang

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: default avatarCherry Zhang <cherryyz@google.com>
parent 4282ba0a
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment