platform/upstream/intel-gpu-tools.git
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.

11 years agoAdd test case for ".declare" overriding feature.
Homer Hsing [Thu, 20 Sep 2012 06:06:06 +0000 (14:06 +0800)]
Add test case for ".declare" overriding feature.

Later same name .declare pragma will override previously defined
one. This patch add a test case for that feature.

11 years agoFix memory leaking in the parser
Homer Hsing [Thu, 20 Sep 2012 06:04:20 +0000 (14:04 +0800)]
Fix memory leaking in the parser

STRING has been malloc'ed by strdup in src/lex.l but forgotten to
be freed in src/gram.y.

11 years agoFix field length of JIP for one-offset-branch in Gen6
Homer Hsing [Thu, 20 Sep 2012 05:09:15 +0000 (13:09 +0800)]
Fix field length of JIP for one-offset-branch in Gen6

Such JIP has 25 bits length in Gen6.

11 years agoAutomatically run all test cases.
Homer Hsing [Wed, 19 Sep 2012 01:34:58 +0000 (09:34 +0800)]
Automatically run all test cases.

In the past test/run-test.sh run only one test case per call.
This patch let it automatically run all test cases.

11 years agoFix missing environment variables problem in test/run-test.sh
Homer Hsing [Tue, 18 Sep 2012 08:44:45 +0000 (16:44 +0800)]
Fix missing environment variables problem in test/run-test.sh

Currently test/run-test.sh cannot get the value of ${srcdir} and
${top_builddir}. Thus we cannot run any test case. This patch uses
$0 to get the absolute path of run-test.sh. Now test cases work.

11 years agoAdd a generic hash table algorithm. Reuse for declared_reg_table and label_table...
Homer Hsing [Tue, 18 Sep 2012 08:32:39 +0000 (16:32 +0800)]
Add a generic hash table algorithm. Reuse for declared_reg_table and label_table in the future.

Rewrite find_register() and insert_register(). The hash table code
has been extracted. We may use those code for label table in the future.

11 years agoAdd a test case for ".declare" pragma
Homer Hsing [Tue, 18 Sep 2012 08:28:27 +0000 (16:28 +0800)]
Add a test case for ".declare" pragma

11 years agoRename brw_instruction.bits3.if_else to branch
Homer Hsing [Tue, 18 Sep 2012 05:57:20 +0000 (13:57 +0800)]
Rename brw_instruction.bits3.if_else to branch

Because that field will be used for all branch instructions

11 years agoAccording to BSPEC, put PLN & BFI1 to binaryop, put SUBB to binaryaccop
Homer Hsing [Tue, 18 Sep 2012 05:47:22 +0000 (13:47 +0800)]
According to BSPEC, put PLN & BFI1 to binaryop, put SUBB to binaryaccop

bspec: BFI1 should not access accumulator. PLN should not use accumulator
as source.
future work in gram.y: show warning if acc is used as dest for
ADDC/SUBB/CMP/CMPN/SHL/BFI1.

11 years agoExplain the difference between binaryinstruction and binaryaccinstruction
Homer Hsing [Tue, 18 Sep 2012 05:25:53 +0000 (13:25 +0800)]
Explain the difference between binaryinstruction and binaryaccinstruction

Developers may add new instructions in wrong place in the future
if they don't know the difference between binaryinstruction and
binaryaccinstruction.

11 years agoRenaming according to BSPEC: jump_count -> JIP; pop_count -> UIP.
Homer Hsing [Tue, 18 Sep 2012 05:12:50 +0000 (13:12 +0800)]
Renaming according to BSPEC: jump_count -> JIP; pop_count -> UIP.

Since bspec SNB+, jump_count and pop_count is renamed to JIP and uIP.

11 years agoUse bits3.if_else.jump_count instead of bits3.ud for readability
Homer Hsing [Mon, 17 Sep 2012 08:11:49 +0000 (16:11 +0800)]
Use bits3.if_else.jump_count instead of bits3.ud for readability

11 years agoPad NOP instructions instead of the ILLEGAL instruction for entry
Homer Hsing [Mon, 17 Sep 2012 08:01:16 +0000 (16:01 +0800)]
Pad NOP instructions instead of the ILLEGAL instruction for entry

