mesa.git
9 years agogallium/target: Haiku softpipe
Alexander von Gluck IV [Tue, 9 Dec 2014 21:30:32 +0000 (21:30 +0000)]
gallium/target: Haiku softpipe

* Use print macro to fix warning on 64-bit systems

9 years agogallium/aux: Avoid redefining MAX
Alexander von Gluck IV [Tue, 9 Dec 2014 21:05:03 +0000 (21:05 +0000)]
gallium/aux: Avoid redefining MAX

* Can be redefined on some platforms through u_debug.h

9 years agoclover: Use switch when creating kernel arguments.
Jan Vesely [Sat, 6 Dec 2014 00:05:30 +0000 (19:05 -0500)]
clover: Use switch when creating kernel arguments.

This way we get a warning if an enum value is not handled.

v2: codestyle

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agor600g: only init GS_VERT_ITEMSIZE on r600
Dave Airlie [Wed, 10 Dec 2014 03:48:29 +0000 (13:48 +1000)]
r600g: only init GS_VERT_ITEMSIZE on r600

On evergreen there are 4 regs, on r600/700 there is only one.

Don't initialise regs and trash someone elses state.

Not sure this fixes anything, but hey one less stupid.

Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agovc4: Do QPU scheduling across uniform loads.
Eric Anholt [Wed, 10 Dec 2014 02:54:29 +0000 (18:54 -0800)]
vc4: Do QPU scheduling across uniform loads.

This means another pass of reordering the uniform data store, but it lets
us pair up a lot more instructions.

total instructions in shared programs: 44639 -> 43176 (-3.28%)
instructions in affected programs:     36938 -> 35475 (-3.96%)

9 years agovc4: Populate the delay field better, and schedule high delay first.
Eric Anholt [Tue, 9 Dec 2014 22:05:52 +0000 (14:05 -0800)]
vc4: Populate the delay field better, and schedule high delay first.

This is a standard scheduling heuristic, and clearly helps.

total instructions in shared programs: 46418 -> 44467 (-4.20%)
instructions in affected programs:     42531 -> 40580 (-4.59%)

9 years agovc4: Skip raddr dependencies for 32-bit immediate loads.
Eric Anholt [Tue, 9 Dec 2014 22:23:39 +0000 (14:23 -0800)]
vc4: Skip raddr dependencies for 32-bit immediate loads.

These don't have raddr fields.

9 years agovc4: Mark VPM read setup as impacting VPM reads, not writes.
Eric Anholt [Tue, 9 Dec 2014 22:20:54 +0000 (14:20 -0800)]
vc4: Mark VPM read setup as impacting VPM reads, not writes.

Fixes assertion failures if we adjust scheduling priorities to emphasize
VPM reads more.

9 years agovc4: Refuse to merge instructions involving 32-bit immediate loads.
Eric Anholt [Wed, 10 Dec 2014 00:34:37 +0000 (16:34 -0800)]
vc4: Refuse to merge instructions involving 32-bit immediate loads.

An immediate load overwrites the mul and add operations, so you can't
merge with them.

9 years agoclover: Fix build after llvm r223802
Aaron Watry [Wed, 10 Dec 2014 01:28:50 +0000 (19:28 -0600)]
clover: Fix build after llvm r223802

Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agofreedreno/a4xx: frag-coord / face fixes
Rob Clark [Sun, 7 Dec 2014 19:12:15 +0000 (14:12 -0500)]
freedreno/a4xx: frag-coord / face fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: fix rendering to layer != 0
Rob Clark [Sun, 7 Dec 2014 17:10:38 +0000 (12:10 -0500)]
freedreno/a4xx: fix rendering to layer != 0

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: temp hack for FLAT varyings
Rob Clark [Sat, 6 Dec 2014 21:29:53 +0000 (16:29 -0500)]
freedreno/a4xx: temp hack for FLAT varyings

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3: lower TXP as needed
Rob Clark [Sat, 6 Dec 2014 20:24:23 +0000 (15:24 -0500)]
freedreno/ir3: lower TXP as needed

On a3xx, lower TXP for 3D textures, on a4xx lower all TXP.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: XA gpu hang at startup
Rob Clark [Sat, 6 Dec 2014 17:39:19 +0000 (12:39 -0500)]
freedreno/a4xx: XA gpu hang at startup

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: texture fixes
Rob Clark [Fri, 5 Dec 2014 16:43:03 +0000 (11:43 -0500)]
freedreno/a4xx: texture fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: cleanup slice alignment/setup
Rob Clark [Thu, 4 Dec 2014 21:56:33 +0000 (16:56 -0500)]
freedreno: cleanup slice alignment/setup

