profile/extras/intel-gpu-tools.git
11 years agoassembler: Implement register-indirect addressing mode in brw_set_src1()
Damien Lespiau [Mon, 28 Jan 2013 15:27:59 +0000 (15:27 +0000)]
assembler: Implement register-indirect addressing mode in brw_set_src1()

The assembler allows people to do that and that's something available
since Crestline.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Fix ')' placement in condition
Damien Lespiau [Sun, 27 Jan 2013 11:23:38 +0000 (11:23 +0000)]
assembler: Fix ')' placement in condition

A small typo in the condition.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Cleanup visibility of a few global variables/functions
Damien Lespiau [Sun, 27 Jan 2013 11:05:50 +0000 (11:05 +0000)]
assembler: Cleanup visibility of a few global variables/functions

Not everything has to be exported out the compilation unit. Do a small
cleanup pass.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Port the warning and error reporting to warn()/error()
Damien Lespiau [Sun, 27 Jan 2013 10:41:23 +0000 (10:41 +0000)]
assembler: Port the warning and error reporting to warn()/error()

This way we ensure to have a single place where these are handled. The
immediate benefit is that now line numbers are always printed out, which
is quite handy.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Use brw_set_src0()
Damien Lespiau [Sun, 27 Jan 2013 02:06:22 +0000 (02:06 +0000)]
assembler: Use brw_set_src0()

Unfortunately, it's all a walk in the park. Both, internal code in the
assembler and external shaders (libva) generate registers that trigger
assertions in brw_eu_emit.c's brw_validate().

To fix all that I took the option to be able to emit warning with the -W
flag but still make the assembler generate the same opcodes.

We can fix all this, but it requires validation, something that I cannot
do right now.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Add the input filename to the error/warning messages
Damien Lespiau [Sun, 27 Jan 2013 01:32:52 +0000 (01:32 +0000)]
assembler: Add the input filename to the error/warning messages

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Add a check for when ExecSize and width are 1
Damien Lespiau [Sat, 26 Jan 2013 23:55:01 +0000 (23:55 +0000)]
assembler: Add a check for when ExecSize and width are 1

Another check (that we hit if we try to use brw_set_src0()). Again,
protect it with the -W option.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Add a check for when width is 1 and hstride is not 0
Damien Lespiau [Sat, 26 Jan 2013 23:09:42 +0000 (23:09 +0000)]
assembler: Add a check for when width is 1 and hstride is not 0

The list of region restrictions in bspec do say that we can't have:
     width == 1 && hstrize != 0

We do have plenty of assembly code that don't respect that behaviour. So
let's hide the warning under a -W flag (for now) while we fix things.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Add error() and warn() shorthands and use them in set_src[01]
Damien Lespiau [Sat, 26 Jan 2013 22:44:45 +0000 (22:44 +0000)]
assembler: Add error() and warn() shorthands and use them in set_src[01]

Now that we have locations, we can write error() and warn() functions
giving more information about where it's going wrong.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Add location support
Damien Lespiau [Sat, 26 Jan 2013 19:51:28 +0000 (19:51 +0000)]
assembler: Add location support

Let's generate location information about the tokens we are parsing.
This can be used to give accurate location when reporting errors and
warnings.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Don't warn if identical declared registers are redefined
Damien Lespiau [Sat, 26 Jan 2013 18:26:03 +0000 (18:26 +0000)]
assembler: Don't warn if identical declared registers are redefined

There's no real need to warn when the same register is declared twice.
Currently the libva driver does do that and this warning makes other
errors really hide in a sea of warnings.

Redefining a register with different parameters is a real error though,
so we should not allow that and error out in that case.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Store immediate values in reg.dw1.ud
Damien Lespiau [Fri, 25 Jan 2013 15:48:58 +0000 (15:48 +0000)]
assembler: Store immediate values in reg.dw1.ud

Another step in pushing the parsing in struct brw_reg.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Fix comparisons between reg.type and Architecture registers
Damien Lespiau [Fri, 25 Jan 2013 15:13:30 +0000 (15:13 +0000)]
assembler: Fix comparisons between reg.type and Architecture registers

