Skip to content
Snippets Groups Projects
Commit b9ddb51c authored by Faith Ekstrand's avatar Faith Ekstrand :speech_balloon: Committed by Emil Velikov
Browse files

intel/eu/reg: Add a subscript() helper


This is similar to the identically named fs_reg helper.

Reviewed-by: default avatarIago Toral Quiroga <itoral@igalia.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 10e4feed)
parent d1060ba3
No related branches found
No related tags found
No related merge requests found
......@@ -896,6 +896,22 @@ spread(struct brw_reg reg, unsigned s)
}
}
/**
* Reinterpret each channel of register \p reg as a vector of values of the
* given smaller type and take the i-th subcomponent from each.
*/
static inline struct brw_reg
subscript(struct brw_reg reg, enum brw_reg_type type, unsigned i)
{
if (reg.file == IMM)
return reg;
unsigned scale = type_sz(reg.type) / type_sz(type);
assert(scale >= 1 && i < scale);
return suboffset(retype(spread(reg, scale), type), i);
}
static inline struct brw_reg
vec16(struct brw_reg reg)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment