OSDN Git Service

android-x86/external-swiftshader.git
7 years agoRemoved extra / from DEPS file
Alexis Hetu [Wed, 1 Feb 2017 16:17:20 +0000 (11:17 -0500)]
Removed extra / from DEPS file

Linux handled the extra / properly, but Windows did not,
so it had to be removed.

Change-Id: Ie42d8777aef83c0024bc9b3e5c631ece7e87e236
Reviewed-on: https://swiftshader-review.googlesource.com/8629
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoSupport TARGET_TRANSLATE_2ND_ARCH case
Victor Khimenko [Fri, 30 Sep 2016 19:31:01 +0000 (21:31 +0200)]
Support TARGET_TRANSLATE_2ND_ARCH case

When second arch is translated we don't have 32-bit platform and
64-bit platform.  Instead we have two 32-bit ones, just one is
translated.

Test: Build system refactoring CL. Existing unit tests still pass.

BUG=31422117
BUG=27526885

Change-Id: Ia5fdd2f485dd5e4e8bc6799f0691cd03c2bff1a0
Reviewed-on: https://swiftshader-review.googlesource.com/8609
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
(cherry picked from commit f24b1b445274b0dbb4ffc860847a26d0b33d3a21)
Reviewed-on: https://swiftshader-review.googlesource.com/8611

7 years agoSupport HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED as RGBX8888
Greg Hartman [Fri, 27 Jan 2017 17:22:31 +0000 (09:22 -0800)]
Support HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED as RGBX8888

The 3.0 camera HAL makes extensive use of
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, which Android defines as the
format that is best for the hardware. The fake camera implementation
decided that that was RGBX8888, so it seem like that is what we should
use.

Test: untested
Change-Id: Ia02ebbefd015f9ca099b4393daf5d464f38fe8fc
Reviewed-on: https://swiftshader-review.googlesource.com/8588
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix using sized internal formats for EGL images.
Nicolas Capens [Mon, 30 Jan 2017 20:45:44 +0000 (15:45 -0500)]
Fix using sized internal formats for EGL images.

Bug b/34799114

Change-Id: Id42d3b784946291d8754774a7916a186a4694ba1
Reviewed-on: https://swiftshader-review.googlesource.com/8591
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRefactor Byte4 unpacking.
Nicolas Capens [Thu, 26 Jan 2017 23:13:36 +0000 (15:13 -0800)]
Refactor Byte4 unpacking.

Change-Id: I82f8215ce4366e0795ce249b4d8f6c8e391af96c
Reviewed-on: https://swiftshader-review.googlesource.com/8568
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMacOS build fix
Alexis Hetu [Mon, 30 Jan 2017 18:46:08 +0000 (13:46 -0500)]
MacOS build fix

Fixed MacOS build after the recent Linux fix caused an issue on
MacOS. Removed a few flags and changed visibility to fix it.

Change-Id: Ic9d08d8ec0ccf8a2002f2787c3ec79861bb59139
Reviewed-on: https://swiftshader-review.googlesource.com/8589
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoSupport unsigned array indices.
Nicolas Capens [Fri, 27 Jan 2017 01:44:37 +0000 (17:44 -0800)]
Support unsigned array indices.

Change-Id: I4136781005cbd0551461adecdd94d8e3cc8688d0
Reviewed-on: https://swiftshader-review.googlesource.com/8570
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix array addressing of emulated vector types.
Nicolas Capens [Fri, 27 Jan 2017 00:05:18 +0000 (16:05 -0800)]
Fix array addressing of emulated vector types.

operator[] on a pointer was using the vector register size (16 bytes)
instead of the size of the (emulated) vector type.

Change-Id: Ice8677b41a3af81176fe9495fd02ede9f8b0482f
Reviewed-on: https://swiftshader-review.googlesource.com/8569
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoGeneralize dead stores.
Nicolas Capens [Fri, 27 Jan 2017 10:29:00 +0000 (02:29 -0800)]
Generalize dead stores.

Stores are dead if the address is from an alloca and all uses of the
address are stores, not just when it's a single store.

Change-Id: I5b65a64e21b9e398922e5440c35f0d318c03e911
Reviewed-on: https://swiftshader-review.googlesource.com/8574
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix eliminating stores to pointer arguments.
Nicolas Capens [Fri, 27 Jan 2017 10:26:12 +0000 (02:26 -0800)]
Fix eliminating stores to pointer arguments.

If a store address has no definition, it must be a pointer argument.
Unlike stores to alloca's, these are not dead.

Change-Id: I66e50b14ffea1cfc61fc756b5545ab8ae28b4bf8
Reviewed-on: https://swiftshader-review.googlesource.com/8573
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdding Subzero in Chromium
Alexis Hetu [Thu, 19 Jan 2017 15:59:25 +0000 (10:59 -0500)]
Adding Subzero in Chromium

In order to add Subzero as a dependency in Chromium, Chromium's
DEPS file will be modified to use SwiftShader's DEPS file in
order to pull SwiftShader's desired revision of Subzero. This
will ensure that SwiftShader and Subzero are always in sync.

Change-Id: I0b24845c0ddbf974baac4ef6cc3ff6ab397d5f69
Reviewed-on: https://swiftshader-review.googlesource.com/8529
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoUpdate to Linux build files for Chromium
Alexis Hetu [Fri, 27 Jan 2017 16:38:59 +0000 (11:38 -0500)]
Update to Linux build files for Chromium

Although SwiftShader was building properly on the build bots, it
wasn't exporting its symbols properly. I compared the flags used in
the BUILD.gn files and in the CMakeLists.txt file and attempted to
get both build systems to use the same flags and options.

