i965: remove pointless diff with the master branch
[mesa.git] / src / mesa / drivers / dri / i965 / brw_vec4_nir.cpp
index a5db2f94d73b27a11815e277f8f45361b3e6ac8e..b67d104c34029c8415c6afe8fc4769e1d708fd8c 100644 (file)
@@ -1093,29 +1093,15 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
       inst->saturate = instr->dest.saturate;
       break;
 
-   case nir_op_fsin: {
-      src_reg tmp = src_reg(this, glsl_type::vec4_type);
-      inst = emit_math(SHADER_OPCODE_SIN, dst_reg(tmp), op[0]);
-      if (instr->dest.saturate) {
-         inst->dst = dst;
-         inst->saturate = true;
-      } else {
-         emit(MUL(dst, tmp, brw_imm_f(0.99997)));
-      }
+   case nir_op_fsin:
+      inst = emit_math(SHADER_OPCODE_SIN, dst, op[0]);
+      inst->saturate = instr->dest.saturate;
       break;
-   }
 
-   case nir_op_fcos: {
-      src_reg tmp = src_reg(this, glsl_type::vec4_type);
-      inst = emit_math(SHADER_OPCODE_COS, dst_reg(tmp), op[0]);
-      if (instr->dest.saturate) {
-         inst->dst = dst;
-         inst->saturate = true;
-      } else {
-         emit(MUL(dst, tmp, brw_imm_f(0.99997)));
-      }
+   case nir_op_fcos:
+      inst = emit_math(SHADER_OPCODE_COS, dst, op[0]);
+      inst->saturate = instr->dest.saturate;
       break;
-   }
 
    case nir_op_idiv:
    case nir_op_udiv:
@@ -1143,6 +1129,10 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
        * When we XOR the sources, the top bit is 0 if they are the same and 1
        * if they are different.  We can then use a conditional modifier to
        * turn that into a predicate.  This leads us to an XOR.l instruction.
+       *
+       * Technically, according to the PRM, you're not allowed to use .l on a
+       * XOR instruction.  However, emperical experiments and Curro's reading
+       * of the simulator source both indicate that it's safe.
        */
       src_reg tmp = src_reg(this, glsl_type::ivec4_type);
       inst = emit(XOR(dst_reg(tmp), op[0], op[1]));
@@ -1657,6 +1647,7 @@ vec4_visitor::nir_emit_jump(nir_jump_instr *instr)
       break;
 
    case nir_jump_return:
+      /* fall through */
    default:
       unreachable("unknown jump");
    }
@@ -1726,7 +1717,7 @@ vec4_visitor::nir_emit_texture(nir_tex_instr *instr)
                                  nir_tex_instr_dest_size(instr));
    dst_reg dest = get_nir_dest(instr->dest, instr->dest_type);
 
-   /* Our hardware requires a LOD for buffer textures */
+   /* The hardware requires a LOD for buffer textures */
    if (instr->sampler_dim == GLSL_SAMPLER_DIM_BUF)
       lod = brw_imm_d(0);