aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm/internal
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-10-18 14:44:05 -0400
committerCherry Zhang <cherryyz@google.com>2019-10-18 14:44:05 -0400
commitc3459eaab0f83be9515e8bc5624ad372a426a6eb (patch)
tree054a028c4c4f8f238d34fd1bf2867317439d8aa3 /src/cmd/asm/internal
parentbd229936cf3873c552ab087232030780dc432067 (diff)
parent65a4dc9c183d37920291ef5ca2e30242a6af2677 (diff)
downloadgo-c3459eaab0f83be9515e8bc5624ad372a426a6eb.tar.xz
[dev.link] all: merge branch 'master' into dev.link
Clean merge. Change-Id: I94d5e621b98cd5b3e1f2007db83d52293edbd9ec
Diffstat (limited to 'src/cmd/asm/internal')
-rw-r--r--src/cmd/asm/internal/arch/s390x.go21
-rw-r--r--src/cmd/asm/internal/asm/testdata/amd64enc_extra.s6
-rw-r--r--src/cmd/asm/internal/asm/testdata/amd64error.s8
-rw-r--r--src/cmd/asm/internal/asm/testdata/arm64.s2
-rw-r--r--src/cmd/asm/internal/asm/testdata/arm64enc.s3
-rw-r--r--src/cmd/asm/internal/asm/testdata/riscvenc.s30
6 files changed, 48 insertions, 22 deletions
diff --git a/src/cmd/asm/internal/arch/s390x.go b/src/cmd/asm/internal/arch/s390x.go
index 0a4d278899..519d20877c 100644
--- a/src/cmd/asm/internal/arch/s390x.go
+++ b/src/cmd/asm/internal/arch/s390x.go
@@ -9,7 +9,6 @@
package arch
import (
- "cmd/internal/obj"
"cmd/internal/obj/s390x"
)
@@ -59,26 +58,6 @@ func jumpS390x(word string) bool {
return false
}
-// IsS390xCMP reports whether the op (as defined by an s390x.A* constant) is
-// one of the CMP instructions that require special handling.
-func IsS390xCMP(op obj.As) bool {
- switch op {
- case s390x.ACMP, s390x.ACMPU, s390x.ACMPW, s390x.ACMPWU:
- return true
- }
- return false
-}
-
-// IsS390xNEG reports whether the op (as defined by an s390x.A* constant) is
-// one of the NEG-like instructions that require special handling.
-func IsS390xNEG(op obj.As) bool {
- switch op {
- case s390x.ANEG, s390x.ANEGW:
- return true
- }
- return false
-}
-
func s390xRegisterNumber(name string, n int16) (int16, bool) {
switch name {
case "AR":
diff --git a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s
index d7afecc230..a7d9bdac54 100644
--- a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s
+++ b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s
@@ -1049,5 +1049,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
VADDPD Z2, Z9, Z21 // 62e1b54858ea
VADDPD Z21, Z2, Z9 // 6231ed4858cd
VADDPD Z9, Z21, Z2 // 62d1d54058d1
+
+ CLWB (BX) // 660fae33
+ CLDEMOTE (BX) // 0f1c03
+ TPAUSE BX // 660faef3
+ UMONITOR BX // f30faef3
+ UMWAIT BX // f20faef3
// End of tests.
RET
diff --git a/src/cmd/asm/internal/asm/testdata/amd64error.s b/src/cmd/asm/internal/asm/testdata/amd64error.s
index 93272e39d5..7e91fb4e97 100644
--- a/src/cmd/asm/internal/asm/testdata/amd64error.s
+++ b/src/cmd/asm/internal/asm/testdata/amd64error.s
@@ -132,4 +132,12 @@ TEXT errors(SB),$0
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
+ // CLWB instuctions:
+ CLWB BX // ERROR "invalid instruction"
+ // CLDEMOTE instructions:
+ CLDEMOTE BX // ERROR "invalid instruction"
+ // WAITPKG instructions:
+ TPAUSE (BX) // ERROR "invalid instruction"
+ UMONITOR (BX) // ERROR "invalid instruction"
+ UMWAIT (BX) // ERROR "invalid instruction"
RET
diff --git a/src/cmd/asm/internal/asm/testdata/arm64.s b/src/cmd/asm/internal/asm/testdata/arm64.s
index 4af47fc626..c0e2fb7e0e 100644
--- a/src/cmd/asm/internal/asm/testdata/arm64.s
+++ b/src/cmd/asm/internal/asm/testdata/arm64.s
@@ -1038,6 +1038,8 @@ again:
FSTPS (F3, F4), 1024(RSP) // fb0310916313002d
FSTPS (F3, F4), x(SB)
FSTPS (F3, F4), x+8(SB)
+ NOOP // 1f2003d5
+ HINT $0 // 1f2003d5
// System Register
MSR $1, SPSel // bf4100d5
diff --git a/src/cmd/asm/internal/asm/testdata/arm64enc.s b/src/cmd/asm/internal/asm/testdata/arm64enc.s
index a2850e2e46..71270ce43f 100644
--- a/src/cmd/asm/internal/asm/testdata/arm64enc.s
+++ b/src/cmd/asm/internal/asm/testdata/arm64enc.s
@@ -152,6 +152,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
EXTR $35, R22, R12, R8 // 888dd693
SEVL // bf2003d5
HINT $6 // df2003d5
+ HINT $0 // 1f2003d5
HLT $65509 // a0fc5fd4
HVC $61428 // 82fe1dd4
ISB $1 // df3103d5
@@ -281,7 +282,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
NGC R2, R7 // e70302da
NGCSW R10, R5 // e5030a7a
NGCS R24, R16 // f00318fa
- //TODO NOP // 1f2003d5
+ NOOP // 1f2003d5
ORNW R4@>11, R16, R3 // 032ee42a
ORN R22@>19, R3, R3 // 634cf6aa
ORRW $4294443071, R15, R24 // f8490d32
diff --git a/src/cmd/asm/internal/asm/testdata/riscvenc.s b/src/cmd/asm/internal/asm/testdata/riscvenc.s
index f5cb10724c..73f41dd877 100644
--- a/src/cmd/asm/internal/asm/testdata/riscvenc.s
+++ b/src/cmd/asm/internal/asm/testdata/riscvenc.s
@@ -237,3 +237,33 @@ start:
// Arbitrary bytes (entered in little-endian mode)
WORD $0x12345678 // WORD $305419896 // 78563412
WORD $0x9abcdef0 // WORD $2596069104 // f0debc9a
+
+ // MOV pseudo-instructions
+ MOV X5, X6 // 13830200
+ MOV $2047, X5 // 9b02f07f
+ MOV $-2048, X5 // 9b020080
+
+ MOV (X5), X6 // 03b30200
+ MOV 4(X5), X6 // 03b34200
+ MOVB (X5), X6 // 03830200
+ MOVB 4(X5), X6 // 03834200
+ MOVH (X5), X6 // 03930200
+ MOVH 4(X5), X6 // 03934200
+ MOVW (X5), X6 // 03a30200
+ MOVW 4(X5), X6 // 03a34200
+ MOV X5, (X6) // 23305300
+ MOV X5, 4(X6) // 23325300
+ MOVB X5, (X6) // 23005300
+ MOVB X5, 4(X6) // 23025300
+ MOVH X5, (X6) // 23105300
+ MOVH X5, 4(X6) // 23125300
+ MOVW X5, (X6) // 23205300
+ MOVW X5, 4(X6) // 23225300
+
+ MOVF 4(X5), F0 // 07a04200
+ MOVF F0, 4(X5) // 27a20200
+ MOVF F0, F1 // d3000020
+
+ MOVD 4(X5), F0 // 07b04200
+ MOVD F0, 4(X5) // 27b20200
+ MOVD F0, F1 // d3000022