Change-Id: Idc73d4ad5b45311881e88720bf611e25110dcc70
Reviewed-on: https://swiftshader-review.googlesource.com/8576
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoOptimize constant operand order.
Nicolas Capens [Wed, 25 Jan 2017 19:35:00 +0000 (11:35 -0800)]
Optimize constant operand order.

Constant operands of commutative operations preferably go on the right
hand side to avoid requiring an extra register for two operand
instructions. Also, Subzero assumes constants in pointer arithmetic are
on the right hand side to consider optimizing it into an addressing
mode.

Change-Id: Ife5a471903d5f4bef0c19b6c908d75715f06bfec
Reviewed-on: https://swiftshader-review.googlesource.com/8548
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoVectorize R5G6B5 framebuffer present.
Nicolas Capens [Tue, 24 Jan 2017 16:53:47 +0000 (08:53 -0800)]
Vectorize R5G6B5 framebuffer present.

Change-Id: I40922c89056cacd00f9d728dfe1f3f12824c81a1
Reviewed-on: https://swiftshader-review.googlesource.com/3253
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd a mutex around SyncSet operations
Greg Hartman [Fri, 26 Aug 2016 03:18:01 +0000 (20:18 -0700)]
Add a mutex around SyncSet operations

BUG: 31072273
Change-Id: I037505ad3ab1ba80aecab4e24ec8d1932df2dcf7
Reviewed-on: https://swiftshader-review.googlesource.com/7030
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Lingfeng Yang <lfy@google.com>
7 years agoUse MAP_ANON if MAP_ANONYMOUS is not defined.
Nicolas Capens [Fri, 20 Jan 2017 22:11:41 +0000 (17:11 -0500)]
Use MAP_ANON if MAP_ANONYMOUS is not defined.

MAP_ANON has been deprecated in favor of MAP_ANONYMOUS, but Mac OS only
defines MAP_ANON.

Bug chromium:630728

Change-Id: I7345a5f9227acbc0caa29d8103855ab531f16499
Reviewed-on: https://swiftshader-review.googlesource.com/8531
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFixed warnings in Reactor
Alexis Hetu [Thu, 19 Jan 2017 15:49:19 +0000 (10:49 -0500)]
Fixed warnings in Reactor

Fixed:
- type comparison mismatch
- redefined macros
- unused functions
- line endings

Change-Id: I965ca4b887aee968e6cf95feb36c3cbf90b85580
Reviewed-on: https://swiftshader-review.googlesource.com/8528
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoSupport building with Subzero on Mac OS.
Nicolas Capens [Wed, 18 Jan 2017 21:24:09 +0000 (16:24 -0500)]
Support building with Subzero on Mac OS.

Change-Id: I7979eb2557a6103ad10b7be3c274fadf12d27ae7
Reviewed-on: https://swiftshader-review.googlesource.com/8508
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoEmit SSE2 compatible operations if SSE4.1 is not supported.
Nicolas Capens [Sat, 14 Jan 2017 17:52:55 +0000 (12:52 -0500)]
Emit SSE2 compatible operations if SSE4.1 is not supported.

Bug swiftshader:20

Change-Id: I67818bfe10cb29211559fb2ee047f6bec6ce46d4
Reviewed-on: https://swiftshader-review.googlesource.com/8451
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoDetect SSE4.1 support for Subzero.
Nicolas Capens [Sat, 14 Jan 2017 17:52:55 +0000 (12:52 -0500)]
Detect SSE4.1 support for Subzero.

Bug swiftshader:20

Change-Id: I20c2ab7cb4c00c365520ff8b8500f7594127498b
Reviewed-on: https://swiftshader-review.googlesource.com/8468
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix loading uninitialized data in loops.
Nicolas Capens [Wed, 18 Jan 2017 15:18:03 +0000 (10:18 -0500)]
Fix loading uninitialized data in loops.

When we have an uninitialized variable that is declared outside of a
loop and is read and written to inside the loop, we should not eliminate
the load and replace it with an undefined value, because in the next
iteration we want the value from the previous iteration.

Change-Id: Ic996c796307f62fc835079af6c58adf1eb288259
Reviewed-on: https://swiftshader-review.googlesource.com/8488
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix packusdw SSE2 fallback.
Nicolas Capens [Tue, 17 Jan 2017 19:01:33 +0000 (14:01 -0500)]
Fix packusdw SSE2 fallback.

Bug swiftshader:20

Change-Id: I81ad267d450713ffe2a5a84e1d7f7f140b515c85
Reviewed-on: https://swiftshader-review.googlesource.com/8454
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoRefactor Reactor type constructors.
Nicolas Capens [Mon, 16 Jan 2017 22:19:00 +0000 (17:19 -0500)]
Refactor Reactor type constructors.

Provide default constructors for each type, and initialize the swizzle
parent in a less bug prone manner.

Change-Id: Ia7f406a66274c7b1737cbe82db733e2e3ab65175
Reviewed-on: https://swiftshader-review.googlesource.com/8453
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix the vector element extraction type for Short4.
Nicolas Capens [Mon, 16 Jan 2017 21:25:08 +0000 (16:25 -0500)]
Fix the vector element extraction type for Short4.

Change-Id: Ic8785bd56ac7303b0502f0303f9270a6999a1df9
Reviewed-on: https://swiftshader-review.googlesource.com/8452
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoAvoid vector element insert type mismatch.
Nicolas Capens [Fri, 13 Jan 2017 22:37:45 +0000 (17:37 -0500)]
Avoid vector element insert type mismatch.

Subzero silently allows inserting a 32-bit integer into a vector with
16-bit elements. This generates a pinsrd instruction, which requires
SSE4.1, even when specifying to only support SSE2. This change emits
a pinsrw instruction instead, which is SSE2.

Bug swiftshader:20

Change-Id: I37bd0ebb6d9cfdd2cdef4788e89e9672386c685e
Reviewed-on: https://swiftshader-review.googlesource.com/8450
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix Subzero vector comparison.
Nicolas Capens [Fri, 13 Jan 2017 20:09:21 +0000 (15:09 -0500)]
Fix Subzero vector comparison.

Subzero returns vNi1 type results for vector comparisons, which we were
sign-extending to v4i32, even for smaller fields. We don't actually
ever have to sign-extend these results.

Change-Id: Ifdd30edd498d66fc4c557804035794a659eacd87
Reviewed-on: https://swiftshader-review.googlesource.com/8449
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoManually convert unsigned integer to floating-point.
Nicolas Capens [Thu, 15 Dec 2016 19:45:13 +0000 (14:45 -0500)]
Manually convert unsigned integer to floating-point.

Subzero uses a helper function to convert uint to float. It's faster to
just emit a sequence of operations to perform the cast manually.
This implementation converts the lower 31 bits as a signed integer, and
adds 0x80000000 as a floating-point value when the upper bit is set.
This approach does not produce the correct rounding in rare cases, but
should still be adequate. For consistency, we're also using this method
with the LLVM back-end.

Change-Id: Ic5d7b73cd2a9e154056365cdbe9af0962bdbe1cb
Reviewed-on: https://swiftshader-review.googlesource.com/8312
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix resource include file path capitalization.
Nicolas Capens [Fri, 13 Jan 2017 17:34:41 +0000 (12:34 -0500)]
Fix resource include file path capitalization.

Change-Id: I01d1e3a5464ba81440cc144ac50beae2c8b3f3c8
Reviewed-on: https://swiftshader-review.googlesource.com/8448
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoAdding OWNERS file for Chromium
Alexis Hetu [Thu, 12 Jan 2017 14:41:49 +0000 (09:41 -0500)]
Adding OWNERS file for Chromium

Whenever we land a SwiftShader related change in Chromium,
it will look for owners of SwiftShader to make sure the cl
is properly LGTMed before landing, so the file was added
here.

Also fixed a case typo in an rc file.

Change-Id: I282a39764654a08b06320360dd66a5d877f368d3
Reviewed-on: https://swiftshader-review.googlesource.com/8428
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFix SubzeroTest compilation.
Nicolas Capens [Tue, 10 Jan 2017 21:41:11 +0000 (16:41 -0500)]
Fix SubzeroTest compilation.

Change-Id: Ie5f7d782764fbc40d4e3ed9cdce0110bbb9da80d
Reviewed-on: https://swiftshader-review.googlesource.com/8408
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoAdding swiftshader unittests to chromium
Alexis Hetu [Tue, 10 Jan 2017 21:58:04 +0000 (16:58 -0500)]
Adding swiftshader unittests to chromium

Chromium does not allow any third_party code to depend on base,
so the main test runner for swiftshader's tests in chromium can't
live inside the swiftshader repo. To solve this:

1) Added a test environment for swiftshader that will be used
for testing in chromium. Currently, it is simply empty.
2) Split unit tests in 2 files, unittests.cpp, which will
contain the tests ran by both chromium and swiftshader and
main.cpp, which will be used as the swiftshader test runner,
but NOT as the chromium test runner (that one will be added
in chromium at the same time I do the swiftshader update).
3) The BUILD.gn file was updated to make the chromium version
of the test depend on base and on the chromium version of the
swiftshader test runner (swiftshader_tests_main.cc, to be added).

Change-Id: I1128bb482565908bc285dcd6818d90d1d881a50e
Reviewed-on: https://swiftshader-review.googlesource.com/8409
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoExplicitly use the Microsoft ABI on Win32 builds.
Nicolas Capens [Mon, 9 Jan 2017 18:35:14 +0000 (13:35 -0500)]
Explicitly use the Microsoft ABI on Win32 builds.

PNaCl does not use the Microsoft x86-64 calling convention on Windows,
so the System V convention is the new default for Subzero. We need to
set a compile definition to explicitly request the use of the
Microsoft convention.

Change-Id: Ic70f5015d4b5753aa08a1247b6ac73eb9a9d278c
Reviewed-on: https://swiftshader-review.googlesource.com/8378
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoTry resolving existing X11 symbols before loading libX11.
Nicolas Capens [Thu, 22 Dec 2016 03:50:26 +0000 (22:50 -0500)]
Try resolving existing X11 symbols before loading libX11.

libX11 may have already been loaded (dynamically or statically) by the
application. Attempting to load it again could result in a different
version being loaded, causing various compatibility issues.

Bug b/32880157

Change-Id: Ica8e6b1c85b82469885a20dcef31e25e6b598132
Reviewed-on: https://swiftshader-review.googlesource.com/8348
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoSet the CMake default build type to Release.
Nicolas Capens [Mon, 9 Jan 2017 16:48:31 +0000 (11:48 -0500)]
Set the CMake default build type to Release.

CMake considers built-in configuration variables to be predefined, thus
setting CMAKE_BUILD_TYPE with a default value doesn't work because it
already exists. The FORCE attribute overrides it, but we have to guard
against overriding user-specified values.

Change-Id: Icf1cad6af15e788c5ae9ac8424f1ef0d29f9a1ff
Reviewed-on: https://swiftshader-review.googlesource.com/8377
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix determining the loop iteration count.
Nicolas Capens [Fri, 6 Jan 2017 22:22:13 +0000 (17:22 -0500)]
Fix determining the loop iteration count.

Bug b/34128224