Of course the assertion is there to make sure GRF and MRF have a reg.nr
< 128. To exclude ARF registers, reg.file has be checked, not reg.type
(channel type). Most likely a typo never caught.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: ExecSize can be as big as 32 channels
Damien Lespiau [Fri, 25 Jan 2013 15:12:12 +0000 (15:12 +0000)]
assembler: ExecSize can be as big as 32 channels

See the IVB PRM, vol4 part3 5.2.3.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Factor out the source register validation
Damien Lespiau [Thu, 24 Jan 2013 18:32:20 +0000 (18:32 +0000)]
assembler: Factor out the source register validation

The goal is to use brw_set_src[01](), so let's start by validating the
register we have before generating the opcode.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Use brw_set_dest() to encode the destination
Damien Lespiau [Thu, 24 Jan 2013 16:16:35 +0000 (16:16 +0000)]
assembler: Use brw_set_dest() to encode the destination

A few notes:

I needed to introduce a brw context and compile structs. These are only
used to get which generation we are compiling code for, but eventually
we can use more of the infrastructure.

brw_set_dest() uses the destination register width to program the
instruction execution size.

The assembler can either take subnr in bytes or in number of elements,
so we need a resolve step when setting a brw_reg.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Factor out the destination register validation
Damien Lespiau [Thu, 24 Jan 2013 12:21:13 +0000 (12:21 +0000)]
assembler: Factor out the destination register validation

The goal is to use brw_set_dest(), so let's start by validating the
register we have before generating the opcode.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Use brw_reg in the source operand
Damien Lespiau [Wed, 23 Jan 2013 22:29:23 +0000 (22:29 +0000)]
assembler: Use brw_reg in the source operand

Last refactoring step in transition to struct brw_reg.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Get rid of src operand's swizzle_set
Damien Lespiau [Wed, 23 Jan 2013 21:46:21 +0000 (21:46 +0000)]
assembler: Get rid of src operand's swizzle_set

swizzle_set can be derived from the value of swizzle itself, no need for
that field.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Consolidate the swizzling configuration on 8 bits
Damien Lespiau [Wed, 23 Jan 2013 21:35:10 +0000 (21:35 +0000)]
assembler: Consolidate the swizzling configuration on 8 bits

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Replace struct dst_operand by struct brw_reg
Damien Lespiau [Wed, 23 Jan 2013 20:33:00 +0000 (20:33 +0000)]
assembler: Replace struct dst_operand by struct brw_reg

One more step on the road to replacing all register-like structures by
struct brw_reg.

Two things in this commit are worth noting:

* As we are using more and more brw_reg, a lot of the field-by-field
  assignments can be replaced by 1 assignment which results is a
  reduction of code

* As the destination horizontal stride is now stored on 2 bits in
  brw_reg, it's not possible to defer the handling of DEFAULT_DSTREGION
  (aka (int)-1) when setting the destination operand. It has to be done
  when parsing the region and resolve_dst_region() is a helper for that
  task.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Unify the direct and indirect register type
Damien Lespiau [Wed, 23 Jan 2013 16:20:05 +0000 (16:20 +0000)]
assembler: Unify the direct and indirect register type

They are all struct brw_reg registers now.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Replace struct indirect_reg by struct brw_reg
Damien Lespiau [Wed, 23 Jan 2013 16:17:28 +0000 (16:17 +0000)]
assembler: Replace struct indirect_reg by struct brw_reg

More code simplification can be layered on top of that (by using some
brw_* helpers to create registers), that'd be for another commit.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Replace struct direct_reg by struct brw_reg
Damien Lespiau [Wed, 23 Jan 2013 16:06:49 +0000 (16:06 +0000)]
assembler: Replace struct direct_reg by struct brw_reg

More code simplification can be layered on top of that (by using some
brw_* helpers to create registers), that'd be for another commit.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Make struct declared_register use struct brw_reg
Damien Lespiau [Wed, 23 Jan 2013 15:13:55 +0000 (15:13 +0000)]
assembler: Make struct declared_register use struct brw_reg

It's time to start converting the emission code in gram.y to use libbrw
infrastructure. Let's start with using brw_reg for declared register.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Don't expose functions only used in main.c
Damien Lespiau [Mon, 21 Jan 2013 22:17:54 +0000 (22:17 +0000)]
assembler: Don't expose functions only used in main.c

