]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/arm64: fix assemble stxr/stxrw/stxrb/stxrh bug
authorfanzha02 <fannie.zhang@arm.com>
Wed, 14 Jun 2017 06:24:18 +0000 (06:24 +0000)
committerCherry Zhang <cherryyz@google.com>
Tue, 15 Aug 2017 14:05:29 +0000 (14:05 +0000)
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>
src/cmd/asm/internal/arch/arm64.go
src/cmd/asm/internal/asm/testdata/arm64enc.s

index dd04719451e75f173dcc3572553b47ec6fe54fe2..b46ae9d5f83b05d149a8bdd292f0a81a98542006 100644 (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
index ec89474990be84a995be3739b85c1fb6ff92e3e9..52663e2b52e906613b846f11068aa36c06c526a0 100644 (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