OSDN Git Service

android-x86/external-swiftshader.git
8 years agoSubzero: Fix -build-atts option.
Jim Stichnoth [Wed, 13 Jan 2016 21:48:46 +0000 (13:48 -0800)]
Subzero: Fix -build-atts option.

If the default --target option is not actually included in the Subzero build (via llvm/Config/SZTargets.def), then "pnacl-sz --build-atts" will fail.  This is because the attribute printing is done after the GlobalContext is created, which does some amount of Target initialization.

The fix is to move the attribute printing to a point after the flags are parsed and the output streams are created, but before the GlobalContext is created.  This basically disables --build-atts in the browser build, but that should be OK.

BUG= none
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1584923002 .

8 years agoSubzero: Fix g++ warnings.
Jim Stichnoth [Wed, 13 Jan 2016 19:39:15 +0000 (11:39 -0800)]
Subzero: Fix g++ warnings.

This tries to use the same -W options that the buildbots use, to reduce the amount of warning spam in the logs.

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1575873006 .

8 years agoBetter error message for running szbuild.py out of directory.
Sean Klein [Mon, 11 Jan 2016 18:49:25 +0000 (10:49 -0800)]
Better error message for running szbuild.py out of directory.

TEST=Run szbuild.py in a directory which does not include "native_client" as a subdirectory.
BUG=None
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1565963002 .

8 years agoAdd VCMP{s,sz,d,dz} Instructions to ARM integrated assembler.
Karl Schimpf [Mon, 11 Jan 2016 18:12:20 +0000 (10:12 -0800)]
Add VCMP{s,sz,d,dz} Instructions to ARM integrated assembler.

Also fixes bug in emitVFPddd.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1564393002 .

8 years agoRefactor PUSH/POP in ARM assemblers.
Karl Schimpf [Mon, 11 Jan 2016 17:59:19 +0000 (09:59 -0800)]
Refactor PUSH/POP in ARM assemblers.

Refactors methods emit() and emitIAS() of InstARM32Push and InstARM32Pop
to separate out the selection of assembler instructions from instruction
emission, using template methods.

Template method assemble() provides a single implementation for emit() and emitIAS(). This method calls template functions in the assembler to generate textual and binary forms of the instruction.

BUG= None
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1535233002 .

8 years agoSubzero. ARM32. Adds header to auto-generated register def file.
John Porto [Mon, 11 Jan 2016 14:11:00 +0000 (06:11 -0800)]
Subzero. ARM32. Adds header to auto-generated register def file.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1572303002 .

8 years agoFix g++ linking error.
Jim Stichnoth [Mon, 11 Jan 2016 03:46:49 +0000 (19:46 -0800)]
Fix g++ linking error.

The linking errors are the following.  Somehow the clang build succeeds.

.../IceInstARM32.o:IceInstARM32.cpp:(.text$_ZNK3Ice5ARM3220InstARM32ThreeAddrFPILNS0_9InstARM3213InstKindARM32E74EE4dumpEPKNS_3CfgE[__ZNK3Ice5ARM3220InstARM32ThreeAddrFPILNS0_9InstARM3213InstKindARM32E74EE4dumpEPKNS_3CfgE]+0x38): undefined reference to `Ice::ARM32::InstARM32ThreeAddrFP<(Ice::ARM32::InstARM32::InstKindARM32)74>::Opcode'
.../IceInstARM32.o:IceInstARM32.cpp:(.text$_ZNK3Ice5ARM3220InstARM32ThreeAddrFPILNS0_9InstARM3213InstKindARM32E75EE4dumpEPKNS_3CfgE[__ZNK3Ice5ARM3220InstARM32ThreeAddrFPILNS0_9InstARM3213InstKindARM32E75EE4dumpEPKNS_3CfgE]+0x38): undefined reference to `Ice::ARM32::InstARM32ThreeAddrFP<(Ice::ARM32::InstARM32::InstKindARM32)75>::Opcode'
collect2.exe: error: ld returned 1 exit status

BUG= none
TBR=jpp

Review URL: https://codereview.chromium.org/1576823002 .

8 years agoFix the g++ build.
Jim Stichnoth [Sun, 10 Jan 2016 20:53:44 +0000 (12:53 -0800)]
Fix the g++ build.

It turns out that the g++ test build, initiated by "make presubmit", was
actually using clang++ for the build.  This fixes the makefile, plus the
code that actually produces errors under the g++ build.

BUG= none
TBR=jpp

Review URL: https://codereview.chromium.org/1572863003 .

8 years agoadd scripts to doxygen for subzero
Reed Kotler [Sun, 10 Jan 2016 03:10:29 +0000 (19:10 -0800)]
add scripts to doxygen for subzero

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1572143002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoAdd vcvt<c>.f32.f64 and vcvt<c>.f64.32 to ARM.
Karl Schimpf [Fri, 8 Jan 2016 15:31:08 +0000 (07:31 -0800)]
Add vcvt<c>.f32.f64 and vcvt<c>.f64.32 to ARM.

Adds vcvt<c>.f32.f64 and vcvt<c>.f64.32 to the ARM integrated
assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1567623008 .

8 years agomake sure there is always a build directory to put doxgen stuff html in
Reed Kotler [Fri, 8 Jan 2016 05:42:36 +0000 (21:42 -0800)]
make sure there is always a build directory to put doxgen stuff html in