and make then static.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Make sure nobody adds a field back to struct brw_instruction
Damien Lespiau [Mon, 21 Jan 2013 22:12:10 +0000 (22:12 +0000)]
assembler: Make sure nobody adds a field back to struct brw_instruction

Adding something there will break the library, so we might as check for
it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Don't change the size of opcodes!
Damien Lespiau [Mon, 21 Jan 2013 21:41:36 +0000 (21:41 +0000)]
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>
11 years agoassembler: Make explicit that labels are part of the instructions list
Damien Lespiau [Mon, 21 Jan 2013 19:28:41 +0000 (19:28 +0000)]
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>
11 years agoassembler: Refactor the code adding instructions and labels
Damien Lespiau [Mon, 21 Jan 2013 17:07:28 +0000 (17:07 +0000)]
assembler: Refactor the code adding instructions and labels

Factoring out the code from the grammar will allow us to switch to
using brw_compile in a cleaner way.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Make print_instruction() take an instruction
Damien Lespiau [Mon, 21 Jan 2013 15:10:01 +0000 (15:10 +0000)]
assembler: Make print_instruction() take an instruction

No need to use a brw_program_instruction there as a brw_instruction is
what you really dump anyway, espcially when the plan is to use
brw_compile from Mesa sooner rather than later.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Simplify get_subreg_address()
Damien Lespiau [Mon, 21 Jan 2013 14:45:46 +0000 (14:45 +0000)]
assembler: Simplify get_subreg_address()

This function can only be called to resolve subreg_nr in direct mode
(there is an other function for the indirect case) and it makes no sense
to call it with an immediate operand.

Express those facts with asserts and simplify the logic.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Use subreg_nr to store the address register subreg
Damien Lespiau [Mon, 21 Jan 2013 14:04:59 +0000 (14:04 +0000)]
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>
11 years agoassembler: Remove the writemask_set field of struct dest_operand
Damien Lespiau [Sun, 20 Jan 2013 21:52:05 +0000 (21:52 +0000)]
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>
11 years agoassembler: Use BRW_WRITEMASK_XYZW instead of the 0xf constant
Damien Lespiau [Sun, 20 Jan 2013 21:11:29 +0000 (21:11 +0000)]
assembler: Use BRW_WRITEMASK_XYZW instead of the 0xf constant

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Import brw_eu_emit.c
Damien Lespiau [Sat, 19 Jan 2013 23:27:46 +0000 (23:27 +0000)]
assembler: Import brw_eu_emit.c

Finally importing the meaty brw_eu_emit.c code that emit instructions.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Don't use -Wpointer-arith
Damien Lespiau [Sat, 19 Jan 2013 23:25:22 +0000 (23:25 +0000)]
assembler: Don't use -Wpointer-arith

Mesa's code uses the GNU C extension that allows additions and
soustractions on void* (+/- 1).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Import brw_eu.c
Damien Lespiau [Sat, 19 Jan 2013 23:04:07 +0000 (23:04 +0000)]
assembler: Import brw_eu.c

Another step the road of importing Mesa's emission code.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Import brw_eu_compact.c
Damien Lespiau [Sat, 19 Jan 2013 22:52:21 +0000 (22:52 +0000)]
assembler: Import brw_eu_compact.c

To be able to import brw_eu.c and brw_eu_emit.c later on. This could be
used to get the assembler generate compact instructions at some point.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Protect gen4asm.h from multiple inclusions
Damien Lespiau [Sat, 19 Jan 2013 22:50:57 +0000 (22:50 +0000)]
assembler: Protect gen4asm.h from multiple inclusions

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Make an libbrw library
Damien Lespiau [Sat, 19 Jan 2013 17:24:56 +0000 (17:24 +0000)]
assembler: Make an libbrw library

With the brw_* files imported from mesa.

There are still a few things in that library that needs gen4asm.h, for
instance the GLuint and GLint types. The hope is that eventually libbrw
can be split out in its own directory and shared.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Introduce struct brw_context
Damien Lespiau [Sat, 19 Jan 2013 17:05:48 +0000 (17:05 +0000)]
assembler: Introduce struct brw_context

