summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/spu
AgeCommit message (Collapse)Author
2009-11-24tgsi: rename fields of tgsi_full_declaration to reduce verbosityKeith Whitwell
DeclarationRange -> Range
2009-11-24tgsi: rename fields of tgsi_full_instruction to avoid excessive verbosityKeith Whitwell
InstructionPredicate -> Predicate InstructionLabel -> Label InstructionTexture -> Texture FullSrcRegisters -> Src FullDstRegisters -> Dst
2009-10-23gallium: remove extended negate also, and also the ExtSwz tokenKeith Whitwell
Likewise, the extended negate functionality hasn't been used since mesa switched to using tgsi_ureg to build programs, and has been translating the SWZ opcode internally to a single MAD.
2009-10-23cell: typo from ExtSwizzle commitKeith Whitwell
2009-10-23gallium: remove the swizzling parts of ExtSwizzleKeith Whitwell
These haven't been used by the mesa state tracker since the conversion to tgsi_ureg, and it seems that none of the other state trackers are using it either. This helps simplify one of the biggest suprises when starting off with TGSI shaders.
2009-10-23gallium: remove noise opcodesKeith Whitwell
Provide a dummy implementation in the GL state tracker (move 0.5 to the destination regs). At some point, a motivated person could add a better implementation of noise. Currently not even the nvidia binary drivers do anything more than this. In any case, the place to do this is in the GL state tracker, not the poor driver.
2009-09-01tgsi: remove redundant CND0 opcodeKeith Whitwell
Can be implemented with CMP src2, src1, src0
2009-07-31Rename TGSI LOOP instruction to better match theri usage.Michal Krol
The LOOP/ENDLOOP pair is renamed to BGNFOR/ENDFOR as its behaviour is similar to a C language for-loop. The BGNLOOP2/ENDLOOP2 pair is renamed to BGNLOOP/ENDLOOP as now there is no name collision.
2009-07-23gallium: remove deprecated TGSI opcodesKeith Whitwell
Various opcodes which can be implemented trivially with other TGSI opcodes, such as matrix multiplication and negation. These were not used by any state tracker or implemented by any of the drivers.
2009-07-22cell: update TGSI_OPCODE_ casesBrian Paul
2009-05-21cell: perform triangle cull a little earlierJonathan Adamczewski
In spu_tri.c:setup_sort_vertices() triangles are culled after the vertices are sorted. This patch moves the check a little earlier and performs the actual check a little faster through intrinsics and a little trickery. Reduced code size and less work is done before a triangle is deemed OK to skip.
2009-05-21cell: unroll inner loop of spu_render.c:cmd_render()Jonathan Adamczewski
It was taking approximately 50 cycles to extract the vertex indices, calculate the vertex_header pointers and call tri_draw() for each three vertices - . Unrolled, it takes less than 100 cycles to extract, unpack, calculate pointers and call tri_draw() eight times. It does have a nasty jump-tabled switch. I'm sure that there's a better way... Code size of spu_render.o gets larger due to the extra constants and work in the inner loop, there are extra stack saves and loads because there are more registers in use, and an assert. spu_tri.o gets a little smaller.
2009-02-18util: Move p_debug.h into util module.José Fonseca
The debug functions depend on several util function for os abstractions, and these depend on debug functions, so a seperate module is not possible.
2009-02-16cell: use some SPU intrinsics to get slightly better code in eval_inputs()Brian Paul
Suggested by Jonathan Adamczewski. There may be more places to do this...
2009-02-15cell: minor Makefile clean-upBrian Paul
2009-02-15cell: new/tighter code for computing fragment program inputsBrian Paul
2009-02-15cell: combine eval_z(), eval_w() functionsBrian Paul
2009-02-07cell: compile fix: alpha.ref is now alpha.ref_valueBrian Paul
2009-01-14cell: Specify constant as float for CEILF().Jonathan Adamczewski
Without the f, the constant is treated as a double, resulting in slower arithmetic and libgcc conversion calls each time CEILF() is used.
2009-01-13cell: Add missing suffix to SHUFFLE macroJonathan Adamczewski
2009-01-12cell: allocate batch buffers w/ 16-byte alignmentJonathan Adamczewski
Replace cell_batch{align,alloc)*() with cell_batch_alloc16(), allocating multiples of 16 bytes that are 16 byte aligned. Opcodes are stored in preferred slot of SPU machine word. Various structures are explicitly padded to 16 byte multiples. Added STATIC_ASSERT().
2009-01-05cell: SIMDize sorting in setup_sort_vertices()Jonathan Adamczewski
Put setup.v{min,mid,max,provoke} into a union with qword vertex_headers. Rewrite vertex sorting to more efficiently handle the packed data items. Reduces spu_tri.o by ~128 bytes.
2009-01-05cell: SIMDize some subtractionsJonathan Adamczewski
Put edge.{dx,dy} into a union with a vector and perform subtractions in setup_sort_vertices() on vectors. Reduces spu_tri.o by ~300 bytes.
2009-01-04cell: improvements to spu_tri.cJonathan Adamczewski
Replace int setup.span{left,right}[2] with vec_uint4 setup.span.quad SIMDize calculate_mask() and inline into into flush_spans() Set setup.span.quad members using spu_shuffle() or spu_sel(). Reduces spu_tri.o by ~116 bytes.
2009-01-04cell: new spu_shuffle.h headerJonathan Adamczewski
Facilitates creation of shuffle patterns for use with spu_shuffle() and si_shufb() intrinsics. To be used by subsequent patches.
2008-11-21CELL: use variant-length fragment ops programsRobert Ellison
This is a set of changes that optimizes the memory use of fragment operation programs (by using and transmitting only as much memory as is needed for the fragment ops programs, instead of maximal sizes), as well as eliminate the dependency on hard-coded maximal program sizes. State that is not dependent on fragment facing (i.e. that isn't using two-sided stenciling) will only save and transmit a single fragment operation program, instead of two identical programs. - Added the ability to emit a LNOP (No Operation (Load)) instruction. This is used to pad the generated fragment operations programs to a multiple of 8 bytes, which is necessary for proper operation of the dual instruction pipeline, and also required for proper SPU-side decoding. - Added the ability to allocate and manage a variant-length struct cell_command_fragment_ops. This structure now puts the generated function field at the end, where it can be as large as necessary. - On the PPU side, we now combine the generated front-facing and back-facing code into a single variant-length buffer (and only use one if the two sets of code are identical) for transmission to the SPU. - On the SPU side, we pull the correct sizes out of the buffer, allocate a new code buffer if the one we have isn't large enough, and save the code to that buffer. The buffer is deallocated when the SPU exits. - Commented out the emit_fetch() static function, which was not being used.
2008-11-11CELL: two-sided stencil fixesRobert Ellison
With these changes, the tests/stencil_twoside test now works. - Eliminate blending from the stencil_twoside test, as it produces an unneeded dependency on having blending working - The spe_splat() function will now work if the register being splatted and the destination register are the same - Separate fragment code generated for front-facing and back-facing fragments. Often these are the same; if two-sided stenciling is on, they can be different. This is easier and faster than generating code that does both tests and merges the results. - Fixed a cut/paste bug where if the back Z-pass stencil operation were different from all the other operations, the back Z-fail results were incorrect.
2008-10-30CELL: stencil bug fixesRobert Ellison
Two definitive bugs in stenciling were fixed. The first, reversed registers in the generated Select Bytes (selb) instruction, caused the stenciling INCR and DECR operations to fail dramatically, putting new values in where old values were supposed to be and vice versa. The second caused stencil tiles to not be read and written from main memory by the SPUs. A per-spu flag, spu.read_depth, was used to indicate whether the SPU should be reading depth tiles, and was set only when depth was enabled. A second flag, spu.read_stencil, was set when stenciling was enabled, but never referenced. As stenciling and depth are in the same tiles on the Cell, and there is no corresponding TAG_WRITE_TILE_STENCIL to complement TAG_WRITE_TILE_COLOR and TAG_WRITE_TILE_Z, I fixed this by eliminating the unused "spu.read_stencil", renaming "spu.read_depth" to "spu.read_depth_stencil", and setting it if either stenciling or depth is enabled. I also added an optimization to the fragment ops generation code, that avoids calculating stencil values and/or stencil writemask when the stencil operations are all KEEP.
2008-10-29cell: use simd utilities for pow, exp2, log2Brian Paul
2008-10-28cell: fix a number of fence issuesBrian Paul
Plus add assertions to check status, alignment, etc.
2008-10-22cell: implement fencing for texture buffersBrian Paul
If we delete a texture, we need to keep the underlying tiled data buffer around until any rendering that references it has completed. Keep a list of buffers referenced by a rendering batch. Unref/free them when the associated batch's fence is executed/signalled.
2008-10-17cell: use an approximation in compute_lambda_2d() to avoid sqrtBrian Paul
Though, the logf() call still needs attention.
2008-10-17cell: add new debug flag (cache) to report texture cache stats on exitBrian Paul
2008-10-17cell: use 7-bit weights in sample_texture_2d_bilinear_int()Brian Paul
This allows us to use 16-bit signed mul/add instructions. Had to used unsigned mul before and there's no unsigned mul/add instruction.
2008-10-16cell: pass spu_texture_level ptr to get_four_texels()Brian Paul
2008-10-16cell: implement KIL instructionBrian Paul
2008-10-16cell: trilinear mipmap interpolationBrian Paul
2008-10-16cell: update commentsBrian Paul
2008-10-16cell: call proper sampler function in sample_texture_cube()Brian Paul
2008-10-16cell: clean up various texture-related thingsBrian Paul
Distinguish among texture targets in codegen. progs/demos/cubemap.c runs correctly now too.
2008-10-15cell: start some performance measurementsBrian Paul
Use the spu_write_decrementer() and spu_read_decrementer() functions to measure time. Convert to milliseconds according to the system timebase value.
2008-10-15cell: updated debug codeBrian Paul
2008-10-15cell: get rid of last usage of float4 union/typedefBrian Paul
Results in slightly tighter code.
2008-10-15cell: simplify triangle front/back face determinationBrian Paul
2008-10-15cell: send rasterizer state to SPUs in proper way, remove front_winding hackBrian Paul
2008-10-15cell: remove some old, pre-batchbuffer stuffBrian Paul
2008-10-15cell: move some CELL_MAX constantsBrian Paul
2008-10-15cell: remove obsolete spu_debug.h fileBrian Paul
2008-10-15cell: simplify spu debug codeBrian Paul
2008-10-15cell: propogate blend color to SPUs for the fallback fragment ops codeBrian Paul