Change-Id: I4aebcda840baa8ceef2ae99c98a80a83e32b89b3
Reviewed-on: https://swiftshader-review.googlesource.com/8376
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd a CMake option to build with Subzero.
Nicolas Capens [Fri, 6 Jan 2017 17:47:46 +0000 (12:47 -0500)]
Add a CMake option to build with Subzero.

This enables building with either LLVM or Subzero as the Reactor JIT
compiler back-end, on both Linux and Windows.

Change-Id: I4c052d224cd1302b7de412df58b07ee275ba924f
Reviewed-on: https://swiftshader-review.googlesource.com/8375
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement executable memory allocation for Subzero on Unix.
Nicolas Capens [Thu, 5 Jan 2017 21:31:06 +0000 (16:31 -0500)]
Implement executable memory allocation for Subzero on Unix.

Change-Id: I82b6a3f5336ca64dea30a8d9541fcf43c7ead81a
Reviewed-on: https://swiftshader-review.googlesource.com/8373
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd LLVM dependencies for Subzero on Android and Linux.
Nicolas Capens [Mon, 5 Dec 2016 22:30:34 +0000 (17:30 -0500)]
Add LLVM dependencies for Subzero on Android and Linux.

Change-Id: I3ad40f5c0f9faf8aa27356b72b4d98763b9711d7
Reviewed-on: https://swiftshader-review.googlesource.com/8372
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoUpdate Subzero LLVM dependencies to 759dd39154f0bbf1adc87bf613c95f9564f64aa8
Nicolas Capens [Tue, 3 Jan 2017 19:02:05 +0000 (14:02 -0500)]
Update Subzero LLVM dependencies to 759dd39154f0bbf1adc87bf613c95f9564f64aa8

Change-Id: I03c5ebf799af288558d08190058d03f1ac2922b7
Reviewed-on: https://swiftshader-review.googlesource.com/8355
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix CMake sample include directory and libraries.
Nicolas Capens [Wed, 26 Oct 2016 20:57:35 +0000 (16:57 -0400)]
Fix CMake sample include directory and libraries.

Change-Id: Ib1339f5a40523007ca5832ed1bc7b7d096e6c1f2
Reviewed-on: https://swiftshader-review.googlesource.com/8374
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoOnly add non-conformant configs on Android.
Nicolas Capens [Fri, 6 Jan 2017 14:41:21 +0000 (09:41 -0500)]
Only add non-conformant configs on Android.

This silences a benign assert in the config sorting operator which
checks for unique configs. On platforms other than Android, all of the
configs are marked as conformant.

Bug b/34029810

Change-Id: I600d67747ba24f153a0316609e5a783991093ebd
Reviewed-on: https://swiftshader-review.googlesource.com/8388
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFix clamping viewport dimensions on specification.
Nicolas Capens [Thu, 5 Jan 2017 19:37:22 +0000 (14:37 -0500)]
Fix clamping viewport dimensions on specification.

The spec states that glViewport() silently clamps the viewport
width and height to GL_MAX_VIEWPORT_DIMS[0] and
GL_MAX_VIEWPORT_DIMS[1], respectively.

Bug b/34078120

Change-Id: Ifeec0d6b601ce8a3825796fa551eea1f46150002
Reviewed-on: https://swiftshader-review.googlesource.com/8371
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix integer overflow in rasterization.
Nicolas Capens [Thu, 5 Jan 2017 18:18:39 +0000 (13:18 -0500)]
Fix integer overflow in rasterization.

Rasterization of very large triangles was causing signed 32-bit
integer overflow due to multiplying two unsigned 12.4 fixed-point
coordinates. The equations have been reworked to only require
multiplication of 12.4 by 0.4 fixed-point.

Bug b/34078120

Change-Id: I227b81254559af04baf50fbfec6a7f123bd230e3
Reviewed-on: https://swiftshader-review.googlesource.com/8370
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoOptimize flat triangle edge rasterization.
Nicolas Capens [Thu, 5 Jan 2017 15:11:01 +0000 (10:11 -0500)]
Optimize flat triangle edge rasterization.

Change-Id: Ibfd483ce3cba6ec036327b32cba1460d68f8c9e8
Reviewed-on: https://swiftshader-review.googlesource.com/3542
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFix the type used for structure field write masks.
Nicolas Capens [Wed, 4 Jan 2017 16:30:45 +0000 (11:30 -0500)]
Fix the type used for structure field write masks.

The index used to index into a structure (a scalar) used to have the
vector size of the resulting type. This changed recently to always be
1, so the field type size needs to be determined from the fields
themselves, which is also the type of the indexing result.

Change-Id: I2dc373d8d31b02c0f69879cb0a3feacd83d6e473
Reviewed-on: https://swiftshader-review.googlesource.com/8368
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years ago[emulator] Delete VAOs starting from highest
Lingfeng Yang [Fri, 23 Dec 2016 02:00:35 +0000 (18:00 -0800)]
[emulator] Delete VAOs starting from highest

If VAOs are deleted starting from 0, then the
following happens when an app's context has
genned two VAO's that are both != 0,
and the first of the two nonzero VAOs
is the current one:

VAO 0
VAO 1 <- current
VAO 2

in context dtor loop over vao map:
delete vao 0 (done)
delete vao 1:
is current, so bind 0:
in bind 0, we create a new map entry since 0 was deleted
next loop iter deletes vao 0 again (done)
*** at this point, vao 0 pointer refers to freed memory ***
next loop iter wants to delete vao 2,
but the current vao is 0 and refers to freed memory.
then, in Context::deleteVertexArray:
if (getCurrentVertexArray()->name...) <- Segmentation fault (core dumped)

This CL deletes VAO 0 last.

