struct brw_reg dst,
struct brw_reg src)
{
+ /* Can't do writemask because math can't be align16. */
+ assert(dst.dw1.bits.writemask == WRITEMASK_XYZW);
+ /* Source swizzles are ignored. */
+ assert(!src.abs);
+ assert(!src.negate);
+ assert(src.dw1.bits.swizzle = BRW_SWIZZLE_XYZW);
+
+ brw_set_access_mode(p, BRW_ALIGN_1);
brw_math(p,
dst,
brw_math_function(inst->opcode),
src,
BRW_MATH_DATA_SCALAR,
BRW_MATH_PRECISION_FULL);
+ brw_set_access_mode(p, BRW_ALIGN_16);
}
void
src_reg temp_src = src_reg(this, glsl_type::vec4_type);
emit(BRW_OPCODE_MOV, dst_reg(temp_src), src);
- emit(opcode, dst, temp_src);
+ if (dst.writemask != WRITEMASK_XYZW) {
+ /* The gen6 math instruction must be align1, so we can't do
+ * writemasks.
+ */
+ dst_reg temp_dst = dst_reg(this, glsl_type::vec4_type);
+
+ emit(opcode, temp_dst, temp_src);
+
+ emit(BRW_OPCODE_MOV, dst, src_reg(temp_dst));
+ } else {
+ emit(opcode, dst, temp_src);
+ }
}
void
emit(BRW_OPCODE_MOV, dst, src1);
src1 = expanded;
- emit(opcode, dst, src0, src1);
+ if (dst.writemask != WRITEMASK_XYZW) {
+ /* The gen6 math instruction must be align1, so we can't do
+ * writemasks.
+ */
+ dst_reg temp_dst = dst_reg(this, glsl_type::vec4_type);
+
+ emit(opcode, temp_dst, src0, src1);
+
+ emit(BRW_OPCODE_MOV, dst, src_reg(temp_dst));
+ } else {
+ emit(opcode, dst, src0, src1);
+ }
}
void