A lot of the mesa code use struct brw_context to get the GPU generation
and various information. Let's stub this structure and initialize it
ourselves to be able to resuse mesa's code untouched.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Remove white space from brw_eu.h
Damien Lespiau [Sat, 19 Jan 2013 11:51:08 +0000 (11:51 +0000)]
assembler: Remove white space from brw_eu.h

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Import ralloc from Mesa
Damien Lespiau [Sat, 19 Jan 2013 11:49:11 +0000 (11:49 +0000)]
assembler: Import ralloc from Mesa

This also add a new brw_compat.h that should help maintaining the
diff between mesa's version and our as small as possible.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Update the disassembler code
Damien Lespiau [Sat, 19 Jan 2013 00:30:18 +0000 (00:30 +0000)]
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>
11 years agoassembler: Remove trailing white space from brw_defines.h
Damien Lespiau [Fri, 18 Jan 2013 13:21:32 +0000 (13:21 +0000)]
assembler: Remove trailing white space from brw_defines.h

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Import brw_defines.h from Mesa
Damien Lespiau [Fri, 18 Jan 2013 13:14:23 +0000 (13:14 +0000)]
assembler: Import brw_defines.h from Mesa

Almost identical files now, the diff is:

-#include "intel_chipset.h"
+#define EX_DESC_SFID_MASK 0xF
+#define EX_DESC_EOT_MASK  0x20

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename BRW_ACCWRCTRL_ACCWRCTRL
Damien Lespiau [Fri, 18 Jan 2013 11:52:01 +0000 (11:52 +0000)]
assembler: Rename BRW_ACCWRCTRL_ACCWRCTRL

To a more self-describing define. This hopefully will help its inclusion
into Mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Adopt enum brw_message_target from mesa
Damien Lespiau [Fri, 18 Jan 2013 11:04:37 +0000 (11:04 +0000)]
assembler: Adopt enum brw_message_target from mesa

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Remove trailing white spaces from brw_structs.h
Damien Lespiau [Wed, 16 Jan 2013 15:11:05 +0000 (15:11 +0000)]
assembler: Remove trailing white spaces from brw_structs.h

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Adopt brw_structs.h from mesa
Damien Lespiau [Wed, 16 Jan 2013 14:56:40 +0000 (14:56 +0000)]
assembler: Adopt brw_structs.h from mesa

Finally merge both brw_structs.h from mesa. One detail has risen in that
last commit, the msg_control field of data port message descriptors.

Mesa's msg_control field is sometimes split with messages-specific
fields where the assembler (at least for recent generations) exposes the
full msg_control value in the send instruction.

As libva's shaders encodes the full msg_control value in its send
instructions, I've chosen to not take the split msg_control from mesa.
It's absolutely possible to have a patch fixing that divergence at some
later point.

I've also kept a hack introduced with ironlake to not have to rewrite
shaders (that encode msg_control in the text, remember), and thus
creates a another difference with Mesa.

-  GLuint msg_control:3;
-  GLuint msg_type:3;
+  GLuint msg_control:4;
+  GLuint msg_type:2;

Once again, I've made sure that re-generating libva's shaders don't show
any difference.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename bits3.id and bits3.fd
Damien Lespiau [Wed, 16 Jan 2013 01:50:47 +0000 (01:50 +0000)]
assembler: Rename bits3.id and bits3.fd

As always, to sync with mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename branch_2_offset to break_cont
Damien Lespiau [Wed, 16 Jan 2013 01:44:41 +0000 (01:44 +0000)]
assembler: Rename branch_2_offset to break_cont

Once again, import the equivalent struct from mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename branch to branch_gen6
Damien Lespiau [Wed, 16 Jan 2013 01:19:29 +0000 (01:19 +0000)]
assembler: Rename branch to branch_gen6

The purpose of this commit is to synchronize opcode definitions across
the gen4asm assembler and mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename gen5 DP pixel_scoreboard_clear to last_render_target
Damien Lespiau [Tue, 15 Jan 2013 20:34:50 +0000 (20:34 +0000)]
assembler: Rename gen5 DP pixel_scoreboard_clear to last_render_target

The purpose of this commit is to synchronize opcode definitions across
the gen4asm assembler and mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Remove struct dp_write_gen6 and struct use gen6_dp
Damien Lespiau [Tue, 15 Jan 2013 20:24:51 +0000 (20:24 +0000)]
assembler: Remove struct dp_write_gen6 and struct use gen6_dp

