[Mesa-dev] [PATCH] Fix strict-aliasing violations in GLSL shader list implementation

2015-06-23 Thread Thomas Helland
2015-06-24 23:05 GMT+02:00 Davin McCall : > Hi - I'm new here. > > I've recently started poking the Mesa codebase for little reason other than > personal interest. In the "help wanted" section of the website it mentions > aliasing violations as a target for newcomers to fix, so with that in mind >

[Mesa-dev] [RFC] Progress on loop-analysis in NIR (GSoC)

2015-06-25 Thread Thomas Helland
So its time for me to post the current state of my loop analysis pass. So where can you find this? You can find it in a branch on github[1], if you want a more reading-friendly experience. (Oh, and don't bother with looking at the commit history.) I've also pasted to code as-is below, as I've yet

[Mesa-dev] [PATCH] glsl: remove dead code in a single pass

2015-07-12 Thread Thomas Helland
2015-07-12 1:17 GMT+02:00 Timothy Arceri : > Currently only one ir assignment is removed for each var in a single > dead code optimisation pass. This means if a var has more than one > assignment, then it requires all the glsl optimisations to be run again > for each additional assignment to be rem

Re: [Mesa-dev] [PATCH v3 (part2) 10/56] glsl: Lower unsized array's length calculation expression

2015-07-14 Thread Thomas Helland
2015-07-14 9:46 GMT+02:00 Iago Toral Quiroga : > From: Samuel Iglesias Gonsalvez > > Signed-off-by: Samuel Iglesias Gonsalvez > --- > src/glsl/lower_ubo_reference.cpp | 179 > +++ ^ This is 80 characters wide in this case(for reference), so we're blowing the

Re: [Mesa-dev] [PATCH 00/13] Avoid double promotion

2015-07-14 Thread Thomas Helland
Hi Matt, Just a small nitpick I noticed; s/promition/promotion in the commit message. -Thomas 2015-07-14 1:22 GMT+02:00 Matt Turner : > In the process of looking at the assembly generated from the OUT_BATCH > series, I noticed a bunch of float <-> double round trips. Mostly this > arises because

[Mesa-dev] [PATCH 0/5] [RFC] Value range propagation for NIR

2015-07-14 Thread Thomas Helland
them soak on the list for some comments while I go head-to-head with the loop unrolling. Happy reviewing =) Thomas Helland (5): nir/worklist: Split out the type-independent parts nir: Add a worklist for SSA definitions nir: Move nir_instr_get_dest_ssa_def to nir.c / nir.h nir: Add a helper

[Mesa-dev] [PATCH 1/5] nir/worklist: Split out the type-independent parts

2015-07-14 Thread Thomas Helland
Now, nir_block_worklist is just a thin wraper around nir_worklist. We can now use nir_worklist also for SSA definitions. Signed-off-by: Connor Abbott V2: Correct comments in more places Add file to makefile Fix EOF blank line idx -> index Signed-off-by: Thomas Helland ---

[Mesa-dev] [PATCH 4/5] nir: Add a helper for iterating over blocks in a cf node

2015-07-14 Thread Thomas Helland
We were already doing this internally for iterating over a function implementation, so just expose it directly. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 7 +++ src/glsl/nir/nir.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c ind

[Mesa-dev] [PATCH 3/5] nir: Move nir_instr_get_dest_ssa_def to nir.c / nir.h

2015-07-14 Thread Thomas Helland
This was originally located in nir_opt_cse. Move it out for reuse. Signed-off-by: Thomas Helland --- This probably is not that smart. We can ofcourse roll our own in value range pass. It was just so conventient at the time. src/glsl/nir/nir.c | 21 + src/glsl/nir

[Mesa-dev] [PATCH 2/5] nir: Add a worklist for SSA definitions

2015-07-14 Thread Thomas Helland
Signed-off-by: Connor Abbott V2: Added entry in makefile --- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir_ssa_def_worklist.h | 100 2 files changed, 101 insertions(+) create mode 100644 src/glsl/nir/nir_ssa_def_worklist.h diff --git a/src/g

[Mesa-dev] [PATCH 0/5] [RFC] Value range propagation for NIR

2015-07-14 Thread Thomas Helland
ken. Weird stuff. 2015-07-15 0:08 GMT+02:00 Thomas Helland : > The deadline for GSoC is aproaching a bit faster than I'm > comfortable with, so I need to get this out on the list > for some review-action. It's not yet complete, but I think > it's getting there. At least it s

[Mesa-dev] [PATCH] nir: Add a value range propagation pass

2015-07-14 Thread Thomas Helland
Signed-off-by: Thomas Helland --- src/glsl/Makefile.sources |1 + src/glsl/nir/nir.h |2 + src/glsl/nir/nir_opt_value_range.c | 1330 3 files changed, 1333 insertions(+) create mode 100644 src/glsl/nir/nir_opt_value_range.c

[Mesa-dev] [PATCH] nir: Add a value range propagation pass