Change-Id: Ifa606ad7517cd213f21606577d3bdd8d810b640d
Reviewed-on: https://swiftshader-review.googlesource.com/8350
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Lingfeng Yang <lfy@google.com>
7 years agoEnable OpenGL ES 3.0 context creation from non-conformant configs.
Nicolas Capens [Mon, 2 Jan 2017 21:21:39 +0000 (16:21 -0500)]
Enable OpenGL ES 3.0 context creation from non-conformant configs.

Allow experimental access to OpenGL ES 3.0 for Android, when the
application explicitly sets the EGL_CONFIG_CAVEAT config attribute
to EGL_NON_CONFORMANT_CONFIG or EGL_DONT_CARE.

Bug b/34029810

Change-Id: I942a6d4812d89446f7045f020df974489c4c0ab3
Reviewed-on: https://swiftshader-review.googlesource.com/8352
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFixed attribute location
Alexis Hetu [Fri, 16 Dec 2016 16:42:38 +0000 (11:42 -0500)]
Fixed attribute location

Attribute location wasn't working properly.
This faulty constructor explains why.

Change-Id: I7701ad316df0684ad02ed405bd2905d56a848bd6
Reviewed-on: https://swiftshader-review.googlesource.com/8328
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed using GL_SAMPLE_ALPHA_TO_COVERAGE
Alexis Hetu [Tue, 13 Dec 2016 21:48:01 +0000 (16:48 -0500)]
Fixed using GL_SAMPLE_ALPHA_TO_COVERAGE

A few things were failing when trying to use
GL_SAMPLE_ALPHA_TO_COVERAGE:
- The alpha test should not be skipped when
  GL_SAMPLE_ALPHA_TO_COVERAGE is set, otherwise
  no computation is performed.
- The alpha reference value was wrong
  (the alpha-to-coverage ramp is centered around it)

Change-Id: Ib9849868d267ca49fb3f0112192af8f207d34307
Reviewed-on: https://swiftshader-review.googlesource.com/8308
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
7 years agoConsistently treat non-existant components as unsigned.
Nicolas Capens [Wed, 14 Dec 2016 15:32:36 +0000 (10:32 -0500)]
Consistently treat non-existant components as unsigned.

Change-Id: I6554202f899559903062155833d49fe43456149b
Reviewed-on: https://swiftshader-review.googlesource.com/8310
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoEliminate dead code.
Nicolas Capens [Mon, 12 Dec 2016 20:07:39 +0000 (15:07 -0500)]
Eliminate dead code.

Bug swiftshader:23

Change-Id: Ifb2862e8358141f67a7974d3fa0a11e6fe41b904
Reviewed-on: https://swiftshader-review.googlesource.com/8290
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoOptimize stores in a single basic block.
Nicolas Capens [Wed, 30 Nov 2016 21:15:28 +0000 (16:15 -0500)]
Optimize stores in a single basic block.

Bug swiftshader:27

Change-Id: Ia5f7da431902c3e87aab47b1dd388e05ced74cd3
Reviewed-on: https://swiftshader-review.googlesource.com/8274
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoEliminate loads following a single store.
Nicolas Capens [Wed, 30 Nov 2016 20:14:28 +0000 (15:14 -0500)]
Eliminate loads following a single store.

Bug swiftshader:27

Change-Id: I11238decf114381126a7465c462d918a3f16b0d8
Reviewed-on: https://swiftshader-review.googlesource.com/8273
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoEliminate loading of uninitialized variables.
Nicolas Capens [Mon, 12 Dec 2016 18:08:06 +0000 (13:08 -0500)]
Eliminate loading of uninitialized variables.

Bug swiftshader:27

Change-Id: I58259e00204550a397522fc26578c9f4d847f502
Reviewed-on: https://swiftshader-review.googlesource.com/8272
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoEliminate unused allocas.
Nicolas Capens [Thu, 24 Nov 2016 19:43:05 +0000 (14:43 -0500)]
Eliminate unused allocas.

Bug swiftshader:27

Change-Id: If085323dc6cc4325c6ff55c1021e98db94a75302
Reviewed-on: https://swiftshader-review.googlesource.com/8228
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed using default attributes
Alexis Hetu [Tue, 13 Dec 2016 16:18:54 +0000 (11:18 -0500)]
Fixed using default attributes

2 issues affected default attributes:
1) The stream type did not match the attributes' internal
   representation
2) The normalized flag was left uninitialized, meaning it was
   using whatever had been set in the previous draw call.

Change-Id: I25b425944e6f59206bf3ef4db35b56d26ef83168
Reviewed-on: https://swiftshader-review.googlesource.com/8292
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix missing switch cases for blitting B32G32R32F.
Nicolas Capens [Tue, 13 Dec 2016 15:19:33 +0000 (10:19 -0500)]
Fix missing switch cases for blitting B32G32R32F.

Change-Id: I09e3615399db4db256d94ba83d44a7b6b17ee2ec
Reviewed-on: https://swiftshader-review.googlesource.com/8291
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoImported a few ES3 fixes from Angle
Alexis Hetu [Fri, 9 Dec 2016 21:01:29 +0000 (16:01 -0500)]
Imported a few ES3 fixes from Angle

Imported some of the more trivial bug fixes:
- Added a few missing interface block cases
- Added checks for varying structs
- Added checks for unsized arrays
- Added first-class array check for pre ES3 compilation
- Added check that ES3 functions do not use builtin names (ES3 only)
- Added more binary operator checks

Change-Id: I3d75453f17e1123478ef7da0998e869970a7fb7d
Reviewed-on: https://swiftshader-review.googlesource.com/8289
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoEliminate assign operations for constants.
Nicolas Capens [Tue, 6 Dec 2016 03:17:19 +0000 (22:17 -0500)]
Eliminate assign operations for constants.