We ended up with 2 structures that where exactly the same, so just use
one, which happens to be the one Mesa has.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename dp_gen7 to gen7_dp and sync it with Mesa's
Damien Lespiau [Tue, 15 Jan 2013 18:47:05 +0000 (18:47 +0000)]
assembler: Rename dp_gen7 to gen7_dp and sync it with Mesa's

The purpose of this commit is to synchronize opcode definitions across
the gen4asm assembler and mesa.

I had to drop how mesa splits msg_control as the current assembly
language gives access the the whole msg_control field.

Recompiling the xorg and the intel driver of libva shaders doesn't show
any difference in the assembly created.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename dp_gen6 to gen6_dp and sync with Mesa's
Damien Lespiau [Tue, 15 Jan 2013 17:35:24 +0000 (17:35 +0000)]
assembler: Rename dp_gen6 to gen6_dp and sync with Mesa's

The purpose of this commit is to synchronize opcode definitions across
the gen4asm assembler and mesa.

I had to drop how mesa splits msg_control as the current assembly
language gives access the the whole msg_control field.

Recompiling the xorg and the intel driver of libva shaders doesn't show
any difference in the assembly created.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename dp_read_gen6 to gen6_dp_sampler_const_cache
Damien Lespiau [Tue, 15 Jan 2013 16:40:06 +0000 (16:40 +0000)]
assembler: Rename dp_read_gen6 to gen6_dp_sampler_const_cache

The purpose of this commit is to synchronize opcode definitions across
the gen4asm assembler and mesa.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Rename three_src_gen6 to da3src
Damien Lespiau [Tue, 15 Jan 2013 14:05:23 +0000 (14:05 +0000)]
assembler: Rename three_src_gen6 to da3src

Mesa's brw_structs.h has named/renamed this field to da3src. Sync with
them.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agoassembler: Sync brw_instruction's header with mesa's
Damien Lespiau [Mon, 14 Jan 2013 19:13:19 +0000 (19:13 +0000)]
assembler: Sync brw_instruction's header with mesa's

Two changes there, a field has been renamed and one bit of padding is
now used for compressed instructions.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agobuild: Add the debugger compilation status to the summary
Damien Lespiau [Tue, 22 Jan 2013 08:35:15 +0000 (08:35 +0000)]
build: Add the debugger compilation status to the summary

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agobuild: Only build the assembler if flex and bison are found
Damien Lespiau [Mon, 21 Jan 2013 23:02:36 +0000 (23:02 +0000)]
build: Only build the assembler if flex and bison are found

And start displaying a nice summary of what we are going to compile.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agobuild: Don't use AM_MAINTAINER_MODE
Damien Lespiau [Sat, 19 Jan 2013 11:54:05 +0000 (11:54 +0000)]
build: Don't use AM_MAINTAINER_MODE

This does not bring us anything these days, not using the macro at all
is the same thing as having it always on.

See this discussion:
https://www.redhat.com/archives/virt-tools-list/2010-October/msg00049.html

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agogitignore: Ignore TAGS files
Damien Lespiau [Tue, 15 Jan 2013 13:52:57 +0000 (13:52 +0000)]
gitignore: Ignore TAGS files

TAGS files are generated with "make tags" to quickly jump through the
code. Ignore those by-products of automake/ctags.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agobuild: Add CAIRO_FLAGS to the debugger compilation
Damien Lespiau [Mon, 14 Jan 2013 23:25:14 +0000 (23:25 +0000)]
build: Add CAIRO_FLAGS to the debugger compilation

The library in lib/ exposes <cairo.h> in its main header and thus users
must be able to include it.

11 years agobuild: Integrate the merged gen assembler in the build system
Damien Lespiau [Mon, 14 Jan 2013 23:21:21 +0000 (23:21 +0000)]
build: Integrate the merged gen assembler in the build system

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agobump version to 1.3
Xiang, Haihao [Wed, 31 Oct 2012 08:10:20 +0000 (16:10 +0800)]
bump version to 1.3

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
11 years agoFix typo. "donesn't" -> "doesn't"
Homer Hsing [Tue, 23 Oct 2012 01:21:15 +0000 (09:21 +0800)]
Fix typo. "donesn't" -> "doesn't"

