diff options
author | Matt Turner <[email protected]> | 2013-09-19 13:01:08 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2013-10-07 10:41:17 -0700 |
commit | 014cce3dc49f5b0bfd7fbb1940ed661c9fc7bbd7 (patch) | |
tree | a025d94de15b5d8af7b1210859d7ab34df62520e /src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | |
parent | 4ec37317c55ee6be1a5988867aaeb8e9b3f02892 (diff) |
i965: Generate code for ir_binop_carry and ir_binop_borrow.
Using the ADDC and SUBB instructions on Gen7.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 09f0236c682..856312f4dd9 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -162,6 +162,8 @@ ALU1(FBH) ALU1(FBL) ALU1(CBIT) ALU3(MAD) +ALU2(ADDC) +ALU2(SUBB) /** Gen4 predicated IF. */ vec4_instruction * @@ -1371,6 +1373,20 @@ vec4_visitor::visit(ir_expression *ir) assert(ir->type->is_integer()); emit_math(SHADER_OPCODE_INT_QUOTIENT, result_dst, op[0], op[1]); break; + case ir_binop_carry: { + struct brw_reg acc = retype(brw_acc_reg(), BRW_REGISTER_TYPE_UD); + + emit(ADDC(dst_null_ud(), op[0], op[1])); + emit(MOV(result_dst, src_reg(acc))); + break; + } + case ir_binop_borrow: { + struct brw_reg acc = retype(brw_acc_reg(), BRW_REGISTER_TYPE_UD); + + emit(SUBB(dst_null_ud(), op[0], op[1])); + emit(MOV(result_dst, src_reg(acc))); + break; + } case ir_binop_mod: /* Floating point should be lowered by MOD_TO_FRACT in the compiler. */ assert(ir->type->is_integer()); |