i965: Combine {VS,FS}_OPCODE_GET_BUFFER_SIZE opcodes.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Dec 2017 01:03:32 +0000 (17:03 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 31 Dec 2017 04:30:34 +0000 (20:30 -0800)
These are the same, we don't need a separate opcode enum per backend.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_eu_defines.h
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_shader.cpp
src/intel/compiler/brw_vec4.cpp
src/intel/compiler/brw_vec4_generator.cpp
src/intel/compiler/brw_vec4_nir.cpp

index 8ed97912b4df3302239bcd6d56c90833a8b94626..30e2e8f0708413ec64d508bc9acfeeab0df9436a 100644 (file)
@@ -451,6 +451,8 @@ enum opcode {
     */
    SHADER_OPCODE_BROADCAST,
 
+   SHADER_OPCODE_GET_BUFFER_SIZE,
+
    VEC4_OPCODE_MOV_BYTES,
    VEC4_OPCODE_PACK_BYTES,
    VEC4_OPCODE_UNPACK_UNIFORM,
@@ -479,7 +481,6 @@ enum opcode {
    FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN4,
    FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7,
    FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_LOGICAL,
-   FS_OPCODE_GET_BUFFER_SIZE,
    FS_OPCODE_MOV_DISPATCH_TO_FLAGS,
    FS_OPCODE_DISCARD_JUMP,
    FS_OPCODE_SET_SAMPLE_ID,
@@ -496,8 +497,6 @@ enum opcode {
    VS_OPCODE_PULL_CONSTANT_LOAD_GEN7,
    VS_OPCODE_SET_SIMD4X2_HEADER_GEN9,
 
-   VS_OPCODE_GET_BUFFER_SIZE,
-
    VS_OPCODE_UNPACK_FLAGS_SIMD4X2,
 
    /**
index 6d9f0eccb29baf35028b296facd6a9786585559b..9d0546e57976017a8e2d1d684420ab2570d229cf 100644 (file)
@@ -5007,7 +5007,7 @@ get_lowered_simd_width(const struct gen_device_info *devinfo,
       return MIN2(8, inst->exec_size);
 
    case FS_OPCODE_LINTERP:
-   case FS_OPCODE_GET_BUFFER_SIZE:
+   case SHADER_OPCODE_GET_BUFFER_SIZE:
    case FS_OPCODE_DDX_COARSE:
    case FS_OPCODE_DDX_FINE:
    case FS_OPCODE_DDY_COARSE:
index 6a3b2dcf8a33ab9f4df8f139de10b0b384203c3d..37b8f07769ef598dfc69ce01193632c8feb14933 100644 (file)
@@ -1964,7 +1964,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
          src[0].subnr = 4 * type_sz(src[0].type);
          brw_MOV(p, dst, stride(src[0], 8, 4, 1));
          break;
-      case FS_OPCODE_GET_BUFFER_SIZE:
+      case SHADER_OPCODE_GET_BUFFER_SIZE:
          generate_get_buffer_size(inst, dst, src[0], src[1]);
          break;
       case SHADER_OPCODE_TEX:
index 01651dda4444a3069c6cfb3245433ca0717e792e..ab132f700a3f711e7dd1301b6d094773363d14b6 100644 (file)
@@ -4290,7 +4290,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
       ubld.MOV(src_payload, brw_imm_d(0));
 
       const unsigned index = prog_data->binding_table.ssbo_start + ssbo_index;
-      fs_inst *inst = ubld.emit(FS_OPCODE_GET_BUFFER_SIZE, ret_payload,
+      fs_inst *inst = ubld.emit(SHADER_OPCODE_GET_BUFFER_SIZE, ret_payload,
                                 src_payload, brw_imm_ud(index));
       inst->header_size = 0;
       inst->mlen = 1;
index 74b52976d74a7041121547d48fa62be3b535c92b..1df4f35cd8e4d492df0f9af929a425873e8ec8be 100644 (file)
@@ -331,6 +331,9 @@ brw_instruction_name(const struct gen_device_info *devinfo, enum opcode op)
    case SHADER_OPCODE_BROADCAST:
       return "broadcast";
 
+   case SHADER_OPCODE_GET_BUFFER_SIZE:
+      return "get_buffer_size";
+
    case VEC4_OPCODE_MOV_BYTES:
       return "mov_bytes";
    case VEC4_OPCODE_PACK_BYTES:
@@ -373,9 +376,6 @@ brw_instruction_name(const struct gen_device_info *devinfo, enum opcode op)
    case FS_OPCODE_PIXEL_Y:
       return "pixel_y";
 
-   case FS_OPCODE_GET_BUFFER_SIZE:
-      return "fs_get_buffer_size";
-
    case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD:
       return "uniform_pull_const";
    case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GEN7:
@@ -422,9 +422,6 @@ brw_instruction_name(const struct gen_device_info *devinfo, enum opcode op)
    case VS_OPCODE_SET_SIMD4X2_HEADER_GEN9:
       return "set_simd4x2_header_gen9";
 
-   case VS_OPCODE_GET_BUFFER_SIZE:
-      return "vs_get_buffer_size";
-
    case VS_OPCODE_UNPACK_FLAGS_SIMD4X2:
       return "unpack_flags_simd4x2";
 
index 73c40ad6009348a6adf5a9a21eabd0343d1137b6..3ddbe6c57fcc181720dc504fdaa2e48f3d7cea2e 100644 (file)
@@ -361,7 +361,7 @@ vec4_visitor::implied_mrf_writes(vec4_instruction *inst)
    case SHADER_OPCODE_TG4:
    case SHADER_OPCODE_TG4_OFFSET:
    case SHADER_OPCODE_SAMPLEINFO:
-   case VS_OPCODE_GET_BUFFER_SIZE:
+   case SHADER_OPCODE_GET_BUFFER_SIZE:
       return inst->header_size;
    default:
       unreachable("not reached");
index 8e11754e021975362dd524b4c0f3c44f62109344..f5d6ad8e4835e347b470c2bbc1383b871fde1089 100644 (file)
@@ -1773,6 +1773,10 @@ generate_code(struct brw_codegen *p,
                       inst, dst, src[0], src[1], src[2]);
          break;
 
+      case SHADER_OPCODE_GET_BUFFER_SIZE:
+         generate_get_buffer_size(p, prog_data, inst, dst, src[0], src[1]);
+         break;
+
       case VS_OPCODE_URB_WRITE:
          generate_vs_urb_write(p, inst);
          break;
@@ -1799,11 +1803,6 @@ generate_code(struct brw_codegen *p,
          generate_set_simd4x2_header_gen9(p, inst, dst);
          break;
 
-
-      case VS_OPCODE_GET_BUFFER_SIZE:
-         generate_get_buffer_size(p, prog_data, inst, dst, src[0], src[1]);
-         break;
-
       case GS_OPCODE_URB_WRITE:
          generate_gs_urb_write(p, inst);
          break;
index 4ff3ef9927e2b2873eacc7888a22e2232a36903b..7131fa06b4ad32e74bc57c4926bb748693414205 100644 (file)
@@ -455,7 +455,7 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
          prog_data->base.binding_table.ssbo_start + ssbo_index;
       dst_reg result_dst = get_nir_dest(instr->dest);
       vec4_instruction *inst = new(mem_ctx)
-         vec4_instruction(VS_OPCODE_GET_BUFFER_SIZE, result_dst);
+         vec4_instruction(SHADER_OPCODE_GET_BUFFER_SIZE, result_dst);
 
       inst->base_mrf = 2;
       inst->mlen = 1; /* always at least one */