11 years agoAdd the CRE enginee for HSW+
Zhao Yakui [Mon, 22 Oct 2012 20:13:51 +0000 (16:13 -0400)]
Add the CRE enginee for HSW+

This is also for media encoding like VME, which can do
the operation of check & refinement.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
11 years agoFix JMPI encoding for Haswell.
Gwenole Beauchesne [Mon, 22 Oct 2012 20:13:51 +0000 (16:13 -0400)]
Fix JMPI encoding for Haswell.

It uses the byte-aligned jump instead of 64-bit units.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
11 years agoAdd initial support for Haswell.
Gwenole Beauchesne [Mon, 22 Oct 2012 20:13:51 +0000 (16:13 -0400)]
Add initial support for Haswell.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
11 years agoAllow Gen version decimals.
Gwenole Beauchesne [Mon, 22 Oct 2012 20:13:51 +0000 (16:13 -0400)]
Allow Gen version decimals.

This is preparatory work for Haswell (Gen 7.5).

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
11 years agoBump gen_level to multiple of tens.
Gwenole Beauchesne [Mon, 22 Oct 2012 20:13:51 +0000 (16:13 -0400)]
Bump gen_level to multiple of tens.

Add new helper macros to check versions:
- IS_GENp() meant to match Gen X and above
- IS_GENx() meant to match Gen X exactly.

Patch mechanically generated. No stale "gen_level" usage.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
11 years agoFix Gen7 JMPI compilation
Homer Hsing [Fri, 19 Oct 2012 03:18:23 +0000 (11:18 +0800)]
Fix Gen7 JMPI compilation

Gen7 JMPI Restrictions in bspec:
The JIP data type must be Signed DWord

11 years agoFix sub-register number of an address register encoding
Homer Hsing [Thu, 18 Oct 2012 04:37:31 +0000 (12:37 +0800)]
Fix sub-register number of an address register encoding

The AddrSubRegNum field in the instruction binary code should be:
  code    value(advanced_flag==0)   value(advanced_flag==1)
  a0.0             0                         0
  a0.1        invalid input                  1
  a0.2             1                         2
  a0.3        invalid input                  3
  a0.4             2                         4
  a0.5        invalid input                  5
  a0.6             3                         6
  a0.7        invalid input                  7
  a0.8             4                  invalid input
  a0.10            5                  invalid input
  a0.12            6                  invalid input
  a0.14            7                  invalid input

11 years agoFix symbol register subreg number calculation rule symbol_reg_p
Homer Hsing [Tue, 16 Oct 2012 06:14:25 +0000 (14:14 +0800)]
Fix symbol register subreg number calculation rule symbol_reg_p

When in normal mode, subreg_nr should not be divided by type_size.
This patch fixes such bug.

11 years agoShow warning when compiling the grammar parser
Homer Hsing [Fri, 28 Sep 2012 06:10:00 +0000 (14:10 +0800)]
Show warning when compiling the grammar parser

11 years agoSupport Gen6 WHILE instruction
Homer Hsing [Fri, 28 Sep 2012 06:05:51 +0000 (14:05 +0800)]
Support Gen6 WHILE instruction

11 years agoMake sure Gen6 IF works
Homer Hsing [Fri, 28 Sep 2012 06:02:25 +0000 (14:02 +0800)]
Make sure Gen6 IF works

11 years agoMake sure Gen6 ENDIF work
Homer Hsing [Fri, 28 Sep 2012 05:46:21 +0000 (13:46 +0800)]
Make sure Gen6 ENDIF work

11 years agoFix JIP position for Gen6 JMPI
Homer Hsing [Fri, 28 Sep 2012 05:43:44 +0000 (13:43 +0800)]
Fix JIP position for Gen6 JMPI

11 years agoFix Gen6 ELSE instructions code logic according to bspec.
Homer Hsing [Thu, 27 Sep 2012 08:20:39 +0000 (16:20 +0800)]
Fix Gen6 ELSE instructions code logic according to bspec.

11 years agoMake sure BREAK/CONT/HALT work on Gen6.
Homer Hsing [Thu, 27 Sep 2012 07:44:15 +0000 (15:44 +0800)]
Make sure BREAK/CONT/HALT work on Gen6.

