summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2013-11-23 12:08:00 -0800
committerFrancisco Jerez <[email protected]>2014-02-19 16:56:57 +0100
commit51b00c5cb9383e59a04431356e3b3605801d13e3 (patch)
tree25bd6b32386a44f44ca6e63a0c2bdb9a8853151c /src/mesa/drivers/dri
parent560f10e573e74854c0313091a5d032700d58a2f1 (diff)
i965: Add helper function to find out the signedness of a register type.
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_reg.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
index 143c5ceabec..f497366b444 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -182,6 +182,34 @@ type_sz(unsigned type)
}
}
+static inline bool
+type_is_signed(unsigned type)
+{
+ switch(type) {
+ case BRW_REGISTER_TYPE_D:
+ case BRW_REGISTER_TYPE_W:
+ case BRW_REGISTER_TYPE_F:
+ case BRW_REGISTER_TYPE_B:
+ case BRW_REGISTER_TYPE_V:
+ case BRW_REGISTER_TYPE_VF:
+ case BRW_REGISTER_TYPE_DF:
+ case BRW_REGISTER_TYPE_HF:
+ case BRW_REGISTER_TYPE_Q:
+ return true;
+
+ case BRW_REGISTER_TYPE_UD:
+ case BRW_REGISTER_TYPE_UW:
+ case BRW_REGISTER_TYPE_UB:
+ case BRW_REGISTER_TYPE_UV:
+ case BRW_REGISTER_TYPE_UQ:
+ return false;
+
+ default:
+ assert(!"Unreachable.");
+ return false;
+ }
+}
+
/**
* Construct a brw_reg.
* \param file one of the BRW_x_REGISTER_FILE values