third_party/cairo/src/drm/cairo-drm-intel-brw-eu-emit.c
void brw_math_16( struct brw_compile *p,
		  struct brw_reg dest,
		  uint32_t function,
		  uint32_t saturate,
		  uint32_t msg_reg_nr,
		  struct brw_reg src,
		  uint32_t precision )
{
    struct brw_instruction *insn;
    uint32_t msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1;
    uint32_t response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1;

    /* First instruction:
    */
    brw_push_insn_state(p);
    brw_set_predicate_control_flag_value(p, 0xff);
    brw_set_compression_control(p, BRW_COMPRESSION_NONE);

    insn = brw_next_instruction(p, BRW_OPCODE_SEND);
    insn->header.destreg__conditonalmod = msg_reg_nr;

    brw_instruction_set_destination(insn, dest);
    brw_instruction_set_source0(insn, src);
    brw_set_math_message(insn,
			 msg_length, response_length,
			 function,
			 BRW_MATH_INTEGER_UNSIGNED,
			 precision,
			 saturate,
			 BRW_MATH_DATA_VECTOR);

    /* Second instruction:
    */
    insn = brw_next_instruction(p, BRW_OPCODE_SEND);
    insn->header.compression_control = BRW_COMPRESSION_2NDHALF;
    insn->header.destreg__conditonalmod = msg_reg_nr+1;

    brw_instruction_set_destination(insn, offset(dest,1));
    brw_instruction_set_source0(insn, src);
    brw_set_math_message(insn,
			 msg_length, response_length,
			 function,
			 BRW_MATH_INTEGER_UNSIGNED,
			 precision,
			 saturate,
			 BRW_MATH_DATA_VECTOR);

    brw_pop_insn_state(p);
}
/* Use 2 send instructions to invert 16 elements
*/
Use 2 send instructions to invert 16 elements
Use 2 send instructions to invert 16 elements
void brw_math_16( struct brw_compile *p,
		  struct brw_reg dest,
		  uint32_t function,
		  uint32_t saturate,
		  uint32_t msg_reg_nr,
		  struct brw_reg src,
		  uint32_t precision )
{
    struct brw_instruction *insn;
    uint32_t msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1;
    uint32_t response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1;
    brw_push_insn_state(p);
    brw_set_predicate_control_flag_value(p, 0xff);
    brw_set_compression_control(p, BRW_COMPRESSION_NONE);
    insn = brw_next_instruction(p, BRW_OPCODE_SEND);
    insn->header.destreg__conditonalmod = msg_reg_nr;
    brw_instruction_set_destination(insn, dest);
    brw_instruction_set_source0(insn, src);
    brw_set_math_message(insn,
			 msg_length, response_length,
			 function,
			 BRW_MATH_INTEGER_UNSIGNED,
			 precision,
			 saturate,
			 BRW_MATH_DATA_VECTOR);
    insn = brw_next_instruction(p, BRW_OPCODE_SEND);
    insn->header.compression_control = BRW_COMPRESSION_2NDHALF;
    insn->header.destreg__conditonalmod = msg_reg_nr+1;
    brw_instruction_set_destination(insn, offset(dest,1));
    brw_instruction_set_source0(insn, src);
    brw_set_math_message(insn,
			 msg_length, response_length,
			 function,
			 BRW_MATH_INTEGER_UNSIGNED,
			 precision,
			 saturate,
			 BRW_MATH_DATA_VECTOR);
    brw_pop_insn_state(p);
}
void brw_math_16 ( struct brw_compile * p , struct brw_reg dest , uint32_t function , uint32_t saturate , uint32_t msg_reg_nr , struct brw_reg src , uint32_t precision ) { struct brw_instruction * insn ; uint32_t msg_length = ( function == BRW_MATH_FUNCTION_POW ) ? 2 : 1 ; uint32_t response_length = ( function == BRW_MATH_FUNCTION_SINCOS ) ? 2 : 1 ; brw_push_insn_state ( p ) ; brw_set_predicate_control_flag_value ( p , 0xff ) ; brw_set_compression_control ( p , BRW_COMPRESSION_NONE ) ; insn = brw_next_instruction ( p , BRW_OPCODE_SEND ) ; insn -> header . destreg__conditonalmod = msg_reg_nr ; brw_instruction_set_destination ( insn , dest ) ; brw_instruction_set_source0 ( insn , src ) ; brw_set_math_message ( insn , msg_length , response_length , function , BRW_MATH_INTEGER_UNSIGNED , precision , saturate , BRW_MATH_DATA_VECTOR ) ; insn = brw_next_instruction ( p , BRW_OPCODE_SEND ) ; insn -> header . compression_control = BRW_COMPRESSION_2NDHALF ; insn -> header . destreg__conditonalmod = msg_reg_nr + 1 ; brw_instruction_set_destination ( insn , offset ( dest , 1 ) ) ; brw_instruction_set_source0 ( insn , src ) ; brw_set_math_message ( insn , msg_length , response_length , function , BRW_MATH_INTEGER_UNSIGNED , precision , saturate , BRW_MATH_DATA_VECTOR ) ; brw_pop_insn_state ( p ) ; }
Use 2 send instructions to invert 16 elements
Use 2 send instructions to invert 16 elements
/* First instruction:
    */ /* Second instruction:
    */