Re: [Mesa-dev] [PATCH 11/28] util: added float to float16 conversions with RTZ and RTNE

2018-12-06 Thread Matt Turner
On Thu, Dec 6, 2018 at 7:22 PM Roland Scheidegger wrote: > > Am 07.12.18 um 03:20 schrieb Matt Turner: > > Since this is for an extension that will be BDW+ can we use the > > _cvtss_sh() intrinsic instead? It corresponds to an IVB+ instruction > > and even takes the rounding mode directly as an

Re: [Mesa-dev] [PATCH 11/28] util: added float to float16 conversions with RTZ and RTNE

2018-12-06 Thread Roland Scheidegger
Am 07.12.18 um 03:20 schrieb Matt Turner: > Since this is for an extension that will be BDW+ can we use the > _cvtss_sh() intrinsic instead? It corresponds to an IVB+ instruction > and even takes the rounding mode directly as an immediate argument. Not saying trying to use it isn't a good idea,

[Mesa-dev] [PATCH 08/20] nir: add new partially_unrolled bool to nir_loop

2018-12-06 Thread Timothy Arceri
In order to stop continuously partially unrolling the same loop we add the bool partialy_unrolled to nir_loop, we add it here rather than in nir_loop_info because nir_loop_info is only set via loop analysis and is intended to be cleared before each analysis. Also nir_loop_info is never cloned. ---

[Mesa-dev] [PATCH 10/20] nir: calculate trip count for more loops

2018-12-06 Thread Timothy Arceri
This adds support to loop analysis for loops where the induction variable is compared to the result of min(variable, constant). For example: for (int i = 0; i < imin(x, 4); i++) ... We add a new bool to the loop terminator struct in order to differentiate terminators with this exit

[Mesa-dev] [PATCH 17/20] nir: add helper to return inversion op of a comparision