currently if you do a make clean-all or have never done a code build, there will be no build directory and doxygen is going to want to create and put files into build/docs/html

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1567313002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoAdd VMULS and VMULD instructions to integrated ARM assembler.
Karl Schimpf [Thu, 7 Jan 2016 21:46:20 +0000 (13:46 -0800)]
Add VMULS and VMULD instructions to integrated ARM assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1570543002 .

8 years agoAdd VDIVS and VDIVD instructions to the integrated ARM assembler.
Karl Schimpf [Thu, 7 Jan 2016 21:37:39 +0000 (13:37 -0800)]
Add VDIVS and VDIVD instructions to the integrated ARM assembler.

Also fixes some badly named locals for VSUBS and VSUBD.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1568933002 .

8 years agoAdd VSUB{S,D} instructions to the integrated ARM assembler.
Karl Schimpf [Thu, 7 Jan 2016 18:20:27 +0000 (10:20 -0800)]
Add VSUB{S,D} instructions to the integrated ARM assembler.

Also adds missing test case for the VADDD instruction.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1568623003 .

8 years agoMove Doxyfile files to docs and associated makefile. This is a prelude to allowing...
Reed Kotler [Thu, 7 Jan 2016 16:45:13 +0000 (08:45 -0800)]
Move Doxyfile files to docs and associated makefile. This is a prelude to allowing a docs directory for all the RST files as well as expanding the makefile to build the docs for those too, not just the doxygen output.

The doxygen html has been moved to build/docs/html so it's not in a source directory.

Gitignore has been fixed to allow files in docs now without complaining.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1562703002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoAdd VADD instruction to the ARM integrated assembler.
Karl Schimpf [Thu, 7 Jan 2016 15:31:19 +0000 (07:31 -0800)]
Add VADD instruction to the ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1540653003 .

8 years agomove .rst to docs
Reed Kotler [Thu, 7 Jan 2016 01:22:21 +0000 (17:22 -0800)]
move .rst to docs

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1562543002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoSubzero: Enable Non-SFI vector cross tests.
Jim Stichnoth [Wed, 6 Jan 2016 17:34:36 +0000 (09:34 -0800)]
Subzero: Enable Non-SFI vector cross tests.

The driver programs for vector tests use a loop to initialize vector-type values one element at a time.  The PNaCl ABI requires the vector element index to be a constant, and the createConstantInsertExtractElementIndexPass() transformation creates an alloca instruction.  When this alloca is inside a loop, it can (and does in the cross tests) cause a stack overflow.

The workaround here is to use a noinline helper function to do the insertelement.

We didn't run into this problem until now because native and sandbox cross tests build the driver in a different way that presumably avoids running the PNaCl ABI simplification passes.

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1560933002 .

8 years agoSubzero: Add Non-SFI support for x86-32.
Jim Stichnoth [Mon, 4 Jan 2016 23:39:06 +0000 (15:39 -0800)]
Subzero: Add Non-SFI support for x86-32.

The basic model is that each translated function begins with a special "GotVar = getIP" instruction, and each ConstantRelocatable reference is changed to GotVar+ConstantRelocatable@GOTOFF (assuming GotVar is legalized into a physical register).  The getIP instruction is late-lowered into:
  call __Sz_getIP_<reg>
  add <reg>, $_GLOBAL_OFFSET_TABLE_
  mov GotVar, <reg>
Note that _GLOBAL_OFFSET_TABLE_ gets a special relocation type.

The register allocator takes GotVar uses into account, giving appropriate weight toward register allocation.

If there are no uses of GotVar, the getIP instruction gets naturally dead-code eliminated.  Special treatment is needed to prevent this elimination when the only GotVar uses are for (floating point) constant pool values from Phi instructions, since the Phi lowering with its GotVar legalization happens after the main round of register allocation.

The x86 mem operand now has a IsPIC field to indicate whether it has been PIC-legalized.  Mem operands are sometimes legalized more than once, and this IsPIC field keeps GotVar from being added more than once.

We have to limit the aggressiveness of address mode inference, to make sure a register slot is left for the GotVar.

The Subzero runtime has new asm files to implement all possible __Sz_getIP_<reg> helpers.

The szbuild.py script and the spec2k version support Non-SFI builds.  Running spec2k depends on a pending change to the spec2k run_all.sh script.

Read-only data sections need to be named .data.rel.ro instead of .rodata because of PIC rules.

Most cross tests are working, but there is some problem with vector types that seems to be not Subzero related, so most vector tests are disabled for now.

Still to do:

* Fix "--nonsfi --filetype=iasm".  The llvm-mc assembler doesn't properly apply the _GLOBAL_OFFSET_TABLE_ relocation in iasm mode.  Maybe I can find a different syntactic trick that works, or use hybrid iasm for this limited case.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4327
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1506653002 .

8 years agoSubzero. ARM32. Materializes the register table.
John Porto [Mon, 4 Jan 2016 21:45:26 +0000 (13:45 -0800)]
Subzero. ARM32. Materializes the register table.

This CL modifies the ARM32 backend so that the REGARM32_TABLE is only
expanded once (to initialize a constexpr array.) This change decreased
the backend size in roughly ~80k.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1554263002 .

8 years agoSubzero. ARM32. Adds an IsGPR attribute to the register tables.
John Porto [Mon, 4 Jan 2016 17:49:55 +0000 (09:49 -0800)]
Subzero. ARM32. Adds an IsGPR attribute to the register tables.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1554203002 .

8 years agoSubzero. Code organization.
John Porto [Mon, 4 Jan 2016 17:33:41 +0000 (09:33 -0800)]
Subzero. Code organization.

