OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 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 |
| 7 #include "native_client/src/include/build_config.h" |
| 8 #include "native_client/src/include/nacl_asm.h" |
| 9 |
| 10 #define GLOBAL_SYM(name) .global IDENTIFIER(name); IDENTIFIER(name): |
| 11 |
| 12 .data |
| 13 |
| 14 #if NACL_BUILD_SUBARCH == 32 |
| 15 |
| 16 GLOBAL_SYM(no_rewrite_code) |
| 17 movntq %mm0, (%ebx) |
| 18 GLOBAL_SYM(no_rewrite_code_end) |
| 19 |
| 20 GLOBAL_SYM(no_rewrite_code_post_rewrite) |
| 21 movntq %mm0, (%ebx) |
| 22 GLOBAL_SYM(no_rewrite_code_post_rewrite_end) |
| 23 |
| 24 GLOBAL_SYM(movntq_code) |
| 25 movntq %mm0, (%ebx) |
| 26 GLOBAL_SYM(movntq_code_end) |
| 27 |
| 28 GLOBAL_SYM(movntq_code_post_rewrite) |
| 29 movq %mm0, (%ebx) |
| 30 GLOBAL_SYM(movntq_code_post_rewrite_end) |
| 31 |
| 32 GLOBAL_SYM(movntdq_code) |
| 33 movntdq %xmm0, (%edx) |
| 34 GLOBAL_SYM(movntdq_code_end) |
| 35 |
| 36 GLOBAL_SYM(movntdq_code_post_rewrite) |
| 37 movdqa %xmm0, (%edx) |
| 38 GLOBAL_SYM(movntdq_code_post_rewrite_end) |
| 39 |
| 40 #else |
| 41 |
| 42 GLOBAL_SYM(no_rewrite_code) |
| 43 mov %edi,%edi |
| 44 movnti %rax,0x68(%r15,%rdi,1) |
| 45 GLOBAL_SYM(no_rewrite_code_end) |
| 46 |
| 47 GLOBAL_SYM(no_rewrite_code_post_rewrite) |
| 48 mov %edi,%edi |
| 49 movnti %rax,0x68(%r15,%rdi,1) |
| 50 GLOBAL_SYM(no_rewrite_code_post_rewrite_end) |
| 51 |
| 52 GLOBAL_SYM(off_webstore_movnt_code) |
| 53 mov %ebx,%ebx |
| 54 movntq %mm0,(%rbx) |
| 55 GLOBAL_SYM(off_webstore_movnt_code_end) |
| 56 |
| 57 GLOBAL_SYM(off_webstore_movnt_code_post_rewrite) |
| 58 mov %ebx,%ebx |
| 59 movntq %mm0,(%rbx) |
| 60 GLOBAL_SYM(off_webstore_movnt_code_post_rewrite_end) |
| 61 |
| 62 GLOBAL_SYM(prefetchnta_code) |
| 63 mov %edi,%edi |
| 64 prefetchnta (%r15,%rdi,1) |
| 65 GLOBAL_SYM(prefetchnta_code_end) |
| 66 |
| 67 GLOBAL_SYM(prefetchnta_code_post_rewrite) |
| 68 mov %edi,%edi |
| 69 nop |
| 70 nop |
| 71 nop |
| 72 nop |
| 73 nop |
| 74 GLOBAL_SYM(prefetchnta_code_post_rewrite_end) |
| 75 |
| 76 GLOBAL_SYM(movntps_code) |
| 77 mov %ebx,%ebx |
| 78 movntps %xmm0,(%r15,%rbx,1) |
| 79 GLOBAL_SYM(movntps_code_end) |
| 80 |
| 81 GLOBAL_SYM(movntps_code_post_rewrite) |
| 82 mov %ebx,%ebx |
| 83 movaps %xmm0,(%r15,%rbx,1) |
| 84 GLOBAL_SYM(movntps_code_post_rewrite_end) |
| 85 |
| 86 GLOBAL_SYM(movnti_code) |
| 87 mov %edi,%edi |
| 88 movnti %rax,0x68(%r15,%rdi,1) |
| 89 GLOBAL_SYM(movnti_code_end) |
| 90 |
| 91 GLOBAL_SYM(movnti_code_post_rewrite) |
| 92 mov %edi,%edi |
| 93 mov %rax,0x68(%r15,%rdi,1) |
| 94 nop |
| 95 GLOBAL_SYM(movnti_code_post_rewrite_end) |
| 96 |
| 97 GLOBAL_SYM(movnti_code2) |
| 98 mov %edx,%edx |
| 99 movnti %r9d,(%r15,%rdx,1) |
| 100 GLOBAL_SYM(movnti_code2_end) |
| 101 |
| 102 GLOBAL_SYM(movnti_code2_post_rewrite) |
| 103 mov %edx,%edx |
| 104 mov %r9d,(%r15,%rdx,1) |
| 105 nop |
| 106 GLOBAL_SYM(movnti_code2_post_rewrite_end) |
| 107 |
| 108 GLOBAL_SYM(movnti_rip_relative_code) |
| 109 movnti %rax,0x20(%rip) |
| 110 GLOBAL_SYM(movnti_rip_relative_code_end) |
| 111 |
| 112 GLOBAL_SYM(movnti_rip_relative_code_post_rewrite) |
| 113 nop |
| 114 mov %rax,0x20(%rip) |
| 115 GLOBAL_SYM(movnti_rip_relative_code_post_rewrite_end) |
| 116 |
| 117 GLOBAL_SYM(movntdq_code) |
| 118 mov %edx,%edx |
| 119 movntdq %xmm0,0x10(%r15,%rdx,1) |
| 120 GLOBAL_SYM(movntdq_code_end) |
| 121 |
| 122 GLOBAL_SYM(movntdq_code_post_rewrite) |
| 123 mov %edx,%edx |
| 124 movdqa %xmm0,0x10(%r15,%rdx,1) |
| 125 GLOBAL_SYM(movntdq_code_post_rewrite_end) |
| 126 |
| 127 GLOBAL_SYM(movntdq_code2) |
| 128 mov %ecx,%ecx |
| 129 movntdq %xmm15,(%r15,%rcx,1) |
| 130 GLOBAL_SYM(movntdq_code2_end) |
| 131 |
| 132 GLOBAL_SYM(movntdq_code2_post_rewrite) |
| 133 mov %ecx,%ecx |
| 134 movdqa %xmm15,(%r15,%rcx,1) |
| 135 GLOBAL_SYM(movntdq_code2_post_rewrite_end) |
| 136 |
| 137 GLOBAL_SYM(multiple_movnt_code) |
| 138 mov %edi,%edi |
| 139 movnti %rax,0x68(%r15,%rdi,1) |
| 140 mov %edx,%edx |
| 141 movntdq %xmm0,0x10(%r15,%rdx,1) |
| 142 GLOBAL_SYM(multiple_movnt_code_end) |
| 143 |
| 144 GLOBAL_SYM(multiple_movnt_code_post_rewrite) |
| 145 mov %edi,%edi |
| 146 mov %rax,0x68(%r15,%rdi,1) |
| 147 nop |
| 148 mov %edx,%edx |
| 149 movdqa %xmm0,0x10(%r15,%rdx,1) |
| 150 GLOBAL_SYM(multiple_movnt_code_post_rewrite_end) |
| 151 |
| 152 /* size = 32 bytes */ |
| 153 GLOBAL_SYM(one_bundle_movnt_code) |
| 154 mov %ecx,%ecx |
| 155 movntdq %xmm15,(%r15,%rcx,1) |
| 156 mov %ecx,%ecx |
| 157 movntdq %xmm15,(%r15,%rcx,1) |
| 158 mov %ecx,%ecx |
| 159 movntdq %xmm15,(%r15,%rcx,1) |
| 160 mov %ecx,%ecx |
| 161 movntdq %xmm15,(%r15,%rcx,1) |
| 162 GLOBAL_SYM(one_bundle_movnt_code_end) |
| 163 |
| 164 /* size = 32 bytes */ |
| 165 GLOBAL_SYM(one_bundle_movnt_code_post_rewrite) |
| 166 mov %ecx,%ecx |
| 167 movdqa %xmm15,(%r15,%rcx,1) |
| 168 mov %ecx,%ecx |
| 169 movdqa %xmm15,(%r15,%rcx,1) |
| 170 mov %ecx,%ecx |
| 171 movdqa %xmm15,(%r15,%rcx,1) |
| 172 mov %ecx,%ecx |
| 173 movdqa %xmm15,(%r15,%rcx,1) |
| 174 GLOBAL_SYM(one_bundle_movnt_code_post_rewrite_end) |
| 175 |
| 176 GLOBAL_SYM(last_movnti_cross_bundle_by_one) |
| 177 mov %ecx,%ecx /* offset 0, length 2 */ |
| 178 movntdq %xmm15,(%r15,%rcx,1) /* offset 2, length 6 */ |
| 179 mov %ecx,%ecx /* offset 8, length 2 */ |
| 180 movntdq %xmm15,(%r15,%rcx,1) /* offset 10, length 6 */ |
| 181 mov %ecx,%ecx /* offset 16, length 2 */ |
| 182 movntdq %xmm15,(%r15,%rcx,1) /* offset 18, length 6 */ |
| 183 nop /* offset 24, length 1 */ |
| 184 mov %edx,%edx /* offset 25, length 2 */ |
| 185 /* the last byte of the following instruction is at offset 32 */ |
| 186 movnti %r9d,(%r15,%rdx,1) /* offset 27, length 5 */ |
| 187 GLOBAL_SYM(last_movnti_cross_bundle_by_one_end) |
| 188 |
| 189 GLOBAL_SYM(last_movnti_cross_bundle_by_one_post_rewrite) |
| 190 mov %ecx,%ecx /* offset 0, length 2 */ |
| 191 movdqa %xmm15,(%r15,%rcx,1) /* offset 2, length 6 */ |
| 192 mov %ecx,%ecx /* offset 8, length 2 */ |
| 193 movdqa %xmm15,(%r15,%rcx,1) /* offset 10, length 6 */ |
| 194 mov %ecx,%ecx /* offset 16, length 2 */ |
| 195 movdqa %xmm15,(%r15,%rcx,1) /* offset 18, length 6 */ |
| 196 nop /* offset 24, length 1 */ |
| 197 mov %edx,%edx /* offset 25, length 2 */ |
| 198 mov %r9d,(%r15,%rdx,1) /* offset 27, length 4 */ |
| 199 nop /* offset 32, length 1 */ |
| 200 GLOBAL_SYM(last_movnti_cross_bundle_by_one_post_rewrite_end) |
| 201 |
| 202 #endif |
OLD | NEW |