- 10 Sep, 2014 1 commit
-
-
Jim Stichnoth authored
This addresses a TODO and fixes a code generation bug that was causing sprintf and _vfprintf_r to execute incorrectly. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/560773002
-
- 09 Sep, 2014 5 commits
-
-
Jan Voung authored
Ended up needing to fix the InstX8632Lockable error that JF ran into now that -O0 is really -O0: https://codereview.chromium.org/512933006/ BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/557933002
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/560493002
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/545623005
-
Jim Stichnoth authored
The script translates a pexe using both Subzero and llc, and then uses linker tricks to resolve each symbol into either its Subzero or llc version. This enables quick bisection-based debugging of Subzero code generation. BUG= none R=jfb@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/551953002
-
Jim Stichnoth authored
1. Modify dump() to match LLVM. 2. If it weren't for minimum stack alignment, the alignment code would be broken, so add a test in case the alignment code changes. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/557533003
-
- 08 Sep, 2014 4 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/548553002
-
Jim Stichnoth authored
This makes it much easier to run scripts from different working directories, as long as they are run somewhere under the native_client directory. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/554013002
-
Jim Stichnoth authored
One issue is that the test_arith cross test defined functions on i1 but never actually invoked them. Another issue is that the lowering was using 8-bit registers for i1 values, but was being sloppy about leaving stuff in the upper 7 bits, and then using all 8 bits for tests. This takes the approach of explicitly masking the result whenever it's possible for the result to exceed one bit, such as trunc, fptosi, fptoui. Another possibility might be to allow the upper 7 bits to stay sloppy, and explicitly only test the lower bit. Additionally, some "CHECK: ret" lines were removed, since they aren't actually needed after the change to use CHECK-LABEL, and they are affected by an llvm-dump bug (which is fixed in LLVM 3.6). BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/547033002
-
Jim Stichnoth authored
This is the truncating cvt instruction instead of rounding. A few interesting floating point inputs are added to the cross tests. Also, the cross test error output is modified to be more clear. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/550723002
-
- 05 Sep, 2014 2 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/545603003
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/543793003
-
- 04 Sep, 2014 4 commits
-
-
Jim Stichnoth authored
Also declare a few variables as Constant* instead of Operand* when they hold the result of Ctx->getConstantInt(), to be consistent with the rest of the code. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/541093002
-
Karl Schimpf authored
BUG=https: //code.google.com/p/nativeclient/issues/detail?id=3894 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/531123002
-
Jim Stichnoth authored
There's already a hack that emits asm like: lea eax, myglobal instead of: mov eax, [myglobal] because of an llvm-mc parser bug. However, the lea hack still doesn't work if the symbol is a reserved word, e.g.: lea eax, flags The extra hack is to drop into AT&T syntax temporarily: .att_syntax leal flags, %eax .intel_syntax BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/543803002
-
Jim Stichnoth authored
The bug was first spotted in the optimized gl_Color4ub() from spec2k's mesa. The lowering sequences for fptosi and fptoui with i8 or i16 include "mov T_2, T_1" where T_1 and T_2 may have different integer types, and the statement: T_2->setPreferredRegister(T_1, true); If T_2's type is i8 and T_1 is assigned a register that has no 8-bit version, then T_2 gets an unsuitable register. The fix is to honor RegisterOverlap only when RegMask allows. It's hard to construct a good test for this, since it depends heavily on register allocation decisions, which will change over time. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/544713002
-
- 03 Sep, 2014 2 commits
-
-
Jim Stichnoth authored
Integers are generally dumped as signed instead of unsigned values. Integers of i1 type are dumped as 'false' and 'true'. Floating point values still don't match LLVM. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/539743002
-
Karl Schimpf authored
BUG= //code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/529113002
-
- 02 Sep, 2014 3 commits
-
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/535623002
-
Jim Stichnoth authored
Now it assumes tests are being run from within the Subzero portion of the native_client tree, and sets up PATH to find PNaCl tools relative to there. It may be necessary to do a one-time setup to be able to build pexes: pnacl/build.sh sdk newlib or the equivalent scons commands. If the tool chain is updated, propagate the changes via: toolchain_build/toolchain_build_pnacl.py llvm_i686_linux --install=toolchain/linux_x86/pnacl_newlib BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/525603002 -
Karl Schimpf authored
Also clean up other error cases (in function block) to simply return, since they have already generated an error message. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/514273002
-
- 29 Aug, 2014 1 commit
-
-
Jan Voung authored
Then when we have an integrated assembler, we can check its disassembly and the result should be the same. This only touches the tests that invoke llvm-mc currently. There are other tests which check for .s file output. There are quite a bit of quirks with llvm-objdump, which is unfortunate: (*) The symbolizer doesn't pick up non-section-local function calls. Some externals were converted to be local functions. Workaround: where it counts, I just left a check via .s files and a new --check-prefix. It's a little better in 3.6. (*) The symbolizer doesn't pick up global variable names. I just checked for the relocation addend instead. Didn't check if it was better in 3.6, but maybe. (*) We have a bug in bundling lock + instructions. See BUG=https://code.google.com/p/nativeclient/issues/detail?id=3929 (*) There's no disassembly for branch lables. Checks of jump instructions were converted to check for positive or negative values, depending on whether it is a forward or backward branch. BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/509233002
-
- 28 Aug, 2014 2 commits
-
-
Jan Voung authored
BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/515993002
-
Jan Voung authored
Otherwise, I don't have pnacl-freeze in my path, and I think the lit tests have trouble finding it. src/PNaClTranslator.cpp: In member function ‘uint32_t {anonymous}::FunctionParser::convertRelativeToAbsIndex(int32_t)’: src/PNaClTranslator.cpp:882:55: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (Id > 0 && AbsNextId < static_cast<uint32_t>(Id)) { ^ BUG=none R=kschimpf@google.com, stichnot@chromium.org Review URL: https://codereview.chromium.org/515003004
-
- 27 Aug, 2014 4 commits
-
-
Karl Schimpf authored
Handle binops and returns. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/395193005
-
Jim Stichnoth authored
Also adds much-needed logging of the decision process that goes into the address mode optimization. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/490333003
-
Jim Stichnoth authored
With the original link command, -lpthread comes before some other LLVM libraries, and this ends up causing undefined pthreads symbols. The new link command makes sure the -lpthread part comes last. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/514723004
-
Jim Stichnoth authored
Some lowering sequences were incorrectly allowing immediate operands in native instructions. This includes 32-bit icmp, 64-bit icmp, select, switch, and 64-bit mul. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/511543002
-
- 26 Aug, 2014 4 commits
-
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/507813002
-
Jim Stichnoth authored
Add the llvm2ice -sandbox option (false by default) to select between native and sandboxed code generation. Currently, it controls whether the llvm.nacl.read.tp intrinsic is lowered to gs:[0x0] or a call to __nacl_read_tp. Change the asm output slightly for -ffunction-sections so that objdump is more willing to provide a disassembly. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/504963002
-
Jim Stichnoth authored
This was committed as a test, not actually intended. This reverts commit 420e8bf2. BUG= R=dschuff@chromium.org Review URL: https://codereview.chromium.org/504073003
-
Jim Stichnoth authored
Patch from Jim Stichnoth <stichnot@chromium.org>.
-
- 18 Aug, 2014 1 commit
-
-
Jim Stichnoth authored
Background: After lowering each high-level ICE instruction, Om1 calls postLower() to do simple register allocation. It only assigns registers where absolutely necessary, specifically for infinite-weight variables, while honoring pre-coloring decisions. The original Om1 register allocation never tried to reuse registers within a lowered sequence, which was generally OK except for very long lowering sequences, such as call instructions or some intrinsics. In these cases, when it ran out of physical registers, it would just reset the free list and hope for the best, but with no guarantee of correctness. The fix involves keeping track of which instruction in the lowered sequence holds the last use of each variable, and releasing each register back to the free list after its last use. This makes much better use of registers. It's not necessarily optimal, at least with respect to pre-colored variables, since those registers are black-listed even if they don't interfere with an infinite-weight variable. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/483453002
-
- 15 Aug, 2014 2 commits
-
-
Matt Wala authored
Adds command line options -nop-insertion, -nop-insertion-probability=X, and -max-nops-per-instruction=X. BUG=none R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/463563006
-
Matt Wala authored
BUG=none R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/477773003
-
- 14 Aug, 2014 2 commits
-
-
Matt Wala authored
This requires sorting the spilled variables based on alignment and introducing additional padding around the spill location areas. These changes allow vector instructions to accept memory operands. Old stack frame layout: New stack frame layout: +---------------------+ +---------------------+ | return address | | return address | +---------------------+ +---------------------+ | preserved registers | | preserved registers | +---------------------+ +---------------------+ | global spill area | | padding | +---------------------+ +---------------------+ | local spill area | | global spill area | +---------------------+ +---------------------+ | padding | | padding | +---------------------+ +---------------------+ | local variables | | local spill area | +---------------------+ +---------------------+ | padding | +---------------------+ | local variables | +---------------------+ BUG=none R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/465413003 -
Jan Voung authored
Otherwise llvm-mc asserts. This is also the order that llc emits the directives. Change a couple of RUIN -> RUN in lit tests. BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/469973002
-
- 13 Aug, 2014 1 commit
-
-
Jan Voung authored
Mostly to make them a bit more portable across OSes. Otherwise the OS assumed by llvm-mc is the build/host OS. So, on Mac llvm-mc will assume it's targeting darwin and only accepts macho assembler directives. Assembler directives like .rodata.cst8 are not accepted (I'm guessing it uses .cstring, .literal4, etc. instead?). Force an OS (NaCl) so that ELF-related assembler macros make sense. Also remove a now unused function typeIdentString to make clang happy. Example errors: Command 5 Stderr: <stdin>:5:2: error: unknown directive .type fixed_400,@function ^ <stdin>:23:2: error: unknown directive .type variable_n,@function ^ <stdin>:40:11: error: mach-o section specifier uses an unknown section type .section .rodata.cst4,"aM",@progbits,4 ^ <stdin>:42:11: error: mach-o section specifier uses an unknown section type .section .rodata.cst8,"aM",@progbits,8 ^ BUG=none R=stichnot@chromium.org, wala@chromium.org Review URL: https://codereview.chromium.org/467103004
-
- 12 Aug, 2014 2 commits
-
-
Matt Wala authored
Introduce a base class for mov, movq, and movp instruction classes. BUG=none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/466733005
-
Matt Wala authored
Be compatible with the x86-32 calling convention by ensuring that the stack is aligned to 16 bytes at the point of the call instruction. Also ensure that vector arguments passed on the stack are 16 byte aligned. Also, make alloca instructions respect alignment. BUG=none R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/444443002
-