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

Issue 1278173009: Inline memove for small constant sizes and refactor memcpy and memset. (Closed)

Created:
5 years, 4 months ago by ascull
Modified:
5 years, 4 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Inline memove for small constant sizes and refactor memcpy and memset. The memory intrinsics are only optimized at -O1 and higher unless the -fmem-intrin-opt flag is set to force to optimization to take place. This change also introduces the xchg instruction for two register operands. This is no longer used in the memory intrinsic lowering (or by anything else) but the implementation is left for future use. BUG= R=jvoung@chromium.org, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=cfa628b5f7612d202de234980b21bd6d59a11998

Patch Set 1 #

Total comments: 28

Patch Set 2 : Fix memmove and add tests #

Total comments: 4

Patch Set 3 : Simplify xtests and add flags for memory intrinsic optimization. #

Total comments: 31

Patch Set 4 : #

Patch Set 5 : r1 == rax #

Total comments: 15

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : Rebase onto master #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+886 lines, -202 lines) Patch
M Makefile.standalone View 1 2 3 4 5 6 7 2 chunks +8 lines, -2 lines 0 comments Download
M crosstest/crosstest.cfg View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M crosstest/mem_intrin.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -3 lines 0 comments Download
M crosstest/mem_intrin.cpp View 1 2 3 4 5 6 7 2 chunks +30 lines, -24 lines 0 comments Download
A crosstest/mem_intrin.def View 1 2 3 4 5 1 chunk +258 lines, -0 lines 0 comments Download
M crosstest/mem_intrin_main.cpp View 1 2 3 4 5 6 7 2 chunks +24 lines, -21 lines 0 comments Download
M pydir/crosstest.py View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M src/IceAssemblerX86Base.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/IceAssemblerX86BaseImpl.h View 1 2 3 4 5 6 7 1 chunk +23 lines, -0 lines 0 comments Download
M src/IceClFlags.h View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M src/IceClFlags.cpp View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M src/IceInstX86BaseImpl.h View 1 2 3 4 5 6 7 1 chunk +17 lines, -7 lines 0 comments Download
M src/IceTargetLowering.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/IceTargetLowering.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/IceTargetLoweringX8632Traits.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M src/IceTargetLoweringX8664Traits.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M src/IceTargetLoweringX86Base.h View 1 2 3 4 5 6 7 2 chunks +23 lines, -2 lines 0 comments Download
M src/IceTargetLoweringX86BaseImpl.h View 1 2 3 4 5 6 7 8 chunks +186 lines, -129 lines 0 comments Download
M tests_lit/llvm2ice_tests/nacl-mem-intrinsics.ll View 1 2 3 19 chunks +173 lines, -14 lines 0 comments Download
M unittest/AssemblerX8632/Locked.cpp View 1 2 3 1 chunk +51 lines, -0 lines 0 comments Download
M unittest/AssemblerX8664/Locked.cpp View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (1 generated)
ascull
None of spec2k uses memmove with a constant size so it isn't thoroughly tested. I ...
5 years, 4 months ago (2015-08-11 21:45:30 UTC) #2
Jim Stichnoth
Be sure to get John's feedback on the rex prefix question. Also, I think it's ...
5 years, 4 months ago (2015-08-12 13:41:47 UTC) #3
John
https://codereview.chromium.org/1278173009/diff/1/src/IceAssemblerX86Base.h File src/IceAssemblerX86Base.h (right): https://codereview.chromium.org/1278173009/diff/1/src/IceAssemblerX86Base.h#newcode833 src/IceAssemblerX86Base.h:833: void xchg(Type Ty, typename Traits::GPRRegister reg0, Can you add ...
5 years, 4 months ago (2015-08-12 17:44:58 UTC) #4
ascull
I have added cross tests for different sized. It ugly and verbose so if you ...
5 years, 4 months ago (2015-08-17 22:18:53 UTC) #5
ascull
X-macros to simplify the cross tests and flags to control memory intrinsic optimizations.
5 years, 4 months ago (2015-08-18 16:53:58 UTC) #6
Jim Stichnoth
https://codereview.chromium.org/1278173009/diff/40001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/1278173009/diff/40001/Makefile.standalone#newcode369 Makefile.standalone:369: @echo "Run with DEBUG=1 lest your machine perish." Cool. ...
5 years, 4 months ago (2015-08-18 17:11:28 UTC) #7
jvoung (off chromium)
https://codereview.chromium.org/1278173009/diff/20001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/1278173009/diff/20001/Makefile.standalone#newcode369 Makefile.standalone:369: @echo "Run with DEBUG=1 lest your machine perish." Thanks ...
5 years, 4 months ago (2015-08-18 17:18:23 UTC) #8
ascull
https://codereview.chromium.org/1278173009/diff/20001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/1278173009/diff/20001/Makefile.standalone#newcode369 Makefile.standalone:369: @echo "Run with DEBUG=1 lest your machine perish." On ...
5 years, 4 months ago (2015-08-18 18:38:01 UTC) #9
John
https://codereview.chromium.org/1278173009/diff/40001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/1278173009/diff/40001/Makefile.standalone#newcode369 Makefile.standalone:369: @echo "Run with DEBUG=1 lest your machine perish." On ...
5 years, 4 months ago (2015-08-18 18:51:39 UTC) #10
ascull
https://codereview.chromium.org/1278173009/diff/40001/Makefile.standalone File Makefile.standalone (right): https://codereview.chromium.org/1278173009/diff/40001/Makefile.standalone#newcode369 Makefile.standalone:369: @echo "Run with DEBUG=1 lest your machine perish." On ...
5 years, 4 months ago (2015-08-18 19:03:10 UTC) #11
John
https://codereview.chromium.org/1278173009/diff/40001/src/IceTargetLoweringX86BaseImpl.h File src/IceTargetLoweringX86BaseImpl.h (right): https://codereview.chromium.org/1278173009/diff/40001/src/IceTargetLoweringX86BaseImpl.h#newcode3528 src/IceTargetLoweringX86BaseImpl.h:3528: if ((Ctx->getFlags().getOptLevel() >= Opt_1 || On 2015/08/18 19:03:10, ascull ...
5 years, 4 months ago (2015-08-18 19:34:07 UTC) #12
jvoung (off chromium)
LGTM -- but check with John and Jim if they have other comments https://codereview.chromium.org/1278173009/diff/80001/src/IceTargetLoweringX86BaseImpl.h File ...
5 years, 4 months ago (2015-08-20 15:42:53 UTC) #13
Jim Stichnoth
otherwise lgtm https://codereview.chromium.org/1278173009/diff/80001/crosstest/mem_intrin.def File crosstest/mem_intrin.def (right): https://codereview.chromium.org/1278173009/diff/80001/crosstest/mem_intrin.def#newcode1 crosstest/mem_intrin.def:1: #define VALUES \ I should have mentioned ...
5 years, 4 months ago (2015-08-20 16:57:05 UTC) #14
ascull
https://codereview.chromium.org/1278173009/diff/80001/crosstest/mem_intrin.def File crosstest/mem_intrin.def (right): https://codereview.chromium.org/1278173009/diff/80001/crosstest/mem_intrin.def#newcode1 crosstest/mem_intrin.def:1: #define VALUES \ On 2015/08/20 16:57:04, stichnot wrote: > ...
5 years, 4 months ago (2015-08-20 18:41:56 UTC) #15
ascull
5 years, 4 months ago (2015-08-20 21:23:13 UTC) #16
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as
cfa628b5f7612d202de234980b21bd6d59a11998 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698