- 04 Nov, 2015 1 commit
-
-
Karl Schimpf authored
It turns out that there are several instruction in the ARM integrated assembler that do not get translated correctly. This results in the spec2k tests not being compilable. To workaround this problem, this CL adds a (temporary) flag that allows all translations to be applied by the integrated assembler. When this flag is false (the default) only correctly working translations to be applied by the integrated assembler. This allows lit tests to still be applied to the correct portions of broken translations. This CL also fixes a bug with local (instruction) labels that did not generate a corresponding label to the -filetype=iasm assembly file. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1424923005 .
-
- 02 Nov, 2015 2 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=jpp@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/1415943009 .
-
Jim Stichnoth authored
"make -f Makefile.standalone check-spec" will translate and run all the spec2k components for a given target. The advantages are that this can be done all within the subzero directory, and the spec components can be run in parallel via "make -j" (particularly helpful for arm32/qemu). Default target is x8632, and arm32 is also available. Example: make -j32 -f Makefile.standalone check-spec TARGET=arm32 SPEC="-O2 --filetype=iasm" Also removes unnecessary tab characters from the makefile, fixes >80-column lines, and gives more consistent indentation. BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/1413033009 .
-
- 31 Oct, 2015 1 commit
-
-
Jim Stichnoth authored
If the alloca alignment exceeds the known ABI stack alignment, the lowering sequence adds an "and esp, xxx" instruction. In this case, the esp adjustment is no longer statically known, so we must force an ebp-based frame. BUG= none R=sehr@google.com Review URL: https://codereview.chromium.org/1426933003 .
-
- 30 Oct, 2015 12 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1403403009 .
-
Karl Schimpf authored
BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1425243002 .
-
Karl Schimpf authored
Also cleans up comments on rotated immediate 8 constants. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1414483008 .
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1427023004 .
-
Jim Stichnoth authored
Somehow missed this in https://codereview.chromium.org/1419173006 . BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1410813004 .
-
Karl Schimpf authored
Also clean up some comments on where code was moved from in Dart sourced. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1429003002 .
-
Karl Schimpf authored
BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1424353003 .
-
Jim Stichnoth authored
This makes it easier to copy the commands and run them manually. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1419173006 .
-
Karl Schimpf authored
Also factor out code to process arguments for data operations into new method Arm32::Assembler32::emitType01(). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1406153011 .
-
Karl Schimpf authored
Also cleans up comments about handling a rotated imm8 value. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1412923006 .
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1431453002 .
-
Karl Schimpf authored
Also cleans up a couple of template definitions by using the appropriate "using" type name. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1430713003 .
-
- 29 Oct, 2015 3 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1412293006 .
-
Karl Schimpf authored
Adds a new type of fixup to handle the relocatable fixups needed for movw and movt on a global addresses. Also adds movw and movt methods to the ARM assembler. Also makes ARM register names visible (without a target lowering object), so that the ARM integrated assembler can generate the appropriate assembly. Note that the integrated assembler needs to generate the corresponding movw/movt, and follows the instruction with the bytes that appear in the corresponding assembler buffer. This allows the ability to test if we have generated the correct values, and will be set up properly for ELF emission. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1424863005 .
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1424213003 .
-
- 28 Oct, 2015 2 commits
-
-
Jim Stichnoth authored
Sets the stage for enabling the use of the 8-bit high registers, but doesn't yet turn it on because more work is needed for correctness. In the lowering, typing is tightened up so that we don't specify e.g. eax when we really mean ax or al. This gets rid of the ShiftHack hack. The one exception is the pinsr instruction which always requires an r32 register even if the memory operand is m8 or m16. The x86 assembler unit tests are fixed, by not passing a GlobalContext arg to the Assembler ctor. Many constexpr and "auto *" upgrades are applied. Sorry for not putting this into a separate CL - a few local fixes got out of hand... Tested in the following ways: - "make check-lit" - some .ll CHECK line changes due to register randomization - "make check-xtest" - "make check-xtest" with forced filetype=asm (via local .py hack) - spec2k with all -filetype options - compare before-and-after spec2k filetype=asm output - a few differences where the correct narrow register is used instead of the full-width register To do in the next CL: 1. Add new register classes: (a) 32-bit GPR truncable to 8-bit (eax, ecx, edx, ebx) (b) 16-bit GPR truncable to 8-bit (ax, cx, dx, bx) (c) 8-bit truncable from 16/32-bit (al, bl, cl, dl) (c) 8-bit "mov"able from ah/bh/ch/dh 2. Enable use of ah/bh/ch/dh for x86-32. 3. Enable use of ah (but skip bh/ch/dh) for x86-64. 4. Statically initialize register tables in the TargetLowering subclass. BUG= none R=jpp@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/1419903002 .
-
John Porto authored
Implements the Availability optimization: a = b x = f(a, c) becomes a = b x = f(b, c) This only triggers if b is an infinite-weight temporary, and it prevents a potential spill at the cost of higher register pressure. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1424873003 .
-
- 27 Oct, 2015 5 commits
-
-
David Sehr authored
This adds some more patterns to address mode recovery to recover ConstantRelocatables as displacements, and a few more generalizations that catch indexed addressing. BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1428443002 .
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1410183004 .
-
Karl Schimpf authored
Fixes a couple of bugs that stopped the ARM integrated assembler from generating assembly code for any spec2k examples. Fixes are: 1) Handle conditional branches with no else branch. 2) Fix usage of fixups so that the emit method does any needed buffer lookups. This fixes case where textual fixups (with zero length) appear at the end of the assembly file. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1417173003 .
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1424773002 .
-
Karl Schimpf authored
Adds an explicit branch instruction (near form only), which allows branching from the current pc up to 2**26 bytes (in either direction). For now, this near restriction (within a function) doesn't appear to be a bad restriction, and only near jumps have been implemented. Also fixes notationally the concepts of the following types: InstValueType : The 32-bit encoding of an instruction value. InstOffsetType : Offset (+/-) used within an instruction. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1418313003 .
-
- 23 Oct, 2015 1 commit
-
-
Karl Schimpf authored
Fixes an issue where branches don't compile in the hybrid integrated assembler because some jump instructions have not yet been integrated. It does this by adding an instruction label for each corresponding label generated by the standalone ARM assembler. Note that in order to fix this, I had to change the signature of virtual method Assembler::bindCfgNodeLabel to get the Cfg node (rather than the index value). This allows the ARM hybrid assembler to generate a label for each CfgNode (using the getAsmName() method). BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1407273006 .
-
- 22 Oct, 2015 1 commit
-
-
Karl Schimpf authored
Adds a notion of a hybrid assembler. That is, if the integrated assembler can lower an instruction to bytes, it does. Otherwise, it uses the standalone assembler to generate text as the placeholder for the instruction. This is done using a textual fixup in the assembly buffer. The advantage of the hybrid assembler is that one can incrementally implement the integrated assembler and still test the generated assembly. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1418523002 .
-
- 21 Oct, 2015 1 commit
-
-
Jim Stichnoth authored
This patch is essentially the same as for ARM https://codereview.chromium.org/1127963004 I have incorporated the new 64 bit register work which was not available at the time of this earlier patch. The MIPS O32 Abi is not perfect on this patch but I am more or less following the development of the ARM patches and those were preliminary at this stage too. I will make corrections in a later patch when I incorporate more of the ARM patches. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4167 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1416493002 .
-
- 17 Oct, 2015 1 commit
-
-
Karl Schimpf authored
Also cleans up comments and condition violations for all implemented ARM instructions. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1411873002 .
-
- 16 Oct, 2015 5 commits
-
-
Jim Stichnoth authored
BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1407263005 .
-
David Sehr authored
Generalize folding of icmp instructions into br. 64-bit comparisons are considered as candidates unless they feed a select. BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1407143002 .
-
Jim Stichnoth authored
Also remind the user of that option in IceConverter.cpp, similar to PNaClTranslator.cpp. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/1408023004 .
-
John Porto authored
With this CL, Spec2k built by the Sz ARM32 backend runs and verifies successfully. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1407063002 .
-
Karl Schimpf authored
Add code to handle spilling stack variables. That is, add code to handle loading and storing to stack addresses. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=jpp@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/1402403002 .
-
- 15 Oct, 2015 2 commits
-
-
Jim Stichnoth authored
1. Helper function sameVarOrReg() also needs to return true if the two physical registers alias or overlap. Otherwise advanced phi lowering may pick an incorrect ordering. 2. With -asm-verbose, redundant truncation assignments expressed as _mov instructions, like "mov cl, ecx", need to have their register use counts updated properly, so that the LIVEEND= annotations are correct. 3. The register allocator should consider suitably typed aliases when choosing a register preference. 4. When evicting a variable, the register allocator should decrement the use count of all aliases. 5. When saving/restoring callee-save registers in the prolog/epilog, map each register to its "canonical" register (e.g. %bl --> %ebx) and make sure each canonical register is only considered once. 6. Remove some unnecessary Variable::setMustHaveReg() calls. 7. When assigning bool results as a constant 0 or 1, use an 8-bit constant instead of 32-bit so that only the 8-bit register gets assigned. BUG= none TEST= make check, plus spec2k -asm-verbose output is unchanged R=kschimpf@google.com Review URL: https://codereview.chromium.org/1405643003 .
-
David Sehr authored
Comparisons with zero can be done with no branches in most cases and with simpler sequences of operations. BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1406593003 .
-
- 14 Oct, 2015 1 commit
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1388323003 .
-
- 13 Oct, 2015 2 commits
-
-
Karl Schimpf authored
Also does some bikeshed clean ups. In particualr, the (ARM) instruction method emitIAS only needs to choose the applicable ARM instruction, and then passes the corresponding operands to the corresponding instruction method of the assembler. The assembler method then extracts the appropriate data from the operands, and decides which rule to apply for the corresponding arm instruction. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=jpp@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/1407613002 .
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4334 R=jpp@chromium.org Review URL: https://codereview.chromium.org/1397043003 .
-