Collapse things back into a setup_slices() which takes the desired
alignment as a param.  This gets things ready for a4xx which has some
slightly different requirements.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: update generated headers
Rob Clark [Fri, 5 Dec 2014 16:42:44 +0000 (11:42 -0500)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agotgsi/lowering: add support to lower TXP (v2)
Rob Clark [Sat, 6 Dec 2014 18:36:02 +0000 (13:36 -0500)]
tgsi/lowering: add support to lower TXP (v2)

v2: actually do perspective divide for RECT/SHADOWRECT

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agomesa: use build flag to ensure stack is realigned on x86
Timothy Arceri [Sat, 6 Dec 2014 13:09:40 +0000 (00:09 +1100)]
mesa: use build flag to ensure stack is realigned on x86

Nowadays GCC assumes stack pointer is 16-byte aligned even on 32-bits, but that is an assumption OpenGL drivers (or any dynamic library for that matter) can't afford to make as there are many closed- and open- source application binaries out there that only assume 4-byte stack alignment.

V4: fix comment and indentation

V3: move all sse4.1 build flag config to the same location
 and add comment as to why we need to do the realign

V2: use $target_cpu rather than $host_cpu
  and setup build flags in config rather than makefile

https://bugs.freedesktop.org/show_bug.cgi?id=86788
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Matt Turner <mattst88@gmail.com>
CC: "10.4" <mesa-stable@lists.freedesktop.org>
9 years agodraw: implement TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION
Marek Olšák [Mon, 17 Nov 2014 21:30:31 +0000 (22:30 +0100)]
draw: implement TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION

Required by Nine. Tested with util_run_tests.
It's added to softpipe, llvmpipe, and r300g/swtcl.

Tested-by: David Heidelberg <david@ixit.cz>
9 years agomain: return two minor digits for ES shading language version
Samuel Iglesias Gonsalvez [Wed, 26 Nov 2014 12:16:38 +0000 (13:16 +0100)]
main: return two minor digits for ES shading language version

For OpenGL ES 3.0 spec, the minor number for SHADING_LANGUAGE_VERSION is always
two digits, matching the OpenGL ES Shading Language Specification release
number. For example, this query might return the string "3.00".

This patch fixes the following dEQP test:

   dEQP-GLES3.functional.state_query.string.shading_language_version

No piglit regression observed.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoglsl: invariant qualifier is not valid for shader inputs in GLSL ES 3.00
Samuel Iglesias Gonsalvez [Tue, 25 Nov 2014 11:23:10 +0000 (12:23 +0100)]
glsl: invariant qualifier is not valid for shader inputs in GLSL ES 3.00

GLSL ES 3.00 spec, chapter 4.6.1 "The Invariant Qualifier",

    Only variables output from a shader can be candidates for invariance. This
    includes user-defined output variables and the built-in output variables.
    As only outputs can be declared as invariant, an invariant output from one
    shader stage will still match an input of a subsequent stage without the
    input being declared as invariant.

This patch fixes the following dEQP tests:

dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_interp_storage_precision
dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_interp_storage
dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_storage_precision
dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_storage
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_interp_storage_precision_invariant_input
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_interp_storage_invariant_input
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_storage_precision_invariant_input
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_storage_invariant_input

No piglit regressions observed.

v2:
- Add spec content in the code

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: Recompute LegalTypesMask if the GL API has changed
Iago Toral Quiroga [Tue, 2 Dec 2014 11:10:14 +0000 (12:10 +0100)]
mesa: Recompute LegalTypesMask if the GL API has changed

The current code computes ctx->Array.LegalTypesMask just once,
however, computing this needs to consider ctx->API so we need
to make sure that the API for that context has not changed if
we intend to reuse the result.

The context API can change, at least, if we go through
_mesa_meta_begin, since that will always force
API_OPENGL_COMPAT until we call _mesa_meta_end. If any
operation in between these two calls triggers a call to
update_array_format, then we might be caching a value for
LegalTypesMask that will not be right once we have called
_mesa_meta_end and restored the context API.

Fixes the following 179 dEQP tests in i965:
dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.*
dEQP-GLES3.functional.vertex_arrays.single_attribute.normalize.fixed.*
dEQP-GLES3.functional.vertex_arrays.single_attribute.output_types.fixed.*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_draw.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_draw.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_draw.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_copy.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_copy.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_copy.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_read.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_read.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_read.*fixed*
dEQP-GLES3.functional.vertex_arrays.multiple_attributes.input_types.3_*fixed2*
dEQP-GLES3.functional.draw.random.{2,18,28,68,83,106,109,156,181,191}

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Returns zero samples when querying GL_NUM_SAMPLE_COUNTS when internal format...
Eduardo Lima Mitev [Thu, 20 Nov 2014 13:52:35 +0000 (14:52 +0100)]
mesa: Returns zero samples when querying GL_NUM_SAMPLE_COUNTS when internal format is integer

From GL ES 3.0 specification, section 6.1.15 Internal Format Queries (page 236),
multisampling is not supported for signed and unsigned integer internal formats.

Fixes 19 dEQP tests under 'dEQP-GLES3.functional.state_query.internal_format.*'.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0
Eduardo Lima Mitev [Thu, 20 Nov 2014 13:02:46 +0000 (14:02 +0100)]
mesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0

GL_RGB and GL_RGBA are valid internal formats on a GLES3 profile. See
"Table 1. Unsized Internal Formats" at
https://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml.

Fixes 2 dEQP tests:
- dEQP-GLES3.functional.state_query.internal_format.rgb_samples
- dEQP-GLES3.functional.state_query.internal_format.rgba_samples

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO invalidation...
Eduardo Lima Mitev [Tue, 18 Nov 2014 15:28:18 +0000 (16:28 +0100)]
mesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO invalidation under GLES3

In OpenGL and OpenGL-ES 3+, GL_DEPTH_STENCIL_ATTACHMENT is a valid attachment point for the family of functions
that invalidate a framebuffer object (e.g, glInvalidateFramebuffer, glInvalidateSubFramebuffer, etc).
Currently, a GL_INVALID_ENUM error is emitted for this attachment point.

Fixes 21 dEQP test failures under 'dEQP-GLES3.functional.fbo.invalidate.*'.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agovc4: Reserve rb31 instead of r3 for raddr conflict spills.
Eric Anholt [Tue, 9 Dec 2014 00:52:53 +0000 (16:52 -0800)]
vc4: Reserve rb31 instead of r3 for raddr conflict spills.

This increases the cost of a raddr b conflict spill (save r3 to rb31, move
src1 to r3, move rb31 back to r3 when done, instead of just move src1 to
r3), but on average thanks to instruction pairing it's more worthwhile to
have another accumulator.

total instructions in shared programs: 46428 -> 46171 (-0.55%)
instructions in affected programs:     38030 -> 37773 (-0.68%)

9 years agovc4: Prioritize allocating accumulators to short-lived values.
Eric Anholt [Tue, 9 Dec 2014 01:43:29 +0000 (17:43 -0800)]
vc4: Prioritize allocating accumulators to short-lived values.

The register allocator walks from the end of the nodes array looking for
trivially-allocatable things to put on the stack, meaning (assuming
everything is trivially colorable and gets put on the stack in a single
pass) the low node numbers get allocated first.  The things allocated
first happen to get the lower-numbered registers, which is to say the fast
accumulators that can be paired more easily.

When we previously made the nodes match the temporary register numbers,
we'd end up putting the shader inputs (VS or FS) in the accumulators,
which are often long-lived values.  By prioritizing the shortest-lived
values for allocation, we can get a lot more instructions that involve
accumulators, and thus fewer conflicts for raddr and WS.

total instructions in shared programs: 52870 -> 46428 (-12.18%)
instructions in affected programs:     52260 -> 45818 (-12.33%)

9 years agor600g: fix regression since UCMP change
Dave Airlie [Tue, 9 Dec 2014 01:28:52 +0000 (11:28 +1000)]
r600g: fix regression since UCMP change

Since d8da6deceadf5e48201d848b7061dad17a5b7cac where the
state tracker started using UCMP on cayman a number of tests
regressed.

this seems to be r600g is doing CNDGE_INT for UCMP which is >= 0,
we should be doing CNDE_INT with reverse arguments.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoprogram: Delete dead _mesa_realloc_instructions.
Matt Turner [Mon, 8 Dec 2014 21:44:40 +0000 (13:44 -0800)]
program: Delete dead _mesa_realloc_instructions.

Dead since 2010 (commit 284ce209).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoswrast: Remove 'inline' from tex filter functions.
Matt Turner [Thu, 4 Dec 2014 19:34:35 +0000 (11:34 -0800)]
swrast: Remove 'inline' from tex filter functions.

Reduces .text size of mesa_dri_drivers.so (i965-only) by 62k, or 1.4%.

Note that we don't remove inline from lerp_2d(), which has a comment
above it saying it definitely should be inlined. Though, removing the
inline keyword from it doesn't actually change the compiled code for me.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoDon't cast the return value of malloc/realloc
Matt Turner [Mon, 22 Sep 2014 04:24:01 +0000 (21:24 -0700)]
Don't cast the return value of malloc/realloc

See commit 2b7a972e for the Coccinelle script.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoUse calloc instead of malloc/memset-0
Matt Turner [Mon, 22 Sep 2014 04:15:26 +0000 (21:15 -0700)]
Use calloc instead of malloc/memset-0

See commit 6bda027e for the Coccinelle script.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoRemove useless checks for NULL before freeing
Matt Turner [Mon, 22 Sep 2014 04:13:33 +0000 (21:13 -0700)]
Remove useless checks for NULL before freeing

See commits 5067506e and b6109de3 for the Coccinelle script.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965/skl: Add Skylake PCI IDs
Kristian Høgsberg [Mon, 22 Sep 2014 11:44:19 +0000 (04:44 -0700)]
i965/skl: Add Skylake PCI IDs

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
9 years agoi965/skl: Emit depth stall workaround for gen9 as well
Damien Lespiau [Wed, 27 Feb 2013 15:05:24 +0000 (15:05 +0000)]
i965/skl: Emit depth stall workaround for gen9 as well

The docs say that we shouldn't need this workaround for gen8+, but just
removing it, causes gpu hangs.  We'll revisit this, but for now, just
extend the workaround to gen9.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
9 years agoi965/skl: Fix GS thread count location
Ben Widawsky [Wed, 3 Dec 2014 23:53:29 +0000 (15:53 -0800)]
i965/skl: Fix GS thread count location

SKL moves the GS threadcount to dw8 from dw7, and no longer does the
divide by 2 thing.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
9 years agoi965: Fix union usage for G++ <= 4.6.
Vinson Lee [Sat, 6 Dec 2014 02:05:06 +0000 (18:05 -0800)]
i965: Fix union usage for G++ <= 4.6.

This patch fixes this build error with G++ <= 4.6.

  CXX    test_vf_float_conversions.o
test_vf_float_conversions.cpp: In function ‘unsigned int f2u(float)’:
test_vf_float_conversions.cpp:63:20: error: expected primary-expression before ‘.’ token

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86939
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agovc4: Interleave register allocation from regfile A and B.
Eric Anholt [Sat, 6 Dec 2014 01:08:28 +0000 (17:08 -0800)]
vc4: Interleave register allocation from regfile A and B.

The register allocator prefers low-index registers from vc4_regs[] in the
configuration we're using, which is good because it means we prioritize
allocating the accumulators (which are faster).  On the other hand, it was
causing raddr conflicts because everything beyond r0-r2 ended up in
regfile A until you got massive register pressure.  By interleaving, we
end up getting more instruction pairing from getting non-conflicting
raddrs and QPU_WSes.

total instructions in shared programs: 55957 -> 52719 (-5.79%)
instructions in affected programs:     46855 -> 43617 (-6.91%)

9 years agovc4: Fix decision for whether the MIN operation writes to the B regfile.
Eric Anholt [Mon, 8 Dec 2014 19:27:50 +0000 (11:27 -0800)]
vc4: Fix decision for whether the MIN operation writes to the B regfile.

9 years agovc4: Drop dependency on r3 for color packing.
Eric Anholt [Sun, 7 Sep 2014 21:38:24 +0000 (14:38 -0700)]
vc4: Drop dependency on r3 for color packing.

We can avoid it by carefully ordering the packing.  This is important as a
step in giving r3 to the register allocator.

total instructions in shared programs: 56087 -> 55957 (-0.23%)
instructions in affected programs:     18368 -> 18238 (-0.71%)

9 years agovc4: Add support for GL 1.0 logic ops.
Eric Anholt [Mon, 8 Dec 2014 20:40:58 +0000 (12:40 -0800)]
vc4: Add support for GL 1.0 logic ops.

9 years agovc4: Add support for TGSI_OPCODE_UCMP.
Eric Anholt [Mon, 8 Dec 2014 19:57:15 +0000 (11:57 -0800)]
vc4: Add support for TGSI_OPCODE_UCMP.

This is being emitted now from st_glsl_to_tgsi.cpp.

9 years agoradeonsi/compute: Clamp COMPUTE_TMPRING_SIZE.WAVES to: num_cu * 32
Tom Stellard [Fri, 5 Dec 2014 23:59:11 +0000 (23:59 +0000)]
radeonsi/compute: Clamp COMPUTE_TMPRING_SIZE.WAVES to: num_cu * 32

This is the maximum value allowed for this field.

9 years agowinsys/radeon: Always report at least 1 compute unit
Tom Stellard [Fri, 5 Dec 2014 23:59:10 +0000 (23:59 +0000)]
winsys/radeon: Always report at least 1 compute unit

All uses of this require that the value be at least one, so it's
easier to report at least one than having to wrap all uses
in MAX2(max_compute_units, 1).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeonsi: Program RASTER_CONFIG for harvested GPUs v5
Tom Stellard [Tue, 9 Sep 2014 19:18:57 +0000 (15:18 -0400)]
radeonsi: Program RASTER_CONFIG for harvested GPUs v5

Harvested GPUs have some of their render backends disabled, so
in order to prevent the hardware from trying to render things
with these disabled backends we need to correctly program
the PA_SC_RASTER_CONFIG register.

v2:
  - Write RASTER_CONFIG for all SEs.

v3:
  - Set GRBM_GFX_INDEX.INSTANCE_BROADCAST_WRITES bit.
  - Set GRBM_GFX_INFEX.SH_BROADCAST_WRITES bit when done setting
    PA_SC_RASTER_CONFIG.
  - Get num_se and num_sh_per_se from kernel.

v4:
  - Get correct value for num_se
  - Remove loop for setting PA_SC_RASTER_CONFIG
  - Only compute raster config when a backend has been disabled.

v5: Michel Dänzer
  - Fix computation for chips with multiple SEs

https://bugs.freedesktop.org/show_bug.cgi?id=60879

CC: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
9 years agodraw: (trivial): remove double semicolon
Roland Scheidegger [Mon, 8 Dec 2014 18:07:10 +0000 (19:07 +0100)]
draw: (trivial): remove double semicolon

9 years agost/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported
Abdiel Janulgue [Mon, 1 Dec 2014 12:59:08 +0000 (14:59 +0200)]
st/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported

There is a bug in the current lowering pass implementation where we lower saturate
to clamp only for vertex shaders on drivers supporting SM 3.0. The correct behavior
is to actually lower to clamp only when we don't support saturate which happens
on drivers that don't support SM 3.0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
9 years agoglsl: Don't optimize min/max into saturate when EmitNoSat is set
Abdiel Janulgue [Mon, 8 Dec 2014 11:31:29 +0000 (13:31 +0200)]
glsl: Don't optimize min/max into saturate when EmitNoSat is set

v3: Fix multi-line comment format (Ian)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
9 years agoir_to_mesa: Remove sat to clamp lowering pass
Abdiel Janulgue [Mon, 8 Dec 2014 11:26:28 +0000 (13:26 +0200)]
ir_to_mesa: Remove sat to clamp lowering pass

Fixes an infinite loop in swrast where the lowering pass unpacks saturate into
clamp but the opt_algebraic pass tries to do the opposite.

v3 (Ian):
This is a revert of commit cfa8c1cb "ir_to_mesa: lower ir_unop_saturate" on
the ir_to_mesa.cpp portion. prog_execute.c can handle saturates in vertex
shaders, so classic swrast shouldn't need this lowering pass.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83463
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
9 years agoloader: Add missing EXPAT_CFLAGS to libloader.la CPPFLAGS
Michael Forney [Sun, 7 Dec 2014 08:51:00 +0000 (00:51 -0800)]
loader: Add missing EXPAT_CFLAGS to libloader.la CPPFLAGS

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Remove default from brw_instruction_name switch to catch missing names.
Matt Turner [Sat, 6 Dec 2014 22:18:21 +0000 (14:18 -0800)]
i965: Remove default from brw_instruction_name switch to catch missing names.

The case-range extension is available in clang and gcc at least back to
3.4.0.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoi965: Add missing opcode names.
Matt Turner [Sat, 6 Dec 2014 22:16:13 +0000 (14:16 -0800)]
i965: Add missing opcode names.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoi965: Add opcode names for set_omask and set_sample_id.
Matt Turner [Sat, 6 Dec 2014 21:34:13 +0000 (13:34 -0800)]
i965: Add opcode names for set_omask and set_sample_id.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoegl: Expose EGL_KHR_get_all_proc_addresses and its client extension
Chad Versace [Thu, 20 Nov 2014 18:26:38 +0000 (10:26 -0800)]
egl: Expose EGL_KHR_get_all_proc_addresses and its client extension

Mesa already implements the behavior of EGL_KHR_get_all_proc_addresses
and EGL_KHR_client_get_all_proc_addresses. This patch just exposes the
extension strings.

See: https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_get_all_proc_addresses.txt
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
9 years agodocs: add news item and link release notes for mesa 10.3.5
Emil Velikov [Fri, 5 Dec 2014 19:10:39 +0000 (19:10 +0000)]
docs: add news item and link release notes for mesa 10.3.5

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add sha256 sums for the 10.3.5 release
Emil Velikov [Fri, 5 Dec 2014 18:43:47 +0000 (18:43 +0000)]
docs: Add sha256 sums for the 10.3.5 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1ba2029184d3e7b013e3fc322e80a761604495d4)

