Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: src/trusted/validator_x86/testdata/64/prefix-2.tf

Issue 10908137: (abandoned) Validator tests: convert hexes to TFs and run on bots (for prod. validator only) (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: restore 'read overflow' and 'SegmentationError' Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_x86/testdata/64/prefix-2.tf
diff --git a/src/trusted/validator_x86/testdata/64/prefix-2.tf b/src/trusted/validator_x86/testdata/64/prefix-2.tf
new file mode 100644
index 0000000000000000000000000000000000000000..8d99e7e6d7797f14348109ce5bfad50707392e6a
--- /dev/null
+++ b/src/trusted/validator_x86/testdata/64/prefix-2.tf
@@ -0,0 +1,341 @@
+BITS: 64
+OUTCOME: invalid
+
+# 2 prefixes of the same type
+# lock lock add %eax,(%rsp)
+hex: F0 F0 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Duplicating a prefix byte is not allowed by Native Client
+
+# mov %edi,%edi
+# lea (%r15,%rdi),%rdi
+# rep rep stos %eax,%es:(%rdi)
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+hex: F3 F3 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Duplicating a prefix byte is not allowed by Native Client
+
+# mov %edi,%edi
+# lea (%r15,%rdi),%rdi
+# repne rep stos %eax,%es:(%rdi)
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+hex: F2 F3 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of REPNE (F2) prefix for instruction not allowed by Native Client
+
+# mov %edi,%edi
+# lea (%r15,%rdi),%rdi
+# rep repne scas %es:(%rdi),%al
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+hex: F3 F2 AE
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+
+# fs gs mov %eax,%eax
+asm: fs; gs; mov %eax,%eax
+hex: 64 65 89 C0
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+nc_out: ERROR: Specifying different segment registers using prefix bytes is not allowed by Native Client
+
+# 0x66 mov %ax,%ax
+hex: 66 66 89 C0
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Duplicating a prefix byte is not allowed by Native Client
+
+# 0x67 mov %eax,(%esp)
+hex: 67 67 89 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Duplicating a prefix byte is not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+# rex rex jmp $
+hex: 40 40 EB FD
+nc_out: ERROR: Multiple use of REX prefix not allowed
+nc_out: [at +1] Bad jump target
+
+
+# 2 prefixes of different type
+# lock add %eax, %ss:(%rsp)
+hex: 36 F0 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+hex: F0 36 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+
+# Nops for bundle alignment.
+asm: nop; nop; nop
+hex: 90 90 90
+
+
+# mov %edi,%edi
+# lea (%r15,%rdi),%rdi
+# es rep stos %eax,%es:(%rdi)
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+nc_out: Bad basic block alignment.
+
+hex: 26 F3 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+hex: F3 26 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+# lock add %ax, (%rsp)
+asm: lock add %ax,(%rsp)
+hex: 66 F0 01 04 24
+
+hex: F0 66 01 04 24
+
+# Doesn't validate due to bug.
+# mov %edi,%edi
+# lea (%r15,%rdi),%rdi
+# rep stosw %ax,%es:(%rdi)
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+asm: rep stos %ax,%es:(%rdi)
+hex: 66 F3 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: Bad basic block alignment.
+
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+hex: F3 66 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+
+# lock add %eax, (%esp)
+asm: lock addr32 add %eax,(%esp)
+hex: 67 F0 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+hex: F0 67 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+
+# Nop for bundle alignment.
+asm: nop
+hex: 90
+
+
+# rep stos %eax, %es:(%edi)
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+asm: rep addr32 stos %eax,%es:(%edi)
+hex: 67 F3 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit segment address
+
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+hex: F3 67 AB
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit segment address
+
+# lock add %rax, (%rsp)
+asm: lock add %rax,(%rsp)
+hex: f0 48 01 04 24
+
+asm: rex.W; lock add %eax,(%rsp)
+hex: 48 f0 01 04 24
+nc_out: ERROR: REX prefix byte must appear last
+
+# mov %edi,%edi
+# lea (%r15,%rdi),%rdi
+# rep stos %rax,%es:(%rdi)
+asm: mov %edi,%edi
+hex: 89 FF
+
+asm: lea (%r15,%rdi,1),%rdi
+hex: 49 8D 3C 3F
+
+asm: rep stos %rax,%es:(%rdi)
+hex: F3 48 AB
+
+# fs mov %ax,%ax
+asm: fs; mov %ax,%ax
+hex: 64 66 89 C0
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+asm: data16; fs; mov %eax,%eax
+hex: 66 64 89 C0
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+# fs add %eax, (%esp)
+hex: 67 64 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit segment address
+
+asm: addr32 add %eax,%fs:(%esp)
+hex: 64 67 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit segment address
+
+# fs mov %rax,%rax
+asm: fs; mov %rax,%rax
+hex: 64 48 89 C0
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+asm: rex.W; fs; mov %eax,%eax
+hex: 48 64 89 C0
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+nc_out: ERROR: REX prefix byte must appear last
+
+# add %ax, (%esp)
+hex: 66 67 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+asm: addr32 add %ax,(%esp)
+hex: 67 66 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+# mov %r15l, (%rsp)
+asm: mov %r15w,(%rsp)
+hex: 66 44 89 3C 24
+
+asm: rex.R; mov %di,(%rsp)
+hex: 44 66 89 3C 24
+nc_out: ERROR: REX prefix byte must appear last
+
+# mov %r15, (%esp)
+asm: addr32 mov %r15,(%esp)
+hex: 67 4C 89 3C 24
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+asm: rex.WR; addr32 mov %edi,(%esp)
+hex: 4C 67 89 3C 24
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: REX prefix byte must appear last
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+
+# 2 prefixes when one is mandatory
+# fs phaddw %xmm0,%xmm1
+asm: fs; phaddw %xmm0,%xmm1
+hex: 64 66 0F 38 01 C8
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+# fs addsd %xmm0,%xmm1
+asm: fs; addsd %xmm0,%xmm1
+hex: 64 F2 0F 58 C8
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Uses a segment prefix byte not allowed by Native Client
+
+# 0x66 phaddw %xmm0,%xmm1
+hex: 66 66 0F 38 01 C8
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Duplicating a prefix byte is not allowed by Native Client
+nc_out: [at +1] Bad basic block alignment.
+
+# 0x66 addsd %xmm0,%xmm1
+asm: data16; addsd %xmm0,%xmm1
+hex: 66 F2 0F 58 C8
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of DATA16 (66) prefix for instruction not allowed by Native Client
+
+# phaddw (%esp), %xmm0
+asm: addr32 phaddw (%esp),%xmm0
+hex: 67 66 0f 38 01 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+# addsd (%esp), %xmm0
+asm: addr32 addsd (%esp),%xmm0
+hex: 67 f2 0f 58 04 24
+nc_out: ERROR: More than one (non-REX) prefix byte specified
+nc_out: ERROR: Use of 67 (ADDR16) prefix not allowed by Native Client
+nc_out: ERROR: Assignment to non-64 bit memory address
+
+# mov %eax,%eax
+# phaddw (%r15,%rax),%xmm0
+asm: mov %eax,%eax
+hex: 89 C0
+
+asm: phaddw (%r15,%rax,1),%xmm0
+hex: 66 41 0F 38 01 04 07
+
+asm: mov %eax,%eax
+hex: 89 C0
+
+asm: rex.B; phaddw (%rdi,%rax,1),%xmm0
+hex: 41 66 0F 38 01 04 07
+nc_out: ERROR: REX prefix byte must appear last
+
+# mov %eax,%eax
+# addsd (%r15,%rax),%xmm0
+asm: mov %eax,%eax
+hex: 89 C0
+
+asm: addsd (%r15,%rax,1),%xmm0
+hex: F2 41 0F 58 04 07
+
+asm: mov %eax,%eax
+hex: 89 C0
+
+asm: rex.B; addsd (%rdi,%rax,1),%xmm0
+hex: 41 F2 0F 58 04 07
+nc_out: ERROR: REX prefix byte must appear last
+

Powered by Google App Engine
This is Rietveld 408576698