We were using Ice::Variable as the implementation type for Reactor's
abstract Value class only because shuffle operations required them.

Bug swiftshader:24

Change-Id: If87ab5f0b0bca5fbffe2df250ed03b7a1b1490c6
Reviewed-on: https://swiftshader-review.googlesource.com/8258
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix transpose2x4().
Nicolas Capens [Fri, 9 Dec 2016 19:07:50 +0000 (14:07 -0500)]
Fix transpose2x4().

Change-Id: I079991d257be4aa00a0aef938ccf0110cd005bcd
Reviewed-on: https://swiftshader-review.googlesource.com/8288
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix rvalue types.
Nicolas Capens [Thu, 8 Dec 2016 19:34:00 +0000 (14:34 -0500)]
Fix rvalue types.

Change-Id: I98853d4858136553be730b07b02db95d1800035c
Reviewed-on: https://swiftshader-review.googlesource.com/8275
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMatch sub-vector load/store operand order to regular load/store.
Nicolas Capens [Thu, 24 Nov 2016 19:45:06 +0000 (14:45 -0500)]
Match sub-vector load/store operand order to regular load/store.

Bug swiftshader:27

Change-Id: Ic116a804fed80222ad9a41f219c937f28104f225
Reviewed-on: https://swiftshader-review.googlesource.com/8271
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoDeprecate support for constant pointers.
Nicolas Capens [Tue, 6 Dec 2016 02:38:09 +0000 (21:38 -0500)]
Deprecate support for constant pointers.

The use of constant pointers produces code that cannot be relocated.
They also cause issues in Subzero when offsetting them due to not having
constant folding support. We only used them for Direct3D cursor
rendering, which can just pass in the data as an argument instead.

Bug swiftshader:14

Change-Id: Id7f16c3fcaeed3fe64b569af6a49c32f6baec483
Reviewed-on: https://swiftshader-review.googlesource.com/8257
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix doc formatting.
Nicolas Capens [Thu, 8 Dec 2016 15:57:43 +0000 (10:57 -0500)]
Fix doc formatting.

Change-Id: I1387cd9c1666bbb736f75d84679672f1b6964f48
Reviewed-on: https://swiftshader-review.googlesource.com/8270
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix rounding to nearest integer.
Nicolas Capens [Thu, 8 Dec 2016 13:58:54 +0000 (08:58 -0500)]
Fix rounding to nearest integer.

Change-Id: I2fbd6524f1975f2c76ae0b5e544f323e7c7e4537
Reviewed-on: https://swiftshader-review.googlesource.com/8269
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoBuild fix
Alexis Hetu [Tue, 6 Dec 2016 21:56:04 +0000 (16:56 -0500)]
Build fix

A few things needed to be fixed:
- Removed unused local variables in Sampler.cpp
- Local tests showed that newly added files for ubsan build fix
  broke Mac and Windows builds. Moved files to Linux non debug
  only to fix the issue on all platforms.

Change-Id: I4d6d0d162603fdf36c581e84e177e6d042bf2d6e
Reviewed-on: https://swiftshader-review.googlesource.com/8268
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoRenamed libEGL/Surface.* to libEGL/EGLSurface.*
Alexis Hetu [Mon, 5 Dec 2016 17:43:27 +0000 (12:43 -0500)]
Renamed libEGL/Surface.* to libEGL/EGLSurface.*

In order to build libEGL without explicitly setting a dependency
on the Renderer and Reactor projects, the Renderer's Surface class
must be linked with libEGL. That was causing an issue where the 2
Surface.so objects were colliding on Linux. In order to solve the
issue, libEGL/Surface.* was renamed to libEGL/EGLSurface.*

Change-Id: I2e230dd770be56fd29f7aecd5133183a7d2f20b5
Reviewed-on: https://swiftshader-review.googlesource.com/8254
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRemoving Code::Blocks build files
Alexis Hetu [Mon, 5 Dec 2016 22:03:53 +0000 (17:03 -0500)]
Removing Code::Blocks build files

We no longer support Code::Blocks, so removing the build files for it.
CMake can be used for Linux builds instead.

Change-Id: I1af29904078270898a3c07915cf32ca4ee4da25a
Reviewed-on: https://swiftshader-review.googlesource.com/8255
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
7 years agoGLSL const arrays are allowed in OpenGL ES 3.0
Alexis Hetu [Thu, 1 Dec 2016 22:02:33 +0000 (17:02 -0500)]
GLSL const arrays are allowed in OpenGL ES 3.0

Change-Id: I54161aaeaa29fe26c246c61f2e27ccda5ef4a5f1
Reviewed-on: https://swiftshader-review.googlesource.com/8234
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoImplement missing vector operations.
Nicolas Capens [Sat, 3 Dec 2016 05:16:14 +0000 (00:16 -0500)]
Implement missing vector operations.

Bug swiftshader:15

Change-Id: I2116fa6ad368c801e921becd89259b02b4ca68ce
Reviewed-on: https://swiftshader-review.googlesource.com/8251
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoDeprecate the Long1 type.
Nicolas Capens [Fri, 2 Dec 2016 20:30:56 +0000 (15:30 -0500)]
Deprecate the Long1 type.

It corresponds to a scalar MMX type, used mainly for vector shifts.
We no longer need these shifts, and they would have been non-trivial
to emulate with SSE2.

Change-Id: I77a94ff5a62e043b991d4d6fa9ddd436d450181d
Reviewed-on: https://swiftshader-review.googlesource.com/8249
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoDeprecate handling power-of-two texture sampling separately.
Nicolas Capens [Fri, 2 Dec 2016 19:22:32 +0000 (14:22 -0500)]
Deprecate handling power-of-two texture sampling separately.