This CL does more than any CL should.

First, it moves all target-specific classes (TargetLowering, Assembler,
and Instructions) to a target-specific namespace. For example, the
::Ice::TargetX8632 class now lives in ::Ice::X8632::TargetX8632. Same
goes for ARM32, X8664, and MIPS32. Now, we have a ton of redundant
prefixes (it should be pretty obvious that ::Ice::X8632::TargetLowering
is an X8632 target lowering), but this is definitively not something
for this CL.

Second, this CL gets rid of the excessive use of 'typename Foo::Bar'
in the X86 templates. These changes appear more intimidating than they
really are, and they were fairly mechanical.

Third, the x86?? Traitses (gollum!) classes are no longer template
instatiation. The previous X86 templates were parameterized with a
X86 TargetLowering, and they assumed that a MachineTraits<Target>
was defined for that TargetLowering. The X86 templates are now
parameterized with a TraitsType, and different backends may have
completely unrelated traits.

Fourth, the X86 templates are no longer members of
::Ice::X86Internal. Instead, each file #include'ing a Ice*X86Base.h
file need to #define X86NAMESPACE to the namespace where the backend
is being defined. With this change, the template instantiation for
X8632 live in ::Ice::X8632, and, for X8664, in ::Ice::X8664.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1548363002 .

8 years agoSubzero. X86. Refactors initRegisterSet.
John Porto [Wed, 30 Dec 2015 17:55:04 +0000 (09:55 -0800)]
Subzero. X86. Refactors initRegisterSet.

initRegisterSet() for x8632 and x8664 were both huge. This CL refactors
those methods to use a pre-initialized table instead of the result of
expanding the x-macros.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1546373003 .

8 years agoSubzero. Refactoring.
John Porto [Wed, 30 Dec 2015 15:30:10 +0000 (07:30 -0800)]
Subzero. Refactoring.

This is the first step towards hiding backend-specific stuff from the
rest of subzero. In this CL, all the references to target-specific files
(e.g., IceTargetLoweringX8632.h) are removed from target-independent
files.

This CL also changes the named constructors in the Target-specific
classes (e.g., TargetX8632::create()) to return unique_ptrs.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1551633002 .

8 years agomisc cleanup of Compiler::run
Reed Kotler [Mon, 28 Dec 2015 08:10:06 +0000 (00:10 -0800)]
misc cleanup of Compiler::run

This assumes patch from 1534883005 though still needs to rename
validateAndGenerateBuildAttributes to  dumpBuildAttributes

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1541063002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agodoxygenize IceClFlags.cpp
Reed Kotler [Mon, 28 Dec 2015 07:57:10 +0000 (23:57 -0800)]
doxygenize IceClFlags.cpp

This is a first cut at this. More can be done and much of this is just moving what is already in the help for the
commands into Doxygen comments. The documentation can be
expanded to better describe the role of the various
command line options.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1547743002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoSubzero. X8664. Fixes filetype=asm.
John Porto [Thu, 24 Dec 2015 21:22:18 +0000 (13:22 -0800)]
Subzero. X8664. Fixes filetype=asm.

Fixes filetype=asm for x8664.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4077
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1543573002 .

8 years agocleanup and rename validateAndGenerateBuildAttributes
Reed Kotler [Tue, 22 Dec 2015 21:31:59 +0000 (13:31 -0800)]
cleanup and rename validateAndGenerateBuildAttributes

there is no way for these values of build attributes to be other than 0,1 by c++ rules since they are constexpr bool.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1534883005 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoSubzero. x8664. Resurrects the Target.
John Porto [Tue, 22 Dec 2015 16:14:00 +0000 (08:14 -0800)]
Subzero. x8664. Resurrects the Target.

After a hiatus while x32 was not available in nacl's llvm, x8664 is
being revived. Rejoice!

The Target is now back to where it was before: the crosstests pass, and
SPEC2k builds and verifies.

Makefile.standalone still has the crosstests for x8664 disabled while
we wait for all the plumbing that's needed for x32 support on nacl's
toolchain to be available.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4077
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1537703002 .

8 years agofix doxygen for IceClFlagsExtra.h
Reed Kotler [Sun, 20 Dec 2015 15:57:28 +0000 (07:57 -0800)]
fix doxygen for IceClFlagsExtra.h

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1538173002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoFix minimal build for constant VpushVpopMaxConsecRegs.
Karl Schimpf [Fri, 18 Dec 2015 23:10:55 +0000 (15:10 -0800)]
Fix minimal build for constant VpushVpopMaxConsecRegs.

BUG=None
R=sehr@chromium.org

Review URL: https://codereview.chromium.org/1534133003 .

8 years agoAdd VPUSH/VPOP instructions to the ARM32 integrated assembler.
Karl Schimpf [Fri, 18 Dec 2015 16:26:16 +0000 (08:26 -0800)]
Add VPUSH/VPOP instructions to the ARM32 integrated assembler.

Also fixes the corresponding emit methods for vpush and vpop to match
constraint that the maximum number of consecutive registers that can
be pushed/popped is 16.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1532233002 .

8 years agoRemove "Adjuststack" instruction opcode.
Karl Schimpf [Fri, 18 Dec 2015 15:45:05 +0000 (07:45 -0800)]
Remove "Adjuststack" instruction opcode.

Both the X86 and ARM header files define "Adjuststack" in the
enumeration of target specific opcodes. However, it is not used in
either. Removing constant from the enumeration since it is not used.