2015-07-15 Thread Thomas Helland
Hi Matt, I've commented on some of your feedback down below. The rest is taken note of and I'll be fixing it up later. 2015-07-15 19:18 GMT+02:00 Matt Turner : > On Tue, Jul 14, 2015 at 4:29 PM, Thomas Helland > wrote: >> Signed-off-by: Thomas Helland >> --- &

[Mesa-dev] [PATCH 1/7] configure.ac: null, android, gdi are not valid egl-platforms

2015-07-20 Thread Thomas Helland
oid platform > +wayland, surfaceless, android, > +and haiku. The android platform > can only be built as a system component, part of AOSP, while the > -haiku and gdi platforms can only be built with > SCons. > +haiku platforms can only be built with SCons. ^ s/platforms/plat

[Mesa-dev] [PATCH 2/7] egl: consolidate ifdef HAVE_LIBDRM blocks

2015-07-20 Thread Thomas Helland
This looks a lot better. The patch is: Reviewed-by: Thomas Helland 2015-07-10 19:49 GMT+02:00 Emil Velikov : > Move the code around rather than having it scattered. No functional > change. > > Signed-off-by: Emil Velikov > --- > src/egl/drivers/dri

[Mesa-dev] [PATCH 5/7] egl/wayland: use designated initializers

2015-07-20 Thread Thomas Helland
This patch is: Reviewed-by: Thomas Helland 2015-07-10 19:49 GMT+02:00 Emil Velikov : > Signed-off-by: Emil Velikov > --- > src/egl/drivers/dri2/platform_wayland.c | 26 +- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/sr

[Mesa-dev] [PATCH 1/7] configure.ac: null, android, gdi are not valid egl-platforms

2015-07-20 Thread Thomas Helland
Hi Emil, I looked at the whole series, but didn't really feel qualified to review the whole bunch. I've sent reviews on the patches I felt I had a good take on. If you don't get anyone else to review the remainder then shout out and I'll give it a shot. - Thomas 2015-07-17 22:57 GMT+02:00 Emil V

[Mesa-dev] [PATCH 1/5] utils: automake: remove uncommon $()

2015-07-21 Thread Thomas Helland
2015-07-21 14:12 GMT+02:00 Emil Velikov : > On 20/07/15 21:25, Chad Versace wrote: >> On Fri 17 Jul 2015, Emil Velikov wrote: >>> On 17 July 2015 at 19:11, Ilia Mirkin wrote: On Fri, Jul 17, 2015 at 2:11 PM, Eric Anholt wrote: > Matt Turner writes: > >> On Fri, Jul 17, 2015 at 1

Re: [Mesa-dev] [PATCH 7/7] nir: add helper macros for running NIR passes

2015-10-25 Thread Thomas Helland
2015-10-25 13:58 GMT+01:00 Rob Clark : > On Sun, Oct 25, 2015 at 8:05 AM, Erik Faye-Lund wrote: >> On Sat, Oct 24, 2015 at 7:08 PM, Rob Clark wrote: >>> From: Rob Clark >>> >>> +#define NIR_PASS_PROGRESS(pass, nir, ...) ({ \ >>> + assert(nir_shader_is_mutable(nir));

[Mesa-dev] FYI: Pull-through optimization for NIR

