gallivm: clarify unsigned vs. signed integer type construction
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_type.c
index 8270cd057f61c114c2f532d09d331f212194bac5..c327ba045a6c1b2271dedb8b7d8775be7818fb8b 100644 (file)
@@ -178,6 +178,25 @@ lp_build_int32_vec4_type(void)
 }
 
 
+/**
+ * Create unsigned integer type variation of given type.
+ */
+struct lp_type
+lp_uint_type(struct lp_type type)
+{
+   struct lp_type res_type;
+
+   memset(&res_type, 0, sizeof res_type);
+   res_type.width = type.width;
+   res_type.length = type.length;
+
+   return res_type;
+}
+
+
+/**
+ * Create signed integer type variation of given type.
+ */
 struct lp_type
 lp_int_type(struct lp_type type)
 {
@@ -186,6 +205,7 @@ lp_int_type(struct lp_type type)
    memset(&res_type, 0, sizeof res_type);
    res_type.width = type.width;
    res_type.length = type.length;
+   res_type.sign = 1;
 
    return res_type;
 }