Commit graph

61 commits

Author SHA1 Message Date
Brian Paul
5c57cbec32 gallium: asst. clean-ups
Don't use register qualifier.  Doxygen-ize comments.  Remove 'extern'.
2008-10-08 16:35:40 -06:00
Brian Paul
73d00b9e93 gallium: better instruction printing for SPE code 2008-10-08 16:33:04 -06:00
Robert Ellison
afaa53040b CELL: changes to generate SPU code for stenciling
This set of code changes are for stencil code generation
support.  Both one-sided and two-sided stenciling are supported.
In addition to the raw code generation changes, these changes had
to be made elsewhere in the system:

- Added new "register set" feature to the SPE assembly generation.
  A "register set" is a way to allocate multiple registers and free
  them all at the same time, delegating register allocation management
  to the spe_function unit.  It's quite useful in complex register
  allocation schemes (like stenciling).

- Added and improved SPE macro calculations.
  These are operations between registers and unsigned integer
  immediates.  In many cases, the calculation can be performed
  with a single instruction; the macros will generate the
  single instruction if possible, or generate a register load
  and register-to-register operation if not.  These macro
  functions are: spe_load_uint() (which has new ways to
  load a value in a single instruction), spe_and_uint(),
  spe_xor_uint(), spe_compare_equal_uint(), and spe_compare_greater_uint().

- Added facing to fragment generation.  While rendering, the rasterizer
  needs to be able to determine front- and back-facing fragments, in order
  to correctly apply two-sided stencil.  That requires these changes:
  - Added front_winding field to the cell_command_render block, so that
    the state tracker could communicate to the rasterizer what it
    considered to be the front-facing direction.
  - Added fragment facing as an input to the fragment function.
  - Calculated facing is passed during emit_quad().
2008-10-03 18:05:14 -06:00
Keith Whitwell
66d4beb874 rtasm: add prefetch instructions 2008-10-02 10:19:48 -04:00
José Fonseca
6607f2cf19 rtasm: Implement immediate group 1 instructions. Fix SIB emition. 2008-09-29 19:09:39 +09:00
Brian Paul
938e12c1ca gallium: SPU register comments 2008-09-26 17:06:22 -06:00
Brian Paul
99cdfc997b cell: use different opcodes for spe_move() depending on even/odd address 2008-09-19 17:56:45 -06:00
Brian Paul
7af5f944e5 gallium: added spe_code_size() 2008-09-19 17:56:45 -06:00
Brian Paul
0838b70275 cell: change spe_complement() to take a src and dst reg, like other instructions 2008-09-19 09:36:29 -06:00
Robert Ellison
a57fbe53dc CELL: add codegen for logic op, color mask
- rtasm_ppc_spe.c, rtasm_ppc_spe.h: added a new macro function
  "spe_load_uint" for loading and splatting unsigned integers
  in a register; it will use "ila" for values 18 bits or less,
  "ilh" for word values that are symmetric across halfwords,
  "ilhu" for values that have zeroes in their bottom halfwords,
  or "ilhu" followed by "iohl" for general 32-bit values.

  Of the 15 color masks of interest, 4 are 18 bits or less,
  2 are symmetric across halfwords, 3 are zero in the bottom
  halfword, and 6 require two instructions to load.

- cell_gen_fragment.c: added full codegen for logic op and
  color mask.
2008-09-19 01:55:00 -06:00
Robert Ellison
f8bba34d4e CELL: finish fragment ops blending (except for unusual D3D modes)
- Added new "macro" functions spe_float_min() and spe_float_max()
  to rtasm_ppc_spe.{ch}.  These emit instructions that cause
  the minimum or maximum of each element in a vector of floats
  to be saved in the destination register.

- Major changes to cell_gen_fragment.c to implement all the blending
  modes (except for the mysterious D3D-based PIPE_BLENDFACTOR_SRC1_COLOR,
  PIPE_BLENDFACTOR_SRC1_ALPHA, PIPE_BLENDFACTOR_INV_SRC1_COLOR, and
  PIPE_BLENDFACTOR_INV_SRC1_ALPHA).

- Some revamping of code in cell_gen_fragment.c: use the new spe_float_min()
  and spe_float_max() functions (instead of expanding these calculations
  inline via macros); create and use an inline utility function for handling
  "optional" register allocation (for the {1,1,1,1} vector, and the
  blend color vectors) instead of expanding with macros; use the Float
  Multiply and Subtract (fnms) instruction to simplify and optimize many
  blending calculations.
