summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* nir: Add lowering support for 64-bit operations to softwareMatt Turner2019-01-092-2/+178
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Create nir_builder in nir_lower_doubles_impl()Matt Turner2019-01-091-17/+19
| | | | | | | We're going to use it more in a future patch, and this avoids a lot of gross code. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Add and set info::uses_64bitMatt Turner2019-01-092-0/+10
| | | | | | | | Will be used to communicate that a shader uses 64-bit operations to the concerned lowering passes. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Implement lowering of 64-bit shift operationsMatt Turner2019-01-092-0/+143
| | | | | Reviewed-by: Elie Tournier <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Wire up int64 lowering functionsMatt Turner2019-01-092-3/+127
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Add some more int64 lowering helpersJason Ekstrand2019-01-091-0/+227
| | | | | | | | | | | [mattst88]: Found in an old branch of Jason's. Jason implemented: inot, iand, ior, iadd, isub, ineg, iabs, compare, imin, imax, umin, umax Matt implemented: ixor, bcsel, b2i, i2b, i2i8, i2i16, i2i32, i2i64, u2u8, u2u16, u2u32, u2u64, and fixed ilt Reviewed-by: Elie Tournier <[email protected]>
* nir: Tag entrypoint for easy recognition by nir_shader_get_entrypoint()Matt Turner2019-01-097-6/+30
| | | | | | | | We're going to have multiple functions, so nir_shader_get_entrypoint() needs to do something a little smarter. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Rework nir_lower_constant_initializers() to handle functionsMatt Turner2019-01-091-34/+25
| | | | | | Previously it assumed that only a single function (the entrypoint) existed and attempted to lower constant initializers of shader outputs for each function, for instance.
* glsl: Add "built-in" functions to do fp32_to_int64(fp32)Sagar Ghuge2019-01-091-0/+31
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do fp32_to_uint64(fp32)Sagar Ghuge2019-01-091-0/+29
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do fp64_to_int64(fp64)Sagar Ghuge2019-01-091-0/+29
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add utility function to round and pack int64_t valueSagar Ghuge2019-01-091-0/+36
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do fp64_to_uint64(fp64)Sagar Ghuge2019-01-091-0/+27
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add utility function to round and pack uint64_t valueSagar Ghuge2019-01-091-0/+32
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do int64_to_fp32(int64_t)Sagar Ghuge2019-01-091-0/+22
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do uint64_to_fp32(uint64_t)Sagar Ghuge2019-01-091-0/+20
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do int64_to_fp64(int64_t)Sagar Ghuge2019-01-091-0/+18
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to do uint64_to_fp64(uint64_t)Sagar Ghuge2019-01-091-0/+18
| | | | | Reviewed-by: Elie Tournier <[email protected]> Signed-off-by: Sagar Ghuge <[email protected]>
* glsl: Add "built-in" functions to convert bool to doubleMatt Turner2019-01-091-0/+12
| | | | | | And vice versa. Reviewed-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do ffract(fp64)Matt Turner2019-01-091-0/+6
| | | | Reviewed-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" function to do ffloor(fp64)Matt Turner2019-01-091-0/+13
| | | | Reviewed-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do fmin/fmax(fp64)Matt Turner2019-01-091-0/+20
| | | | Reviewed-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do ffma(fp64)Matt Turner2019-01-091-0/+6
| | | | | | Definitely not actually a fused-multiply add. Reviewed-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do round(fp64)Elie Tournier2019-01-091-0/+42
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do trunc(fp64)Elie Tournier2019-01-091-0/+22
| | | | | | v2: use mix. Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do sqrt(fp64)Elie Tournier2019-01-091-0/+272
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do fp32_to_fp64(fp32)Elie Tournier2019-01-091-0/+38
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do fp64_to_fp32(fp64)Elie Tournier2019-01-091-0/+101
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do int_to_fp64(int)Elie Tournier2019-01-091-0/+23
| | | | | v2: use mix Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do fp64_to_int(fp64)Elie Tournier2019-01-091-0/+41
| | | | | | v2: use mix Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do uint_to_fp64(uint)Elie Tournier2019-01-091-0/+22
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do fp64_to_uint(fp64)Elie Tournier2019-01-091-0/+61
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do mul(fp64, fp64)Elie Tournier2019-01-091-0/+148
| | | | | v2: use mix Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do add(fp64, fp64)Elie Tournier2019-01-091-0/+433
| | | | | | | v2: use mix and findMSB to optimise. v3: [Sagar] Fix zFrac0 == 0u case in __normalizeRoundAndPackFloat64 Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do lt(fp64, fp64)Elie Tournier2019-01-091-0/+50
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add utility function to extract 64-bit signElie Tournier2019-01-091-0/+7
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add "built-in" functions to do eq/ne(fp64, fp64)Elie Tournier2019-01-091-0/+56
|
* glsl: Add "built-in" function to do sign(fp64)Elie Tournier2019-01-091-0/+10
| | | | | | v2: use mix. Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" functions to do neg(fp64)Elie Tournier2019-01-091-0/+26
| | | | | | v2: use mix. Signed-off-by: Elie Tournier <[email protected]>
* glsl: Add "built-in" function to do abs(fp64)Elie Tournier2019-01-091-0/+11
| | | | Signed-off-by: Elie Tournier <[email protected]>
* glsl: Create file to contain software fp64 functionsMatt Turner2019-01-096-2/+80
| | | | | | | The following patches will add implementations of various double-precision operations to this file. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add utility to convert text files to C stringsIan Romanick2019-01-092-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Will be used to convert the .glsl source file containing software fp64 routines to a .h file that can be included while building the compiler. This commit contains two squashed together: the first from Ian adding the utility (with the existing title), and the second from Dylan making the code both python2 and python3 compatible. This is somewhat modeled after the xxd utility that comes with Vim. Signed-off-by: Ian Romanick <[email protected]> xxd.py: Make python2 and 3 compatible This makes use of unicode_literals, so that undecorated strings are considered text (python2 unicode, python3 str) and not bytes in python2 and text in python3. It makes use of io.open, which provides python2 with python3's open behavior (it's an alias in python3), in particular support for the 't' and 'b' option. Finally, it decorates all of the string literals with the 'b' prefix, so that python interprets them as bytes. I've removed the stdin and stdout options, as python2 always requires these to be bytes, but python3 always treats them as text (there is a way to get at the underlying bytes buffer, but that's even more complexity), and makes the input files required arguments. In the meson we use the '@INPUT@' shorthand instead of listing each input, as meson will expand that to [prog_python, '@INPUT0@', @INPUT1@, ..., @OUTPUT@, ...]
* glsl: Copy function out to temp if we don't directly ref a variableTimothy Arceri2019-01-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we can end up with IR that looks like this: ( (declare (temporary ) vec4 f@8) (assign (xyzw) (var_ref f@8) (var_ref f) ) (call f16 ((swiz y (var_ref f@8) ))) (assign (xyzw) (var_ref f) (var_ref f@8) ) )) When we really need: (declare (temporary ) float inout_tmp) (assign (x) (var_ref inout_tmp) (swiz y (var_ref f) )) (call f16 ((var_ref inout_tmp) )) (assign (y) (var_ref f) (swiz y (swiz xxxx (var_ref inout_tmp) ))) (declare (temporary ) void void_var) The GLSL IR function inlining code seemed to produce correct code even without this but we need the correct IR for GLSL IR -> NIR to be able to understand whats going on. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add function support to glsl_to_nirMatt Turner2019-01-091-9/+119
| | | | | | | Based on a patch from Tim Arceri, but I had to substantially rewrite it as a result of the NIR derefs rework. Reviewed-by: Kenneth Graunke <[email protected]>
* intel/fs: Remove FS_OPCODE_UNPACK_HALF_2x16_SPLIT opcodes.Francisco Jerez2019-01-096-47/+4
| | | | | | | | These are broken on a future platform, but it turns out we don't need to fix them, since they're just type-converting moves with strided source. Kill them. Reviewed-by: Iago Toral Quiroga <[email protected]>
* intel/fs: Remove nasty open-coded CHV/BXT 64-bit workarounds.Francisco Jerez2019-01-092-145/+12
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* intel/fs: Remove existing lower_conversions pass.Francisco Jerez2019-01-095-139/+1
| | | | | | It's redundant with the functionality provided by lower_regioning now. Reviewed-by: Iago Toral Quiroga <[email protected]>
* intel/fs: Introduce regioning lowering pass.Francisco Jerez2019-01-096-19/+418
| | | | | | | | | | | | | | | | | This legalization pass is meant to handle situations where the source or destination regioning controls of an instruction are unsupported by the hardware and need to be lowered away into separate instructions. This should be more reliable and future-proof than the current approach of handling CHV/BXT restrictions manually all over the visitor. The same mechanism is leveraged to lower unsupported type conversions easily, which obsoletes the lower_conversions pass. v2: Give conditional modifiers the same treatment as predicates for SEL instructions in lower_dst_modifiers() (Iago). Special-case a couple of other instructions with inconsistent conditional mod semantics in lower_dst_modifiers() (Curro). Reviewed-by: Iago Toral Quiroga <[email protected]>
* intel/fs: Constify fs_inst::can_do_source_mods().Francisco Jerez2019-01-092-2/+2
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* intel/fs: Respect CHV/BXT regioning restrictions in copy propagation pass.Francisco Jerez2019-01-092-0/+38
| | | | | | | | | | | | | Currently the visitor attempts to enforce the regioning restrictions that apply to double-precision instructions on CHV/BXT at NIR-to-i965 translation time. It is possible though for the copy propagation pass to violate this restriction if a strided move is propagated into one of the affected instructions. I've only reproduced this issue on a future platform but it could affect CHV/BXT too under the right conditions. Cc: [email protected] Reviewed-by: Iago Toral Quiroga <[email protected]>