summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/compiler
Commit message (Collapse)AuthorAgeFilesLines
* gallium/drivers: Remove unnecessary semicolonsEdward O'Callaghan2016-01-061-1/+1
| | | | | | Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/drivers: Sanitize NULL checks into canonical formEdward O'Callaghan2015-12-061-1/+1
| | | | | | | | | | Use NULL tests of the form `if (ptr)' or `if (!ptr)'. They do not depend on the definition of the symbol NULL. Further, they provide the opportunity for the accidental assignment, are clear and succinct. Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* util/ra: Make allocating conflict lists optionalJason Ekstrand2015-08-181-1/+2
| | | | | | | | | Since i965 is now using make_reg_conflicts_transitive and doesn't need q-value computations, they are disabled on i965. They are enabled everywhere else so that they get the old behavior. This reduces the time spent in eglInitialize() on BDW by around 10-15%. Reviewed-by: Eric Anholt <[email protected]>
* Fix a few typosZoë Blade2015-04-272-2/+2
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* r300g: remove the broken SNORM->UNORM shader lowering passMarek Olšák2015-03-092-53/+0
| | | | Not used anymore.
* r300g: Check return value of snprintf().Matt Turner2015-03-041-1/+6
| | | | | | | | Would have at least prevented the crash the previous patch fixed. Cc: 10.4, 10.5 <[email protected]> Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540970 Reviewed-by: Tom Stellard <[email protected]>
* r300g: Use PATH_MAX instead of limiting ourselves to 100 chars.Matt Turner2015-03-041-3/+3
| | | | | | | | | | When built with Gentoo's package manager, the Mesa source directory exists seven directories deep. The path to the .test file is too long and is silently truncated, leading to a crash. Just use PATH_MAX. Cc: 10.4, 10.5 <[email protected]> Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540970 Reviewed-by: Tom Stellard <[email protected]>
* r300g/tests: Include stdio.h.Vinson Lee2015-02-261-0/+2
| | | | | | | | | | | | Fix build error. CC compiler/tests/r300_compiler_tests-radeon_compiler_regalloc_tests.o compiler/tests/radeon_compiler_regalloc_tests.c: In function ‘test_runner_rc_regalloc’: compiler/tests/radeon_compiler_regalloc_tests.c:57:3: error: implicit declaration of function ‘fprintf’ [-Werror=implicit-function-declaration] fprintf(stderr, "Failed to load program\n"); ^ Signed-off-by: Vinson Lee <[email protected]>
* radeon/compiler: include stdio.hBrian Paul2015-02-261-0/+1
| | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89343 Reviewed-by: Tom Stellard <[email protected]>
* r300g: remove dependency on compiler.hBrian Paul2015-02-264-3/+4
| | | | | | | | It only needs typical stdio.h and stdlib.h functions. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* r300g: implement ARR opcodeDavid Heidelberg2014-12-213-3/+15
| | | | | | | | | | Same as ARL, just has extra rounding. Useful for st/nine. Tested-by: Pavel Ondračka <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: David Heidelberg <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* r300/compiler: remove useless checkDavid Heidelberger2014-10-141-5/+2
| | | | | | | | This code is already in if (!variable->C->is_r500) so no need check twice. Reviewed-by: Tom Stellard <[email protected]> Signed-off-by: David Heidelberger <[email protected]>
* gallium/r300: remove obsolete declarationEmil Velikov2014-09-241-1/+0
| | | | | | | | | The definition of rc_pair_regalloc_inputs_only() is no longer around so drop the declaration. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Matt Turner <[email protected]>
* mesa: Move register_allocate.c to util.Eric Anholt2014-09-231-1/+1
| | | | | | | | | | | | | The r300 gallium driver is using it outside of the Mesa tree, and I wanted to do so for vc4 as well. Rather than make the multiple-definitions problem even more complicated, just move it to more-shared code. v2: Don't forget to delete the symlink in r300 (review by Matt). Delete more r300-helper references (review by Emil) Don't prefix util/ header inclusion with "util/" (review by Emil) Reviewed-by: Matt Turner <[email protected]> (v1) Reviewed-by: Emil Velikov <[email protected]> (v1)
* r300g: set register classes before interferencesConnor Abbott2014-09-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 567e2769b81863b6dffdac3826a6b729ce6ea37c ("ra: make the p, q test more efficient") I unknowingly introduced a new requirement to the register allocator API: the user must set the register class of all nodes before setting up their interferences, because ra_add_conflict_list() now uses the classes of the two interfering nodes. i965 already did this, but r300g was setting up register classes interleaved with setting up the interference graph. This led to us calculating the wrong q total, and in certain cases e78a01d5e6f77e075fe667a0f0ccb10d89c0dd58 (" ra: optimistically color only one node at a time") made it so that this bug caused a segfault. In particular, the error occurred if the q total was decremented to 1 below 0 for the last node to be pushed onto the stack. Since q_total is an unsigned integer, it overflowed to 0xffffffff, which is what lowest_q_total happens to be initialzed to. This means that we would fail the "new_q_total < lowest_q_total" check on line 476 of register_allocate.c, and so the node would never be pushed onto the stack, which led to segfaults in ra_select() when we failed to ever give it a register. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82828 Cc: "10.3" <[email protected]> Signed-off-by: Connor Abbott <[email protected]> Tested-by: Pavel Ondračka <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* gallium/radeon: cleanup header inclusionEmil Velikov2014-08-287-7/+7
| | | | | | | | | | | | | | - Add top_srcdir/src/gallium/winsys to GALLIUM_DRIVER_C{XXFLAGS}. - Remove top_srcdir/src/gallium/drivers/radeon from the includes. As a result: - Common radeon headers are prefixed with 'radeon/' - Winsys header inclusion is prefixed 'radeon/drm' Cc: Marek Olšák <[email protected]> Cc: Michel Dänzer <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r300g: Fix path to test programs for out-of-tree buildsMichel Dänzer2014-08-201-1/+1
| | | | | | Fixes make check in that case. Reviewed-by: Tom Stellard <[email protected]>
* r300g: Fix bug in build_loop_info()/compiler v2Tom Stellard2014-08-131-11/+23
| | | | | | | | | | | Fixes piglit glean "do-loop with continue and break" on RS690 It's based on Tom Stellard patch and improved to handle CMP instruction. [v2] handle CMP instruction Reviewed-by: Tom Stellard <[email protected]> Signed-off-by: David Heidelberger <[email protected]>
* ra: cleanup the public APIConnor Abbott2014-08-131-1/+1
| | | | | | | | | | | | | | Previously, there were 3 entrypoints into parts of the actual allocator, and an API called ra_allocate_no_spills() that called all 3. Nobody would ever want to call any of the 3 entrypoints by themselves, so everybody just used ra_allocate_no_spills(). So just make them static functions, and while we're at it rename ra_allocate_no_spills() to ra_allocate() since there's no equivalent "with spills," because the backend is supposed to handle spilling. Signed-off-by: Connor Abbott <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-041-1/+1
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r300g/tests: Added missing fclose for FILE resource.Siavash Eliasi2014-02-281-0/+3
| | | | | Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* r300/compiler/tests: Fix line length check in test parserTom Stellard2013-12-091-1/+3
| | | | | | Reviewed-by: Alex Deucher <[email protected]> CC: "9.2" "10.0" <[email protected]>
* r300/compiler/tests: Fix segfaultTom Stellard2013-12-091-6/+5
| | | | | | Reviewed-by: Alex Deucher <[email protected]> CC: "9.2" "10.0" <[email protected]>
* r300g/compiler: Fix unsigned comparison with less than zeroDavid Heidelberger2013-10-211-1/+1
| | | | | | | | | | rc_find_free_temporary_list() returns signed integer (in case of lack of free temporary registers returns -1), so new_index in radeon_rename_regs() should be signed. https://bugs.freedesktop.org/show_bug.cgi?id=54867 Signed-off-by: Marek Olšák <[email protected]>
* r300g/compiler/tests: Fix segfaultTom Stellard2013-08-073-4/+4
| | | | CC: "9.2" <[email protected]>
* tgsi: rename the TGSI fragment kill opcodesBrian Paul2013-07-123-8/+8
| | | | | | | | | | | | | | | | | | | | | TGSI_OPCODE_KIL and KILP had confusing names. The former was conditional kill (if any src component < 0). The later was unconditional kill. At one time KILP was supposed to work with NV-style condition codes/predicates but we never had that in TGSI. This patch renames both opcodes: TGSI_OPCODE_KIL -> KILL_IF (kill if src.xyzw < 0) TGSI_OPCODE_KILP -> KILL (unconditional kill) Note: I didn't just transpose the opcode names to help ensure that I didn't miss updating any code anywhere. I believe I've updated all the relevant code and comments but I'm not 100% sure that some drivers had this right in the first place. For example, the radeon driver might have llvm.AMDGPU.kill and llvm.AMDGPU.kilp mixed up. Driver authors should review their code. Reviewed-by: Jose Fonseca <[email protected]>
* r300g/compiler: Prevent regalloc from swizzling texture operands v2Tom Stellard2013-06-304-0/+123
| | | | | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=63520 NOTE: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* r300g/compiler/tests: Add an assembly parserTom Stellard2013-06-305-16/+200
| | | | | | | The assembly parser can be used to load r300 assembly dumps and run them through any of the r300 compiler passes. Reviewed-by: Alex Deucher <[email protected]>
* r300g: Fix bug in OMOD optimizationTom Stellard2013-04-121-1/+3
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=60503 NOTE: This is a candidate for the stable branches.
* r300g/compiler: Fix bug in OMOD foldingTom Stellard2013-02-212-1/+76
| | | | | | | | | | The OMOD value was only being folded to one instruction in cases where the MUL instruction was reading a value written by more than one instruction. NOTE: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]>
* r300g/tests: Add helper functions for creating a full programTom Stellard2013-02-212-8/+75
| | | | | | | | | Now you can convert assembly strings into a full struct radeon_compiler object and use it to test individual compiler pases. NOTE: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]>
* r300g/tests: Exit test runner with a valid status codeTom Stellard2013-02-215-6/+22
| | | | | | | | This way make check can report whether or not the tests pass. NOTE: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]>
* r300g/complier: Make r300_vertprog_swizzle_caps visible in other filesTom Stellard2013-02-212-1/+3
| | | | | | | | This will be used by the test suite in later commits. NOTE: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]>
* r300g/compiler: Fix typo in commentTom Stellard2013-02-211-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* r300g/compiler: Add missing license headersTom Stellard2013-02-2113-1/+339
| | | | | | | | | | These are all files that I authored, but forgot to add the license headers. NOTE: This is a candidate for the stable branches. Signed-off-by: Tom Stellard <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r300/compiler: copy-propagate saturate mode when possibleMarek Olšák2013-02-061-2/+19
| | | | Reviewed-by: Tom Stellard <[email protected]>
* r300/compiler: add support for saturate output modifier in r500 vertex shadersMarek Olšák2013-02-061-8/+15
| | | | | | | The GLSL compiler can simplify clamp(v,0,1) to saturate. The state tracker doesn't use it yet, but it will. Reviewed-by: Tom Stellard <[email protected]>
* r300g/compiler: add shader emulation for the alpha_to_one stateMarek Olšák2013-01-065-0/+41
|
* r300/compiler: Avoid generating MOV instructions for invalid IMM swizzles v2Tom Stellard2012-11-161-4/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an instruction reads from a constant register that contains immediates using an invalid swizzle, we can avoid generating MOV instructions to fix up the swizzle by loading the immediates into a different constant register that can be read using a valid swizzle. This only affects r300 and r400 cards. For example: CONST[1] = { -3.5000 3.5000 2.5000 1.5000 } MAD temp[4].xy, const[0].xy__, const[1].xz__, input[0].xy__; ========== Before this change would be lowered to: ========= CONST[1] = { -3.5000 3.5000 2.5000 1.5000 } MOV temp[0].x, const[1].x___; MOV temp[0].y, const[1]._z__; MAD temp[4].xy, const[0].xy__, temp[0].xy__, input[0].xy__; ========== After this change is lowered to: =============== CONST[1] = { -3.5000 3.5000 2.5000 1.5000 } CONST[2] = { 0.0000 -3.5000 2.5000 0.0000 } MAD temp[4].xy, const[0].xy__, const[2].yz__, input[0].xy__; ============================================================ This change reduces one of the Lightsmark shaders from 133 to 91 instructions. v2: - Fix crash caused by swizzles with only inline constants.
* r300/compiler: Use precomputed q values in the register allocatorTom Stellard2012-09-191-1/+69
|
* r300g: Init regalloc state during context creationTom Stellard2012-09-194-153/+191
| | | | | | Initializing the regalloc state is expensive, and since it is always the same for every compile we only need to initialize it once per context. This should help improve shader compile times for the driver.
* r300/compiler: Don't create register classes for inputsTom Stellard2012-09-191-14/+1
|
* ra: Add q_values parameter to ra_set_finalize()Tom Stellard2012-09-191-1/+1
| | | | | | This allows the user to pass precomputed q values to the allocator. Reviewed-by: Kenneth Graunke <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* r300g: implement TRUNC correctlyMarek Olšák2012-08-273-0/+41
| | | | This fixes some integer division tests.
* r300/compiler: Use variable lists in the rename_regs passTom Stellard2012-08-261-17/+14
|
* mesa: Kill GL_ARB_shadow_ambient with fireIan Romanick2012-08-142-12/+2
| | | | | | | | | | No driver supports this extension, and it seems unlikely than any driver ever will. I think r300c may have supported it at one time, but that driver has already been removed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r300g: silence uninitialized var warningBrian Paul2012-07-161-1/+1
|
* r300/compiler: Exit immediately from rc_vert_fc() if there is an errorTom Stellard2012-04-141-0/+4
| | | | | | | | This way we correctly report "Too many temporaries" errors. https://bugs.freedesktop.org/show_bug.cgi?id=48680 Note: This is a candidate for the stable branches.
* r300/compiler: Copy all instruction attributes during local transfomsTom Stellard2012-04-141-31/+42
| | | | | | | | | | | | | | | | | | | | | Instruction attributes like WriteALUResult and ALUResultCompare were being discarded during the some of the local transformations. This fixes the following piglit tests: glsl1-inequality (vec2, pass) loopfunc fs-any-bvec2-using-if fs-op-ne-bvec2-bvec2-using-if fs-op-ne-ivec2-ivec2-using-if fs-op-ne-mat2-mat2-using-if fs-op-ne-vec2-vec2-using-if fs-op-ne-mat2x3-mat2x3-using-if fs-op-ne-mat2x4-mat2x4-using-if https://bugs.freedesktop.org/show_bug.cgi?id=45921 NOTE: This is a candidate for the stable branches.