9 years agoAdd release notes for the 10.3.5 release
Emil Velikov [Fri, 5 Dec 2014 18:21:51 +0000 (18:21 +0000)]
Add release notes for the 10.3.5 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit c90b0db1aef8f439b52b38ad58aac4ca202232a7)

9 years agofreedreno/a2xx: silence warning about missing DEPTH32X
Ilia Mirkin [Thu, 4 Dec 2014 03:12:39 +0000 (22:12 -0500)]
freedreno/a2xx: silence warning about missing DEPTH32X

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: handle index_bias (i.e. base_vertex)
Ilia Mirkin [Thu, 4 Dec 2014 05:45:45 +0000 (00:45 -0500)]
freedreno/a3xx: handle index_bias (i.e. base_vertex)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: add bgr565 texturing and rendering
Ilia Mirkin [Thu, 4 Dec 2014 01:43:22 +0000 (20:43 -0500)]
freedreno/a3xx: add bgr565 texturing and rendering

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: add support for SRGB render targets
Ilia Mirkin [Fri, 28 Nov 2014 19:10:50 +0000 (14:10 -0500)]
freedreno/a3xx: add support for SRGB render targets

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: output RGBA16_FLOAT from fs for certain outputs
Ilia Mirkin [Tue, 2 Dec 2014 06:00:47 +0000 (01:00 -0500)]
freedreno/a3xx: output RGBA16_FLOAT from fs for certain outputs

