ilo: add TOY_OPCODE_DO
authorChia-I Wu <olvaffe@gmail.com>
Fri, 11 Apr 2014 18:26:46 +0000 (02:26 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 14 Apr 2014 12:45:03 +0000 (20:45 +0800)
We used to give BRW_OPCODE_DO a special meaning, while we should have used
TOY_OPCODE_DO.

src/gallium/drivers/ilo/shader/ilo_shader_gs.c
src/gallium/drivers/ilo/shader/toy_compiler.c
src/gallium/drivers/ilo/shader/toy_compiler.h
src/gallium/drivers/ilo/shader/toy_legalize.c
src/gallium/drivers/ilo/shader/toy_legalize_ra.c
src/gallium/drivers/ilo/shader/toy_tgsi.c

index 79a6acb7a280dfdc9586dd51cd3e1c97338aebd6..0741754189ffc26fe42bdb355379d2e815b14ecf 100644 (file)
@@ -804,7 +804,7 @@ get_num_prims_static(struct gs_compile_context *gcc)
       case BRW_OPCODE_ENDIF:
          if_depth--;
          break;
-      case BRW_OPCODE_DO:
+      case TOY_OPCODE_DO:
          do_depth++;
          break;
       case BRW_OPCODE_WHILE:
index 71f6fa87dd9d9eee557ce49047a38ae8b9a295f2..623d47821c3c64b506518106903d324b474582cc 100644 (file)
@@ -312,6 +312,7 @@ get_opcode_name(unsigned opcode)
    case BRW_OPCODE_PLN:                   return "pln";
    case BRW_OPCODE_MAD:                   return "mad";
    case BRW_OPCODE_NOP:                   return "nop";
+   case TOY_OPCODE_DO:                    return "do";
    /* TGSI */
    case TOY_OPCODE_TGSI_IN:               return "tgsi.in";
    case TOY_OPCODE_TGSI_CONST:            return "tgsi.const";
index 3238c22b47815673084d8d28847ce9b3c8bd1e6c..cc5fc8079a631b999242553bda706e6ceecc8091 100644 (file)
@@ -41,6 +41,8 @@ enum toy_opcode {
    /* 0..127 are reserved for BRW_OPCODE_x */
    TOY_OPCODE_LAST_HW = 127,
 
+   TOY_OPCODE_DO,
+
    /* TGSI register functions */
    TOY_OPCODE_TGSI_IN,
    TOY_OPCODE_TGSI_CONST,
index 19aab4c79522906e9d4ef5b8e9007cad18fc0294..2339b7d3b8e8cc77c536d4e6628e4ca208475713 100644 (file)
@@ -315,7 +315,7 @@ patch_while_jip(struct toy_compiler *tc, struct toy_inst *inst)
    LIST_FOR_EACH_ENTRY_FROM_REV(inst2, inst->list.prev,
          &tc->instructions, list) {
       if (inst2->marker) {
-         if (inst2->opcode == BRW_OPCODE_DO) {
+         if (inst2->opcode == TOY_OPCODE_DO) {
             if (nest_level) {
                nest_level--;
             }
@@ -455,7 +455,7 @@ patch_break_continue_jip(struct toy_compiler *tc, struct toy_inst *inst)
    /* search forward */
    LIST_FOR_EACH_ENTRY_FROM(inst2, inst->list.next, &tc->instructions, list) {
       if (inst2->marker) {
-         if (inst2->opcode == BRW_OPCODE_DO)
+         if (inst2->opcode == TOY_OPCODE_DO)
             nest_level++;
          continue;
       }
@@ -474,7 +474,7 @@ patch_break_continue_jip(struct toy_compiler *tc, struct toy_inst *inst)
    inst3 = inst2;
    LIST_FOR_EACH_ENTRY_FROM(inst2, &inst3->list, &tc->instructions, list) {
       if (inst2->marker) {
-         if (inst2->opcode == BRW_OPCODE_DO)
+         if (inst2->opcode == TOY_OPCODE_DO)
             nest_level++;
          continue;
       }
index e691f127584546dbd8a6c64e183b57babe78c3de..ba05b0a1e2bd500a9d8c2b1c8dfe09a7156ec7ee 100644 (file)
@@ -351,7 +351,7 @@ linear_scan_init_live_intervals(struct linear_scan *ls,
             struct toy_inst *inst2;
             int loop_level = 1;
 
-            assert(inst->opcode == BRW_OPCODE_DO);
+            assert(inst->opcode == TOY_OPCODE_DO);
             do_pc = pc;
             while_pc = pc + 1;
 
@@ -359,7 +359,7 @@ linear_scan_init_live_intervals(struct linear_scan *ls,
             LIST_FOR_EACH_ENTRY_FROM(inst2, tc->iter_next,
                   &tc->instructions, list) {
                if (inst2->marker) {
-                  assert(inst->opcode == BRW_OPCODE_DO);
+                  assert(inst->opcode == TOY_OPCODE_DO);
                   loop_level++;
                   continue;
                }
index 93fe3b1f7e7b3f9c0812e8faea42da08e89ff397..a0db732279caae480cf692ed5a37096bb96da10c 100644 (file)
@@ -788,7 +788,7 @@ aos_BGNLOOP(struct toy_compiler *tc,
 {
    struct toy_inst *inst;
 
-   inst = tc_add0(tc, BRW_OPCODE_DO);
+   inst = tc_add0(tc, TOY_OPCODE_DO);
    /* this is just a marker */
    inst->marker = true;
 }