Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
|
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.
| |
| 7 .data | |
| 8 | |
| 9 /* 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.
| |
| 10 * '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.
| |
| 11 * compilers. */ | |
| 12 .macro global_bytes name | |
| 13 .global \name | |
| 14 \name: | |
| 15 .global _\name | |
| 16 _\name: | |
| 17 .endm | |
| 18 | |
| 19 global_bytes no_rewrite_code | |
| 20 mov %edi,%edi | |
| 21 movnti %rax,0x68(%r15,%rdi,1) | |
| 22 .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.
| |
| 23 | |
| 24 global_bytes no_rewrite_code_post_rewrite | |
| 25 mov %edi,%edi | |
| 26 movnti %rax,0x68(%r15,%rdi,1) | |
| 27 .byte 0 | |
| 28 | |
| 29 global_bytes prefetchnta_code | |
| 30 mov %edi,%edi | |
| 31 prefetchnta (%r15,%rdi,1) | |
| 32 .byte 0 | |
| 33 | |
| 34 global_bytes prefetchnta_code_post_rewrite | |
| 35 mov %edi,%edi | |
| 36 nop | |
| 37 nop | |
| 38 nop | |
| 39 nop | |
| 40 nop | |
| 41 .byte 0 | |
| 42 | |
| 43 global_bytes movntps_code | |
| 44 mov %ebx,%ebx | |
| 45 movntps %xmm0,(%r15,%rbx,1) | |
| 46 .byte 0 | |
| 47 | |
| 48 global_bytes movntps_code_post_rewrite | |
| 49 mov %ebx,%ebx | |
| 50 movaps %xmm0,(%r15,%rbx,1) | |
| 51 .byte 0 | |
| 52 | |
| 53 global_bytes movnti_code | |
| 54 mov %edi,%edi | |
| 55 movnti %rax,0x68(%r15,%rdi,1) | |
| 56 .byte 0 | |
| 57 | |
| 58 global_bytes movnti_code_post_rewrite | |
| 59 mov %edi,%edi | |
| 60 mov %rax,0x68(%r15,%rdi,1) | |
| 61 nop | |
| 62 .byte 0 | |
| 63 | |
| 64 global_bytes movnti_code2 | |
| 65 mov %edx,%edx | |
| 66 movnti %r9d,(%r15,%rdx,1) | |
| 67 .byte 0 | |
| 68 | |
| 69 global_bytes movnti_code2_post_rewrite | |
| 70 mov %edx,%edx | |
| 71 mov %r9d,(%r15,%rdx,1) | |
| 72 nop | |
| 73 .byte 0 | |
| 74 | |
| 75 global_bytes movnti_rip_relative_code | |
| 76 movnti %rax,0x20(%rip) | |
| 77 .byte 0 | |
| 78 | |
| 79 global_bytes movnti_rip_relative_code_post_rewrite | |
| 80 nop | |
| 81 mov %rax,0x20(%rip) | |
| 82 .byte 0 | |
| 83 | |
| 84 global_bytes movntdq_code | |
| 85 mov %edx,%edx | |
| 86 movntdq %xmm0,0x10(%r15,%rdx,1) | |
| 87 .byte 0 | |
| 88 | |
| 89 global_bytes movntdq_code_post_rewrite | |
| 90 mov %edx,%edx | |
| 91 movdqa %xmm0,0x10(%r15,%rdx,1) | |
| 92 .byte 0 | |
| 93 | |
| 94 global_bytes movntdq_code2 | |
| 95 mov %ecx,%ecx | |
| 96 movntdq %xmm15,(%r15,%rcx,1) | |
| 97 .byte 0 | |
| 98 | |
| 99 global_bytes movntdq_code2_post_rewrite | |
| 100 mov %ecx,%ecx | |
| 101 movdqa %xmm15,(%r15,%rcx,1) | |
| 102 .byte 0 | |
| 103 | |
| 104 global_bytes multiple_movnt_code | |
| 105 mov %edi,%edi | |
| 106 movnti %rax,0x68(%r15,%rdi,1) | |
| 107 mov %edx,%edx | |
| 108 movntdq %xmm0,0x10(%r15,%rdx,1) | |
| 109 .byte 0 | |
| 110 | |
| 111 global_bytes multiple_movnt_code_post_rewrite | |
| 112 mov %edi,%edi | |
| 113 mov %rax,0x68(%r15,%rdi,1) | |
| 114 nop | |
| 115 mov %edx,%edx | |
| 116 movdqa %xmm0,0x10(%r15,%rdx,1) | |
| 117 .byte 0 | |
| 118 | |
| 119 /* size = 32 bytes */ | |
| 120 global_bytes one_bundle_movnt_code | |
| 121 mov %ecx,%ecx | |
| 122 movntdq %xmm15,(%r15,%rcx,1) | |
| 123 mov %ecx,%ecx | |
| 124 movntdq %xmm15,(%r15,%rcx,1) | |
| 125 mov %ecx,%ecx | |
| 126 movntdq %xmm15,(%r15,%rcx,1) | |
| 127 mov %ecx,%ecx | |
| 128 movntdq %xmm15,(%r15,%rcx,1) | |
| 129 .byte 0 | |
| 130 | |
| 131 /* size = 32 bytes */ | |
| 132 global_bytes one_bundle_movnt_code_post_rewrite | |
| 133 mov %ecx,%ecx | |
| 134 movdqa %xmm15,(%r15,%rcx,1) | |
| 135 mov %ecx,%ecx | |
| 136 movdqa %xmm15,(%r15,%rcx,1) | |
| 137 mov %ecx,%ecx | |
| 138 movdqa %xmm15,(%r15,%rcx,1) | |
| 139 mov %ecx,%ecx | |
| 140 movdqa %xmm15,(%r15,%rcx,1) | |
| 141 .byte 0 | |
| 142 | |
| 143 global_bytes last_movnti_cross_bundle_by_one | |
| 144 mov %ecx,%ecx /* offset 0, length 2 */ | |
| 145 movntdq %xmm15,(%r15,%rcx,1) /* offset 2, length 6 */ | |
| 146 mov %ecx,%ecx /* offset 8, length 2 */ | |
| 147 movntdq %xmm15,(%r15,%rcx,1) /* offset 10, length 6 */ | |
| 148 mov %ecx,%ecx /* offset 16, length 2 */ | |
| 149 movntdq %xmm15,(%r15,%rcx,1) /* offset 18, length 6 */ | |
| 150 nop /* offset 24, length 1 */ | |
| 151 mov %edx,%edx /* offset 25, length 2 */ | |
| 152 /* the last byte of the following instruction is at offset 32 */ | |
| 153 movnti %r9d,(%r15,%rdx,1) /* offset 27, length 5 */ | |
| 154 .byte 0 | |
| 155 | |
| 156 global_bytes last_movnti_cross_bundle_by_one_post_rewrite | |
| 157 mov %ecx,%ecx /* offset 0, length 2 */ | |
| 158 movdqa %xmm15,(%r15,%rcx,1) /* offset 2, length 6 */ | |
| 159 mov %ecx,%ecx /* offset 8, length 2 */ | |
| 160 movdqa %xmm15,(%r15,%rcx,1) /* offset 10, length 6 */ | |
| 161 mov %ecx,%ecx /* offset 16, length 2 */ | |
| 162 movdqa %xmm15,(%r15,%rcx,1) /* offset 18, length 6 */ | |
| 163 nop /* offset 24, length 1 */ | |
| 164 mov %edx,%edx /* offset 25, length 2 */ | |
| 165 mov %r9d,(%r15,%rdx,1) /* offset 27, length 4 */ | |
| 166 nop /* offset 32, length 1 */ | |
| 167 .byte 0 | |
| OLD | NEW |