Added API functions for checking types of signed and unsigned ints
authorSiddhi Tadpatrikar <siddhi@huey.fsl.cs.sunysb.edu>
Sat, 12 Feb 2011 00:18:53 +0000 (19:18 -0500)
committerSiddhi Tadpatrikar <siddhi@huey.fsl.cs.sunysb.edu>
Sat, 12 Feb 2011 00:18:53 +0000 (19:18 -0500)
src/aop-type.c
src/aop.h

index c9d2194d91addf4301e67052b37c8b59e623bc02..f88a6705c954eea0d5528c1c39889b285979adfc 100644 (file)
@@ -730,6 +730,25 @@ is_all_integer_type (const struct aop_type *type)
          && type->pointer_levels == 0 && type->size <= 0);
 }
 
+/* Returns true if the specified type is a "signed integer" which is 
+   NOT 128 bits integer */
+int
+aop_is_all_signed_subtype (const struct aop_type *type)
+{
+  return (type->kind == ATK_SIGNED_INT
+         && type->pointer_levels == 0 && type->size <= 8);
+}
+
+/* Returns true if the specified type is a "unsigned integer" which is 
+   NOT 128 bits integer */
+int
+aop_is_all_unsigned_subtype (const struct aop_type *type)
+{
+  return (type->kind == ATK_UNSIGNED_INT
+         && type->pointer_levels == 0 && type->size <= 8);
+}
+
+
 /* Returns true if specified type is an "all fp" type. */
 bool
 is_all_fp_type (const struct aop_type *type)
index 55ef3705da26b1dd2258344fafa6898b8ab71c74..a0d154900cb189f07bd096e45216692b35f5e5f2 100644 (file)
--- a/src/aop.h
+++ b/src/aop.h
@@ -209,6 +209,8 @@ extern const struct aop_type *aop_t_enum (const char *tag);
 extern const struct aop_type *aop_t_pointer_to (const struct aop_type *type);
 
 extern int aop_is_pointer_type (const struct aop_type *type);
+extern int aop_is_all_signed_integer_type (const struct aop_type *type);
+extern int aop_is_all_unsigned_integer_type (const struct aop_type *type);
 extern void aop_cast_to_all_pointer (struct aop_dynval *dv);
 
 extern const struct aop_type *aop_get_dynval_type (struct aop_dynval *dv);