src/lima/pp_hir/pp_hir.h
//Returns the number of channels used for an argument
Returns the number of channels used for an argument
Returns the number of channels used for an argument
static inline unsigned lima_pp_hir_arg_size(lima_pp_hir_cmd_t* cmd, unsigned arg)
{
	if (cmd->op == lima_pp_hir_op_combine)
	{
		unsigned i, size = 0;
		for (i = 0; i < arg; i++)
		{
			if (cmd->src[i].constant)
				continue;
			lima_pp_hir_cmd_t* dep = (lima_pp_hir_cmd_t*) cmd->src[i].depend;
			size += dep->dst.reg.size + 1;
		}
		lima_pp_hir_cmd_t* dep = (lima_pp_hir_cmd_t*) cmd->src[arg].depend;
		unsigned arg_size = dep->dst.reg.size + 1;
		if (size + arg_size > cmd->dst.reg.size)
			return cmd->dst.reg.size + 1 - size;
		else
			return arg_size;
	}
	if (cmd->op != lima_pp_hir_op_phi &&
		lima_pp_hir_op[cmd->op].arg_sizes[arg] != 0)
		return lima_pp_hir_op[cmd->op].arg_sizes[arg];
	return cmd->dst.reg.size + 1;
}
static inline unsigned lima_pp_hir_arg_size ( lima_pp_hir_cmd_t * cmd , unsigned arg ) { if ( cmd -> op == lima_pp_hir_op_combine ) { unsigned i , size = 0 ; for ( i = 0 ; i < arg ; i ++ ) { if ( cmd -> src [ i ] . constant ) continue ; lima_pp_hir_cmd_t * dep = ( lima_pp_hir_cmd_t * ) cmd -> src [ i ] . depend ; size += dep -> dst . reg . size + 1 ; } lima_pp_hir_cmd_t * dep = ( lima_pp_hir_cmd_t * ) cmd -> src [ arg ] . depend ; unsigned arg_size = dep -> dst . reg . size + 1 ; if ( size + arg_size > cmd -> dst . reg . size ) return cmd -> dst . reg . size + 1 - size ; else return arg_size ; } if ( cmd -> op != lima_pp_hir_op_phi && lima_pp_hir_op [ cmd -> op ] . arg_sizes [ arg ] != 0 ) return lima_pp_hir_op [ cmd -> op ] . arg_sizes [ arg ] ; return cmd -> dst . reg . size + 1 ; }
Returns the number of channels used for an argument
Returns the number of channels used for an argument