If a label is an entry, the assembler will pad empty instruction
before the label until offset % 4 == 0. In the past, the ILLEGAL
instructions are padded. It may raise exceptions. We use the NOP
instructions instead.

11 years agoMerge same if branches in declare_pragma section in gram.y
Homer Hsing [Mon, 17 Sep 2012 05:34:38 +0000 (13:34 +0800)]
Merge same if branches in declare_pragma section in gram.y

11 years agoReduce memory cost in entry_table
Homer Hsing [Fri, 14 Sep 2012 07:27:19 +0000 (15:27 +0800)]
Reduce memory cost in entry_table

Original code double entry table space if there is no space. It may
waste 50% memory of the entry table. Now we use a link list to store
entry items.

11 years agoMake the entry point padding code logic looks nicer
Homer Hsing [Fri, 14 Sep 2012 05:40:08 +0000 (13:40 +0800)]
Make the entry point padding code logic looks nicer

11 years agoFix a typo in src/main.c: "in unit of type" -> "in unit of byte"
Homer Hsing [Fri, 14 Sep 2012 02:50:09 +0000 (10:50 +0800)]
Fix a typo in src/main.c: "in unit of type" -> "in unit of byte"

11 years agoReduce hash value collision probability in src/main.c
Homer Hsing [Fri, 14 Sep 2012 02:06:39 +0000 (10:06 +0800)]
Reduce hash value collision probability in src/main.c

Original code use "hash_value = *name++", which may produce
hash value collision for word permutations like "abc", "bac" and "cba".

11 years agoMove program_defaults init statement into variable declaration
Homer Hsing [Fri, 14 Sep 2012 02:02:53 +0000 (10:02 +0800)]
Move program_defaults init statement into variable declaration

In original code, the init value for "program_defaults.register_type"
is put inside main(), which may be hard to maintain.

11 years agoBetter comment text. Change "c like" to "C style" in main.c
Homer Hsing [Fri, 14 Sep 2012 01:42:30 +0000 (09:42 +0800)]
Better comment text. Change "c like" to "C style" in main.c

11 years agoReplace bzero by memset.
Homer Hsing [Fri, 14 Sep 2012 01:34:58 +0000 (09:34 +0800)]
Replace bzero by memset.

bzero has been removed from POSIX.1-2008. Should use memset instead.

11 years agoSupporting integer subtraction with borrow
Homer Hsing [Fri, 14 Sep 2012 01:02:01 +0000 (09:02 +0800)]
Supporting integer subtraction with borrow

subb: subtract unsigned integer src1 from src0. store the result
in dst and store the borrow (0 or 1) as a 32-bit value in acc.

11 years agoSupporting find first bit instructions
Homer Hsing [Fri, 14 Sep 2012 00:56:36 +0000 (08:56 +0800)]
Supporting find first bit instructions

fbh: Find the first significant bit searching from the high bits
in src0 and store the result in dst.

fbl: Find the first 1 bit searching from the low bits in src0
and store the result in dst.

11 years agoSupporting half precision to single precision float convertion
Homer Hsing [Fri, 14 Sep 2012 00:50:18 +0000 (08:50 +0800)]
Supporting half precision to single precision float convertion

The f16to32 instruction converts the half precision float
in src0 to single precision float and storing in dst.

The f32to16 instruction converts the single precision float
in src0 to half precision float and storing in the lower word
of each channel in dst.

11 years agoSupporting count bit set instruction
Homer Hsing [Fri, 14 Sep 2012 00:41:16 +0000 (08:41 +0800)]
Supporting count bit set instruction

The cbit instruction counts component-wise the total bits set
in src0 and stores the resulting counts in dst.

11 years agoSupporting instruction "reverse bits"
Homer Hsing [Fri, 14 Sep 2012 00:32:12 +0000 (08:32 +0800)]
Supporting instruction "reverse bits"

The bfrev instruction component-wise reverses all the bits in src0
and stores the results in dst.

11 years agoSupporting instruction Bit Field Insert 1
Homer Hsing [Fri, 14 Sep 2012 00:27:41 +0000 (08:27 +0800)]
Supporting instruction Bit Field Insert 1

The bfi1 instruction component-wise generates mask with control
from src0 and src1 and stores the results in dst.

11 years agoDelete an extra space character in brw_defines.h
Homer Hsing [Fri, 14 Sep 2012 00:24:54 +0000 (08:24 +0800)]
Delete an extra space character in brw_defines.h