BUG= None
R=sehr@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1527363004 .

8 years agoadd RBIT instruction to the ARM integrated assembler.
Karl Schimpf [Fri, 18 Dec 2015 15:41:06 +0000 (07:41 -0800)]
add RBIT instruction to the ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1530233004 .

8 years agoAdd mls instruction to the ARM integrated assembler.
Karl Schimpf [Fri, 18 Dec 2015 15:36:02 +0000 (07:36 -0800)]
Add mls instruction to the ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1538443003 .

8 years agoFix regression in SSE instruction opcodes
David Sehr [Fri, 18 Dec 2015 00:53:12 +0000 (16:53 -0800)]
Fix regression in SSE instruction opcodes

BUG=
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1531303004 .

8 years agoadd include files from llvm used by subzero into doxygen
Reed Kotler [Fri, 18 Dec 2015 00:34:00 +0000 (16:34 -0800)]
add include files from llvm used by subzero into doxygen

this fixes a lot of problems with the doxygen. for example
with this, now doxygen correctly understands the cl::opt
variables in ClFlags.cpp as variables, whereas previously
it thought they were functions.

it's possible to make the llvm includes more selective but
this is a good first cut and better than including all
of llvm includes.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1536773003 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoadd predefines to doxygen
Reed Kotler [Fri, 18 Dec 2015 00:31:55 +0000 (16:31 -0800)]
add predefines to doxygen

this is added for both standard doxygen and clang assisted
doxygen (which cannot be turned on yet without some additions to the third-party toolchain but can be used locally).

the predefines here are the defaults when subzero is built.

not having these creates the bigger issue when clang
assisted parsing is enabled but should be there always.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1533963002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agocleanup doxygen for IceClFlags.h
Reed Kotler [Fri, 18 Dec 2015 00:30:26 +0000 (16:30 -0800)]
cleanup doxygen for IceClFlags.h

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1527173002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoAdd template parameter for suffix to BinopXmm
David Sehr [Thu, 17 Dec 2015 23:01:30 +0000 (15:01 -0800)]
Add template parameter for suffix to BinopXmm

BUG=
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1530423002 .

8 years agoAdd trap (an UDF instruction) to the ARM integrated Assembler.
Karl Schimpf [Thu, 17 Dec 2015 16:55:10 +0000 (08:55 -0800)]
Add trap (an UDF instruction) to the ARM integrated Assembler.

Uses the same UDF instruction as used for function alignment.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1519873003 .

8 years agoAdd various forms of LDREX/STREX to ARM integrated assembler.
Karl Schimpf [Thu, 17 Dec 2015 16:06:01 +0000 (08:06 -0800)]
Add various forms of LDREX/STREX to ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1516863003 .

8 years agoAdd CLZ instruction to the ARM integrated assembler.
Karl Schimpf [Thu, 17 Dec 2015 16:02:17 +0000 (08:02 -0800)]
Add CLZ instruction to the ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1521133002 .

8 years agoSubzero. Introduces a new LoweringContext::insert() method.
John Porto [Thu, 17 Dec 2015 14:19:34 +0000 (06:19 -0800)]
Subzero. Introduces a new LoweringContext::insert() method.

Emitting an instruction in Subzero requires a fair amount of
boilerplated code:

Context.insert(<InstType>::create(Func, <Args>...));

The ordeal is worse if one needs access to the recently create
instructionL

auto *Instr = <InstType>::create(Func, <Args>...);
Context.insert(Instr);
Instr->...

This CL introduces a new LoweringContext::insert() method:

template <<InstType>, <Args>...>
<InstType> *LoweringContext::insert(<Args>...) {
  auto *New = Inst::create(Node.Cfg, <Args>...);
  insert(New);
  return New;
}

This is essentially a syntatic sugar that allows instructions to be
emitted by using

Context.insert<InstType>(<Args>...);

The compiler should be able to inline the calls (and get rid of the
return value) when appropriate.

make bloat reviews a small increase in translator code size

BUG=
R=sehr@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1527143003 .

8 years agoSubzero: Fix mid-line comments when using -asm-verbose .
Jim Stichnoth [Wed, 16 Dec 2015 20:40:31 +0000 (12:40 -0800)]
Subzero: Fix mid-line comments when using -asm-verbose .

The llvm-mc assembler for x86 uses '#' to start a mid-line comment, while arm32 uses '@'.  Those characters cause syntax errors for the other architecture.  There doesn't seem to be a common character for starting mid-line comments.

However, the /* ... */ style comment works in both (all?) cases.

(The '#' character at the start of a line, preceded by optional whitespace, starts a comment in both cases.)

BUG= none
TEST= ./pydir/szbuild_spec2k.py --force -v -O2 --filetype=asm --sz=--asm-verbose --target=arm32
TEST= ./pydir/szbuild_spec2k.py --force -v -O2 --filetype=asm --sz=--asm-verbose --target=x8632
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1521863002 .

8 years agoSubzero. ARM32. Fixes register aliasing bugs.
John Porto [Wed, 16 Dec 2015 17:52:10 +0000 (09:52 -0800)]
Subzero. ARM32. Fixes register aliasing bugs.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1528413002 .

8 years agoSubzero. ARM32. Introduces explicit register parameter attribute.
John Porto [Wed, 16 Dec 2015 15:48:25 +0000 (07:48 -0800)]
Subzero. ARM32. Introduces explicit register parameter attribute.