2015-10-28 Thread Thomas Helland
Hi all, Just thought I'd inform you of my experiments and findings this weekend. This summer I discussed a possible optimization pass with Connor that I've simply named "pull-through" for the lack of a better name. This tries to reorder operations of the type min(sqrt(a), sqrt(b)) into sqrt(min(

Re: [Mesa-dev] nir/i965: Source modifiers on vecN opcodes

2015-11-09 Thread Thomas Helland
2015-11-09 12:55 GMT+01:00 Iago Toral : > Hi, > > Currently, NIR defines vecN operations as unsigned (integer). The fp64 > patches from Connor change this to float (I guess because we need to > know the case where we are packing vectors of 64-bit floats). However, > this makes it so that nir_lower

Re: [Mesa-dev] Naming conventions, DSA, and meta

2015-02-02 Thread Thomas Helland
sert: 4.13 % --> 2.13 % hash_table_search: 4.12 % --> 2.29 % To be done: Do the same for hash set. Change some hash table uses to the one in util. Similar treatment for the other tables. Test on something that is actually CPU bound. -Thomas Helland ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 0/10] more header file clean-ups

2015-02-26 Thread Thomas Helland
On Feb 26, 2015 4:32 PM, "Emil Velikov" wrote: > > On 26/02/15 01:30, Brian Paul wrote: > > Another clean-up series. Mostly trimming down on unneeded #includes. > > > > I tested DRI, non-DRI and MSVC builds of this series but it's possible > > I've missed some configuration and broke something.

[Mesa-dev] [PATCH 0/8] Hash table and hash set reworking

2015-02-28 Thread Thomas Helland
asher [2] http://stackoverflow.com/questions/17645167/implementing-sse-4-2s-crc32c-in-software Thomas Helland (8): util: Change hash_table to use quadratic probing. util: Change table size to be power of two glsl: Change ir_const_expr to use util/hash_table util: Change util/set to use quad

[Mesa-dev] [PATCH 6/8] util: Change size of table to have 23% free

2015-02-28 Thread Thomas Helland
Should decrease collisions and therefore improve performance. Result from oprofile on a run of shader-db shows: mesa_hash_data 3.23 ---> 3.25 hash_table_insert 2.71 ---> 2.52 hash_table_search 2.87 ---> 2.64 set_add 1.69 ---> 1.65 set_search 2.11 -

[Mesa-dev] [PATCH 4/8] util: Change util/set to use quadratic probing

2015-02-28 Thread Thomas Helland
Less code, and gives a small speedup due to avoiding the extra modulo operation. Also less memory footprint since rehash gets dropped. Results from oprofile on a shader-db run: set_add 2.80 ---> 2.70 set_search 2.86 ---> 2.74 runtime 162 ---> 165 ---

[Mesa-dev] [PATCH 5/8] util: Change set to use power-of-two sized table

2015-02-28 Thread Thomas Helland
Should be more efficient as we can use a bitmask operation instead of an expensive modulo. Results from oprofile on a shader-db run: set_add 2.70 ---> 1.69 set_search 2.74 ---> 2.11 runtime 165 ---> 157 --- src/util/set.c | 82

[Mesa-dev] [PATCH 2/8] util: Change table size to be power of two

2015-02-28 Thread Thomas Helland
This gives better performance as we can do bitmasking instead of modulo operations. This reduces oprofile hits on a shader-db run accordingly: hash_table_insert 4.28 ---> 2.57 hash_table_search 4.59 ---> 2.67 runtime 175 ---> 170 Since the last patch hits assertion fa

[Mesa-dev] [PATCH 1/8] util: Change hash_table to use quadratic probing.

2015-02-28 Thread Thomas Helland
This should give better cache locality, less memory consumption, less code, and should also be faster since we avoid a modulo operation. This is not the quadratic probing function you see most places. They do not accumulate, so you try hash +1, +4, +9, etc. My code accumulates; so it becomes hash

[Mesa-dev] [PATCH 7/8] util: Add murmur3 hashing function

2015-02-28 Thread Thomas Helland
Copy-pasta from the wikipedia article. Results from oprofile on a shader-db run: mesa_hash_data 3.25 ---> 3.11 hash_table_insert 2.52 ---> 2.52 hash_table_search 2.64 ---> 2.64 set_add 1.65 ---> 1.74 set_search 2.07 ---> 2.08 runtime

[Mesa-dev] [PATCH 3/8] glsl: Change ir_const_expr to use util/hash_table

2015-02-28 Thread Thomas Helland
This is faster than program_hash_table, and we don't need the extra capabilities. Results from oprofile on a shader-db run: mesa_hash_data 3.09 ---> 3.05 hash_table_insert 2.57 ---> 2.58 hash_table_search 2.67 ---> 2.72 runtime 170 ---> 162 --- src/glsl/ir_co

[Mesa-dev] [PATCH 8/8] util: Add header for hardware crc32c

2015-02-28 Thread Thomas Helland
There are probably better ways to do this. Results from oprofile on a shader-db run: mesa_hash_data 3.11 ---> 3.12 hash_table_insert 2.52 ---> 2.50 hash_table_search 2.64 ---> 2.59 set_add 1.74 ---> 1.72 set_search 2.08 ---> 2.09 runtime

Re: [Mesa-dev] [PATCH 0/8] Hash table and hash set reworking

2015-02-28 Thread Thomas Helland
Forgot to run piglit on this before sending out. And well, it looks bad, really bad. I'm looking into it now. Will report back when I get some more data. Regards, Thomas ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.or

Re: [Mesa-dev] [PATCH 3/8] glsl: Change ir_const_expr to use util/hash_table

2015-02-28 Thread Thomas Helland
This is the commit that regresses piglit. With this reverted there are no regressions. Regards, Thomas ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 1/2] nir: Optimize (a*b)+(a*c) -> a*(b+c)

2015-02-28 Thread Thomas Helland
8 GAINED:0 LOST: 0 Signed-off-by: Thomas Helland --- src/glsl/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 7bf6431..688ceff 100644 --- a/

[Mesa-dev] [PATCH 2/2] nir: Optimize a + neg(a)

2015-02-28 Thread Thomas Helland
0 LOST: 0 Signed-off-by: Thomas Helland --- src/glsl/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 688ceff..ef855aa 100644 --- a/

Re: [Mesa-dev] [PATCH 2/2] nir: Optimize a + neg(a)

2015-02-28 Thread Thomas Helland
On Feb 28, 2015 8:39 PM, "Jason Ekstrand" wrote: > > Both patches are > > Reviewed-by: Jason Ekstrand Could you commit them? I don't have commit access. Regards, Thomas > > On Sat, Feb 28, 2015 at 11:32 AM, Thomas Helland < thomashellan...@gmail.com> w

Re: [Mesa-dev] [PATCH 0/8] Hash table and hash set reworking