Fixes R11G11B10F rendering, and is required for SRGB format support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: re-enable rgb10_a2 render targets
Ilia Mirkin [Wed, 3 Dec 2014 02:31:33 +0000 (21:31 -0500)]
freedreno/a3xx: re-enable rgb10_a2 render targets

There were previously regressions regarding border colors, which the
updated swizzle logic resolves.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: fix border color swizzle to match texture format desc
Ilia Mirkin [Wed, 3 Dec 2014 04:27:03 +0000 (23:27 -0500)]
freedreno/a3xx: fix border color swizzle to match texture format desc

This is a hack since it uses the texture information together with the
sampler, but I don't see a better way to do it. In OpenGL, there is a
1:1 correspondence.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a3xx: fix alpha-blending on RGBX formats
Ilia Mirkin [Wed, 3 Dec 2014 02:32:01 +0000 (21:32 -0500)]
freedreno/a3xx: fix alpha-blending on RGBX formats

Expert debugging assistance provided by Chris Forbes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
9 years agoglcpp: Fix `can not` to `cannot` in error message
Chris Forbes [Sat, 6 Dec 2014 22:49:28 +0000 (11:49 +1300)]
glcpp: Fix `can not` to `cannot` in error message

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoglcpp: Disallow undefining GL_* builtin macros.
Chris Forbes [Sat, 29 Nov 2014 20:54:59 +0000 (09:54 +1300)]
glcpp: Disallow undefining GL_* builtin macros.

