Index: src/trusted/validator/validation_rewrite_64_test_data.S |
diff --git a/src/trusted/validator/validation_rewrite_64_test_data.S b/src/trusted/validator/validation_rewrite_64_test_data.S |
new file mode 100644 |
index 0000000000000000000000000000000000000000..96852d98a2e6de79804e6183a7bfccc44aeb795c |
--- /dev/null |
+++ b/src/trusted/validator/validation_rewrite_64_test_data.S |
@@ -0,0 +1,167 @@ |
+/* |
+ * Copyright 2015 The Native Client Authors. All rights reserved. |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
Mark Seaborn
2015/08/14 21:12:59
Does the test have an example of a non-temporal wr
ruiq
2015/08/15 04:46:40
Done.
|
+.data |
+ |
+/* This macro is used to define two global symbols for the same byte sequence: |
Mark Seaborn
2015/08/14 21:12:59
Nit: Use the NaCl style for multiline comments, wi
ruiq
2015/08/15 04:46:40
Done.
|
+ * 'name' and '_name'. This is to work around the linkage issue across OS and |
Mark Seaborn
2015/08/14 21:12:59
There's already a macro for doing this, "IDENTIFIE
ruiq
2015/08/15 04:46:40
Done.
|
+ * compilers. */ |
+.macro global_bytes name |
+ .global \name |
+\name: |
+ .global _\name |
+_\name: |
+.endm |
+ |
+ global_bytes no_rewrite_code |
+ mov %edi,%edi |
+ movnti %rax,0x68(%r15,%rdi,1) |
+ .byte 0 |
Mark Seaborn
2015/08/14 21:12:59
What is this for?
Oh, you're using strlen() on x8
ruiq
2015/08/15 04:46:40
Now using two labels: xx_code, and xx_code_end.
|
+ |
+ global_bytes no_rewrite_code_post_rewrite |
+ mov %edi,%edi |
+ movnti %rax,0x68(%r15,%rdi,1) |
+ .byte 0 |
+ |
+ global_bytes prefetchnta_code |
+ mov %edi,%edi |
+ prefetchnta (%r15,%rdi,1) |
+ .byte 0 |
+ |
+ global_bytes prefetchnta_code_post_rewrite |
+ mov %edi,%edi |
+ nop |
+ nop |
+ nop |
+ nop |
+ nop |
+ .byte 0 |
+ |
+ global_bytes movntps_code |
+ mov %ebx,%ebx |
+ movntps %xmm0,(%r15,%rbx,1) |
+ .byte 0 |
+ |
+ global_bytes movntps_code_post_rewrite |
+ mov %ebx,%ebx |
+ movaps %xmm0,(%r15,%rbx,1) |
+ .byte 0 |
+ |
+ global_bytes movnti_code |
+ mov %edi,%edi |
+ movnti %rax,0x68(%r15,%rdi,1) |
+ .byte 0 |
+ |
+ global_bytes movnti_code_post_rewrite |
+ mov %edi,%edi |
+ mov %rax,0x68(%r15,%rdi,1) |
+ nop |
+ .byte 0 |
+ |
+ global_bytes movnti_code2 |
+ mov %edx,%edx |
+ movnti %r9d,(%r15,%rdx,1) |
+ .byte 0 |
+ |
+ global_bytes movnti_code2_post_rewrite |
+ mov %edx,%edx |
+ mov %r9d,(%r15,%rdx,1) |
+ nop |
+ .byte 0 |
+ |
+ global_bytes movnti_rip_relative_code |
+ movnti %rax,0x20(%rip) |
+ .byte 0 |
+ |
+ global_bytes movnti_rip_relative_code_post_rewrite |
+ nop |
+ mov %rax,0x20(%rip) |
+ .byte 0 |
+ |
+ global_bytes movntdq_code |
+ mov %edx,%edx |
+ movntdq %xmm0,0x10(%r15,%rdx,1) |
+ .byte 0 |
+ |
+ global_bytes movntdq_code_post_rewrite |
+ mov %edx,%edx |
+ movdqa %xmm0,0x10(%r15,%rdx,1) |
+ .byte 0 |
+ |
+ global_bytes movntdq_code2 |
+ mov %ecx,%ecx |
+ movntdq %xmm15,(%r15,%rcx,1) |
+ .byte 0 |
+ |
+ global_bytes movntdq_code2_post_rewrite |
+ mov %ecx,%ecx |
+ movdqa %xmm15,(%r15,%rcx,1) |
+ .byte 0 |
+ |
+ global_bytes multiple_movnt_code |
+ mov %edi,%edi |
+ movnti %rax,0x68(%r15,%rdi,1) |
+ mov %edx,%edx |
+ movntdq %xmm0,0x10(%r15,%rdx,1) |
+ .byte 0 |
+ |
+ global_bytes multiple_movnt_code_post_rewrite |
+ mov %edi,%edi |
+ mov %rax,0x68(%r15,%rdi,1) |
+ nop |
+ mov %edx,%edx |
+ movdqa %xmm0,0x10(%r15,%rdx,1) |
+ .byte 0 |
+ |
+ /* size = 32 bytes */ |
+ global_bytes one_bundle_movnt_code |
+ mov %ecx,%ecx |
+ movntdq %xmm15,(%r15,%rcx,1) |
+ mov %ecx,%ecx |
+ movntdq %xmm15,(%r15,%rcx,1) |
+ mov %ecx,%ecx |
+ movntdq %xmm15,(%r15,%rcx,1) |
+ mov %ecx,%ecx |
+ movntdq %xmm15,(%r15,%rcx,1) |
+ .byte 0 |
+ |
+ /* size = 32 bytes */ |
+ global_bytes one_bundle_movnt_code_post_rewrite |
+ mov %ecx,%ecx |
+ movdqa %xmm15,(%r15,%rcx,1) |
+ mov %ecx,%ecx |
+ movdqa %xmm15,(%r15,%rcx,1) |
+ mov %ecx,%ecx |
+ movdqa %xmm15,(%r15,%rcx,1) |
+ mov %ecx,%ecx |
+ movdqa %xmm15,(%r15,%rcx,1) |
+ .byte 0 |
+ |
+ global_bytes last_movnti_cross_bundle_by_one |
+ mov %ecx,%ecx /* offset 0, length 2 */ |
+ movntdq %xmm15,(%r15,%rcx,1) /* offset 2, length 6 */ |
+ mov %ecx,%ecx /* offset 8, length 2 */ |
+ movntdq %xmm15,(%r15,%rcx,1) /* offset 10, length 6 */ |
+ mov %ecx,%ecx /* offset 16, length 2 */ |
+ movntdq %xmm15,(%r15,%rcx,1) /* offset 18, length 6 */ |
+ nop /* offset 24, length 1 */ |
+ mov %edx,%edx /* offset 25, length 2 */ |
+ /* the last byte of the following instruction is at offset 32 */ |
+ movnti %r9d,(%r15,%rdx,1) /* offset 27, length 5 */ |
+ .byte 0 |
+ |
+ global_bytes last_movnti_cross_bundle_by_one_post_rewrite |
+ mov %ecx,%ecx /* offset 0, length 2 */ |
+ movdqa %xmm15,(%r15,%rcx,1) /* offset 2, length 6 */ |
+ mov %ecx,%ecx /* offset 8, length 2 */ |
+ movdqa %xmm15,(%r15,%rcx,1) /* offset 10, length 6 */ |
+ mov %ecx,%ecx /* offset 16, length 2 */ |
+ movdqa %xmm15,(%r15,%rcx,1) /* offset 18, length 6 */ |
+ nop /* offset 24, length 1 */ |
+ mov %edx,%edx /* offset 25, length 2 */ |
+ mov %r9d,(%r15,%rdx,1) /* offset 27, length 4 */ |
+ nop /* offset 32, length 1 */ |
+ .byte 0 |