NPOT texture sampling is slightly slower, but with OpenGL we were
already treating every mipmapped texture as NPOT due to requiring
padding at the 1x1 level for renderability. Seamless cube maps are
also NPOT due to the border. Furthermore, the vector shifts by scalar
required for POT texel address calculation would require 128-bit
values when we deprecate MMX.

Change-Id: Ie2e68f632bea7c6f3e599015c14be50392ea7e9a
Reviewed-on: https://swiftshader-review.googlesource.com/8248
Reviewed-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFixed sys/time.h vs time.h issue on Linux
Alexis Hetu [Mon, 5 Dec 2016 16:25:24 +0000 (11:25 -0500)]
Fixed sys/time.h vs time.h issue on Linux

There was a compilation issue on some bots on Linux related to
time functions which was fixable with a simple config setting.

Change-Id: I8bc71f4298d662e48dd12a4c8963ed5ef3211949
Reviewed-on: https://swiftshader-review.googlesource.com/8252
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoSupport integer rvalues as return value.
Nicolas Capens [Fri, 18 Nov 2016 19:40:40 +0000 (14:40 -0500)]
Support integer rvalues as return value.

Change-Id: I23e9b8de20dae93e7aa5ea7f5ff90abeba672b2b
Reviewed-on: https://swiftshader-review.googlesource.com/8091
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8233
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoMake Reactor destination variables non-const.
Nicolas Capens [Fri, 18 Nov 2016 19:22:38 +0000 (14:22 -0500)]
Make Reactor destination variables non-const.

Bug swiftshader:27

Change-Id: I53e2e4858b10d810f649907fda98dc7863752551
Reviewed-on: https://swiftshader-review.googlesource.com/8090
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8232
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoHold LValue address in a non-template Variable class.
Nicolas Capens [Fri, 18 Nov 2016 17:52:17 +0000 (12:52 -0500)]
Hold LValue address in a non-template Variable class.

Variable<> was redundant after LValue became a template class. We can
recycle it as a container for Values.

Bug swiftshader:27

Change-Id: Ic5ed6f3f7e26579fd38f0e809f8bada1e3639d00
Reviewed-on: https://swiftshader-review.googlesource.com/8071
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8231
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoEliminate "false" basic block when no Else clause.
Nicolas Capens [Wed, 16 Nov 2016 22:40:48 +0000 (17:40 -0500)]
Eliminate "false" basic block when no Else clause.

Bug swiftshader:13

Change-Id: I5dd2ce4ddf1eaf0ec2fc732d022ccad2331e6b6b
Reviewed-on: https://swiftshader-review.googlesource.com/8070
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8230
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoRefactor If/Else to use encapsulated data.
Nicolas Capens [Wed, 16 Nov 2016 20:03:18 +0000 (15:03 -0500)]
Refactor If/Else to use encapsulated data.

Bug swiftshader:13

Change-Id: Ife259311bf6123629ae8505b4164fa82f02e5629
Reviewed-on: https://swiftshader-review.googlesource.com/8033
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8229
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement vector casts.
Nicolas Capens [Wed, 9 Nov 2016 19:24:25 +0000 (14:24 -0500)]
Implement vector casts.

Bug swiftshader:15

Change-Id: Ie20d881be8710d2c8e8e996ae670f7f40481f13c
Reviewed-on: https://swiftshader-review.googlesource.com/7990
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8167
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement vector absolute value.
Nicolas Capens [Wed, 9 Nov 2016 18:31:06 +0000 (13:31 -0500)]
Implement vector absolute value.

Bug swiftshader:15

Change-Id: Ib22831ce669c68a790664839d18ea05668e90992
Reviewed-on: https://swiftshader-review.googlesource.com/7971
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8166
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement switch constructs.
Nicolas Capens [Wed, 9 Nov 2016 17:24:06 +0000 (12:24 -0500)]
Implement switch constructs.

Bug swiftshader:6

Change-Id: Ifd28cab11e814dd09515ad8721f8d3d86123f19c
Reviewed-on: https://swiftshader-review.googlesource.com/7970
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8165
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement vector masking.
Nicolas Capens [Tue, 8 Nov 2016 20:43:17 +0000 (15:43 -0500)]
Implement vector masking.

Bug swiftshader:15

Change-Id: I6975f7a61ee232630b82e7844b8bc65088564827
Reviewed-on: https://swiftshader-review.googlesource.com/7959
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8164
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement remaining vector extract/insert operations.
Nicolas Capens [Tue, 8 Nov 2016 20:15:31 +0000 (15:15 -0500)]
Implement remaining vector extract/insert operations.

Bug swiftshader:15

Change-Id: I9ed683b6d122183c4313d2bf609fd7c14bf5e387
Reviewed-on: https://swiftshader-review.googlesource.com/7958
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8163
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement remaining vector compare operations.
Nicolas Capens [Tue, 8 Nov 2016 19:28:59 +0000 (14:28 -0500)]
Implement remaining vector compare operations.

Bug swiftshader:15

Change-Id: I69184dcb70f4a4082a25420a0dade7bc87a8027e
Reviewed-on: https://swiftshader-review.googlesource.com/7957
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8162
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement negation and inversion.
Nicolas Capens [Tue, 8 Nov 2016 16:37:01 +0000 (11:37 -0500)]
Implement negation and inversion.

Bug swiftshader:6