The ARM32 backend used to rely on a specific register declaration order
for calling convention register assignment. This CL introduces a new
field in the ARM32 register tables for explicitly setting which
register holds which parameter.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1508423003 .

8 years agoSubzero: Separate "\t" from "opcode" in asm emission.
Jim Stichnoth [Wed, 16 Dec 2015 14:17:58 +0000 (06:17 -0800)]
Subzero: Separate "\t" from "opcode" in asm emission.

Instead of output like this:
  Str << "\tmov\t" << ...
we prefer to use string concatenation:
  Str << "\t" "mov\t" << ...

That way, "git grep -w mov" can be used for more precise pattern matching.

BUG= none
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1523873003 .

8 years agoFuse icmp/fcmp with select
David Sehr [Wed, 16 Dec 2015 01:34:55 +0000 (17:34 -0800)]
Fuse icmp/fcmp with select

Allows the optimization of pairs of operations, including 64-bit compares and
selects as well as preparing for idioms (minsd, maxsd, etc.).

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1497033002 .

8 years agodocument dump
Reed Kotler [Tue, 15 Dec 2015 16:54:14 +0000 (08:54 -0800)]
document dump

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1522213002 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoadd todo for ALLOW_LLVM_CL
Jim Stichnoth [Tue, 15 Dec 2015 16:53:23 +0000 (08:53 -0800)]
add todo for ALLOW_LLVM_CL

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1520383002 .

8 years agoeliminate code related to --no-ir-gen
Jim Stichnoth [Mon, 14 Dec 2015 05:36:33 +0000 (21:36 -0800)]
eliminate code related to --no-ir-gen

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1522433004 .

8 years agofix doxygen for IceBuildDefs.h
Reed Kotler [Sat, 12 Dec 2015 15:04:17 +0000 (07:04 -0800)]
fix doxygen for IceBuildDefs.h

This is an attempt to make IceBuildDefs more understandable
in the Doxygen produced output, as well as when the various
functions are later referenced from other parts of the subzero docs.

If you look at the doxygen for both the file and the IceBuildDefs namespace, I think it's definitely much
clearer.

I'm still learning Doxygen and always see new things and more that I could have done but Rome was not built in a day.

In my browser:
file:///home/rkotler/nacl_dir/native_client/toolchain_build/src/subzero/docs/html/namespaceIce_1_1BuildDefs.html

and

file:///home/rkotler/nacl_dir/native_client/toolchain_build/src/subzero/docs/html/IceBuildDefs_8h.html

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1519113003 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoSubzero: Use "auto" per (unwritten) auto coding style.
Jim Stichnoth [Fri, 11 Dec 2015 17:53:00 +0000 (09:53 -0800)]
Subzero: Use "auto" per (unwritten) auto coding style.

auto *Foo = llvm::cast<Foo>(...)
auto *Foo = llvm::dyn_cast<Foo>(...)
auto *Foo = llvm::dyn_cast_or_null<Foo>(...)
auto *Foo = Foo::create(...)

Some instances may have been missed due to line breaks or "const" mismatches.

BUG= none
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1516753008 .

8 years agoClean up remnants of direct use of PNACL_BROWSER_TRANSLATOR
Reed Kotler [Fri, 11 Dec 2015 17:51:47 +0000 (09:51 -0800)]
Clean up remnants of direct use of PNACL_BROWSER_TRANSLATOR

BUG=
R=kschimpf@google.com, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1514193003 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoAdd some missing encodings in the ARM integrated assembler.
Karl Schimpf [Fri, 11 Dec 2015 17:41:55 +0000 (09:41 -0800)]
Add some missing encodings in the ARM integrated assembler.

Adds the data-processing "register-shifted register" form, as
well as the 5-bit immediate shift for mov instructions (which
unfortunately represent this form differently than other instructions).

This CL fixes the ARM integrated assembler to handle all non-V
(i.e. neon) instructions used by the spec2k test suite except:

   rsc: 59 instances.
   rev: 14 instances.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1516063002 .

8 years agoAdd translation of REV in ARM integrated assembler.
Karl Schimpf [Fri, 11 Dec 2015 17:32:28 +0000 (09:32 -0800)]
Add translation of REV in ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1517863002 .

8 years agoAdd the RSC instruction to the ARM integrated assembler.
Karl Schimpf [Fri, 11 Dec 2015 17:12:07 +0000 (09:12 -0800)]
Add the RSC instruction to the ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1516103003 .

8 years agoclean up doxygen comments for main
Reed Kotler [Thu, 10 Dec 2015 21:57:32 +0000 (13:57 -0800)]
clean up doxygen comments for main

the comments now for the main program describe it very well
and the classes and methods in the comments are clickable.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1511483005 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoSubzero: Add a proper default for --pnacl-bin-path .
Jim Stichnoth [Thu, 10 Dec 2015 19:08:49 +0000 (11:08 -0800)]
Subzero: Add a proper default for --pnacl-bin-path .

Defining this argument as "required=False, default=None" means it's not really optional.  It's possible to provide a reasonable default like in e.g. szbuild.py.

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1511963002 .

8 years agoAdd DMB instruction to the ARM integrated assembler.
Karl Schimpf [Wed, 9 Dec 2015 15:35:00 +0000 (07:35 -0800)]
Add DMB instruction to the ARM integrated assembler.

Note: There are no updates to the Dart source files, because Dart
doesn't implement this instruction (data memory barrier).

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1507873004 .

