mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
llvmpipe: Utility function to double the bit width of a type.
This commit is contained in:
parent
421507de06
commit
4458695bda
2 changed files with 28 additions and 5 deletions
|
|
@ -160,12 +160,31 @@ lp_build_int_vec_type(struct lp_type type)
|
|||
struct lp_type
|
||||
lp_int_type(struct lp_type type)
|
||||
{
|
||||
struct lp_type int_type;
|
||||
struct lp_type res_type;
|
||||
|
||||
memset(&int_type, 0, sizeof int_type);
|
||||
int_type.width = type.width;
|
||||
int_type.length = type.length;
|
||||
return int_type;
|
||||
memset(&res_type, 0, sizeof res_type);
|
||||
res_type.width = type.width;
|
||||
res_type.length = type.length;
|
||||
|
||||
return res_type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the type with twice the bit width (hence half the number of elements).
|
||||
*/
|
||||
struct lp_type
|
||||
lp_wider_type(struct lp_type type)
|
||||
{
|
||||
struct lp_type res_type;
|
||||
|
||||
memcpy(&res_type, &type, sizeof res_type);
|
||||
res_type.width *= 2;
|
||||
res_type.length /= 2;
|
||||
|
||||
assert(res_type.length);
|
||||
|
||||
return res_type;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -166,6 +166,10 @@ struct lp_type
|
|||
lp_int_type(struct lp_type type);
|
||||
|
||||
|
||||
struct lp_type
|
||||
lp_wider_type(struct lp_type type);
|
||||
|
||||
|
||||
void
|
||||
lp_build_context_init(struct lp_build_context *bld,
|
||||
LLVMBuilderRef builder,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue