diff options
author | Homer Hsing <homer.xing@intel.com> | 2012-09-27 13:51:33 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-09-28 04:06:00 -0400 |
commit | 70c8eb3952afd9c71fbecc4ff470de158ebbb0e4 (patch) | |
tree | 17c7112554ad80ee699852907172f44f6b80f5f7 | |
parent | f6fbfc762dfdde347afd382fcc372ba447351f21 (diff) |
Compile ELSE and WHILE in Gen5 as same way as in Gen4
-rw-r--r-- | src/gram.y | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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 |