summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-09-27 13:51:33 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2012-09-28 04:06:00 -0400
commit70c8eb3952afd9c71fbecc4ff470de158ebbb0e4 (patch)
tree17c7112554ad80ee699852907172f44f6b80f5f7
parentf6fbfc762dfdde347afd382fcc372ba447351f21 (diff)
Compile ELSE and WHILE in Gen5 as same way as in Gen4
-rw-r--r--src/gram.y11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gram.y b/src/gram.y
index 26625ef..65e7f20 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -429,8 +429,8 @@ ifelseinstruction: ENDIF
}
| ELSE execsize relativelocation instoptions
{
- // for Gen4
- if(gen_level == 4) {
+ // for Gen4, Gen5
+ if(gen_level <= 5) {
struct direct_reg dst;
struct dst_operand ip_dst;
struct src_operand ip_src;
@@ -509,7 +509,7 @@ ifelseinstruction: ENDIF
loopinstruction: predicate WHILE execsize relativelocation instoptions
{
- if(gen_level == 4) {
+ if(gen_level <= 5) {
struct direct_reg dst;
struct dst_operand ip_dst;
struct src_operand ip_src;
@@ -535,13 +535,16 @@ loopinstruction: predicate WHILE execsize relativelocation instoptions
set_instruction_src1(&$$, &$4);
$$.first_reloc_target = $4.reloc_target;
$$.first_reloc_offset = $4.imm32;
- } else if (gen_level == 7) { // TODO: Gen5, Gen6 also OK?
+ } else if (gen_level == 7) { // TODO: Gen6 also OK?
memset(&$$, 0, sizeof($$));
set_instruction_predicate(&$$, &$1);
$$.header.opcode = $2;
$$.header.execution_size = $3;
$$.first_reloc_target = $4.reloc_target;
$$.first_reloc_offset = $4.imm32;
+ } else {
+ fprintf(stderr, "'WHILE' instruction is not implemented!\n");
+ YYERROR;
}
}
| DO