2008-09-18 01:29:41 -06:00
Brian Paul
ae3373441d gallium: emit SPU instructions in assembler-compatible syntax 2008-09-15 15:10:02 -06:00
Jonathan White
367774a62a Fixed emit_RRR 2008-09-15 11:57:59 -06:00
Brian Paul
8b5013d232 gallium: added print/dump code to SPE code emitter 2008-09-12 21:52:47 -06:00
Brian Paul
31a112cad4 gallium: added spe_splat_word() 2008-09-12 21:08:01 -06:00
Brian Paul
b71f4150c8 gallium: minor optimization to spe_load_int() 2008-09-12 08:22:15 -06:00
Brian Paul
be5d8bd078 gallium: initial PPC/Altivec codegen 2008-09-12 08:21:43 -06:00
Brian Paul
178bbaff80 gallium: add special cases in spe_load_float(), spe_load_int(), added spe_splat() 2008-09-11 17:10:32 -06:00
Brian Paul
ee582fd3a7 gallium: assorted additions and fixes to Cell SPE rtasm code
Fix incorrect opcode for fsmbi.
Added "macro" functions for loading floats/ints, register complement, zero, move.
Added #defines for return address and stack pointer registers.
Added assertions to check that the instruction buffer doesn't overflow.
2008-09-11 10:39:28 -06:00
Brian Paul
bb5becf1e2 gallium: comments, assertions, etc 2008-09-11 10:39:28 -06:00
Brian Paul
f3a7463fee gallium: include u_pointer,h, not p_pointer.h 2008-09-01 15:33:19 -06:00
Brian Paul
0bb852fa49 gallium: thread wrapper clean-up
In p_thread.h replace _glthread_* functions with new pipe_* functions.
Remove other old cruft.
2008-08-26 16:35:12 -06:00
Brian Paul
4f25420bdd gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.h
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-24 17:48:55 -06:00
José Fonseca
aa1a39d1a7 rtasm: Use enum sse_cc in sse_cmpps. 2008-06-02 20:46:05 +09:00
Jakob Bornecrantz
3869c3c87a Merge branch 'gallium-tex-surfaces' into gallium-0.1
Conflicts:

	src/gallium/drivers/i915simple/i915_context.h
2008-05-30 13:46:18 +02:00
Keith Whitwell
648da5158e rtasm: special case for [ebp] 2008-05-28 17:06:18 +01:00
Jakob Bornecrantz
938d9d5963 Merge branch 'gallium-vertex-linear' into gallium-0.1
Conflicts:

	src/gallium/auxiliary/draw/draw_pt_varray.c
2008-05-28 12:42:42 +02:00
José Fonseca
55d29a8d48 gallium: Windows CE portability fixes. 2008-05-28 16:13:24 +09:00
Keith Whitwell
6b3723ee8d rtasm: add some helpers for calling out from generated code 2008-05-24 13:22:15 +01:00
Keith Whitwell
6f407b0724 rtasm: remove debug 2008-05-23 09:16:57 +01:00
Keith Whitwell
030af06691 rtasm: add x87 instructions and debug-check for x87 stack usage 2008-05-23 09:16:56 +01:00
Keith Whitwell
d3e64caef6 rtasm: export debug reg print function 2008-05-23 09:16:55 +01:00
Keith Whitwell
9232f0c023 rtasm: remove unused struct member 2008-05-23 09:16:55 +01:00
Keith Whitwell
2c89b75e36 rtasm: learn another version of push 2008-05-01 20:49:45 +01:00
Keith Whitwell
fb3623b235 rtasm: fix labels after (not so) recent change to allow dynamic fn growth
Using char * for labels doesn't work if you realloc the function
during assembly and free the old storage...
2008-05-01 20:49:45 +01:00
Keith Whitwell
727257f320 rtasm: assert stack is fully popped in return 2008-05-01 15:37:30 +01:00
Michal Krol
58d3dff0d3 gallium: Generate SSE code to swizzle and unswizzle vs inputs and outputs.
Change SSE_SWIZZLES #define to 0 to disable it.
2008-04-28 18:50:58 +02:00
José Fonseca
e3c4159957 rtasm: Implement x86_retw. 2008-04-27 21:09:45 +09:00
Keith Whitwell
a945420ae6 rtasm: debug some missing funcs 2008-04-21 19:48:21 +01:00
Keith Whitwell
73706deef5 rtasm: quieten sse_enabled debug 2008-04-21 19:48:08 +01:00
Keith Whitwell
73c2711bb1 rtasm: clean up debug dumping a little 2008-04-21 19:43:53 +01:00
Keith Whitwell
b17e123a8f rtasm: propogate errors in x86 emit 2008-04-21 19:12:08 +01:00
Keith Whitwell
b6c9d2ef2c rtasm: add dump facility for x86 (from tgsi_sse2.c) 2008-04-21 13:14:30 +01:00
José Fonseca
40e0439db4 gallium: Centralize SSE usage logic. 2008-04-21 13:02:59 +09:00
Keith Whitwell
af523a5bd7 rtasm: include yet another i386 define varient 2008-04-19 18:27:29 +01:00
Keith Whitwell
363f7abf20 rtasm: add x86_imul 2008-04-18 18:32:37 +01:00
Keith Whitwell
5b97c762ed rtasm: add a couple more insns, clean up x86_mul 2008-04-18 18:32:36 +01:00
Keith Whitwell
4d184cc331 gallium: fix broken x86_call() 2008-04-11 14:19:31 -06:00
Ian Romanick
84d8030735 cell: Float convert-to and convert-from instructions use different shift bias 2008-03-25 18:15:58 -07:00
Ian Romanick
9f106a8683 cell: Don't free NULL code pointers 2008-03-17 16:07:54 -07:00