Fixes the piglit test: spec/glsl-es-3.00/compiler/undef-GL_ES.vert

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965/Gen6-7: Fix point sprites with PolygonMode(GL_POINT)
Chris Forbes [Fri, 5 Dec 2014 06:43:13 +0000 (19:43 +1300)]
i965/Gen6-7: Fix point sprites with PolygonMode(GL_POINT)

This was an oversight in the original patch. When PolygonMode is
used, then front faces, back faces, or both may be rendered as
points and are affected by point sprite state.

Note that SNB/IVB can't actually be fully conformant here, for
a legacy context -- we don't have separate sets of pointsprite
enables for front and back faces. Haswell ignores pointsprite
state correctly in hardware for non-point rasterization, so can
do this correctly, but it doesn't seem worth it.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86764
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Fix regs read for FS_OPCODE_INTERP_PER_SLOT_OFFSET
Chris Forbes [Sat, 6 Dec 2014 21:12:36 +0000 (10:12 +1300)]
i965: Fix regs read for FS_OPCODE_INTERP_PER_SLOT_OFFSET

Dead code elimination was eating the Y offset.

Fixes the piglit test:
spec/ARB_gpu_shader5/arb_gpu_shader5-interpolateAtOffset-nonconst

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Add opcode names for FS interpolation opcodes
Chris Forbes [Sat, 6 Dec 2014 21:07:16 +0000 (10:07 +1300)]
i965: Add opcode names for FS interpolation opcodes

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agomesa/st: don't use CMP / I2F for conditional assignments with native integers
Roland Scheidegger [Fri, 5 Dec 2014 22:08:34 +0000 (23:08 +0100)]
mesa/st: don't use CMP / I2F for conditional assignments with native integers