Change-Id: I1eaef2745f6e1aa3defb39f408df36e654f97b4d
Reviewed-on: https://swiftshader-review.googlesource.com/7956
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8161
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement vector intrinsics.
Nicolas Capens [Tue, 8 Nov 2016 03:25:14 +0000 (22:25 -0500)]
Implement vector intrinsics.

Bug swiftshader:15

Change-Id: I1391f656bce9b5cb09c4034df977ae4757e58843
Reviewed-on: https://swiftshader-review.googlesource.com/7955
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8160
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement floating-point rounding intrinsics.
Nicolas Capens [Mon, 7 Nov 2016 22:32:17 +0000 (17:32 -0500)]
Implement floating-point rounding intrinsics.

Bug swiftshader:15

Change-Id: I27fe7bd2f0deaf19fab2f4565574ad084c49cddb
Reviewed-on: https://swiftshader-review.googlesource.com/7954
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8159
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement increment/decrement operators.
Nicolas Capens [Mon, 7 Nov 2016 21:05:22 +0000 (16:05 -0500)]
Implement increment/decrement operators.

Bug swiftshader:6

Change-Id: Ie59ca6e16eb82b84b01d9f47e5168fce7614084e
Reviewed-on: https://swiftshader-review.googlesource.com/7953
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8158
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoRemove unused createIntCast() method.
Nicolas Capens [Mon, 7 Nov 2016 20:32:52 +0000 (15:32 -0500)]
Remove unused createIntCast() method.

Bug swiftshader:6

Change-Id: Iba0a4904e99f7323c7e2044be03bb7dd950929d9
Reviewed-on: https://swiftshader-review.googlesource.com/7951
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8157
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoDon't use Long1 for stencil operations.
Nicolas Capens [Mon, 7 Nov 2016 20:30:33 +0000 (15:30 -0500)]
Don't use Long1 for stencil operations.

Bug swiftshader:15

Change-Id: I4fa5356109e35ac13f9f8d5a97e9059262901051
Reviewed-on: https://swiftshader-review.googlesource.com/7950
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8156
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFix debug dump and error output.
Nicolas Capens [Mon, 7 Nov 2016 18:01:07 +0000 (13:01 -0500)]
Fix debug dump and error output.

Bug swiftshader:6

Change-Id: I170feba4050b750727fa57927545996577123e30
Reviewed-on: https://swiftshader-review.googlesource.com/7930
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8155
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement square root and reciprocal.
Nicolas Capens [Tue, 1 Nov 2016 03:23:15 +0000 (23:23 -0400)]
Implement square root and reciprocal.

Bug swiftshader:15

Change-Id: If9336a87f90269a295fcd3b3bff2fd6899c773e4
Reviewed-on: https://swiftshader-review.googlesource.com/7910
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8154
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoSimplify abstract value bitcasting.
Nicolas Capens [Thu, 27 Oct 2016 14:20:28 +0000 (10:20 -0400)]
Simplify abstract value bitcasting.

Change-Id: I173d563cd3cd17cf90caf723f29a6c1da51103b5
Reviewed-on: https://swiftshader-review.googlesource.com/7872
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8153
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFix packing of 64-bit vectors.
Nicolas Capens [Thu, 27 Oct 2016 03:38:41 +0000 (23:38 -0400)]
Fix packing of 64-bit vectors.

Bug swiftshader:15

Change-Id: I5177113ad50ff2e1aa99f772d9254f7894ce5a61
Reviewed-on: https://swiftshader-review.googlesource.com/7870
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8152
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement min/max.
Nicolas Capens [Wed, 26 Oct 2016 04:23:12 +0000 (00:23 -0400)]
Implement min/max.

Bug swiftshader:15

Change-Id: I785e31724e802a3ed1bca75186e012ccc7cb336e
Reviewed-on: https://swiftshader-review.googlesource.com/7850
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8151
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement vector packing.
Nicolas Capens [Tue, 25 Oct 2016 21:32:37 +0000 (17:32 -0400)]
Implement vector packing.

Bug swiftshader:15

Change-Id: I3b20ba10e71c7813c35b16ae6c7382bfe4e0ae00
Reviewed-on: https://swiftshader-review.googlesource.com/7851
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8150
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement unpacking of high 64-bit vector halves.
Nicolas Capens [Tue, 25 Oct 2016 21:32:37 +0000 (17:32 -0400)]
Implement unpacking of high 64-bit vector halves.

Bug swiftshader:15

Change-Id: I59bfec356b04ebc2ff7d8507d39ec8f18c57e42a
Reviewed-on: https://swiftshader-review.googlesource.com/7830
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8149
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement vector sign mask operations.
Nicolas Capens [Fri, 21 Oct 2016 21:26:13 +0000 (17:26 -0400)]
Implement vector sign mask operations.

Bug swiftshader:15

Change-Id: I0d9cb2daeea931994abeb63f0939879875d4e81f
Reviewed-on: https://swiftshader-review.googlesource.com/7791
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8148
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoImplement arithmetic and logical operations.
Nicolas Capens [Fri, 21 Oct 2016 19:30:29 +0000 (15:30 -0400)]
Implement arithmetic and logical operations.

Bug swiftshader:15

Change-Id: I27f7c2b9d87841a1eae0d9bc92fbe79b28c65982
Reviewed-on: https://swiftshader-review.googlesource.com/7773
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8146
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoEnable multiprocessor compilation.
Nicolas Capens [Fri, 21 Oct 2016 20:23:24 +0000 (16:23 -0400)]
Enable multiprocessor compilation.

Change-Id: Ie932ff6fa92bd026754a4339919df02093bdae95
Reviewed-on: https://swiftshader-review.googlesource.com/7775
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-on: https://swiftshader-review.googlesource.com/8147
Reviewed-by: Alexis Hétu <sugoi@google.com>