2015-02-28 Thread Thomas Helland
On Feb 28, 2015 5:05 PM, "Jason Ekstrand" wrote: > > > On Feb 28, 2015 4:55 AM, "Thomas Helland" wrote: > > > > So here comes my hash-table series mentioned earlier. > > > > So, first of all, there's some issues. > > I've been

Re: [Mesa-dev] [PATCH 0/8] Hash table and hash set reworking

2015-03-05 Thread Thomas Helland
2015-02-28 17:05 GMT+01:00 Jason Ekstrand : > > On Feb 28, 2015 4:55 AM, "Thomas Helland" wrote: >> >> So here comes my hash-table series mentioned earlier. >> >> So, first of all, there's some issues. >> I've been strugling with hitting ass

Re: [Mesa-dev] [PATCH 2/2] nir: Optimize a + neg(a)

2015-03-10 Thread Thomas Helland
Humble ping? 2015-02-28 21:19 GMT+01:00 Matt Turner : > On Sat, Feb 28, 2015 at 11:47 AM, Thomas Helland > wrote: >> On Feb 28, 2015 8:39 PM, "Jason Ekstrand" wrote: >>> >>> Both patches are >>> >>> Reviewed-by: Jason Ekstrand >>

[Mesa-dev] [PATCH 4/7] glsl: Prehash to avoid hashing two times when inserting

2017-02-02 Thread Thomas Helland
--- src/compiler/glsl/opt_constant_variable.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/opt_constant_variable.cpp b/src/compiler/glsl/opt_constant_variable.cpp index 1c06ffe675..a07d64067b 100644 --- a/src/compiler/glsl/opt_constant_variable.cpp

[Mesa-dev] [PATCH 2/7] util: Avoid computing hash twice in string_to_uint_map

2017-02-02 Thread Thomas Helland
This is not a hot path, but when we have the functionality we should take advantage of it. --- src/util/string_to_uint_map.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/string_to_uint_map.h b/src/util/string_to_uint_map.h index e0533ec6ea..3248696e88 10064

[Mesa-dev] [PATCH 3/7] glsl: Prehash to avoid computing the hash twice

2017-02-02 Thread Thomas Helland
--- src/compiler/glsl/opt_copy_propagation_elements.cpp | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/opt_copy_propagation_elements.cpp b/src/compiler/glsl/opt_copy_propagation_elements.cpp index 9f79fa9202..d318417f6c 100644 --- a/src/compiler/glsl/

[Mesa-dev] [PATCH 6/7] nir: Prehash in instr_set to avoid unnecessary hashing

2017-02-02 Thread Thomas Helland
This should prove benefitial in the common case of inserting and not rewriting anything. --- src/compiler/nir/nir_instr_set.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c index 9cb9ed43e8..4c45d051f8

[Mesa-dev] [PATCH 5/7] glsl: Prehash in constant propagation

2017-02-02 Thread Thomas Helland
--- src/compiler/glsl/opt_constant_propagation.cpp | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/glsl/opt_constant_propagation.cpp b/src/compiler/glsl/opt_constant_propagation.cpp index 4039512097..553de9c803 100644 --- a/src/compiler/glsl/opt_constant_p

[Mesa-dev] [PATCH 1/7] mesa: Avoid unnecessary string hashing in symbol table

2017-02-02 Thread Thomas Helland
This is one of our largest users of hash_table_insert. This causes some code duplication and a parameter to pass in, so might not be worth it. --- src/mesa/program/symbol_table.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/mesa/program/symbol_table

[Mesa-dev] [PATCH 0/7] Prehash all the things

2017-02-02 Thread Thomas Helland
hmark this one will need to take care of that. Thomas Helland (7): mesa: Avoid unnecessary string hashing in symbol table util: Avoid computing hash twice in string_to_uint_map glsl: Prehash to avoid computing the hash twice glsl: Prehash to avoid hashing two times when inserting glsl:

[Mesa-dev] [PATCH 7/7] glsl: Prehash in refcount hash table