The original idea was to optimize away the condition by integrating it directly
into the CMP instruction. However, with native integers this requires an extra
I2F instruction. It is also fishy because the negation used didn't really honor
ieee754 float comparison rules, not to mention the CMP instruction itself
(being pretty much a legacy instruction) doesn't really have defined special
float value behavior in any case.
So, use UCMP and adjust the code trying to optimize the condition away
accordingly (I have absolutely no idea if such conditions are actually hit
or would be translated away somewhere else already).

v2: cosmetic changes

No piglit regressions on llvmpipe.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agollvmpipe: decrease MAX_SCENES from 2 to 1
Roland Scheidegger [Wed, 3 Dec 2014 02:57:15 +0000 (03:57 +0100)]
llvmpipe: decrease MAX_SCENES from 2 to 1

Multiple scenes per context are meant to be used so a new scene can be built
while another one is processed in rasterization. However, quite surprisingly,
this does not actually work (and according to git log, possibly never did,
though maybe it did at some point further back (5 years+) but was buggy)
because we always wait immediately on the rasterizer to finish the scene when
contexts (and hence setup/scene) is flushed. This means when we try to get
an empty scene later, any old one is already empty again.
Thus using multiple scenes is just a waste of memory (not too bad, since the
additional scenes are guaranteed to be empty, which means their size ought to
be one data block (64kB) plus the size of some structs), without actually
really doing anything. (There is also quite some code for the whole concept of
multiple scenes which doesn't really do much in practice, but keep it hoping
the wait-on-scene-flush can be fixed some day.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodraw: use the prim type from prim_info not emit in passthrough emit
Roland Scheidegger [Tue, 2 Dec 2014 01:27:56 +0000 (02:27 +0100)]
draw: use the prim type from prim_info not emit in passthrough emit

The prim assembler may change the prim type when injecting prim ids now,
which isn't reflected by what's stored in emit.
This looks brittle and potentially dangerous (it is not obvious if such prim
type changes are really supported by pt emit, the prim type is actually also
set in prepare which would then be different).

This fixes piglit primitive-id-no-gs-first-vertex.shader_test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodraw: use correct output prim for non-adjacent topologies in prim assembler.
Roland Scheidegger [Mon, 1 Dec 2014 22:40:31 +0000 (23:40 +0100)]
draw: use correct output prim for non-adjacent topologies in prim assembler.

The decomposition done in the prim assembler will turn tri fans into tris,
but this wasn't reflected in the output prim type. Meaning with a tri fan
with 6 verts input, the output was a tri fan with 12 vertices instead of a
tri list with 12 vertices (not as bad as it sounds, since the additional tris
created would all be degenerate since they'd all have two times vertex zero
but still bogus).
This is because the prim assembler is used if either the input topology is
something with adjacency, or if prim id needs to be injected, and for the
latter case topologies without adjacency can be converted to basic ones.
Unfortunately decomposition here for inserting prim ids is necessary, at
least for the indexed case where we can't just insert the prim id at the
right place depending on provoking vertex.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodraw: kill off unneded prim assembler code for handling adjacency verts
Roland Scheidegger [Mon, 1 Dec 2014 22:13:55 +0000 (23:13 +0100)]
draw: kill off unneded prim assembler code for handling adjacency verts

The default macros when the adjacency macros aren't defined will already
exactly do that (that is, drop the adjacent vertices and call the non-adjacent
macro).

Reviewed-by: Jose Fonseca <jfonseca@vmwarec.com>
9 years agogallium/docs: (trivial) remove STR opcode description.
Roland Scheidegger [Mon, 1 Dec 2014 16:03:47 +0000 (17:03 +0100)]
gallium/docs: (trivial) remove STR opcode description.

The opcode was removed alongside SFL by commit
ecfe9e2ad2b5f178ef09420f8d95d49937137cd9.

9 years agoi965/fs: Perform CSE on MOV ..., VF instructions.
Matt Turner [Thu, 3 Apr 2014 21:29:30 +0000 (14:29 -0700)]
i965/fs: Perform CSE on MOV ..., VF instructions.

Safe from causing optimization loops, since we don't constant propagate
VF arguments.

(for this and the previous patch):
total instructions in shared programs: 4289075 -> 4271932 (-0.40%)
instructions in affected programs:     1616779 -> 1599636 (-1.06%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965/fs: Try to emit LINE instructions on Gen <= 5.
Matt Turner [Tue, 1 Apr 2014 23:49:13 +0000 (16:49 -0700)]
i965/fs: Try to emit LINE instructions on Gen <= 5.

The LINE instruction performs a multiply-add instruction (a * b + c)
where b and c are scalar arguments. It reads b and c from offsets in
src0 such that you can load them (it they're representable) as a
vector-float immediate with a single instruction.

Hurts some programs, but that'll all get better once we CSE the
vector-float MOVs in the next patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77544
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965/fs: Add support for generating the LINE instruction.
Matt Turner [Wed, 2 Apr 2014 00:25:12 +0000 (17:25 -0700)]
i965/fs: Add support for generating the LINE instruction.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965: Set the region of LINE's src0 to <0,1,0>.
Matt Turner [Tue, 19 Aug 2014 06:14:44 +0000 (23:14 -0700)]
i965: Set the region of LINE's src0 to <0,1,0>.

The PRMs say that

   <src0> region must be a replicated scalar
   (with HorzStride = VertStride = 0).

but apparently that doesn't actually apply to all generations. I did
notice when implementing the optimization later in this series that G45
and ILK needed this regioning.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965: Give compile stats through KHR_debug.
Matt Turner [Fri, 14 Nov 2014 20:46:44 +0000 (12:46 -0800)]
i965: Give compile stats through KHR_debug.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: Add a source parameter to _mesa_gl_debug.
Matt Turner [Fri, 14 Nov 2014 01:35:58 +0000 (17:35 -0800)]
mesa: Add a source parameter to _mesa_gl_debug.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agovc4: Try swapping the regfile A to B to pair instructions.
Eric Anholt [Fri, 5 Dec 2014 21:23:17 +0000 (13:23 -0800)]
vc4: Try swapping the regfile A to B to pair instructions.

total instructions in shared programs: 56995 -> 56087 (-1.59%)
instructions in affected programs:     40503 -> 39595 (-2.24%)

9 years agovc4: Allow pairing of some instructions that disagree about the WS bit.
Eric Anholt [Fri, 5 Dec 2014 20:34:30 +0000 (12:34 -0800)]
vc4: Allow pairing of some instructions that disagree about the WS bit.

No difference on shader-db because we tend to have a lot of other
conflicts going on as well (like RADDR_A disagreements)

9 years agoconfigure.ac: Replace contraction to fix syntax highlighting.
Matt Turner [Fri, 5 Dec 2014 21:06:01 +0000 (13:06 -0800)]
configure.ac: Replace contraction to fix syntax highlighting.

9 years agoi965/gs: Avoid DW * DW mul
Ben Widawsky [Thu, 4 Dec 2014 23:37:17 +0000 (15:37 -0800)]
i965/gs: Avoid DW * DW mul

The GS has an interesting use for mul. Because the GS can emit multiple
vertices per input vertex, and it also has a unique count at the top of the URB
payload, the GS unit needs to be able to dynamically specify URB write offsets
(relative to the global offset). The documentation in the function has a very
good explanation from Paul on the mechanics.

This fixes around 2000 piglit tests on BSW.

v2:
Reworded commit message (Ben) no mention of CHV (Matt)
Change SHRT_MAX to USHRT_MAX (Ken, and Matt)
Update comment in code to reflect the use of UW (Ben)
Add Gen7+ assertion for the relevant GS code, since it won't work on Gen6- (Ken)
Drop the bogus hunk in emit_control_data_bits() (Ken)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84777 (with many dupes)
Cc: "10.4 10.3 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agovc4: Add separate write-after-read dependency tracking for pairing.
Eric Anholt [Tue, 2 Dec 2014 23:42:58 +0000 (15:42 -0800)]
vc4: Add separate write-after-read dependency tracking for pairing.

If an operation is the last one to read a register, the instruction
containing it can also include the op that has the next write to that
register.

total instructions in shared programs: 57486 -> 56995 (-0.85%)
instructions in affected programs:     43004 -> 42513 (-1.14%)

9 years agovc4: Fix inverted priority of instructions for QPU scheduling.
Eric Anholt [Wed, 3 Dec 2014 00:31:29 +0000 (16:31 -0800)]
vc4: Fix inverted priority of instructions for QPU scheduling.

We were scheduling TLB operations as early as possible, and texture setup
as late as possible.  When I introduced prioritization, I visually
inspected that an independent operation got moved above texture results
collection, which tricked me into thinking it was working (but it was just
because texture setup was being pushed late).

total instructions in shared programs: 57651 -> 57486 (-0.29%)
instructions in affected programs:     18532 -> 18367 (-0.89%)

9 years agovc4: Refuse to merge two ops that both access shared functions.
Eric Anholt [Wed, 3 Dec 2014 00:23:40 +0000 (16:23 -0800)]
vc4: Refuse to merge two ops that both access shared functions.

Avoids assertion failures in vc4_qpu_validate.c if we happen to find the
right set of operations available.

9 years agovc4: Allow dead code elimination of color reads.
Eric Anholt [Tue, 2 Dec 2014 20:58:27 +0000 (12:58 -0800)]
vc4: Allow dead code elimination of color reads.

This might happen if the blending functions are set up to not actually use
the destination color/alpha, for example.

9 years agovc4: Add a debug flag for waiting for sync on submit.
Eric Anholt [Tue, 2 Dec 2014 21:18:56 +0000 (13:18 -0800)]
vc4: Add a debug flag for waiting for sync on submit.

This is nice when you're tracking down which command list is hanging the
GPU.

9 years agoi965/fs: Move brw_file_from_reg() higher in the file.
Matt Turner [Fri, 5 Dec 2014 17:53:11 +0000 (09:53 -0800)]
i965/fs: Move brw_file_from_reg() higher in the file.

This was supposed to be part of the previous commit.

9 years agoi965/fs: Make brw_reg_from_fs_reg static and remove prototype.
Matt Turner [Fri, 28 Nov 2014 20:21:03 +0000 (12:21 -0800)]
i965/fs: Make brw_reg_from_fs_reg static and remove prototype.

And move it above its first use in brw_fs_generator.cpp.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Use ~0 to represent true on all generations.
Matt Turner [Tue, 2 Dec 2014 20:28:13 +0000 (12:28 -0800)]
i965: Use ~0 to represent true on all generations.

Jason realized that we could fix the result of the CMP instruction on
Gen <= 5 by doing -(result & 1). Also do the resolves in the vec4
backend before use, rather than when the bool was created. The FS does
this and it saves some unnecessary resolves.

On Ironlake:

total instructions in shared programs: 4289762 -> 4287277 (-0.06%)
instructions in affected programs:     619430 -> 616945 (-0.40%)

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Change the type of booleans to D.
Matt Turner [Tue, 2 Dec 2014 20:30:27 +0000 (12:30 -0800)]
i965: Change the type of booleans to D.

This is a revert of commit 4656c14e ("i965/fs: Change the type of
booleans to UD and emit correct immediates") plus some small additional
fixes, like casting ctx->Const.UniformBooleanTrue to int and changing UD
to D in the ir_unop_b2f cases. Note that it's safe to leave 0x3f800000
as UD and as a literal it's more recognizable than 1065353216.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/fs: Add a negate() function.
Matt Turner [Thu, 4 Dec 2014 21:35:25 +0000 (13:35 -0800)]
i965/fs: Add a negate() function.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/vec4: Don't DCE flag-writing insts because dest was unused.
Matt Turner [Thu, 4 Dec 2014 07:32:30 +0000 (23:32 -0800)]
i965/vec4: Don't DCE flag-writing insts because dest was unused.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/vec4: Allow CSE on uniform-vec4 expansion MOVs.
Matt Turner [Fri, 24 Oct 2014 06:22:09 +0000 (23:22 -0700)]
i965/vec4: Allow CSE on uniform-vec4 expansion MOVs.

Three source instructions cannot directly source a packed vec4 (<0,4,1>
regioning) like vec4 uniforms, so we emit a MOV that expands the vec4 to
both halves of a register.

If these uniform values are used by multiple three-source instructions,
we'll emit multiple expansion moves, which we cannot combine in CSE
(because CSE emits moves itself).

So emit a virtual instruction that we can CSE.

Sometimes we demote a uniform to to a pull constant after emitting an
expansion move for it. In that case, recognize in opt_algebraic that if
the .file of the new instruction is GRF then it's just a real move that
we can copy propagate and such.

total instructions in shared programs: 5822418 -> 5812335 (-0.17%)
instructions in affected programs:     351841 -> 341758 (-2.87%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>