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

Side by Side Diff: tests/validator/rewrite_nontemporals.c

Issue 1865743002: x86 validator: Implement rewriting "movntps" to "movaps" on x86-32 (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/trusted/validator_ragel/dfa_validate_common.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The Native Client Authors. All rights reserved. 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 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "native_client/src/include/nacl_assert.h" 9 #include "native_client/src/include/nacl_assert.h"
10 10
(...skipping 28 matching lines...) Expand all
39 39
40 /* This compiles to prefetchnta on x86. */ 40 /* This compiles to prefetchnta on x86. */
41 __builtin_prefetch(&g_dest, /* rw= */ 0, /* locality= */ 0); 41 __builtin_prefetch(&g_dest, /* rw= */ 0, /* locality= */ 0);
42 42
43 /* Test movntq. */ 43 /* Test movntq. */
44 reset_test_vars(); 44 reset_test_vars();
45 asm("movq g_src" MEM_SUFFIX ", %%mm0\n" 45 asm("movq g_src" MEM_SUFFIX ", %%mm0\n"
46 "movntq %%mm0, g_dest" MEM_SUFFIX "\n" : : : "mm0"); 46 "movntq %%mm0, g_dest" MEM_SUFFIX "\n" : : : "mm0");
47 ASSERT_EQ(memcmp(g_dest, g_src, 8), 0); 47 ASSERT_EQ(memcmp(g_dest, g_src, 8), 0);
48 48
49 #if defined(__x86_64__)
50 /* Test movntps. */ 49 /* Test movntps. */
51 reset_test_vars(); 50 reset_test_vars();
52 asm("movdqa g_src(%%r15), %%xmm0\n" 51 asm("movdqa g_src" MEM_SUFFIX ", %%xmm0\n"
53 "movntps %%xmm0, g_dest(%%r15)\n" : : : "xmm0"); 52 "movntps %%xmm0, g_dest" MEM_SUFFIX "\n" : : : "xmm0");
54 ASSERT_EQ(memcmp(g_dest, g_src, 16), 0); 53 ASSERT_EQ(memcmp(g_dest, g_src, 16), 0);
55 54
55 #if defined(__x86_64__)
56 /* Test movnti, using 32-bit operand. */ 56 /* Test movnti, using 32-bit operand. */
57 reset_test_vars(); 57 reset_test_vars();
58 asm("mov g_src(%%r15), %%eax\n" 58 asm("mov g_src(%%r15), %%eax\n"
59 "movnti %%eax, g_dest(%%r15)\n" : : : "eax"); 59 "movnti %%eax, g_dest(%%r15)\n" : : : "eax");
60 ASSERT_EQ(memcmp(g_dest, g_src, 4), 0); 60 ASSERT_EQ(memcmp(g_dest, g_src, 4), 0);
61 61
62 /* Test movnti, using 64-bit operand. */ 62 /* Test movnti, using 64-bit operand. */
63 reset_test_vars(); 63 reset_test_vars();
64 asm("mov g_src(%%r15), %%rax\n" 64 asm("mov g_src(%%r15), %%rax\n"
65 "movnti %%rax, g_dest(%%r15)\n" : : : "rax"); 65 "movnti %%rax, g_dest(%%r15)\n" : : : "rax");
(...skipping 15 matching lines...) Expand all
81 asm("mov g_src(%%r15), %%rax\n" 81 asm("mov g_src(%%r15), %%rax\n"
82 "movnti %%rax, g_dest(%%rip)\n" : : : "rax"); 82 "movnti %%rax, g_dest(%%rip)\n" : : : "rax");
83 ASSERT_EQ(memcmp(g_dest, g_src, 8), 0); 83 ASSERT_EQ(memcmp(g_dest, g_src, 8), 0);
84 84
85 /* Test prefetchnta using RIP-relative addressing. */ 85 /* Test prefetchnta using RIP-relative addressing. */
86 asm("prefetchnta g_dest(%rip)\n"); 86 asm("prefetchnta g_dest(%rip)\n");
87 #endif 87 #endif
88 88
89 return 0; 89 return 0;
90 } 90 }
OLDNEW
« no previous file with comments | « src/trusted/validator_ragel/dfa_validate_common.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698