]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.12] cmd/internal/obj/arm64: fix the bug assembling TSTW
authorfanzha02 <fannie.zhang@arm.com>
Thu, 21 Feb 2019 07:53:15 +0000 (07:53 +0000)
committerIan Lance Taylor <iant@golang.org>
Tue, 26 Feb 2019 00:41:59 +0000 (00:41 +0000)
Current assembler reports error when it assembles
"TSTW $1689262177517664, R3", but go1.11 was building
fine.

Fixes #30334

Change-Id: I9c16d36717cd05df2134e8eb5b17edc385aff0a9
Reviewed-on: https://go-review.googlesource.com/c/163259
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ben Shi <powerman1st@163.com>
(cherry picked from commit 2ef8abb41f2565e38e520c18773308b3cf005af6)
Reviewed-on: https://go-review.googlesource.com/c/163419
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/asm7.go

index d025543e6db2d8cb59b34b5260cbdecbfa778416..b54fd860458ced982b5354a732ad9c8e54720888 100644 (file)
@@ -261,6 +261,18 @@ TEXT       foo(SB), DUPOK|NOSPLIT, $-8
        ORRW    $0x1b000, R2, R3                    // ORRW     $110592, R2, R3                 // 1b0096523b00a07243001b2a
        TSTW    $0x500000, R1                       // TSTW     $5242880, R1                    // 1b0aa0523f001b6a
        TSTW    $0xff00ff, R1                       // TSTW     $16711935, R1                   // 3f9c0072
+       TSTW    $0x60060, R5                        // TSTW     $393312, R5                     // 1b0c8052db00a072bf001b6a
+       TSTW    $0x6006000060060, R5                // TSTW     $1689262177517664, R5           // 1b0c8052db00a072bf001b6a
+       ANDW    $0x6006000060060, R5                // ANDW     $1689262177517664, R5           // 1b0c8052db00a072a5001b0a
+       ANDSW   $0x6006000060060, R5                // ANDSW    $1689262177517664, R5           // 1b0c8052db00a072a5001b6a
+       EORW    $0x6006000060060, R5                // EORW     $1689262177517664, R5           // 1b0c8052db00a072a5001b4a
+       ORRW    $0x6006000060060, R5                // ORRW     $1689262177517664, R5           // 1b0c8052db00a072a5001b2a
+       BICW    $0x6006000060060, R5                // BICW     $1689262177517664, R5           // 1b0c8052db00a072a5003b0a
+       EONW    $0x6006000060060, R5                // EONW     $1689262177517664, R5           // 1b0c8052db00a072a5003b4a
+       ORNW    $0x6006000060060, R5                // ORNW     $1689262177517664, R5           // 1b0c8052db00a072a5003b2a
+       BICSW   $0x6006000060060, R5                // BICSW    $1689262177517664, R5           // 1b0c8052db00a072a5003b6a
+       ADDW    $0x60060, R2                        // ADDW     $393312, R2                     // 4280011142804111
+       CMPW    $0x60060, R2                        // CMPW     $393312, R2                     // 1b0c8052db00a0725f001b6b
 
        AND     $8, R0, RSP // 1f007d92
        ORR     $8, R0, RSP // 1f007db2
index 093b2228983d6bd12ac92aa903809969293d841a..cbe5796234a0f60caeea9ad73d005403c5036fba 100644 (file)
@@ -2986,7 +2986,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
                num := uint8(0)
                cls := oclass(&p.From)
                if isADDWop(p.As) {
-                       if (cls != C_LCON) && (cls != C_ADDCON2) {
+                       if !cmp(C_LCON, cls) {
                                c.ctxt.Diag("illegal combination: %v", p)
                        }
                        num = c.omovlconst(AMOVW, p, &p.From, REGTMP, os[:])
@@ -3271,7 +3271,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
                num := uint8(0)
                cls := oclass(&p.From)
                if isANDWop(p.As) {
-                       if (cls != C_LCON) && (cls != C_ADDCON) {
+                       if !cmp(C_LCON, cls) {
                                c.ctxt.Diag("illegal combination: %v", p)
                        }
                        num = c.omovlconst(AMOVW, p, &p.From, REGTMP, os[:])