2017-02-02 Thread Thomas Helland
_mesa_hash_table_search is one of our hottest function according to perf. Callgrind shows the refcounting as one of the major users of the searching functions. We can reduce the pain by prehashing, so that we avoid hash two times when inserting in the table. On a short shader-db run (with validati

Re: [Mesa-dev] [PATCH 4/7] glsl: Prehash to avoid hashing two times when inserting

2017-02-02 Thread Thomas Helland
2017-02-02 21:57 GMT+01:00 Thomas Helland : > --- > src/compiler/glsl/opt_constant_variable.cpp | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/compiler/glsl/opt_constant_variable.cpp > b/src/compiler/glsl/opt_constant_variable.cpp

Re: [Mesa-dev] [PATCH 0/7] Prehash all the things

2017-02-04 Thread Thomas Helland
Definitely not worth the added complexity. I'll clean up the other patches that I have laying and post those instead, as they can actually have a certain impact on things. 2017-02-02 21:57 GMT+01:00 Thomas Helland : > This series converts multiple users of the hash table to reuse the >

[Mesa-dev] [PATCH 1/4] util/tests: Expand collision test for hash table

2017-02-08 Thread Thomas Helland
Add a test to exercise a worst case collision scenario that may cause us to not be able to find an empty slot in the table even though it is not full. V2: Feedback from Emil Velikov -Don't include code in the assert --- src/util/tests/hash_table/collision.c | 14 ++ 1 file changed

[Mesa-dev] [PATCH 0/4] RFC: Quadratic probing for the win

2017-02-08 Thread Thomas Helland
out it's effect though, as it sacrifices insert speed for lookup speed, but one never knows until one tests. Let me know if this is something I should persue. If not I'll mark this series as "junk" in my git repo, and get on with the cleaning. Thomas Helland (4): util/tests: Ex

[Mesa-dev] [PATCH 4/4] util: Use set_foreach instead of rolling our own

2017-02-08 Thread Thomas Helland
This follows the same pattern as in the hash_table. Reviewed-by: Jason Ekstrand --- src/util/set.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/util/set.c b/src/util/set.c index 99c04369c5..110f182244 100644 --- a/src/util/set.c +++ b/src/util/set.c @@ -196,12

[Mesa-dev] [PATCH 3/4] util: Change util/set to use quadratic probing

2017-02-08 Thread Thomas Helland
The same rationale applies here as for the hash table. Power of two size should give better performance, and using the algorithm hash = sh + i/2 + i*i/2 should result in only distinct hash values when hitting collisions. V4: Feedback from Jason Ekstrand - Split cleanup of set_rehash into separa

[Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2017-02-08 Thread Thomas Helland
This will allow us to remove the large static table and use a power of two hash table size that we can compute on the fly. We can use bitmasking instead of modulo to fit our hash in the table, and it's less code. By using the algorithm hash = sh + i/2 + i*i/2 we are guaranteed that all retries fro

Re: [Mesa-dev] [PATCH 0/4] RFC: Quadratic probing for the win

2017-02-08 Thread Thomas Helland
2017-02-08 21:35 GMT+01:00 Thomas Helland : > I was cleaning up my local git repo, and came across this series. > Last time it was discussed was all the way back in April 2015. > Things looked pretty good back then, but we where seeing a smaller > regression in CPU-bound scenarios a

Re: [Mesa-dev] [PATCH 0/4] RFC: Quadratic probing for the win

2017-02-08 Thread Thomas Helland
2017-02-08 22:07 GMT+01:00 Thomas Helland : > 2017-02-08 21:35 GMT+01:00 Thomas Helland : >> I was cleaning up my local git repo, and came across this series. >> Last time it was discussed was all the way back in April 2015. >> Things looked pretty good back then, but we w

Re: [Mesa-dev] [PATCH 0/4] RFC: Quadratic probing for the win

2017-02-08 Thread Thomas Helland
2017-02-09 1:57 GMT+01:00 Timothy Arceri : > On Wed, 2017-02-08 at 21:35 +0100, Thomas Helland wrote: >> I was cleaning up my local git repo, and came across this series. >> Last time it was discussed was all the way back in April 2015. >> Things looked pretty good back then,

[Mesa-dev] [PATCH 3/7] util: Change util/set to use quadratic probing

2017-02-21 Thread Thomas Helland
The same rationale applies here as for the hash table. Power of two size should give better performance, and using the algorithm hash = sh + i/2 + i*i/2 should result in only distinct hash values when hitting collisions. Collision performane is also a lot better. V4: Feedback from Jason Ekstrand

[Mesa-dev] [PATCH 0/7] Another take on the hash table

2017-02-21 Thread Thomas Helland
st patch, that reworks our pointer hashing. This patch has been tested on shader-db, but has not been tested on other workloads, like the above mentioned games. That's on my todo-lsit. Thomas Helland (7): util/tests: Expand collision test for hash table util: Change hash_table to use q

[Mesa-dev] [PATCH 1/7] util/tests: Expand collision test for hash table

2017-02-21 Thread Thomas Helland
Add a test to exercise a worst case collision scenario that may cause us to not be able to find an empty slot in the table even though it is not full. This hits the bug in my last revision of the series converting the hash table to quadratic probing. V2: Feedback from Emil Velikov -Don't inclu

[Mesa-dev] [PATCH 6/7] util: Use a starting load factor of 7/8 entries

2017-02-21 Thread Thomas Helland
--- src/util/hash_table.c | 2 +- src/util/set.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/hash_table.c b/src/util/hash_table.c index e1255a2484..8121c8e67a 100644 --- a/src/util/hash_table.c +++ b/src/util/hash_table.c @@ -85,7 +85,7 @@ _mesa_hash_tabl

[Mesa-dev] [PATCH 2/7] util: Change hash_table to use quadratic probing

2017-02-21 Thread Thomas Helland
This will allow us to remove the large static table and use a power of two hash table size that we can compute on the fly. We can use bitmasking instead of modulo to fit our hash in the table, and it's less code. By using the algorithm hash = sh + i/2 + i*i/2 we are guaranteed that all retries fro

[Mesa-dev] [PATCH 4/7] util: Use set_foreach instead of rolling our own

2017-02-21 Thread Thomas Helland
This follows the same pattern as in the hash_table. Reviewed-by: Jason Ekstrand --- src/util/set.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/util/set.c b/src/util/set.c index 99c04369c5..110f182244 100644 --- a/src/util/set.c +++ b/src/util/set.c @@ -196,12

[Mesa-dev] [PATCH 5/7] util: Increase start size of hash table and set to 8

2017-02-21 Thread Thomas Helland
--- src/util/hash_table.c | 2 +- src/util/set.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/hash_table.c b/src/util/hash_table.c index a93326ec27..e1255a2484 100644 --- a/src/util/hash_table.c +++ b/src/util/hash_table.c @@ -83,7 +83,7 @@ _mesa_hash_tabl

[Mesa-dev] [PATCH 7/7] util: Change the pointer hashing function

2017-02-21 Thread Thomas Helland
Use our knowledge that pointers are at least 4 byte aligned to remove the useless digits. Then shift by 6, 10, and 14 bits and add this to the original pointer, effectively folding in the entropy of the higher bits of the pointer into a 4-bit section. Stopping at 14 means we can add the entropy fro

[Mesa-dev] [PATCH 1/3] nir: Add a helper for iterating over blocks in a cf node

2015-07-28 Thread Thomas Helland
We were already doing this internally for iterating over a function implementation, so just expose it directly. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 7 +++ src/glsl/nir/nir.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c ind

[Mesa-dev] [PATCH 2/3] nir: Add a LCSAA-pass

2015-07-28 Thread Thomas Helland
e phi-nodes or other dead code that is left behind. Signed-off-by: Thomas Helland --- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h| 4 + src/glsl/nir/nir_form_LCSSA.c | 227 ++ src/glsl/nir/nir_metadata.c | 2 + 4 files cha

[Mesa-dev] [PATCH 3/3] nir: Make remove_phis not remove LCSSA phi's

2015-07-28 Thread Thomas Helland
I was hoping this should fix the problem with the pass getting rerun forever, but apparently not. We still need a solution like this though, so sending it out for some feedback of whether or not this is the way to do it. Signed-off-by: Thomas Helland --- src/glsl/nir/nir.h | 1

Re: [Mesa-dev] [PATCH 3/3] nir: Make remove_phis not remove LCSSA phi's

2015-07-28 Thread Thomas Helland
've solved the DFS here is they way I'm planning on doing it for the loop analysis too, and in fact a lot of it will be quite similar. So if this looks OK-ish then I know I'm on the right track. I'll post the loop-analysis patches later today when I've reworked them. 2015-0

[Mesa-dev] [RFC] [PATCH 2/3 v2] nir: Add a LCSAA-pass

2015-07-29 Thread Thomas Helland
or the other? Or I can do a "foreach in cf node" and compare pointers. It might be a bit hacky, but it will do the job. TODO items: I haven't fixed up the casting in the visitor-functions, and I should probably rename some of them. Signed-off-by: Thomas Helland --- src/glsl/Make

[Mesa-dev] [RFC] [PATCH] nir: Add a loop analysis pass

2015-08-01 Thread Thomas Helland
ill be my next big thing on the list, as I also need to do a job witht that for the value range propagation pass I'm writing. With that said, those are mainly mechanical changes. I don't expect the aproach I've taken to change a lot, so I think it is now ready to be put on the list fo

Re: [Mesa-dev] [PATCH v2 21/21] i965/gen7: Resolve GCC sign-compare warning.

2015-08-06 Thread Thomas Helland
The series looks good. You could probably s/GLuint/unsigned in patch three as it is not "in the API", but that's a nitpick. (You're fixing warnings, and not making things worse) Either way the series is: Reviewed-by: Thomas Helland Someone else needs to push these for you

[Mesa-dev] [PATCH 1/3] nir: Simplify fne(fneg(a), a) -> fne(a, 0.0)

2015-08-06 Thread Thomas Helland
und in Dota2 and Brutal Legend. One shader is cut by 8%, from 323 -> 296 instructons in SIMD8 Signed-off-by: Thomas Helland --- src/glsl/nir/nir_opt_algebraic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py inde

[Mesa-dev] [PATCH 0/3] NIR: Simplifications of fne/feq

2015-08-06 Thread Thomas Helland
These where found when going through the mysteriously high gains I got from the VRP pass. My pass was doing bad things, but upon inspection I found these. First patch is benefitial, the rest shows no change on a shader-db run on my system. Thomas Helland (3): nir: Simplify fne(fneg(a), a

[Mesa-dev] [PATCH 3/3] nir: Simplify ine/ieq(ineg(a), a) -> ine/ieq(a, 0)

2015-08-06 Thread Thomas Helland
The same rationale as in the other patches. No shader-db changes. Signed-off-by: Thomas Helland --- src/glsl/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 3e483fb..d005f81 100644 --- a

[Mesa-dev] [PATCH 2/3] nir: Simplify feq(fneg(a), a)) -> feq(a, 0.0)

2015-08-06 Thread Thomas Helland
The positive and negative value of a float can only be equal to each other if it is -0.0f and 0.0f. This is safe for Nan and Inf, as -Nan != Nan, and -Inf != Inf This gives no changes in my shader-db Signed-off-by: Thomas Helland --- src/glsl/nir/nir_opt_algebraic.py | 1 + 1 file changed, 1

[Mesa-dev] [RFC][PATCH] nir: Add a value range propagation pass

2015-08-06 Thread Thomas Helland
t would not give us any substantial benefit. Phi-nodes might have some saying in if we are able to remove complete nodes/blocks? If so, then we should probably revisit this decision, but for now it seems the return-on-investment and risk-reward ratio does not justify dealing with them. Signed-of

Re: [Mesa-dev] [PATCH 3/3] nir: Simplify ine/ieq(ineg(a), a) -> ine/ieq(a, 0)

2015-08-06 Thread Thomas Helland
2015-08-06 16:22 GMT+02:00 Boyan Ding : > But, isn't -INT_MIN == INT_MIN? > > Regards, > Boyan Ding > Yup. That's correct. Thanks for pointing that out. That means this patch is wrong, so I NAK myself on this one. Regards, ThoHel > 2015-08-06 19:36 GMT+08:00

Re: [Mesa-dev] [PATCH 3/3] nir: Simplify ine/ieq(ineg(a), a) -> ine/ieq(a, 0)

2015-08-06 Thread Thomas Helland
2015-08-07 0:08 GMT+02:00 Matt Turner : > (Don't top quote) > > On Thu, Aug 6, 2015 at 7:22 AM, Boyan Ding wrote: >> But, isn't -INT_MIN == INT_MIN? > > In C (-INT_MIN) is undefined since it relies on behavior of signed > integer overflow. > > In GLSL though, I think you're right. The spec says th

Re: [Mesa-dev] [RFC][PATCH] nir: Add a value range propagation pass

2015-08-06 Thread Thomas Helland
2015-08-06 19:22 GMT+02:00 Thomas Helland : > It is now mostly working, and I've incorporated a bunch > of the feedback I got on the last posting. I promised to > have it out on the list by american office hours today, > so here it goes. > > There is a massive issue w

Re: [Mesa-dev] [PATCH] glsl: Add missing spec quote about atomic counter in structs

2015-08-09 Thread Thomas Helland
"Members of structures cannot be declared as atomic > counter" > + *" types." Unintentionally "split string" due to your editor? With the nit fixed: Reviewed-by: Thomas Helland > */ > YYLTYPE loc = decl_list-&

[Mesa-dev] [PATCH] nir: Add a value range propagation pass

2015-08-10 Thread Thomas Helland
in a statistics-gathering I performed, and amount to aproximately 90% of alu-ops on a scalar only run. If we actually knew the input to these operations there is the possibility that the effectiveness could be greatly improved. A piglit-run shows no regression with or without INTEL_USE_NIR=1. Sign

[Mesa-dev] [PATCH 1/2][RFC] docs: Update with GLES3.2 entries and status

2015-08-11 Thread Thomas Helland
Signed-off-by: Thomas Helland --- These are listed to the best of my knowledge, looking at the nvidia driver dropped yesterday, and a glance at the "what changed according to the ARB variant" section of each extension spec. Hopefully it should not be too far off. Feel free to leave you

[Mesa-dev] [PATCH 2/2][RFC] docs: Add the 2015 ARB extensions

2015-08-11 Thread Thomas Helland
Signed-off-by: Thomas Helland --- This adds a section for the extensions nvidia has chosen to call the "GL ARB 2015 Extensions" unveiled at SIGGRAPH. Also some minor whitespace fixes for consistency. We might also want to add other extensions that are not part of the openGL core specs

Re: [Mesa-dev] [PATCH 1/2] nir: Add a nir_opt_undef() to handle csels with undef.

2015-08-11 Thread Thomas Helland
2015-08-11 20:25 GMT+02:00 Eric Anholt : > We may find a cause to do more undef optimization in the future, but for > now this fixes up things after if flattening. vc4 was handling this > internally most of the time, but a GLB2.7 shader that did a conditional > discard and assign gl_FragColor in t

Re: [Mesa-dev] [PATCH 1/2] nir: Add a nir_opt_undef() to handle csels with undef.

2015-08-11 Thread Thomas Helland
gt; + for (int i = 1; i <= 2; i++) { > + if (!instr->src[i].src.is_ssa) > + continue; > + > + nir_instr *parent = instr->src[i].src.ssa->parent_instr; > + if (parent->type != nir_instr_type_ssa_undef) > + continue; > + > +

Re: [Mesa-dev] [PATCH v2 21/21] i965/gen7: Resolve GCC sign-compare warning.

2015-08-11 Thread Thomas Helland
wn reviewed patches. I'll then get someone to merge the patches some time before the 11.0 branchpoint (21st August). BR, Thomas > On 6 August 2015 at 18:35, Thomas Helland wrote: >> >> The series looks good. You could probably s/GLuint/unsigned >> in patch three as it is n

Re: [Mesa-dev] [PATCH 1/2][RFC] docs: Update with GLES3.2 entries and status

2015-08-12 Thread Thomas Helland
2015-08-12 7:45 GMT+02:00 Tapani Pälli : > > > On 08/11/2015 08:48 PM, Thomas Helland wrote: >> >> Signed-off-by: Thomas Helland >> --- >> These are listed to the best of my knowledge, looking >> at the nvidia driver dropped yesterday, and a glance at th

[Mesa-dev] [PATCH V2] docs: Update with GLES3.2 entries and status

2015-08-12 Thread Thomas Helland
V2: -Change to "not started" for most entries -Add status for multisample_2d_array -Change shader_multisample_interpolation to "not_stared" Signed-off-by: Thomas Helland Reviewed-by: Tapani Pälli --- docs/GL3.txt | 25 + 1 file changed, 25

Re: [Mesa-dev] [PATCH V2] docs: Update with GLES3.2 entries and status

2015-08-12 Thread Thomas Helland
>2015-08-12 15:59 GMT+02:00 Gustaw Smolarczyk : > Hello. I've just spotted a simple typo. > > 2015-08-12 15:07 GMT+02:00 Thomas Helland : >> >> V2: -Change to "not started" for most entries >> -Add status for multisample_2d_array >> -Cha

Re: [Mesa-dev] [PATCH V2] docs: Update with GLES3.2 entries and status

2015-08-12 Thread Thomas Helland
2015-08-12 16:15 GMT+02:00 Ilia Mirkin : > On Wed, Aug 12, 2015 at 9:07 AM, Thomas Helland > wrote: >> V2: -Change to "not started" for most entries >> -Add status for multisample_2d_array >> -Change shader_multisample_interpolation to "not_star

Re: [Mesa-dev] [PATCH 2/2][RFC] docs: Add the 2015 ARB extensions

2015-08-12 Thread Thomas Helland
2015-08-12 17:48 GMT+02:00 Ilia Mirkin : > On Tue, Aug 11, 2015 at 1:48 PM, Thomas Helland > wrote: >> Signed-off-by: Thomas Helland >> --- >> This adds a section for the extensions nvidia has chosen to >> call the "GL ARB 2015 Extensions" unveiled a

Re: [Mesa-dev] [PATCH 2/2][RFC] docs: Add the 2015 ARB extensions

2015-08-12 Thread Thomas Helland
2015-08-12 18:56 GMT+02:00 Kenneth Graunke : > On Wednesday, August 12, 2015 06:32:50 PM Thomas Helland wrote: >> 2015-08-12 17:48 GMT+02:00 Ilia Mirkin : >> > On Tue, Aug 11, 2015 at 1:48 PM, Thomas Helland >> > wrote: >> >> Signed-off-by: Thomas Helland

[Mesa-dev] [PATCH] docs: Add ARB extensions from 2012 - 2015

2015-08-12 Thread Thomas Helland
... that are not mandated by the current openGL specifications Signed-off-by: Thomas Helland Reviewed-by: Edward O'Callaghan Reviewed-by: Tapani Pälli --- Tapani, Edward: Does your review still stand? I decided to be kind and not rename the file. That way we don't break thin

Re: [Mesa-dev] [PATCH 2/2][RFC] docs: Add the 2015 ARB extensions

2015-08-13 Thread Thomas Helland
On Aug 13, 2015 12:33 PM, "Marek Olšák" wrote: > > On Wed, Aug 12, 2015 at 11:23 PM, Thomas Helland > wrote: > > 2015-08-12 18:56 GMT+02:00 Kenneth Graunke : > >> On Wednesday, August 12, 2015 06:32:50 PM Thomas Helland wrote: > >>> 2015-08-12 17:48

[Mesa-dev] LICM vs GCM

2015-08-15 Thread Thomas Helland
Hi all, I'm now doing the last modifications to the loop analysis pass I've been working on, and I stumbled upon something I found a bit surprising. (Keep in mind I'm not very familiar with GCM) Some background info: there are 550 loops in my shader-db. The glsl unrolling unrolls 150 of those. My

Re: [Mesa-dev] [PATCH] nir: Add a value range propagation pass

2015-08-17 Thread Thomas Helland
me a lot, and so it might not be 100% correctly implmented. Writemasks? I haven't really delt with those. I guess I should probably do that? I'm unsure what more there is to share to make review simpler, but just shout out. [1]: https://parasol.tamu.edu/~rwerger/Courses/605/ssa_wt_

Re: [Mesa-dev] [PATCH 03/25] glsl: clean-up link uniform code

2015-08-20 Thread Thomas Helland
t; char **name, > (*name)[name_length] = '\0'; > this->leave_record(t, *name, row_major); >} > - } else if (t->is_array() && (t->fields.array->is_record() > -|| t->fields.array->is_interface())) {

Re: [Mesa-dev] [PATCH v2] docs: Update todo regarding StencilOp and StencilOpSeparate.

2015-08-20 Thread Thomas Helland
t; - */ > void GLAPIENTRY > _mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum > zpass) > { > -- > 2.1.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedeskto

  1   2   3   4   5   6   >