Now the column is aligned and the code is nicer.

11 years agoSupporting addc instruction
Homer Hsing [Fri, 14 Sep 2012 00:20:13 +0000 (08:20 +0800)]
Supporting addc instruction

The addc instruction performs component-wise addition of
src0 and src1 and stores the results in dst;
it also stores the carry into acc.

11 years agoSupporting bit field extract and bit field insert 2
Homer Hsing [Thu, 13 Sep 2012 03:05:50 +0000 (11:05 +0800)]
Supporting bit field extract and bit field insert 2

Supporting two new operators, bfe and bfi2
bfe: Component-wise extracts a bit field from src2 using the bit field width from src0 and the bit field offset from src1.
bfi2: component-wise performs the bitfield insert operation on src1 and src2 based on the mask in src0.

11 years agoSupporting LRP: dest = src0 * src1 + (1-src0) * src2
Homer Hsing [Wed, 12 Sep 2012 05:04:49 +0000 (13:04 +0800)]
Supporting LRP: dest = src0 * src1 + (1-src0) * src2

11 years agoSupport trinary source instruction "multiply add".
Homer Hsing [Fri, 7 Sep 2012 06:38:13 +0000 (14:38 +0800)]
Support trinary source instruction "multiply add".

MAD (Multiply ADd) computes dst <- src1*src2 + src0.

Tried best to follow previous variable naming habit.

Also renamed "triinstruction" -> "trinaryinstruction" in grammar parser
for better readability.

11 years agoadd data structure in src/brw_structs.h for supporting three-source-operator instruncions
Homer Hsing [Fri, 7 Sep 2012 01:53:17 +0000 (09:53 +0800)]
add data structure in src/brw_structs.h for supporting three-source-operator instruncions

11 years agoComment magic words "da1", "da16", "ia1", and "ia16"
Homer Hsing [Fri, 7 Sep 2012 01:20:50 +0000 (09:20 +0800)]
Comment magic words "da1", "da16", "ia1", and "ia16"

11 years agoclose File yyin before calling yylex_destroy
Homer Hsing [Thu, 6 Sep 2012 08:12:08 +0000 (16:12 +0800)]
close File yyin before calling yylex_destroy

This patch makes sure file handler yyin is closed.
yylex_destroy() calls yy_init_globals(), which reset yyin to 0.
Therefore if we do not close yyin before yylex_destroy(), yyin
will not be closed anymore.

11 years agoCall yylex_destroy() to free memory after yyparse()
Homer Hsing [Thu, 6 Sep 2012 07:55:54 +0000 (15:55 +0800)]
Call yylex_destroy() to free memory after yyparse()

11 years agoClose input file handler yyin after yyparse
Homer Hsing [Thu, 6 Sep 2012 07:33:41 +0000 (15:33 +0800)]
Close input file handler yyin after yyparse

11 years agoFix a typo ... lable -> label
Homer Hsing [Thu, 6 Sep 2012 02:31:22 +0000 (10:31 +0800)]
Fix a typo ... lable -> label

11 years agofix the label checking logics
Lu Guanqun [Wed, 22 Aug 2012 01:09:36 +0000 (09:09 +0800)]
fix the label checking logics

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
11 years agoWaring if both predication and conditional modifier are enabled but use different...
Xiang, Haihao [Tue, 17 Jul 2012 08:16:11 +0000 (16:16 +0800)]
Waring if both predication and conditional modifier are enabled but use different flag registers

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
11 years agoAdd support for flag register f1 on Ivy bridge
Xiang, Haihao [Tue, 17 Jul 2012 07:05:31 +0000 (15:05 +0800)]
Add support for flag register f1 on Ivy bridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
11 years agos/flag_reg_nr/flag_subreg_nr for an instruction
Xiang, Haihao [Tue, 17 Jul 2012 06:18:54 +0000 (14:18 +0800)]
s/flag_reg_nr/flag_subreg_nr for an instruction
s/flagreg/flag_subreg_nr for a condition

They are flag subregister number indeed

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
11 years agoRemove flag_reg_nr from the DW3 of an instruction
Xiang, Haihao [Tue, 17 Jul 2012 06:01:54 +0000 (14:01 +0800)]
Remove flag_reg_nr from the DW3 of an instruction

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>