8 years agoSubzero. ARM32. Show FP lowering some love.
John Porto [Wed, 9 Dec 2015 13:10:58 +0000 (05:10 -0800)]
Subzero. ARM32. Show FP lowering some love.

After some time of being neglected, this CL improves FP lowering for
ARM32.

1) It emits vpush {list}, and vpop {list} when possible.

2) It stops saving alised Vfp registers multiple times (yes, sz used to
save both D and S registers even when they aliased.)

3) Introduces Vmla (fp multiply and accumulate) and Vmls (multiply and
subtract.)

(1 + 2) minimally (but positively) affected SPEC.

(3) caused a 2% geomean improvement.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1481133002 .

8 years agoSubzero: Improve the Doxygen input filter for TODO extraction.
Jim Stichnoth [Wed, 9 Dec 2015 01:44:34 +0000 (17:44 -0800)]
Subzero: Improve the Doxygen input filter for TODO extraction.

The previous filter was too aggressive at changing "//" to "///".  The new filter does that transformation more selectively, starting at a commented TODO line and ending at the next non-commented line.

BUG= none

Review URL: https://codereview.chromium.org/1510893004 .

8 years agoFix problems with sandboxing and the ARM integrated assembler.
Karl Schimpf [Tue, 8 Dec 2015 23:37:00 +0000 (15:37 -0800)]
Fix problems with sandboxing and the ARM integrated assembler.

Fixes (at least) the obvious problems with sandboxing and the
integrated assembler. This includes:

Added assembly instruction Nop.

Fixed implementation of padWithNop.

Fixed linking to local label to only fire when persistent (i.e.  last
pass of assembly generation).

Removed restriction on single register push/pop, since the ARM
integrated assembler converts it to a corresopnding str/ldr.

Fixed OperandARM32FlexImm to use smallest rotation value, so that
external assemblers and the ARM integrated assembler will agree on
encoding.

Fixed ARM sandboxing requires test in sandboxing.ll

BUG=None
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1511653002 .

8 years agoAdd CMN instruction to ARM integrated assembler.
Karl Schimpf [Tue, 8 Dec 2015 22:45:28 +0000 (14:45 -0800)]
Add CMN instruction to ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1513543002 .

8 years agoAdd ASR instruction to the ARM integrated assembler.
Karl Schimpf [Tue, 8 Dec 2015 21:41:38 +0000 (13:41 -0800)]
Add ASR instruction to the ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1509243002 .

8 years agoAdd Sxtb/Sxth instructions to ARM integrated assembler.
Karl Schimpf [Tue, 8 Dec 2015 19:17:23 +0000 (11:17 -0800)]
Add Sxtb/Sxth instructions to ARM integrated assembler.

Refactors code to take advantage of these instructions with
Uxtb/Uxth.

Note. These instructions are used by Subzero, but not Dart.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1503273002 .

8 years agocleanup main
Reed Kotler [Mon, 7 Dec 2015 22:31:01 +0000 (14:31 -0800)]
cleanup main

seems like these two lines are common to both paths and in fact
the different classes allocated are derived from the same common
base class so this makes sense to me.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1494753003 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

8 years agoImplement LSR instructions for the integrated ARM assembler.
Karl Schimpf [Mon, 7 Dec 2015 18:43:34 +0000 (10:43 -0800)]
Implement LSR instructions for the integrated ARM assembler.

Also factors out the body of method lsl() to emitShift(), so
that all forms of shift instructions can use the same code.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1501073002 .

8 years agoSubzero: Doxygenify TODO comments.
Jim Stichnoth [Mon, 7 Dec 2015 16:37:25 +0000 (08:37 -0800)]
Subzero: Doxygenify TODO comments.

Uses a nasty regexp to turn something like:

  // ... TODO(stichnot): Fix
  // this.

into:

  /// ... @todo TODO(stichnot): Fix
  /// this.

so that doxygen can generate the TODO list.

Matches "TODO:" and "TODO " and "TODO(...".

BUG= none
R=rkotlerimgtec@gmail.com

Review URL: https://codereview.chromium.org/1489413007 .

8 years agoSubzero. ARM32. Implements sandboxing.
John Porto [Sat, 5 Dec 2015 22:16:25 +0000 (14:16 -0800)]
Subzero. ARM32. Implements sandboxing.

(See https://codereview.chromium.org/1491473002/ for the steps taken
while implementing sandboxing.)

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1499983002 .

8 years agoAdd RSB instruction to the ARM integrated assembler.
Karl Schimpf [Fri, 4 Dec 2015 23:11:43 +0000 (15:11 -0800)]
Add RSB instruction to the ARM integrated assembler.

Adds RSB (immediate) and RSB (register) to the ARM integrated assembler.

Also moves udiv method to corresponding (sorted) position in cpp file.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1494433005 .

8 years agoAdd missing form of movt to ARM integrated assembler.
Karl Schimpf [Fri, 4 Dec 2015 23:07:01 +0000 (15:07 -0800)]
Add missing form of movt to ARM integrated assembler.

Add allowing movt to work on integer constants that aren't relocatable.

Also clean up code sharing between movw and movt.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1500073002 .

8 years agoTurn on anonymous namespaces.
Jim Stichnoth [Fri, 4 Dec 2015 16:28:52 +0000 (08:28 -0800)]
Turn on anonymous namespaces.
Once again, the configuration file that comes with Doxygen
seems to have defaults set for those generating API
Documentation and not for documenting the code in a whole
project.

With this turned off, even todos and such are ignored in
an anonymous namespace.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1501503002 .

