OSDN Git Service
Nicolas Capens [Mon, 24 Oct 2016 15:04:22 +0000 (11:04 -0400)]
Fix unit tests.
Change-Id: I70899be0455958aaad6af8d8218f1db50591beae
Reviewed-on: https://chromium-review.googlesource.com/401385
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Wed, 19 Oct 2016 18:19:41 +0000 (14:19 -0400)]
Remove verified asserts.
BUG=swiftshader:15
Change-Id: I3c3314f3787d42835a9483c7b797dc1dbdc0b76a
Reviewed-on: https://chromium-review.googlesource.com/400663
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Fri, 21 Oct 2016 16:47:59 +0000 (12:47 -0400)]
Assert that PNaCl bitcode only uses 128-bit vector casts.
Change-Id: I5aee2c998842f95ccc44d5c0fed90aa289bdf67b
Reviewed-on: https://chromium-review.googlesource.com/401639
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Tue, 18 Oct 2016 20:27:27 +0000 (16:27 -0400)]
Implement vector sign mask intrinsic.
BUG=swiftshader:15
Change-Id: I7fec56518a5b4e07d2189ab01a0a223b038564c1
Nicolas Capens [Mon, 17 Oct 2016 21:42:29 +0000 (17:42 -0400)]
Implement bitcast between i32 and (emulated) v4i8.
BUG=swiftshader:15
Change-Id: Ic795def8a914508ab0d850c846b73b343ace45de
Nicolas Capens [Mon, 17 Oct 2016 21:42:29 +0000 (17:42 -0400)]
Implement vector packing intrinsics.
BUG=swiftshader:15
Change-Id: Id95a08f82c47ec20bb958358c01f389b6fb5565b
Nicolas Capens [Wed, 19 Oct 2016 05:24:27 +0000 (01:24 -0400)]
Fix 64-bit pointer type for non-x32 ABIs.
BUG=swiftshader:9
Change-Id: Ife06416736d47acba4f2cff1ea8b17be61134752
Jim Stichnoth [Wed, 19 Oct 2016 12:49:47 +0000 (05:49 -0700)]
Subzero: Fix compiler warnings.
src/IceTargetLoweringX86BaseImpl.h:6093:13: error: unused variable 'Src1RM' [-Werror,-Wunused-variable]
auto *Src1RM = legalize(Src1, Legal_Reg | Legal_Mem);
^
src/IceTargetLoweringX86BaseImpl.h:4007:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
default:
^
src/IceTargetLoweringMIPS32.cpp:4065:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
default:
^
src/IceTargetLoweringARM32.cpp:4975:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
default:
^
BUG= none
R=capn@chromium.org
Review URL: https://codereview.chromium.org/
2434643002 .
Nicolas Capens [Fri, 14 Oct 2016 20:37:09 +0000 (16:37 -0400)]
Optimize shuffles corresponding to x86 punpckh instructions.
BUG=swiftshader:15
Change-Id: I04a7c4206f3936c604ec623e43834c2a153fd3cb
Reviewed-on: https://chromium-review.googlesource.com/399379
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Sagar Thakur [Tue, 18 Oct 2016 14:32:21 +0000 (07:32 -0700)]
[Subzero][MIPS32] Account for variable alloca alignment bytes in addProlog
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2425673002 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Nicolas Capens [Mon, 17 Oct 2016 17:02:47 +0000 (13:02 -0400)]
Generate error on unexpected intrisics.
Change-Id: I5a02aee156a64f48baca356f0a5263123f570741
Reviewed-on: https://chromium-review.googlesource.com/399590
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Thu, 6 Oct 2016 15:33:55 +0000 (11:33 -0400)]
Add x86 vector packing instructions.
BUG=swiftshader:15
Change-Id: I0d40fab6287130143693e8e4752859b7142a503d
Reviewed-on: https://chromium-review.googlesource.com/394007
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Fri, 14 Oct 2016 20:29:11 +0000 (16:29 -0400)]
Fix unpacking from a single vector.
Both vector arguments were being used in a punpckl instruction, while
the shuffle mask repeats elements from just the first vector.
BUG=swiftshader:15
Change-Id: I8e29c252ee4957692c4949e724ae67253b423e89
Reviewed-on: https://chromium-review.googlesource.com/399419
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Jaydeep Patil [Mon, 17 Oct 2016 13:33:50 +0000 (06:33 -0700)]
[SubZero] Implement Fcmp, ICmp, Cast and Select for vector type
The patch scalarizes Fcmp, ICmp, Cast and Select for operands of vector type.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2412053002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Jaydeep Patil [Mon, 17 Oct 2016 04:50:43 +0000 (21:50 -0700)]
[SubZero] Handle relocatable constants for MIPS
The patch generates HI/LO modifiers for relocatable constants.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2420033002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Sagar Thakur [Sun, 16 Oct 2016 14:20:44 +0000 (07:20 -0700)]
[Subzero][MIPS32] Fix alloca alignment and offset for Om1 and O2 optimization
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2417233002 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Jaydeep Patil [Sun, 16 Oct 2016 14:13:38 +0000 (07:13 -0700)]
[SubZero] Legalize load, store for MIPS post lower
This patch legalizes load, store instructions post lowering.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2411193003 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Sagar Thakur [Wed, 12 Oct 2016 06:36:01 +0000 (23:36 -0700)]
[Subzero][MIPS32] Implement bitcast operation for both 32-bit and 64-bit operands
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2404803002 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Nicolas Capens [Thu, 6 Oct 2016 21:25:39 +0000 (17:25 -0400)]
Support running unit tests on Windows.
BUG=swiftshader:7
Change-Id: I83e51a3256365700dbaf550ed4b50c2352612f7d
Reviewed-on: https://chromium-review.googlesource.com/394887
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 4 Oct 2016 14:13:03 +0000 (10:13 -0400)]
Optimize x86 vector shift by constant.
BUG=swiftshader:15
Change-Id: I4b7b97f3de18c201a502d0bc38a2c845a1caf278
Reviewed-on: https://chromium-review.googlesource.com/392627
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Tue, 4 Oct 2016 04:07:21 +0000 (00:07 -0400)]
Optimize lowering of x86 byte and word vector unpack.
BUG=swiftshader:15
Change-Id: Id0d3bed46d00336fc31501c41a26ebe2d4ddd697
Reviewed-on: https://chromium-review.googlesource.com/392626
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Mon, 3 Oct 2016 14:46:30 +0000 (10:46 -0400)]
Implement intrinsics for loading/storing subvectors.
This enables emulating 64-bit and 32-bit vectors using 128-bit
vectors internally (x86 only for now). Note that these Intrinsics
are not part of the PNaCL specification.
BUG=swiftshader:15
Change-Id: I61a666243832c2856e60eb477d42a72dec07d01d
Reviewed-on: https://chromium-review.googlesource.com/392246
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Jim Stichnoth [Thu, 6 Oct 2016 21:24:38 +0000 (14:24 -0700)]
Subzero: Fix "make -f Makefile.standalone check-lit FORCEASM=1".
https://codereview.chromium.org/
2384983002/ apparently didn't test the full "make presubmit", otherwise this would have been caught.
BUG= none
TBR=jpp@chromium.org
Review URL: https://codereview.chromium.org/
2399873003 .
Stefan Maksimovic [Wed, 5 Oct 2016 17:45:19 +0000 (10:45 -0700)]
Subzero, MIPS32: Fix conditional mov instructions
This patch implements changes needed for conditional mov instructions
to fix problem with failing crosstest and invalid register allocation.
Problem is visible from icmp test examples, causing cross test for icmp
to fail. Eg:
Incorrect, before this change:
674:
00653026 xor a2,v1,a1
678:
00a3182b sltu v1,a1,v1
67c:
0082102b sltu v0,a0,v0
680:
0043180a movz v1,v0,v0
Correct, aftrer this change:
674:
00653026 xor a2,v1,a1
678:
00a3182b sltu v1,a1,v1
67c:
0082102b sltu v0,a0,v0
680:
0046180a movz v1,v0,a2
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2394773004 .
Patch from Stefan Maksimovic <makdstefan@gmail.com>.
Jim Stichnoth [Mon, 3 Oct 2016 14:56:25 +0000 (07:56 -0700)]
Subzero: Remove --skip-unimplemented from ARM lit tests.
ARM support is complete, so clean up some of the lit tests:
1. Remove --skip-unimplemented
2. Use --filetype=obj instead of =asm, and remove --assemble
3. Remove --need=allow_dump requirement
4. Remove related TODOs.
5. Fix some CHECK lines because objdump output is slightly different from filetype=asm output.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
2384983002 .
Jaydeep Patil [Mon, 3 Oct 2016 14:52:48 +0000 (07:52 -0700)]
[SubZero] Vector types support for MIPS
This patch implements vector operations on MIPS32 using VariableVecOn32 method (on the lines of Variable64On32).
Vector operations are scalarized prior to lowering. Each vector variable is split into 4 containers to hold a variable of vector type.
For MIPS32, four GP/FP registers are used to hold a vector variable. Arguments are passed in GP registers irrespective of the type of the vector variable.
Lit test vector-mips.ll has been added to test this implementation.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2380023002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Sagar Thakur [Thu, 29 Sep 2016 13:52:29 +0000 (06:52 -0700)]
[Subzero][MIPS] Implement conditional branches with 64-bit integer compares
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2384433002 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Sagar Thakur [Thu, 29 Sep 2016 13:22:25 +0000 (06:22 -0700)]
[Subzero][MIPS] Add RUN command line with -Om1 in test 64bit.pnacl.ll
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2376233004 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Nicolas Capens [Wed, 28 Sep 2016 11:20:30 +0000 (07:20 -0400)]
Don't emit address size prefixes for native x86-64 ABI.
Address size prefixes are used in 64-bit x86 for PNaCl's use of the
x32 ABI with ILP32 data model. Don't emit them for any other ABI.
BUG=swiftshader:9
Change-Id: I1351db086d44ce4b144b3428866a54e84637b9a4
Reviewed-on: https://chromium-review.googlesource.com/390409
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Srdjan Obucina [Wed, 28 Sep 2016 13:38:44 +0000 (06:38 -0700)]
Subzero, MIPS32: SRAV instruction encoding
Implements SRAV instruction encoding
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2375923002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Sagar Thakur [Wed, 28 Sep 2016 13:36:47 +0000 (06:36 -0700)]
[Subzero][MIPS] Implement 64-bit integer compare operations
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2369323002 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Srdjan Obucina [Wed, 28 Sep 2016 03:43:11 +0000 (20:43 -0700)]
Subzero, MIPS32: MOVZ instruction encoding
Implements MOVZ instruction encoding
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2377783002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Wed, 28 Sep 2016 03:38:30 +0000 (20:38 -0700)]
Subzero, MIPS32: DIVU instruction encoding
Implements DIVU instruction encoding
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2377733002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Tue, 27 Sep 2016 14:00:17 +0000 (07:00 -0700)]
Subzero, MIPS32: Intrinsic call Bswap for i16, i32 and i64
Implements intrinsic call llvm.bswap for i16, i32 and i64
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2368343003 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Tue, 27 Sep 2016 03:58:17 +0000 (20:58 -0700)]
Subzero, MIPS32: Intrinsic calls Ctlz and Cttz for i64
Implements intrinsic calls llvm.ctlz and llvm.cttz for i64.
Also adds test cases for constant operands.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2364093002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jaydeep Patil [Tue, 27 Sep 2016 03:48:18 +0000 (20:48 -0700)]
Subzero, MIPS32: Binding intrablock labels, unconditional branch
This patch was supposed to be a part of patch with instruction encodings.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2367743004 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Author: Jaydeep Patil
Srdjan Obucina [Tue, 27 Sep 2016 03:12:17 +0000 (20:12 -0700)]
Subzero, MIPS32: Filling missing bits from genTargetHelperCallFor
Implements missing calls to runtime libraries, covering mostly
data casting.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2363333002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Tue, 27 Sep 2016 03:03:20 +0000 (20:03 -0700)]
Subzero, MIPS32: Cross-testing enabled for MIPS32
Enables running crosstests for MIPS32 target.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2085303002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Sun, 25 Sep 2016 17:32:19 +0000 (10:32 -0700)]
Subzero, MIPS32: lowerSelect for i64
Implements lowerSelect for i64.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2364143002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Sagar Thakur [Fri, 23 Sep 2016 18:55:46 +0000 (11:55 -0700)]
[Subzero][MIPS32] Implements 64-bit shl, lshr, ashr for MIPS
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2359713003 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Srdjan Obucina [Fri, 23 Sep 2016 13:59:50 +0000 (06:59 -0700)]
Subzero, MIPS32: Intrinsic call Cttz for i32
Implements intrinsic call llvm.cttz for i32
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2358393004 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Fri, 23 Sep 2016 05:01:51 +0000 (22:01 -0700)]
Subzero, MIPS32: Fix floating point comparison crosstest
Floating point comparison crosstest was failing in
filetype=obj mode because of missing breaks in load
encoding functions. With this patch, crosstest
generator, with vector tests disabled, for parameters
--filetype=obj --include=test_fcmp,mips32,native,Om1,base
returns
TotalTests=123904 Passes=123904 Failures=0
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2355413008 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Thu, 22 Sep 2016 19:56:12 +0000 (12:56 -0700)]
Subzero, MIPS32: Intrinsic call Ctlz for i32
Implements intrinsic call llvm.ctlz for i32
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2354293002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Thu, 22 Sep 2016 18:24:44 +0000 (11:24 -0700)]
Subzero, MIPS32: Instruction NOR, pseudoinstruction NOT
These two are prerequisites for some intrinsic calls and
bitwise operations.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2356293002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Thu, 22 Sep 2016 14:05:05 +0000 (07:05 -0700)]
Subzero, MIPS32: Remove duplicate functionalities
Removes lowering functions functionalities already covered by
genTargetHelperCallFor. Adds error messages for appropriate cases.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2358123002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jaydeep Patil [Wed, 21 Sep 2016 13:24:41 +0000 (06:24 -0700)]
[SubZero] Fix floating-point comparison for MIPS
The patch fixes code generation and encoding of floating-point comparison.
All floating-point comparison related test in test_fcmp cross test pass (after removing vector related tests):
TotalTests=123904 Passes=123904 Failures=0
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2357143002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Srdjan Obucina [Tue, 20 Sep 2016 23:25:14 +0000 (16:25 -0700)]
Subzero, MIPS32: Intrinsic call Trap
Implements intrinsic call llvm.trap.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2351893004 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Tue, 20 Sep 2016 15:44:44 +0000 (08:44 -0700)]
Subzero, MIPS32: Encoding of FP comparison instructions
Patch implements encoding for instructions used for floating point number comparison.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2350833002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jaydeep Patil [Tue, 20 Sep 2016 15:38:11 +0000 (08:38 -0700)]
[SubZero] lower float and double constants for MIPS
The patch emits constant pool for float and double constants.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2351583002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Srdjan Obucina [Tue, 20 Sep 2016 13:49:52 +0000 (06:49 -0700)]
Subzero, MIPS32: lowerUnreachable
Patch implements lowerUnreachable and encoding for teq
instruction. To avoid duplicated code, class describing
trap instruction is borrowed from
https://codereview.chromium.org/
2339323004/
Review URL: https://codereview.chromium.org/
2350903002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jaydeep Patil [Mon, 19 Sep 2016 23:48:34 +0000 (16:48 -0700)]
[SubZero] Use DIV instruction instead of TargetHelperCall
Use DIV/DIVU instructions provided by MIPS32 ISA instead of calling target
helper function (__divsi3 etc.). These instructions give 32-bit quotient and
remainder in 32-bit special LO/HI registers respectively. An additional
instructions to check for divide-by-zero (Trap if equal) is emitted after the
DIV/DIVU instructions.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2339323004 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Nicolas Capens [Sat, 17 Sep 2016 04:19:38 +0000 (00:19 -0400)]
Implement Microsoft x86-64 calling convention support.
BUG=swiftshader:9
Change-Id: Ie58412c13991143c1ee39f3a122475bf93ead242
Reviewed-on: https://chromium-review.googlesource.com/385117
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 16 Sep 2016 21:00:12 +0000 (17:00 -0400)]
Allow 64-bit code to be stored as ELF64.
Previously all unsandboxed 64-bit code was assumed to use ILP32 and
be stored in ELF32 format using the x32 ABI.
BUG=swiftshader:9
Change-Id: I2476a09d1f0af60b1ac6f8807ee9ed37d54a99d4
Reviewed-on: https://chromium-review.googlesource.com/385277
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Srdjan Obucina [Sun, 18 Sep 2016 14:30:19 +0000 (07:30 -0700)]
Subzero, MIPS32: Floating point support in ELF output
Patch implements improvements and instruction encodings for many COP1 instructions for handling floating point values.
Patch covers load, store, basic arithmetic, data movement for FPR<->FPR, GPR<->FPR, FPR<->GPR, and format conversion instructinos.
Added instruction encodings:
Load: lb, lh, lwc1, ldc1
Store: sb, sh, swc1, sdc1
FP arith: abs_d, abs_s, add_d, add_s, div_d, div_s, mul_d, mul_s, sqrt_d, sqrt_s, sub_d, sub_s
FP movs: mfc1, mov_d, mov_s, movn_d, movn_s, movz_d, movz_s, mtc1
Conversion: cvt_d_l, cvt_d_s, cvt_d_w, cvt_s_d, cvt_s_l, cvt_s_w, trunc_l_d, trunc_l_s, trunc_w_d, trunc_w_s
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2341713003 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Sun, 18 Sep 2016 13:50:52 +0000 (06:50 -0700)]
Subzero, MIPS32: nacl-other-intrinsics-mips merged to original file
With fix related to stack alignment bytes increasing, it is
possible to return mips tests from nacl-other-intrinsics-mips
to its original place. However, with existing vector test, O2 test
had to be turned off. This does not affect anything imortant,
because it only tested one case (test_sqrt_ignored).
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2342083003 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Nicolas Capens [Tue, 13 Sep 2016 15:35:57 +0000 (11:35 -0400)]
Abstract the ELFStreamer class.
This enables other implementations, such as streaming to memory
instead of a file.
BUG=swiftshader:9
Change-Id: I2a780ee67e9bccd157c120b7a0895d9764117464
Reviewed-on: https://chromium-review.googlesource.com/384911
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Srdjan Obucina [Fri, 16 Sep 2016 00:26:40 +0000 (17:26 -0700)]
Subzero, MIPS32: Randomly insert NOP
Patch implements randomlyInsertNop for MIPS32. Separate test case
added because current test is based on function with vector
operands, which MIPS32 does not support yet.
run-pnacl-sz.py updated, to pass -z argument to objdump, so it does
not hide multiple nops (shows ... instead) between instruction.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2340733003 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jim Stichnoth [Wed, 14 Sep 2016 18:07:30 +0000 (11:07 -0700)]
Subzero: Fix SUBZERO_REVISION in production builds.
In production autoconf builds (which are the builds that matter), the SUBZERO_REVISION was being calculated based on git history of the top-level native_client repo, rather than the pnacl-subzero repo.
BUG= none
R=jpp@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/
2338943003 .
Sagar Thakur [Wed, 14 Sep 2016 13:09:26 +0000 (06:09 -0700)]
[Subzero][MIPS] Fix test nacl-other-intrinsics.ll
The test nacl-other-intrinsics.ll fails with an assertion failure: assert(SpillAreaAlignmentBytes <= MIPS32_STACK_ALIGNMENT_BYTES). This assertion triggers because MIPS32_STACK_ALIGNMENT_BYTES is 8 and SpillAreaAlignmentBytes is 16. The minimum required alignment of stack for MIPS32 is 8 bytes according to the ABI document. Since 16 is aligned to 8, we can safely keep the stack aligned to 16 bytes to fix the test.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2339683003 .
Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
Srdjan Obucina [Wed, 14 Sep 2016 13:06:24 +0000 (06:06 -0700)]
Subzero, MIPS32: lowerSelect for i1, i8, i16, i32, f32, f64
Implements lowerSelect for basic integer and float datatypes.
Support for i64 will be added as separate patch.
Crucial for running crosstests.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2337023003 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jim Stichnoth [Wed, 14 Sep 2016 12:41:46 +0000 (05:41 -0700)]
Subzero: Fix ODR errors in the g++ build.
In a similar fashion as https://codereview.chromium.org/
1732233002 .
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
2339843002 .
Jaydeep Patil [Wed, 14 Sep 2016 05:52:27 +0000 (22:52 -0700)]
[SubZero] Implement GP to/from FP moves for MIPS
The patch implements mtc1/mfc1 instructions which are required for GP to/from FP registers moves.
The patch also implements fptosi and sitofp for float and i32 types to test mtc1/mfc1 instructions.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2316933002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Nicolas Capens [Mon, 12 Sep 2016 19:40:25 +0000 (15:40 -0400)]
Remove instructions instead of attempting to delete them.
Instructions are allocated using the ArenaAllocator which uses a
memory pool of "slabs", so we can't use the regular C++ delete to
deallocate them. Just remove them from the list. This change also
provides an override for Inst's operator delete to use the custom
allocator, which should currently not be called.
BUG=swiftshader:8
Change-Id: Ibb166910402a70e7d9276b28e19b15caf64422f2
Reviewed-on: https://chromium-review.googlesource.com/384336
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Jaydeep Patil [Tue, 13 Sep 2016 13:09:48 +0000 (06:09 -0700)]
[SubZero] Implement address optimization for MIPS
The patch implements address optimization for MIPS.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2313293002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Srdjan Obucina [Tue, 13 Sep 2016 12:46:30 +0000 (05:46 -0700)]
Subzero, MIPS32: Floating point comparison
This patch implements lowerFcmp, for lowering floating point comparison.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2047043002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Jim Stichnoth [Tue, 13 Sep 2016 02:11:43 +0000 (19:11 -0700)]
Subzero: x8664: Fix a "uitofp i32 to double" lowering error.
The movzx instruction in the lowering sequence should not be allowed to be elided.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4379
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
2335933002 .
Srdjan Obucina [Sun, 11 Sep 2016 14:08:30 +0000 (07:08 -0700)]
Subzero, MIPS32: Handling fptrunc and fpext casting
Patch implements truncation and extension of FP values.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2324903002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Sat, 10 Sep 2016 15:25:37 +0000 (08:25 -0700)]
Subzero, MIPS32: Intrinsic calls for ABS.fmt and SQRT.fmt
This patch adds ABS.fmt and SQRT.fmt instructions for intrinsic
calls. Test cases are copied from nacl-other-intrinsics.ll.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2325703002 .
Patch from Srdjan Obucina <Srdjan.Obucina@imgtec.com>.
Srdjan Obucina [Fri, 9 Sep 2016 16:39:52 +0000 (09:39 -0700)]
Subzero, MIPS32: Introduction of genTargetHelperCallFor
genTargetHelperCallFor provides framework for calling Subzero
runtime functions. This patch implements calls and tests for
some of the available functions, but not all. Current
lowerCall implementation does not allow more (Handling of FP
return values is missing).
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2317653004 .
Patch from Srdjan Obucina <srdjan.obucina@imgtec.com>.
Jim Stichnoth [Fri, 9 Sep 2016 16:33:07 +0000 (09:33 -0700)]
Subzero: Fix target attribute when SZTARGET is defined.
Adds the right macro voodoo so that when Subzero is built for a single target, e.g.:
$ make -f Makefile.standalone SZTARGET=ARM32
we get output like this:
$ ./pnacl-sz --build-atts
target_ARM32
rather than this:
$ ./pnacl-sz --build-atts
target_SZTARGET
BUG= none
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
2306273002 .
Jim Stichnoth [Fri, 9 Sep 2016 16:29:08 +0000 (09:29 -0700)]
Subzero: Fix a build error. Also reformat.
BUG= none
TBR=nicolascapens@chromium.org
Review URL: https://codereview.chromium.org/
2328873003 .
Nicolas Capens [Tue, 6 Sep 2016 16:59:58 +0000 (12:59 -0400)]
Fix initializing the allocator before creating empty vector.
MSVC's implementation of the STL allocates memory even for an empty
vector. Since we're using a custom thread-local allocator, it should
be initialized before any STL member containers get initialized.
BUG=swiftshader:7
Change-Id: I4bd977e7ee8eb87006fe08b051cbcfc9bc62342b
Reviewed-on: https://chromium-review.googlesource.com/381531
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Thu, 8 Sep 2016 16:47:42 +0000 (12:47 -0400)]
Ensure NoDefinitions gets initialized only at first use.
As a global, NoDefinitions could get initialized at program startup,
which happens specifically with Visual Studio. This causes the
progam to abort because its initialization depends on a TLS variable
to be (manually) initialized first. Since there's only one use of
NoDefinitions, it can be moved to that location and since it's at
function scope it only gets constructed at first use.
BUG=swiftshader:7
Change-Id: I30801ad0d0ab380ead33069f174bb78dc1b230ab
Reviewed-on: https://chromium-review.googlesource.com/379955
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Fri, 2 Sep 2016 10:32:56 +0000 (06:32 -0400)]
Work around Visual Studio template specialization issue.
Visual Studio 2015 generates an error for using array_lengthof() on
a template class member array. Since the array content does not
depend on the template types, just make it a global.
BUG=swiftshader:7
Change-Id: If197308413f880484be06e6738f246be144d0ba6
Reviewed-on: https://chromium-review.googlesource.com/380501
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 7 Sep 2016 19:03:32 +0000 (15:03 -0400)]
Add missing header includes.
BUG=swiftshader:7
Change-Id: If4e1f8269343161f907a62f1fccf6a547f80fc1d
Reviewed-on: https://chromium-review.googlesource.com/382371
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Nicolas Capens [Fri, 2 Sep 2016 11:05:50 +0000 (07:05 -0400)]
Fix unresolved template method definition.
ConstantInteger32::shouldBeRandomizedOrPooled() was defined in a
source file and not resolvable. Move its definition inline.
BUG=swiftshader:7
Change-Id: I693ef93a9986e11b4e24f0194c9260f074567b81
Reviewed-on: https://chromium-review.googlesource.com/380422
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 2 Sep 2016 14:22:57 +0000 (10:22 -0400)]
Fix Visual Studio compilation of types within template classes.
BUG=swiftshader:7
Change-Id: I0c51c67b6f19a061dfff83415df5e41ea0efd6de
Reviewed-on: https://chromium-review.googlesource.com/380596
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 1 Sep 2016 20:53:49 +0000 (16:53 -0400)]
Enable disabling API-based TLS support.
BUG=swiftshader:7
Change-Id: I0ef3b0ab059bd48e0241eea13a5b77a193351108
Reviewed-on: https://chromium-review.googlesource.com/380275
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 1 Sep 2016 20:22:36 +0000 (16:22 -0400)]
Work around Visual Studio static constexpr bug.
Visual Studio doesn't recognize the use of a class member in a static
constexpr unless prefixed with the class name.
BUG=swiftshader:7
Change-Id: I4ffbaa6fc1a43a7294ecdaf426bd7fc2aab5e469
Reviewed-on: https://chromium-review.googlesource.com/380195
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 1 Sep 2016 15:04:46 +0000 (11:04 -0400)]
Fix type alias compilation issue on Windows.
With Visual Studio 2015, the Traits type alias is not considered
within scope yet for the constructor's argument list. Instead Use
the template argument directly.
BUG=swiftshader:7
Change-Id: I677f5bed1a4749aba921a23ed5b1466431147069
Reviewed-on: https://chromium-review.googlesource.com/379915
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 1 Sep 2016 19:05:49 +0000 (15:05 -0400)]
Allow using SZTARGET without PNACL_LLVM.
BUG=swiftshader:7
Change-Id: If0cfad149ba6ba7bc17708e8a6e5183189eeef5c
Reviewed-on: https://chromium-review.googlesource.com/379876
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Jaydeep Patil [Sun, 4 Sep 2016 14:19:08 +0000 (07:19 -0700)]
[SubZero] Implement load and store for MIPS
This patch implements lowerLoad and extends existing lowerStore for byte, short and floating-point types.
The patch also modifies PostLoweringLegalizer for conversion of mov to load or store.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2301303003 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Nicolas Capens [Thu, 1 Sep 2016 15:29:43 +0000 (11:29 -0400)]
Simplify ClFlags macro for older C++ standards.
Visual Studio 2015 does not support the use of typename outside of a
template definition. Instead alias the flag's storage type. This
even avoids some duplication.
BUG=swiftshader:7
Change-Id: I787701f6bfe8e36169e6ac5d63fcb6a1a114bdb0
Nicolas Capens [Fri, 2 Sep 2016 16:51:03 +0000 (16:51 +0000)]
Merge "Implement ICE_CACHELINE_BOUNDARY for Visual Studio."
Jim Stichnoth [Fri, 2 Sep 2016 13:29:48 +0000 (06:29 -0700)]
Subzero: Add the MIPS=1 makefile option for alternate testing mode.
There are two problems to address:
1. Google developers lack some tooling to test MIPS changes.
2. MIPS developers lack some tooling/packages to allow full "make presubmit" testing.
Until all this gets sorted out, we add the "make -f Makefile.standalone MIPS=1" option to control some of the testing targets:
check-lit: No changes, as all these lit tests should be runnable in both environments.
check-xtest: MIPS=1 runs just the mips32 tests, plus the x8664 native tests as a sanity-check. Non-MIPS runs everything except the mips32 tests.
check-spec: MIPS=1 completely disables spec2k testing.
presubmit: MIPS=1 greatly reduces the number of tests (especially since so many are spec variants).
With this change, mips32 CLs should pass "make -f Makefile.standalone MIPS=1 presubmit" before upload, and other CLs should pass "make -f Makefile.standalone presubmit".
BUG= none
R=kschimpf@google.com, obucinac@gmail.com
Review URL: https://codereview.chromium.org/
2271053006 .
Nicolas Capens [Thu, 1 Sep 2016 15:40:49 +0000 (11:40 -0400)]
Implement ICE_CACHELINE_BOUNDARY for Visual Studio.
BUG=swiftshader:7
Change-Id: I1c40c10b3c3d032d3f7e0f8634c7c9abcc21d130
Jim Stichnoth [Wed, 31 Aug 2016 22:32:32 +0000 (15:32 -0700)]
Subzero: Deterministically sort local var stack offsets.
Currently, TargetLowering::sortVarsByAlignment() uses the variable's required alignment as the primary key, but then std::sort() breaks ties arbitrarily. This can give different results across different STL implementations, for example when building against LLVM trunk versus building in the PNaCl environment.
The fix is to use Variable::Number as the secondary key.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
2295393002 .
Jim Stichnoth [Wed, 31 Aug 2016 20:42:00 +0000 (13:42 -0700)]
Subzero: Fix a build error against LLVM trunk.
LLVM commit
1d79fff9e65e77f84bf80c2cf4f0155bd167c90d changed the way ilist::reverse_iterator is converted to ilist::iterator.
See https://github.com/llvm-mirror/llvm/commit/
1d79fff9e65e77f84bf80c2cf4f0155bd167c90d
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
2297363002 .
Jaydeep Patil [Wed, 31 Aug 2016 12:10:03 +0000 (05:10 -0700)]
[SubZero] Implement lowerSwitch for MIPS
The patch implements lowerSwitch for i32 and i64 types.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2289043002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Jim Stichnoth [Mon, 29 Aug 2016 17:15:18 +0000 (10:15 -0700)]
Subzero: Fix the LLVM trunk build.
The original Ice::Inst needed a bit of template specialization so that llvm::ilist<Ice::Inst> methods wouldn't try to invoke private/deleted ctor/dtor methods. The Subzero code copied a pattern fairly widely used in LLVM.
Recently, LLVM improved ilist<> so that this specialization is no longer needed.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
2287363002 .
Jaydeep Patil [Mon, 29 Aug 2016 12:14:05 +0000 (05:14 -0700)]
[SubZero] Generate ELF output for MIPS
This patch adds encoding of few arithmetic and branch instructions.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2259983004 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Jaydeep Patil [Fri, 26 Aug 2016 20:27:40 +0000 (13:27 -0700)]
Delete unconditional branch to the next node.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2275883002 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Thomas Lively [Mon, 22 Aug 2016 17:05:30 +0000 (10:05 -0700)]
Subzero: Updated documentation to describe building spec2k benchmarks
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4374
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2266593002 .
Patch from Thomas Lively <tlively@google.com>.
Jaydeep Patil [Fri, 19 Aug 2016 05:43:43 +0000 (22:43 -0700)]
Provide repointEdges for MIPS.
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2257043003 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Jaydeep Patil [Fri, 19 Aug 2016 05:37:30 +0000 (22:37 -0700)]
[SubZero]Added InstMIPS32Load to differentiate stores from loads
Both the operands in InstMIPS32Memory are source. However in load instructions, first operand is a destination. The InstMIPS32Load treats first operand as destination and second operand as source.
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2250203005 .
Patch from Jaydeep Patil <jaydeep.patil@imgtec.com>.
Thomas Lively [Fri, 19 Aug 2016 00:47:34 +0000 (17:47 -0700)]
Subzero: Added address of bad instruction to error output
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4374
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2256673004 .
Thomas Lively [Thu, 18 Aug 2016 17:37:46 +0000 (10:37 -0700)]
Subzero: Replace pointers to allocation functions in stores
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4374
R=kschimpf@google.com, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2256903003 .
Jim Stichnoth [Wed, 17 Aug 2016 23:20:21 +0000 (16:20 -0700)]
Subzero: Include commit count in revision string.
Instead of the version string being like this:
Subzero_revision_efdf412032f7622a0663696896708d75b82e92f6
Make it more like this:
Subzero_revision_1089_efdf412032f7622a0663696896708d75b82e92f6
I.e., provide both git hash and commit count.
That way, it's easier to compare revision strings and determine which one is newer.
BUG= none
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
2251153002 .
Jim Stichnoth [Wed, 17 Aug 2016 16:12:52 +0000 (09:12 -0700)]
Subzero: Fix build errors with LLVM trunk.
1. Some explicit conversions between Inst* and InstList::iterator are needed.
2. llvm::sys::PrintStackTraceOnErrorSignal() has a new argument.
3. A previous CL neglected to plumb in SUBZERO_REVISION for the cmake build.
BUG= none
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
2247253005 .
Thomas Lively [Tue, 16 Aug 2016 21:55:51 +0000 (14:55 -0700)]
Subzero: Replace pointers to allocation functions in loads
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4374
R=kschimpf@google.com, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2241383006 .