11 years agoSupport Gen6 RET instruction.
Homer Hsing [Thu, 27 Sep 2012 07:39:28 +0000 (15:39 +0800)]
Support Gen6 RET instruction.

11 years agoSupport Gen6 CALL instruction.
Homer Hsing [Thu, 27 Sep 2012 07:31:56 +0000 (15:31 +0800)]
Support Gen6 CALL instruction.

11 years agoReplace variable init code in WAIT by src_null_reg
Homer Hsing [Thu, 27 Sep 2012 06:56:30 +0000 (14:56 +0800)]
Replace variable init code in WAIT by src_null_reg

11 years agoLet ip_dst and ip_src become local const variable, so as to reduce replicated code.
Homer Hsing [Thu, 27 Sep 2012 06:48:14 +0000 (14:48 +0800)]
Let ip_dst and ip_src become local const variable, so as to reduce replicated code.

11 years agoSupport Gen6 three-source-operand instructions.
Homer Hsing [Thu, 27 Sep 2012 06:20:32 +0000 (14:20 +0800)]
Support Gen6 three-source-operand instructions.

Add bits1.three_src.gen6.dest_reg_file according to Gen6 spec

11 years agoCompile ELSE and WHILE in Gen5 as same way as in Gen4
Homer Hsing [Thu, 27 Sep 2012 05:51:33 +0000 (13:51 +0800)]
Compile ELSE and WHILE in Gen5 as same way as in Gen4

11 years agoFix reloc_target_offset computing logic
Homer Hsing [Mon, 24 Sep 2012 08:39:36 +0000 (16:39 +0800)]
Fix reloc_target_offset computing logic

11 years agoFully support Gen7 branching instructions
Homer Hsing [Mon, 24 Sep 2012 02:12:26 +0000 (10:12 +0800)]
Fully support Gen7 branching instructions

Also fix integer argument parsing rule for JMPI, IF and WHILE
Fix shift/reduce conflicts in relativelocation

11 years agoSupporting multi-branch instructios BRD & BRC
Homer Hsing [Mon, 24 Sep 2012 02:06:35 +0000 (10:06 +0800)]
Supporting multi-branch instructios BRD & BRC

brd: redirect channels to branches
brc: let channels converging together

also rewrite code converting label to offset

11 years agoUse right-recursing in parser rule inst_option_list
Homer Hsing [Fri, 21 Sep 2012 04:35:35 +0000 (12:35 +0800)]
Use right-recursing in parser rule inst_option_list

This recursing cost less memory. It is recommended by Bison.

11 years agoSupport subroutine instructions, CALL & RET
Homer Hsing [Fri, 21 Sep 2012 04:33:13 +0000 (12:33 +0800)]
Support subroutine instructions, CALL & RET

11 years agoMerge replicative code in gram.y
Homer Hsing [Fri, 21 Sep 2012 02:14:31 +0000 (10:14 +0800)]
Merge replicative code in gram.y

11 years agoReduce replicative code in gram.y by reloc_target field in src_operand
Homer Hsing [Fri, 21 Sep 2012 02:06:20 +0000 (10:06 +0800)]
Reduce replicative code in gram.y by reloc_target field in src_operand

Bspec says JIP and UIP should be the source operands. It is better if
src_operand has a field "reloc_target" according to bspec.
The replicative code in JMPI and branchloop rules can be merged into one.

11 years agoRestrict type of relativelocation2 to int
Homer Hsing [Fri, 21 Sep 2012 01:51:55 +0000 (09:51 +0800)]
Restrict type of relativelocation2 to int

Original rule set it to EXP | NUMBER, then YYERROR if it is NUMBER.
This patch set it directly to EXP, restricting its type to int.

11 years agoRewrite label matching code. Collect labels in a linked list.
Homer Hsing [Fri, 21 Sep 2012 01:37:06 +0000 (09:37 +0800)]
Rewrite label matching code. Collect labels in a linked list.

Label matching is faster because of searching only in a small list,
rather than searching a label in all instructions.

11 years agoAdd second_reloc_target in the data structure.
Homer Hsing [Fri, 21 Sep 2012 00:39:57 +0000 (08:39 +0800)]
Add second_reloc_target in the data structure.

Since Gen6+, some branching instructions have two relocation targets.