8 years agoImprove error handling in the ARM integrated assembler.
Karl Schimpf [Fri, 4 Dec 2015 15:29:10 +0000 (07:29 -0800)]
Improve error handling in the ARM integrated assembler.

Up to now, all error handling in the ARM integrated assembler was
handled by forcing a text fixup. This CL tries to minimize the use of
fixup's to only be applied when there is an unimplemented form of an
instruction. All other cases now generate fatal error messages.

This CL should make it easier to determine what instructions still need
to be extended.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1495093002 .

8 years agoRevert "Subzero. ARM32. Initial sandboxing code."
John Porto [Fri, 4 Dec 2015 15:09:20 +0000 (07:09 -0800)]
Revert "Subzero. ARM32. Initial sandboxing code."

This reverts commit 38ac6bee58b7ef19cbc2b0540315c3c299ca77a9 (mistakenly
TBRed.)

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076

Review URL: https://codereview.chromium.org/1499973002 .

8 years agoSubzero. ARM32. Initial sandboxing code.
John Porto [Fri, 4 Dec 2015 14:51:38 +0000 (06:51 -0800)]
Subzero. ARM32. Initial sandboxing code.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076

Review URL: https://codereview.chromium.org/1491473002 .

8 years agoSubzero. ARM32. Folding rematerializable offsets in address operands.
John Porto [Thu, 3 Dec 2015 17:45:31 +0000 (09:45 -0800)]
Subzero. ARM32. Folding rematerializable offsets in address operands.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1477873002 .

8 years agofix doxygen brief in subzero header files
Jim Stichnoth [Thu, 3 Dec 2015 00:52:44 +0000 (16:52 -0800)]
fix doxygen brief in subzero header files

There is a consistent mistake in most of the file level subzero doxygen
comments which stems from a problem with brief.

Basically, there are two types of documentation in Doxygen, inline and
structural documentation. File level documentation is always structural
because inline documentation must either come before or after the entity
and for a file that would be impossible.

When you have structure documentation, the brief and detailed is
handled differently and you have to explicity put the \brief qualifier in.

We were only doing this for a few files so when you looked the doxygen
for the source directory, the description was blank for almost all of them.
If you build docs with this patch and look at the "files" and src
directory, you will see all the brief descriptions now.

In addition I deleted the text "This file ..." from the
beginning of all the file desriptions because it's redundant when you look at the doxygen output and adds
no information but takes up space in the descripton.
BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1488913002 .

8 years agoClean up use of encode/decode in the ARM integrated assembler.
Karl Schimpf [Wed, 2 Dec 2015 22:20:38 +0000 (14:20 -0800)]
Clean up use of encode/decode in the ARM integrated assembler.

Cleans up function names containing "decode" and "encode". Change
"encode" to represent the conversion of values into bit-sequences, as
they appear in instructions. Change "decode" to represent the extraction
of values from bit sequences.

BUG=None
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1490383002 .

8 years agoMore coverage of load/stores in ARM integrated assembler.
Karl Schimpf [Wed, 2 Dec 2015 18:24:15 +0000 (10:24 -0800)]
More coverage of load/stores in ARM integrated assembler.

Adds many more cases of ldr{b,h}/str{b,h} instructions to the ARM
integerated assembler.

Also refactored decodeAddress() to deal with the fact that
immediate/register arguments for LDR/LDRB/STR/STRB differ for
LDRH/LDRD/STRH/STRD, by passing in the layout wanted.

Note: LDRD/STRD instructions are currently not used by Subzero.

BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1486263002 .

8 years agoSubzero. ARM32. Pre-lowers calls to ARM32 Helpers.
John Porto [Tue, 1 Dec 2015 21:00:43 +0000 (13:00 -0800)]
Subzero. ARM32. Pre-lowers calls to ARM32 Helpers.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1474883002 .

8 years agoClean up implementation reading literal constants.
Karl Schimpf [Tue, 1 Dec 2015 19:24:53 +0000 (11:24 -0800)]
Clean up implementation reading literal constants.

Moves APInt and corresponding convert to float method into the pnacl
translator. Renames APInt to BitcodeInt to be more clear that we aren't referring to LLVM's APInt. Rather, it is the representation in PNaCl bitcode.

BUG=None
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1484003003 .

8 years agoFix nits from previous CLs.
Karl Schimpf [Mon, 30 Nov 2015 19:19:16 +0000 (11:19 -0800)]
Fix nits from previous CLs.

Fixes nits found in landed CL's
https://codereview.chromium.org/1456783003,
https://codereview.chromium.org/1452293003, and
https://codereview.chromium.org/1460523005

BUG=None
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1484023002 .

8 years agoSubzero: Add newlines for bundle lock/unlock textual asm.
Jim Stichnoth [Fri, 27 Nov 2015 22:22:02 +0000 (14:22 -0800)]
Subzero: Add newlines for bundle lock/unlock textual asm.

BUG= none
R=sehr@chromium.org

Review URL: https://codereview.chromium.org/1479873002 .

8 years ago1) Move helper creation to separate method, which also computes the maximum outgoing...
David Sehr [Thu, 26 Nov 2015 21:03:50 +0000 (13:03 -0800)]
1) Move helper creation to separate method, which also computes the maximum outgoing argument size.  The computed size is checked against call lowering's size.
2) Make addProlog use the outgoing argument size and remove the adjustments in lowerCall.
3) Remove AdjustStack instructions and friends.