2018-12-06 Thread Timothy Arceri
This will be used to help find the trip count of loops that look like the following: while (a < x && i < 8) { ... i++; } Where the NIR will end up looking something like this: vec1 32 ssa_0 = load_const (0x /* 0.00 */) vec1 32 ssa_1 = load_const (0x0008

[Mesa-dev] [PATCH 14/20] nir: reword code comment

2018-12-06 Thread Timothy Arceri
Reviewed-by: Thomas Helland --- src/compiler/nir/nir_loop_analyze.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c index fbaa638884..ef69422c12 100644 --- a/src/compiler/nir/nir_loop_analyze.c +++

[Mesa-dev] [PATCH 13/20] nir: in loop analysis track actual control flow type

2018-12-06 Thread Timothy Arceri
This will allow us to improve analysis to find more induction variables. Reviewed-by: Thomas Helland --- src/compiler/nir/nir_loop_analyze.c | 34 ++--- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/compiler/nir/nir_loop_analyze.c

[Mesa-dev] [PATCH 16/20] nir: simplify the loop analysis trip count code a little

2018-12-06 Thread Timothy Arceri
Here we create a helper is_supported_terminator_condition() and use that rather than embedding all the trip count code inside a switch. The new helper will also be used in a following patch. --- src/compiler/nir/nir_loop_analyze.c | 172 +++- 1 file changed, 93

[Mesa-dev] [PATCH 15/20] nir: detect more induction variables

2018-12-06 Thread Timothy Arceri
This allows loop analysis to detect inductions variables that are incremented in both branches of an if rather than in a main loop block. For example: loop { block block_1: /* preds: block_0 block_7 */ vec1 32 ssa_8 = phi block_0: ssa_4, block_7: ssa_20 vec1 32 ssa_9 =

[Mesa-dev] [PATCH 11/20] nir: unroll some loops with a variable limit

2018-12-06 Thread Timothy Arceri
For some loops can have a single terminator but the exact trip count is still unknown. For example: for (int i = 0; i < imin(x, 4); i++) ... Shader-db results radeonsi (all affected are from Tropico 5): Totals from affected shaders: SGPRS: 200 -> 208 (4.00 %) VGPRS: 164 -> 148 (-9.76

[Mesa-dev] [PATCH 19/20] nir: pass nir_op to calculate_iterations()

2018-12-06 Thread Timothy Arceri
Rather than getting this from the alu instruction this allows us some flexibility. In the following pass we instead pass the inverse op. --- src/compiler/nir/nir_loop_analyze.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git

[Mesa-dev] [PATCH 06/20] nir: rework force_unroll_array_access()

2018-12-06 Thread Timothy Arceri
Here we rework force_unroll_array_access() so that we can reused the induction variable detection in a following patch. Reviewed-by: Thomas Helland --- src/compiler/nir/nir_loop_analyze.c | 49 - 1 file changed, 35 insertions(+), 14 deletions(-) diff --git

[Mesa-dev] [PATCH 09/20] nir: add partial loop unrolling support

2018-12-06 Thread Timothy Arceri
This adds partial loop unrolling support and makes use of a guessed trip count based on array access. The code is written so that we could use partial unrolling more generally, but for now it's only use when we have guessed the trip count. We use partial unrolling for this guessed trip count

[Mesa-dev] [PATCH 20/20] nir: find induction/limit vars in iand instructions

2018-12-06 Thread Timothy Arceri
This will be used to help find the trip count of loops that look like the following: while (a < x && i < 8) { ... i++; } Where the NIR will end up looking something like this: vec1 32 ssa_0 = load_const (0x /* 0.00 */) vec1 32 ssa_1 = load_const (0x0008

[Mesa-dev] [PATCH 18/20] nir: add get_induction_and_limit_vars() helper to loop analysis

2018-12-06 Thread Timothy Arceri
This helps make find_trip_count() a little easier to follow but will also be used by a following patch. --- src/compiler/nir/nir_loop_analyze.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/compiler/nir/nir_loop_analyze.c

[Mesa-dev] [PATCH 12/20] nir: add if opt opt_if_loop_last_continue()

2018-12-06 Thread Timothy Arceri
From: Danylo Piliaiev Removing the last continue can allow more loops to unroll. Also inserting code into the if branch can allow the various if opts to progress further. The insertion of some loops into the if branch also reduces VGPR use in some shaders. vkpipeline-db results (VEGA): Totals

[Mesa-dev] [PATCH 05/20] nir: factor out some of the complex loop unroll code to a helper

2018-12-06 Thread Timothy Arceri
Reviewed-by: Thomas Helland --- src/compiler/nir/nir_opt_loop_unroll.c | 115 ++--- 1 file changed, 64 insertions(+), 51 deletions(-) diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c index c267c185b6..8406880204 100644 ---

[Mesa-dev] [PATCH 07/20] nir: add guess trip count support to loop analysis

2018-12-06 Thread Timothy Arceri
This detects an induction variable used as an array index to guess the trip count of the loop. This enables us to do a partial unroll of the loop, with can eventually result in the loop being eliminated. --- src/compiler/nir/nir.h | 4 ++ src/compiler/nir/nir_loop_analyze.c | 78

[Mesa-dev] [PATCH 03/20] nir: add a new nir_cf_list_clone_and_reinsert() helper

2018-12-06 Thread Timothy Arceri
Reviewed-by: Thomas Helland --- src/compiler/nir/nir_control_flow.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/compiler/nir/nir_control_flow.h b/src/compiler/nir/nir_control_flow.h index 2ea460e5df..9111b30a29 100644 --- a/src/compiler/nir/nir_control_flow.h +++

[Mesa-dev] [PATCH 04/20] nir: make use of new nir_cf_list_clone_and_reinsert() helper

2018-12-06 Thread Timothy Arceri
Reviewed-by: Thomas Helland --- src/compiler/nir/nir_opt_loop_unroll.c | 76 ++ 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c index 0e9966320b..c267c185b6 100644 ---

[Mesa-dev] [PATCH 01/20] nir: small tidy ups for nir_loop_analyze()

2018-12-06 Thread Timothy Arceri
Reviewed-by: Thomas Helland --- src/compiler/nir/nir_loop_analyze.c | 31 ++--- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c index 9c3fd2f286..c779383b36 100644 ---

[Mesa-dev] [PATCH 02/20] nir: clarify some nit_loop_info member names

2018-12-06 Thread Timothy Arceri
Following commits will introduce additional fields such as guessed_trip_count. Renaming these will help avoid confusion as our unrolling feature set grows. Reviewed-by: Thomas Helland --- src/compiler/nir/nir.h | 8 +--- src/compiler/nir/nir_loop_analyze.c| 14

[Mesa-dev] More loop unrolling

2018-12-06 Thread Timothy Arceri
This is three series combined. I've sent the first two previously (patch 1-11 & patch 12-15) and they have been partially reviewed by Thomas. Please see the previous sends of those series for cover letters. There is a small bug fix in patch 11 that was discovered by some new piglit tests [1].

Re: [Mesa-dev] [PATCH 11/28] util: added float to float16 conversions with RTZ and RTNE

2018-12-06 Thread Matt Turner
Since this is for an extension that will be BDW+ can we use the _cvtss_sh() intrinsic instead? It corresponds to an IVB+ instruction and even takes the rounding mode directly as an immediate argument. ___ mesa-dev mailing list

Re: [Mesa-dev] [PATCH 12/28] util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modes

2018-12-06 Thread Matt Turner
On Wed, Dec 5, 2018 at 7:56 AM Samuel Iglesias Gonsálvez wrote: > > Signed-off-by: Samuel Iglesias Gonsálvez > --- > src/util/Makefile.sources | 2 + > src/util/double.c | 197 ++ > src/util/double.h | 46 + > src/util/meson.build

[Mesa-dev] [PATCH] gallivm: remove unused float coord wrapping for aos sampling

2018-12-06 Thread sroland
From: Roland Scheidegger AoS sampling tries to use integers for coord wrapping when possible, as it should be faster. However, for AVX, this was suboptimal, because only floats can use 8x32bit vectors, whereas integers have to be split into 4x32bit vectors. (I believe part of why it was slower

[Mesa-dev] [PATCH 11/12] virgl: move resource metadata into base resource

2018-12-06 Thread Gurchetan Singh
A resource is just a buffer with some metadata. --- src/gallium/drivers/virgl/virgl_buffer.c | 51 +++-- src/gallium/drivers/virgl/virgl_context.c | 5 +- src/gallium/drivers/virgl/virgl_resource.h | 21 +- src/gallium/drivers/virgl/virgl_texture.c | 85 +++--- 4

[Mesa-dev] [PATCH 12/12] virgl: move resource creation / import / destruction to common code

2018-12-06 Thread Gurchetan Singh
We can remove some duplicated code. --- src/gallium/drivers/virgl/virgl_buffer.c | 33 + src/gallium/drivers/virgl/virgl_resource.c | 84 +++--- src/gallium/drivers/virgl/virgl_resource.h | 16 ++--- src/gallium/drivers/virgl/virgl_texture.c | 70 ++ 4

[Mesa-dev] [PATCH 10/12] virgl: modify how we handle GL_MAP_FLUSH_EXPLICIT_BIT

2018-12-06 Thread Gurchetan Singh
Previously, we ignored the the glUnmap(..) operation and flushed before we flush the cbuf. Now, let's just flush the data when we unmap. Neither method is optimal, for example: glMapBufferRange(.., 0, 100, GL_MAP_FLUSH_EXPLICIT_BIT) glFlushMappedBufferRange(.., 25, 30)

[Mesa-dev] [PATCH 09/12] virgl: make virgl_buffers use resource helpers

2018-12-06 Thread Gurchetan Singh
We reuse the helpers we created. --- src/gallium/drivers/virgl/virgl_buffer.c | 28 +++--- src/gallium/drivers/virgl/virgl_resource.h | 1 + 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/virgl/virgl_buffer.c

[Mesa-dev] [PATCH 05/12] virgl: move vrend_get_tex_image_offset to common code

2018-12-06 Thread Gurchetan Singh
Will be reused. --- src/gallium/drivers/virgl/virgl_resource.c | 24 +++ src/gallium/drivers/virgl/virgl_resource.h | 3 +++ src/gallium/drivers/virgl/virgl_texture.c | 27 +- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git

[Mesa-dev] [PATCH 07/12] virgl: consolidate transfer code

2018-12-06 Thread Gurchetan Singh
We could allocate and destroy transfers in one place. --- src/gallium/drivers/virgl/virgl_buffer.c | 2 +- src/gallium/drivers/virgl/virgl_resource.c | 47 +++--- src/gallium/drivers/virgl/virgl_resource.h | 14 -- src/gallium/drivers/virgl/virgl_texture.c | 58

[Mesa-dev] [PATCH 08/12] virgl: make transfer code with PIPE_BUFFER targets

2018-12-06 Thread Gurchetan Singh
util_format_get_blocksize returns 1 for R8 formats (all PIPE_BUFFERs are R8). --- src/gallium/drivers/virgl/virgl_resource.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c index

[Mesa-dev] [PATCH 06/12] virgl: store layer_stride in metadata

2018-12-06 Thread Gurchetan Singh
The ioctls don't even pass this (though they should). Let's calculate this correctly in one place and then pass it down. Note -- If anyone is using vtest with protocol version 1 (why?), then you'll need this host side CL too since the layer stride is forwarded for non-array textures.

[Mesa-dev] [PATCH 04/12] virgl: move virgl_resource_layout to common code

2018-12-06 Thread Gurchetan Singh
Will be reused. --- src/gallium/drivers/virgl/virgl_resource.c | 37 +++ src/gallium/drivers/virgl/virgl_resource.h | 4 ++ src/gallium/drivers/virgl/virgl_texture.c | 52 +- 3 files changed, 51 insertions(+), 42 deletions(-) diff --git

[Mesa-dev] [PATCH 01/12] virgl: texture_transfer_pool --> transfer_pool

2018-12-06 Thread Gurchetan Singh
It's used for all types of resources. --- src/gallium/drivers/virgl/virgl_buffer.c | 4 ++-- src/gallium/drivers/virgl/virgl_context.c | 4 ++-- src/gallium/drivers/virgl/virgl_context.h | 2 +- src/gallium/drivers/virgl/virgl_screen.c | 4 ++-- src/gallium/drivers/virgl/virgl_screen.h | 2 +-

[Mesa-dev] [PATCH 03/12] virgl: move texture metadata to common code

2018-12-06 Thread Gurchetan Singh
Will be reused. --- src/gallium/drivers/virgl/virgl_resource.h | 11 --- src/gallium/drivers/virgl/virgl_texture.c | 19 ++- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/virgl/virgl_resource.h

[Mesa-dev] [PATCH 02/12] virgl: remove unnessecary code

2018-12-06 Thread Gurchetan Singh
With commit 89b479, we moved to tracking buffer cleanliness when binding. TEST=dEQP-GLES31.functional.image_load_store.buffer.load_store.r32ui --- src/gallium/drivers/virgl/virgl_buffer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gallium/drivers/virgl/virgl_buffer.c

Re: [Mesa-dev] [PATCH 00/11] i965 shader debug through KHR_debug

2018-12-06 Thread Ilia Mirkin
On Thu, Dec 6, 2018 at 7:36 PM Mark Janes wrote: > > This series provides Intel shader compilation debug information via > KHR_debug. Previously, shader assembly and related compilation > artifacts were dumped to stderr. Tools associating compilation > artifacts with programs (e.g.

[Mesa-dev] [PATCH 04/11] i965/disasm: allow caller to specify output filehandle.

2018-12-06 Thread Mark Janes
--- src/intel/compiler/brw_disasm_info.c | 28 +++ src/intel/compiler/brw_disasm_info.h | 2 +- src/intel/compiler/brw_fs_generator.cpp | 2 +- src/intel/compiler/brw_vec4_generator.cpp | 2 +- src/intel/compiler/test_eu_validate.cpp | 2 +- 5 files changed,

[Mesa-dev] [PATCH 11/11] i965: provide shader cache assemblies to KHR_debug

2018-12-06 Thread Mark Janes
--- src/mesa/drivers/dri/i965/brw_disk_cache.c | 23 ++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_disk_cache.c b/src/mesa/drivers/dri/i965/brw_disk_cache.c index 65fcab24b7f..0acbef4f20e 100644 ---

[Mesa-dev] [PATCH 00/11] i965 shader debug through KHR_debug

2018-12-06 Thread Mark Janes
This series provides Intel shader compilation debug information via KHR_debug. Previously, shader assembly and related compilation artifacts were dumped to stderr. Tools associating compilation artifacts with programs (e.g. FrameRetrace*) parsed stderr, which was error prone. Changes to the

[Mesa-dev] [PATCH 01/11] mesa: properly report the length of truncated log messages

2018-12-06 Thread Mark Janes
_mesa_log_msg must provide the length of the string passed into the KHR_debug api. When the string formatted by _mesa_gl_vdebugf exceeds MAX_DEBUG_MESSAGE_LENGTH, the length is incorrectly set to the number of characters that would have been written if enough space had been available. Fixes:

[Mesa-dev] [PATCH 10/11] i965: provide GLSL IR to KHR_debug

2018-12-06 Thread Mark Janes
--- src/mesa/drivers/dri/i965/brw_link.cpp | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 2cbb1e0b879..24e0079fc5d 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++

[Mesa-dev] [PATCH 06/11] i965/disasm: provide shader assembly to KHR_debug.

2018-12-06 Thread Mark Janes
Shader assemblies can be more easily incorporated into debug tools if they are presented through KHR_debug. --- src/intel/compiler/brw_fs_generator.cpp | 38 --- src/intel/compiler/brw_vec4_generator.cpp | 22 +++-- 2 files changed, 33 insertions(+), 27 deletions(-)

[Mesa-dev] [PATCH 09/11] i965: make shader_debug_log_mesa callable

2018-12-06 Thread Mark Janes
Debug output of IR/assemblies is likely to exceed the 4k limit in KHR_debug. shader_debug_log_mesa splits large messages, providing the full content through KHR_debug. Expose the function, so it can be called from the shader cache and the linker. --- src/mesa/drivers/dri/i965/intel_screen.c | 2

[Mesa-dev] [PATCH 05/11] i965: provide stable message id's for shader_debug_log

2018-12-06 Thread Mark Janes
KHR_debug indicates that message id's can be used to filter debug logs. Mesa incorrectly generates incrementing message id's for each message in shader_debug_log. The ids must be stable if they are to be used for filtering. _mesa_gl_vdebug expects the address of a static GLuint, which is

[Mesa-dev] [PATCH 03/11] mesa: add logging function for formatted string

2018-12-06 Thread Mark Janes
--- src/mesa/main/errors.c | 27 +++ src/mesa/main/errors.h | 8 2 files changed, 35 insertions(+) diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index fad8cb59cae..995b0510575 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@

[Mesa-dev] [PATCH 08/11] intel/nir: provide SSA form to KHR_debug

2018-12-06 Thread Mark Janes
--- src/intel/compiler/brw_fs.cpp | 11 - src/intel/compiler/brw_nir.c | 26 +- src/intel/compiler/brw_nir.h | 1 + src/intel/compiler/brw_shader.cpp | 2 +- src/intel/compiler/brw_vec4.cpp| 2 +-

[Mesa-dev] [PATCH 07/11] i965/compiler: provide formatted strings to the shader debug log

2018-12-06 Thread Mark Janes
--- src/intel/compiler/brw_compiler.h | 2 +- src/intel/compiler/brw_fs_generator.cpp | 2 +- src/intel/compiler/brw_vec4_generator.cpp | 3 +-- src/intel/vulkan/anv_device.c | 2 +- src/mesa/drivers/dri/i965/intel_screen.c | 19 ++- 5 files changed, 14

[Mesa-dev] [PATCH 02/11] mesa: rename logging functions to reflect that they format strings

2018-12-06 Thread Mark Janes
In preparation for the definition of a function to log a formatted string. --- src/mesa/drivers/dri/i915/intel_context.h | 18 +-- src/mesa/drivers/dri/i915/intel_fbo.c | 10 +++--- src/mesa/drivers/dri/i965/brw_context.h | 18 +--

Re: [Mesa-dev] [PATCH 05/28] Revert "spirv: Don’t check for NaN for most OpFOrd* comparisons"

2018-12-06 Thread Ian Romanick
On 12/05/2018 10:12 AM, Connor Abbott wrote: > This won't work, since this optimization in nir_opt_algebraic will undo it: > > # For any float comparison operation, "cmp", if you have "a == a && a cmp b" > # then the "a == a" is redundant because it's equivalent to "a is not NaN" > # and, if a is

Re: [Mesa-dev] [PATCH v2] docs: Document GitLab merge request process (email alternative)

2018-12-06 Thread Jordan Justen
On 2018-12-06 13:57:09, Nicolai Hähnle wrote: > On 06.12.18 00:32, Jordan Justen wrote: > > + To participate in code review, you should monitor the > > + https://lists.freedesktop.org/mailman/listinfo/mesa-dev;> > > + mesa-dev email list and the GitLab > > + Mesa >

Re: [Mesa-dev] [PATCH v2] docs: Document GitLab merge request process (email alternative)

2018-12-06 Thread Jason Ekstrand
On Thu, Dec 6, 2018 at 3:57 PM Nicolai Hähnle wrote: > On 06.12.18 00:32, Jordan Justen wrote: > > This documents a process for using GitLab Merge Requests as an second > > way to submit code changes for Mesa. Only one of the two methods is > > allowed for each patch series. > > > > We will

Re: [Mesa-dev] [PATCH v2] docs: Document GitLab merge request process (email alternative)

2018-12-06 Thread Nicolai Hähnle
On 06.12.18 00:32, Jordan Justen wrote: This documents a process for using GitLab Merge Requests as an second way to submit code changes for Mesa. Only one of the two methods is allowed for each patch series. We will *not* require all patches to be emailed. Some code changes may be reviewed and

Re: [Mesa-dev] [PATCH v2] docs: Document GitLab merge request process (email alternative)

2018-12-06 Thread Dylan Baker
Quoting Jordan Justen (2018-12-05 15:32:05) > This documents a process for using GitLab Merge Requests as an second > way to submit code changes for Mesa. Only one of the two methods is > allowed for each patch series. > > We will *not* require all patches to be emailed. Some code changes may >

[Mesa-dev] [Bug 108961] make check test_replace_src_bitsize failure

2018-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108961 Jason Ekstrand changed: What|Removed |Added Assignee|mesa-dev@lists.freedesktop. |cwabbo...@gmail.com

[Mesa-dev] [Bug 108961] make check test_replace_src_bitsize failure

2018-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108961 Bug ID: 108961 Summary: make check test_replace_src_bitsize failure Product: Mesa Version: git Hardware: x86-64 (AMD64) OS: All Status: NEW Keywords:

[Mesa-dev] [PATCH] nir/constant_folding: Fix source bit size logic

2018-12-06 Thread Jason Ekstrand
Instead of looking at input_sizes[i] which contains the number of components for each source, we look at the bit size of input_types[i]. This fixes a regression in the 1-bit boolean series though I have no idea how we haven't seen it before now. Fixes: 35baee5dce5 "nir/constant_folding: fix

[Mesa-dev] [PATCH] nir/constant_folding: Fix source bit size logic

2018-12-06 Thread Jason Ekstrand
Instead of looking at input_sizes[i] which contains the number of components for each source, we look at the bit size of input_types[i]. This fixes a regression in the 1-bit boolean series though I have no idea how we haven't seen it before now. Fixes: 35baee5dce5 "nir/constant_folding: fix

Re: [Mesa-dev] [PATCH v2 00/29] nir: Use a 1-bit data type for booleans

2018-12-06 Thread Jason Ekstrand
Ugh... This should not be 29 patches. I used the wrong base. The real series starts at "nir/algebraic: Optimize x2b(xneg(a)) -> a" On Thu, Dec 6, 2018 at 1:45 PM Jason Ekstrand wrote: > This is a v2 of my series to switch NIR over to 1-bit Booleans. The first > version of the series can be

Re: [Mesa-dev] [PATCH v2 11/29] nir: Drop support for lower_b2f

2018-12-06 Thread Jason Ekstrand
Thanks! On Thu, Dec 6, 2018 at 2:24 PM Alyssa Rosenzweig wrote: > Reviewed-by: Alyssa Rosenzweig > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH v2] docs: Document GitLab merge request process (email alternative)

2018-12-06 Thread Eric Anholt
Jordan Justen writes: > This documents a process for using GitLab Merge Requests as an second > way to submit code changes for Mesa. Only one of the two methods is > allowed for each patch series. > > We will *not* require all patches to be emailed. Some code changes may > be reviewed and merged

[Mesa-dev] [PATCH v2 27/29] FIXUP: nir/builder: Generate 1-bit Booleans in nir_build_imm_bool

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_builder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 08c5f1e8b6c..826e549019a 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -212,9

[Mesa-dev] [PATCH v2 29/29] nir/algebraic: Add some optimizations for D3D-style Booleans

2018-12-06 Thread Jason Ekstrand
D3D Booleans use a 32-bit 0/-1 representation. Because this previously matched NIR exactly, we didn't have to really optimize for it. Now that we have 1-bit Booleans, we need some specific optimizations to chew through the D3D12-style Booleans. Shader-db results on Kaby Lake: total

[Mesa-dev] [PATCH v2 26/29] FIXUP: Revert "nir/builder: Generate 32-bit bool opcodes transparently"

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_builder_opcodes_h.py | 39 +-- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/src/compiler/nir/nir_builder_opcodes_h.py b/src/compiler/nir/nir_builder_opcodes_h.py index 5c38818d4ec..34b8c4371e1 100644 ---

[Mesa-dev] [PATCH v2 17/29] FIXUP: Use 32-bit opcodes in the NIR back-ends

2018-12-06 Thread Jason Ekstrand
Generated with a little hand-editing and the following sed commands: sed -i 's/nir_op_ball_fequal/nir_op_b32all_fequal/g' **/*.c sed -i 's/nir_op_bany_fnequal/nir_op_b32any_fnequal/g' **/*.c sed -i 's/nir_op_ball_iequal/nir_op_b32all_iequal/g' **/*.c sed -i

[Mesa-dev] [PATCH v2 28/29] nir/algebraic: Optimize 1-bit Booleans

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_algebraic.py | 40 ++ src/compiler/nir/nir_opt_algebraic.py | 103 +- 2 files changed, 57 insertions(+), 86 deletions(-) diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index

[Mesa-dev] [PATCH v2 20/29] nir/large_constants: Properly handle 1-bit bools

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_opt_large_constants.c | 14 +- src/compiler/nir_types.cpp | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_large_constants.c b/src/compiler/nir/nir_opt_large_constants.c index

[Mesa-dev] [PATCH v2 14/29] FIXUP: nir/builder: Generate 32-bit bool opcodes transparently

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_builder_opcodes_h.py | 39 ++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_builder_opcodes_h.py b/src/compiler/nir/nir_builder_opcodes_h.py index 34b8c4371e1..5c38818d4ec 100644 ---

[Mesa-dev] [PATCH v2 22/29] nir: Add 1-bit Boolean opcodes

2018-12-06 Thread Jason Ekstrand
We also have to add support for 1-bit integers while we're here so we get 1-bit variants of iand, ior, and inot. --- src/compiler/nir/nir_lower_alu_to_scalar.c | 4 +++ src/compiler/nir/nir_opcodes.py| 29 -- src/compiler/nir/nir_search.c | 4 ++- 3

[Mesa-dev] [PATCH v2 25/29] FIXUP: Revert "Use 32-bit opcodes in the NIR producers and optimizations"

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir.h | 24 - src/compiler/nir/nir_loop_analyze.c| 28 +- src/compiler/nir/nir_opt_if.c | 2 +- src/compiler/nir/nir_opt_peephole_select.c | 2 +- src/compiler/nir/nir_opt_undef.c | 2 +-

[Mesa-dev] [PATCH v2 24/29] glsl,spirv: Generate 1-bit Booleans

2018-12-06 Thread Jason Ekstrand
--- src/compiler/glsl/glsl_to_nir.cpp | 15 +++ src/compiler/nir/nir.h| 2 +- src/compiler/nir/nir_builder.h| 4 ++-- src/compiler/nir_types.h | 4 +++- src/compiler/spirv/spirv_to_nir.c | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git

[Mesa-dev] [PATCH v2 08/29] nir/opt_algebraic: Add 32-bit specifiers to a bunch of booleans

2018-12-06 Thread Jason Ekstrand
Reviewed-by: Connor Abbott --- src/compiler/nir/nir_opt_algebraic.py | 112 +- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index c482bde8b3b..aa1a7a94e6e 100644 ---

[Mesa-dev] [PATCH v2 21/29] nir/algebraic: Generalize an optimization

2018-12-06 Thread Jason Ekstrand
This just makes it nicely scale across bit sizes. --- src/compiler/nir/nir_opt_algebraic.py | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 1f1dd9e8b77..72445ee830e 100644 ---

[Mesa-dev] [PATCH v2 15/29] FIXUP: nir/algebraic: Remap Boolean opcodes to the 32-bit variant

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_algebraic.py | 30 ++ 1 file changed, 30 insertions(+) diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index c16cadbdc58..9a28421b799 100644 --- a/src/compiler/nir/nir_algebraic.py +++

[Mesa-dev] [PATCH v2 16/29] FIXUP: Use 32-bit opcodes in the NIR producers and optimizations

2018-12-06 Thread Jason Ekstrand
Generated with a little hand-editing and the following sed commands: sed -i 's/nir_op_ball_fequal/nir_op_b32all_fequal/g' **/*.c sed -i 's/nir_op_bany_fnequal/nir_op_b32any_fnequal/g' **/*.c sed -i 's/nir_op_ball_iequal/nir_op_b32all_iequal/g' **/*.c sed -i

[Mesa-dev] [PATCH v2 23/29] nir: Add a bool to int32 lowering pass

2018-12-06 Thread Jason Ekstrand
We also enable it in all of the NIR drivers. --- src/amd/vulkan/radv_shader.c | 2 + src/broadcom/compiler/vir.c | 2 + src/compiler/Makefile.sources| 1 + src/compiler/nir/meson.build | 1 + src/compiler/nir/nir.h

[Mesa-dev] [PATCH v2 12/29] nir/algebraic: Make an optimization more specific

2018-12-06 Thread Jason Ekstrand
Later in this series, bool is not going to imply 32-bit. --- src/compiler/nir/nir_opt_algebraic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 57abe7c9952..1f1dd9e8b77 100644 ---

[Mesa-dev] [PATCH v2 05/29] nir/algebraic: Add support for unsized conversion opcodes

2018-12-06 Thread Jason Ekstrand
All conversion opcodes require a destination size but this makes constructing certain algebraic expressions rather cumbersome. This commit adds support to nir_search and nir_algebraic for writing conversion opcodes without a size. These meta-opcodes match any conversion of that type regardless

[Mesa-dev] [PATCH v2 06/29] nir/opt_algebraic: Simplify an optimization using the new search ops

2018-12-06 Thread Jason Ekstrand
Reviewed-by: Connor Abbott --- src/compiler/nir/nir_opt_algebraic.py | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index f2a7be0c403..27c90cebaee 100644 ---

[Mesa-dev] [PATCH v2 19/29] nir: Add support for 1-bit data types

2018-12-06 Thread Jason Ekstrand
This commit adds support for 1-bit Booleans and integers. Booleans obviously take a value of true or false. Because we have to define the semantics of 1-bit signed and unsigned integers, we define uint1_t to take values of 0 and 1 and int1_t to take values of 0 and -1. 1-bit arithmetic is then

[Mesa-dev] [PATCH v2 03/29] nir/algebraic: Clean up some __str__ cruft

2018-12-06 Thread Jason Ekstrand
Both of these things are already handled in the Value base class so we don't need to handle them explicitly in Constant. Reviewed-by: Connor Abbott --- src/compiler/nir/nir_algebraic.py | 4 1 file changed, 4 deletions(-) diff --git a/src/compiler/nir/nir_algebraic.py

[Mesa-dev] [PATCH v2 18/29] nir/constant_expressions: Rework Boolean handling

2018-12-06 Thread Jason Ekstrand
This commit contains three related changes. First, we define boolN_t for N = 8, 16, and 64 and move the definition of boolN_vec to the loop with the other vec definitions. Second, there's no reason why we need the != 0 on the source because that happens implicitly when it's converted to bool.

[Mesa-dev] [PATCH v2 11/29] nir: Drop support for lower_b2f

2018-12-06 Thread Jason Ekstrand
This was originally added for the out-of-tree Mali driver but I think we've all agreed it's easy enough for them to just do in their back-end. Cc: Alyssa Rosenzweig --- src/compiler/nir/nir.h| 3 --- src/compiler/nir/nir_opt_algebraic.py | 5 + 2 files changed, 1

[Mesa-dev] [PATCH v2 01/29] nir/opcodes: Pull in the type helpers from constant_expressions

2018-12-06 Thread Jason Ekstrand
While we're at it, we rework them a bit to all use regular expressions and assert more. Reviewed-by: Connor Abbott --- src/compiler/nir/nir_constant_expressions.py | 25 ++ src/compiler/nir/nir_opcodes.py | 34 +--- src/compiler/nir/nir_opcodes_c.py

[Mesa-dev] [PATCH v2 02/29] nir/opcodes: Rename tbool to tbool32

2018-12-06 Thread Jason Ekstrand
Reviewed-by: Connor Abbott --- src/compiler/nir/nir_opcodes.py | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index d69d09d30ce..00720708305 100644 ---

[Mesa-dev] [PATCH v2 13/29] nir: Rename Boolean-related opcodes to include 32 in the name

2018-12-06 Thread Jason Ekstrand
--- src/compiler/nir/nir_lower_alu_to_scalar.c | 8 ++--- src/compiler/nir/nir_opcodes.py| 34 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/nir/nir_lower_alu_to_scalar.c b/src/compiler/nir/nir_lower_alu_to_scalar.c index

[Mesa-dev] [PATCH v2 10/29] nir/algebraic: Optimize x2b(xneg(a)) -> a

2018-12-06 Thread Jason Ekstrand
Shader-db results on Kaby Lake: total instructions in shared programs: 15072525 -> 15072525 (0.00%) instructions in affected programs: 0 -> 0 helped: 0 HURT: 0 This helps prevent regressions in later commits. --- src/compiler/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2

[Mesa-dev] [PATCH v2 07/29] nir/opt_algebraic: Drop bit-size suffixes from conversions

2018-12-06 Thread Jason Ekstrand
Suffixes are dropped from a bunch of conversion opcodes when it makes sense to do so. Others are kept if we really do want the bit-size restriction. Reviewed-by: Connor Abbott --- src/compiler/nir/nir_opt_algebraic.py | 58 +-- 1 file changed, 29 insertions(+), 29

[Mesa-dev] [PATCH v2 09/29] nir: Make boolean conversions sized just like the others

2018-12-06 Thread Jason Ekstrand
Instead of a single i2b and b2i, we now have i2b32 and b2iN where N is one if 8, 16, 32, or 64. This leads to having a few more opcodes but now everything is consistent and booleans aren't a weird special case anymore. Reviewed-by: Connor Abbott --- src/amd/common/ac_nir_to_llvm.c | 12

[Mesa-dev] [PATCH v2 04/29] nir/algebraic: Refactor codegen a bit

2018-12-06 Thread Jason Ekstrand
Instead of using an OrderedDict, just have a (necessarily sorted) array of transforms and a set of opcodes. Reviewed-by: Connor Abbott --- src/compiler/nir/nir_algebraic.py | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git

[Mesa-dev] [PATCH v2 00/29] nir: Use a 1-bit data type for booleans

2018-12-06 Thread Jason Ekstrand
This is a v2 of my series to switch NIR over to 1-bit Booleans. The first version of the series can be found here: https://patchwork.freedesktop.org/series/51351/ Since then, a bit of work has been done on NIR to make the transition a bit smoother. Connor rewrote the entire bit-size inference

[Mesa-dev] [Bug 108933] Unreal Tournament (UT99) segfault on opengl init

2018-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108933 --- Comment #5 from i...@yahoo.com --- The upgrade was from gcc-7.3.0 to gcc-8.2.0. You can see 8.2.0 include in the backtrace. I don't think that we can blame gcc-8.2.0 for the redhat bugreport, as they do use a development snapshot. (Now

Re: [Mesa-dev] [PATCH] meson: link LLVM 'native' component when LLVM is available

2018-12-06 Thread Dylan Baker
Quoting Nicolai Hähnle (2018-12-06 05:49:02) > From: Nicolai Hähnle > > Linking against LLVM built with BUILD_SHARED_LIBS fails otherwise, > as the component is required for the draw module. > --- > meson.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [Mesa-dev] [PATCH 11/18] autotools: wire the new generator for es1 and es2

2018-12-06 Thread Erik Faye-Lund
On Wed, 2018-11-21 at 12:04 +, Emil Velikov wrote: > The output produced functionally identical, with the following > changes: > - A cosmetic: swapped ABI compatible types [ GLclampf -> GLfloat, > etc ] > - B cosmetic: renamed parameters [ zNear -> n, etc ] > - C dropped gl_dispatch_stub

Re: [Mesa-dev] [PATCH mesa] meson: add missing tegra vdpau driver

2018-12-06 Thread Ilia Mirkin
On Thu, Dec 6, 2018 at 12:17 PM Eric Engestrom wrote: > > On Thursday, 2018-12-06 12:07:06 -0500, Ilia Mirkin wrote: > > Under what circumstances would tegra have a vdpau implementation? > > I don't know about that, but this patch brings meson on par with > autotools. Are you saying autotools was

Re: [Mesa-dev] [PATCH mesa] meson: add missing tegra vdpau driver

2018-12-06 Thread Eric Engestrom
On Thursday, 2018-12-06 12:07:06 -0500, Ilia Mirkin wrote: > Under what circumstances would tegra have a vdpau implementation? I don't know about that, but this patch brings meson on par with autotools. Are you saying autotools was wrong and it should be removed there instead? FtR,

Re: [Mesa-dev] [PATCH 13/18] scons: wire the new generator for es1 and es2

2018-12-06 Thread Erik Faye-Lund
Reviewed-by: Erik Faye-Lund On Wed, 2018-11-21 at 12:04 +, Emil Velikov wrote: > From: Emil Velikov > > Signed-off-by: Emil Velikov > --- > src/mapi/shared-glapi/SConscript | 28 +--- > 1 file changed, 21 insertions(+), 7 deletions(-) > > diff --git

Re: [Mesa-dev] [PATCH 18/18] mapi: remove machinery handling CSV files

2018-12-06 Thread Erik Faye-Lund
On Wed, 2018-11-21 at 12:04 +, Emil Velikov wrote: > From: Emil Velikov > > We haven't have one in years, so just drop the code. > > Signed-off-by: Emil Velikov > --- > src/mapi/mapi_abi.py | 80 > > 1 file changed, 6 insertions(+), 74

  1   2   >