Skip to content

intel/brw: Rework BRW_REGISTER_TYPE's representation

Kenneth Graunke requested to merge kwg/mesa:brw-reg-type into main

This is a small series that changes the representation of brw_reg_type (BRW_REGISTER_TYPE_*) to be easier and more efficient to work with. Rather than ad-hoc switch statements all over to calculate the size of a type, change a type to the same base but a different size, or change a type to the same size but a different base, you can now do all those things by simple and efficient bit-operations. It also shortens the name to BRW_TYPE_* (fewer letters!) and tidies the names of the helper functions.

There are some small improvements to compile time from this alone:

Borderlands 3: -1.21457% +/- 0.151606% (n = 24) Wolfenstein Youngblood: -1.06122% +/- 0.392175% (n = 24) Witcher 3: -1.00174% +/- 0.403434% (n = 24)

However, the main rationale is to clean things up and make certain operations easier. For example, taking the larger of two types can now be done by taking the MAX of both size bit expressions and using that, rather than ad-hoc switches.

Merge request reports