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

Issue 1309953002: x86 validator: Rewrite non-temporal stores into cached memory accesses (Closed)

Created:
5 years, 4 months ago by Mark Seaborn
Modified:
4 years, 10 months ago
Reviewers:
Petr Hosek
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/src/native_client.git@master
Target Ref:
refs/heads/master
Project:
nacl
Visibility:
Public.

Description

x86 validator: Rewrite non-temporal stores into cached memory accesses * This rewrites the set of non-temporal store/prefetch instructions that are currently used in the Chrome Web Store, and rejects the other non-temporal store/prefetch instructions. * This adds two sets of tests: * src/trusted/validator/validation_rewrite_test.cc checks for exact rewrites. * tests/validator/rewrite_nontemporals.c tests that the rewritten instructions have the expected behaviour. * validation_cache_test.cc: Change the instruction used in the test case, because "prefetchnta (%{esp,rsp})" is no longer accepted: prefetchnta is not allowed at all on x86-32, and it's only allowed with a REX prefix on x86-64. * This is based on Rui Qiao's change, https://codereview.chromium.org/1269113003/, patch set 29. BUG=https://code.google.com/p/chromium/issues/detail?id=500026 TEST=run_validation_rewrite_test run_rewrite_nontemporals_test run_validation_cache_test Committed: https://chromium.googlesource.com/native_client/src/native_client/+/3a518c77e47e7e1f0fb65e00e1115103f0e24ba6

Patch Set 1 #

Patch Set 2 : Cleanups + add test #

Patch Set 3 : Cleanups #

Patch Set 4 : Merge tests #

Patch Set 5 : Disable for glibc #

Patch Set 6 : Clean up tests #

Patch Set 7 : Fix Windows build #

Patch Set 8 : Actually fix Windows build #

Patch Set 9 : Cleanups + add one more test #

Patch Set 10 : Fix undetected -Wundef error #

Total comments: 2

Patch Set 11 : Review nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+629 lines, -26 lines) Patch
M src/trusted/validator/build.scons View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
M src/trusted/validator/validation_cache_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -1 line 0 comments Download
M src/trusted/validator/validation_disable_nontemporals_test.cc View 1 2 3 4 5 6 7 8 2 chunks +19 lines, -7 lines 0 comments Download
A src/trusted/validator/validation_rewrite_test.cc View 1 2 3 4 5 6 7 1 chunk +173 lines, -0 lines 0 comments Download
A src/trusted/validator/validation_rewrite_test_data.S View 1 2 3 1 chunk +202 lines, -0 lines 0 comments Download
M src/trusted/validator_ragel/dfa_validate_common.c View 1 2 3 4 5 6 7 8 6 chunks +110 lines, -18 lines 0 comments Download
M tests/validator/nacl.scons View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download
A tests/validator/rewrite_nontemporals.c View 1 2 3 4 5 6 7 8 9 10 1 chunk +86 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
Mark Seaborn
4 years, 10 months ago (2016-02-11 20:58:13 UTC) #3
Petr Hosek
lgtm https://codereview.chromium.org/1309953002/diff/180001/tests/validator/rewrite_nontemporals.c File tests/validator/rewrite_nontemporals.c (right): https://codereview.chromium.org/1309953002/diff/180001/tests/validator/rewrite_nontemporals.c#newcode2 tests/validator/rewrite_nontemporals.c:2: * Copyright (c) 2016 The Native Client Authors. ...
4 years, 10 months ago (2016-02-11 23:59:53 UTC) #4
Mark Seaborn
https://codereview.chromium.org/1309953002/diff/180001/tests/validator/rewrite_nontemporals.c File tests/validator/rewrite_nontemporals.c (right): https://codereview.chromium.org/1309953002/diff/180001/tests/validator/rewrite_nontemporals.c#newcode2 tests/validator/rewrite_nontemporals.c:2: * Copyright (c) 2016 The Native Client Authors. All ...
4 years, 10 months ago (2016-02-12 00:32:19 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309953002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309953002/200001
4 years, 10 months ago (2016-02-12 00:32:35 UTC) #8
commit-bot: I haz the power
Failed to request the patch to try. Please note that binary files are still unsupported ...
4 years, 10 months ago (2016-02-12 01:25:03 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309953002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309953002/200001
4 years, 10 months ago (2016-02-12 02:06:50 UTC) #12
commit-bot: I haz the power
Committed patchset #11 (id:200001) as https://chromium.googlesource.com/native_client/src/native_client/+/3a518c77e47e7e1f0fb65e00e1115103f0e24ba6
4 years, 10 months ago (2016-02-12 02:07:47 UTC) #14
Mark Seaborn
4 years, 10 months ago (2016-02-12 20:30:53 UTC) #15
Message was sent while issue was closed.
I noticed this caused some failures in the toolchain torture tests on the
toolchain FYI bots:

https://build.chromium.org/p/client.nacl.toolchain/builders/linux-pnacl-x86_6...
https://build.chromium.org/p/client.nacl.toolchain/builders/linux-pnacl-x86_6...

Basically some tests for __builtin_prefetch() are generating "prefetchnta"
(documented here:
https://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Other-Builtins.html).

I'll fix that by changing the validator to rewrite more cases.

Powered by Google App Engine
This is Rietveld 408576698