13 Commits

Author SHA1 Message Date
Damien Lespiau
79c62f1134 assembler: Don't change the size of opcodes!
Until now, the assembler had relocation-related fields added to struct
brw_instruction. This changes the size of the structure and break code
assuming the opcode structure is really 16 bytes, for instance the
emission code in brw_eu_emit.c.

With this commit, we build on the infrastructure that slowly emerged in
the few previous commits to add a relocatable instruction with the
needed fields.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:38 +00:00
Damien Lespiau
a45a47183a assembler: Make explicit that labels are part of the instructions list
The output of the parsing is a list of struct brw_program_instruction.
These instructions can be either GEN instructions aka struct
brw_instruction or labels. To make this more explicit we now have a type
to test to determine which instruction we are dealing with.

This will also allow to to pull the relocation bits into struct
brw_program_instruction instead of having them in the structure
representing the opcodes.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:38 +00:00
Damien Lespiau
8322802acb assembler: Use subreg_nr to store the address register subreg
Another step towards using struct brw_reg for source and destination
operands.

Instead of having a separate field to store the sub register number of
the address register in indirect access mode, we can reuse the subreg_nr
field that was only used for direct access so far.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:37 +00:00
Damien Lespiau
02019d4d55 assembler: Remove the writemask_set field of struct dest_operand
writemask_set gets in the way of switching to using struct brw_reg and
it's possible to derive it from the writemask value.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:37 +00:00
Damien Lespiau
a66cd60f2d assembler: Protect gen4asm.h from multiple inclusions
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:37 +00:00
Damien Lespiau
4ca1a04b85 assembler: Update the disassembler code
From Mesa. This imports a bit more the of brw_eu* infrastructure (which
is going towards the right direction!) from mesa and the update is quite
a significant improvement over what we had.

I also verified that the changes that were done on the assembler old
version of brw_disasm.c were already supported by the Mesa version, and
indeed they were.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:37 +00:00
Damien Lespiau
191c85976d build: Integrate the merged gen assembler in the build system
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-03-04 15:54:35 +00:00
Eric Anholt
9b40c3724a Add autotools build system, and rearrange directory layout. 2013-03-04 15:54:23 +00:00
Eric Anholt
3bcf6b29cd Add support for register-indirect access in destination registers.
This is untested.  Also, a few bits for source operand register-indirect access
sneak in with this commit.
2013-03-04 15:54:23 +00:00
Eric Anholt
2dac0a19a4 Add support for destination writemasks.
This involved changing dest operands to have their own structure like src
operands, as the destination writemask (which is align16-only) shares space
with register numbers in align1 mode.
2013-03-04 15:54:23 +00:00
Eric Anholt
6a88ada7e8 Add support for swizzle control on source operands.
This required restructuring to store source operands in a new structure rather
than being stored in instructions, as swizzle is align16-only and shares
storage with other fields for align1 mode.

These changes were not tested on real programs using swizzle.
2013-03-04 15:54:22 +00:00
Eric Anholt
f2f18561e5 C warnings cleanup. 2013-03-04 15:54:20 +00:00
Eric Anholt
22a1063cc0 Initial gen4asm code. 2013-03-04 15:54:20 +00:00