BUG=
R=jpp@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/1472623002 .

8 years agoSubzero: Add "szbuild_spec2k.py --run" option.
Jim Stichnoth [Wed, 25 Nov 2015 23:19:21 +0000 (15:19 -0800)]
Subzero: Add "szbuild_spec2k.py --run" option.

This makes it easier to do bisection debugging.

Note that this could be used to simplify "make -f Makefile.standalone check-spec", but I chose not to do that because shellcmd() buffers all of the stdout until completion, which is not a great user experience (at least for this user).

BUG= none
R=sehr@chromium.org

Review URL: https://codereview.chromium.org/1472833006 .

8 years agoSubzero. ARM32. Strength reduce multiplications.
John Porto [Tue, 24 Nov 2015 20:30:01 +0000 (12:30 -0800)]
Subzero. ARM32. Strength reduce multiplications.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1469113003 .

8 years agoSubzero. ARM32. Combine allocas.
John Porto [Mon, 23 Nov 2015 19:43:13 +0000 (11:43 -0800)]
Subzero. ARM32. Combine allocas.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1465213002 .

8 years agoSubzero: Add a makefile config for building with g++.
Jim Stichnoth [Sun, 22 Nov 2015 14:06:34 +0000 (06:06 -0800)]
Subzero: Add a makefile config for building with g++.

This way, the g++ build for the "make presubmit" target gets a separate build directory, and gets to use ccache.

Also, get rid of the "git diff" test, because uncommitted changes are already checked by "git cl upload" and "git cl land".

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1468823002 .

8 years agoCompute the size of the stack space required to send the parameters to a call.
David Sehr [Sat, 21 Nov 2015 05:09:31 +0000 (21:09 -0800)]
Compute the size of the stack space required to send the parameters to a call.

BUG=
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1458713002 .

8 years agoAdd recognizing register-shifted forms in ARM assembler.
Karl Schimpf [Fri, 20 Nov 2015 22:42:33 +0000 (14:42 -0800)]
Add recognizing register-shifted forms in ARM assembler.

Extends the ARM integrated assembler to understand register-shifted
data processing instructions (add, sub, etc.), as well as cmp/test
instructions.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1459673003 .

8 years agoAdd MVN (register, immediate) to ARM integrated assembler.
Karl Schimpf [Fri, 20 Nov 2015 22:26:12 +0000 (14:26 -0800)]
Add MVN (register, immediate) to ARM integrated assembler.

Also removes redundant rule checks in emitType01().

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1460523005 .

8 years agoSubzero. ARM32. No more SP frobbing.
John Porto [Fri, 20 Nov 2015 22:17:23 +0000 (14:17 -0800)]
Subzero. ARM32. No more SP frobbing.

Pre-computes the max stack size outgoing arguments, and pre-allocates
it during prolog, deallocating during epilog.

With this CL, there are no more StackAdjustments needed for the ARM32,
which will simplify rematerializing alloca'd variables.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=sehr@chromium.org

Review URL: https://codereview.chromium.org/1467473003 .

8 years agoSubzero. Adds a pass for target-specific helper call generation.
John Porto [Fri, 20 Nov 2015 21:50:36 +0000 (13:50 -0800)]
Subzero. Adds a pass for target-specific helper call generation.

This pass gives Targets the ability to pre-lower high-level
instructions that will later be lowered to a target-specific helper,
e.g., 64-bit division on targets that can't natively handle them.

This is a pre-requirement for correct outargs pre-allocation during
function prolog.

R=sehr@chromium.org

Review URL: https://codereview.chromium.org/1455033005 .

8 years agoFix race condition in jump table list creation
David Sehr [Fri, 20 Nov 2015 05:47:15 +0000 (21:47 -0800)]
Fix race condition in jump table list creation

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1460003003 .

8 years agoAdd LSL (register, immediate) to ARM integrated assembler.
Karl Schimpf [Thu, 19 Nov 2015 16:10:44 +0000 (08:10 -0800)]
Add LSL (register, immediate) to ARM integrated assembler.

Also does some clean up on emitType01 methods (making optional argument
explicit, and moving rule checks to the lowest level).

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1456783003 .

8 years agoSubzero. ARM32. Removes memory legalization warts.
John Porto [Thu, 19 Nov 2015 13:42:59 +0000 (05:42 -0800)]
Subzero. ARM32. Removes memory legalization warts.

This CL removes two warts from the ARM32 backend:
1) during argument lowering, if a stack parameter is assigned a
register, the backend creates a new Variable that references the stack
location with the incoming argument, and _mov() it to the parameter.

2) During stack slot legalization, all _mov(Mem(), Reg) are converted to
stores; and all _mov(Reg, Mem()) are converted to loads.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1457683004 .

8 years agoAdd BL (immediate) and BLX (register) to ARM assembler.
Karl Schimpf [Wed, 18 Nov 2015 16:19:26 +0000 (08:19 -0800)]
Add BL (immediate) and BLX (register) to ARM assembler.

Adds BL and BLX to ARM integrated assembler.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1452293003 .

8 years agoMake more visible with doxygen.
Jim Stichnoth [Wed, 18 Nov 2015 14:25:46 +0000 (06:25 -0800)]
Make more visible with doxygen.
To see the main effect of this, look at the doxygen for file
IceGlobalContext.h to see the effect of turning this on.
Without it, the nested classes are not available because they
are private.

My guess is that often doxygen is used to generate API documents and for that reason, exporting of private info is excluded by default.

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1411123019 .