[Mesa-dev,29/95] i965/vec4: Rename DF to/from F generator opcodes

Submitted by Iago Toral Quiroga on July 19, 2016, 10:40 a.m.

Details

Message ID 1468924892-6910-30-git-send-email-itoral@igalia.com
State New
Headers show
Series "i965 Haswell ARB_gpu_shader_fp64 / OpenGL 4.0" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Iago Toral Quiroga July 19, 2016, 10:40 a.m.
The opcodes are not specific for conversions to/from float since we need
the same for conversions to/from other 32-bit types. Rename the opcodes
accordingly and change the asserts to check the size of the types involved
instead.
---
 src/mesa/drivers/dri/i965/brw_defines.h                 |  4 ++--
 src/mesa/drivers/dri/i965/brw_shader.cpp                |  8 ++++----
 src/mesa/drivers/dri/i965/brw_vec4.cpp                  |  8 ++++----
 src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp |  4 ++--
 src/mesa/drivers/dri/i965/brw_vec4_generator.cpp        | 12 ++++++------
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp              |  4 ++--
 6 files changed, 20 insertions(+), 20 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h
index ea5c273..e485f45 100644
--- a/src/mesa/drivers/dri/i965/brw_defines.h
+++ b/src/mesa/drivers/dri/i965/brw_defines.h
@@ -1094,8 +1094,8 @@  enum opcode {
    VEC4_OPCODE_MOV_BYTES,
    VEC4_OPCODE_PACK_BYTES,
    VEC4_OPCODE_UNPACK_UNIFORM,
-   VEC4_OPCODE_DOUBLE_TO_FLOAT,
-   VEC4_OPCODE_FLOAT_TO_DOUBLE,
+   VEC4_OPCODE_DOUBLE_TO_SINGLE,
+   VEC4_OPCODE_SINGLE_TO_DOUBLE,
    VEC4_OPCODE_PICK_LOW_32BIT,
    VEC4_OPCODE_PICK_HIGH_32BIT,
    VEC4_OPCODE_SET_LOW_32BIT,
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index e0c38e5..38d060e 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -313,10 +313,10 @@  brw_instruction_name(const struct brw_device_info *devinfo, enum opcode op)
       return "pack_bytes";
    case VEC4_OPCODE_UNPACK_UNIFORM:
       return "unpack_uniform";
-   case VEC4_OPCODE_DOUBLE_TO_FLOAT:
-      return "double_to_float";
-   case VEC4_OPCODE_FLOAT_TO_DOUBLE:
-      return "float_to_double";
+   case VEC4_OPCODE_DOUBLE_TO_SINGLE:
+      return "double_to_single";
+   case VEC4_OPCODE_SINGLE_TO_DOUBLE:
+      return "single_to_double";
    case VEC4_OPCODE_PICK_LOW_32BIT:
       return "pick_low_32bit";
    case VEC4_OPCODE_PICK_HIGH_32BIT:
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index d806f41..c55d594 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -243,8 +243,8 @@  vec4_instruction::can_do_writemask(const struct brw_device_info *devinfo)
 {
    switch (opcode) {
    case SHADER_OPCODE_GEN4_SCRATCH_READ:
-   case VEC4_OPCODE_DOUBLE_TO_FLOAT:
-   case VEC4_OPCODE_FLOAT_TO_DOUBLE:
+   case VEC4_OPCODE_DOUBLE_TO_SINGLE:
+   case VEC4_OPCODE_SINGLE_TO_DOUBLE:
    case VEC4_OPCODE_PICK_LOW_32BIT:
    case VEC4_OPCODE_PICK_HIGH_32BIT:
    case VEC4_OPCODE_SET_LOW_32BIT:
@@ -501,8 +501,8 @@  vec4_visitor::opt_reduce_swizzle()
          swizzle = brw_swizzle_for_size(2);
          break;
 
-      case VEC4_OPCODE_FLOAT_TO_DOUBLE:
-      case VEC4_OPCODE_DOUBLE_TO_FLOAT:
+      case VEC4_OPCODE_SINGLE_TO_DOUBLE:
+      case VEC4_OPCODE_DOUBLE_TO_SINGLE:
       case VEC4_OPCODE_PICK_LOW_32BIT:
       case VEC4_OPCODE_PICK_HIGH_32BIT:
       case VEC4_OPCODE_SET_LOW_32BIT:
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index 56c0dbb..73abd57 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -284,8 +284,8 @@  static bool
 is_align1_opcode(unsigned opcode)
 {
    switch (opcode) {
-   case VEC4_OPCODE_DOUBLE_TO_FLOAT:
-   case VEC4_OPCODE_FLOAT_TO_DOUBLE:
+   case VEC4_OPCODE_DOUBLE_TO_SINGLE:
+   case VEC4_OPCODE_SINGLE_TO_DOUBLE:
    case VEC4_OPCODE_PICK_LOW_32BIT:
    case VEC4_OPCODE_PICK_HIGH_32BIT:
    case VEC4_OPCODE_SET_LOW_32BIT:
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index 5f48df1..d7e6e2d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -1910,9 +1910,9 @@  generate_code(struct brw_codegen *p,
          break;
       }
 
-      case VEC4_OPCODE_DOUBLE_TO_FLOAT: {
-         assert(src[0].type == BRW_REGISTER_TYPE_DF);
-         assert(dst.type == BRW_REGISTER_TYPE_F);
+      case VEC4_OPCODE_DOUBLE_TO_SINGLE: {
+         assert(type_sz(src[0].type) == 8);
+         assert(type_sz(dst.type) == 4);
 
          brw_set_default_access_mode(p, BRW_ALIGN_1);
 
@@ -1931,9 +1931,9 @@  generate_code(struct brw_codegen *p,
          break;
       }
 
-      case VEC4_OPCODE_FLOAT_TO_DOUBLE: {
-         assert(src[0].type == BRW_REGISTER_TYPE_F);
-         assert(dst.type == BRW_REGISTER_TYPE_DF);
+      case VEC4_OPCODE_SINGLE_TO_DOUBLE: {
+         assert(type_sz(src[0].type) == 4);
+         assert(type_sz(dst.type) == 8);
 
          brw_set_default_access_mode(p, BRW_ALIGN_1);
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 65fa057..38c7322 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -1074,7 +1074,7 @@  vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
 
       dst_reg temp2 = dst_reg(this, glsl_type::dvec4_type);
       temp2 = retype(temp2, BRW_REGISTER_TYPE_F);
-      emit(VEC4_OPCODE_DOUBLE_TO_FLOAT, temp2, src_reg(temp))
+      emit(VEC4_OPCODE_DOUBLE_TO_SINGLE, temp2, src_reg(temp))
          ->regs_written = 2;
 
       vec4_instruction *inst = emit(MOV(dst, src_reg(temp2)));
@@ -1086,7 +1086,7 @@  vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
       dst_reg tmp_dst = dst_reg(src_reg(this, glsl_type::dvec4_type));
       src_reg tmp_src = src_reg(this, glsl_type::vec4_type);
       emit(MOV(dst_reg(tmp_src), retype(op[0], BRW_REGISTER_TYPE_F)));
-      emit(VEC4_OPCODE_FLOAT_TO_DOUBLE, tmp_dst, tmp_src);
+      emit(VEC4_OPCODE_SINGLE_TO_DOUBLE, tmp_dst, tmp_src);
       vec4_instruction *inst = emit(MOV(dst, src_reg(tmp_dst)));
       inst->saturate = instr->dest.saturate;
       break;