Added is_Const
[libfirm] / ir / ir / irmode.c
index 95a6e55..d49b73f 100644 (file)
@@ -913,6 +913,20 @@ ir_mode *find_double_bits_int_mode(const ir_mode *mode) {
   return find_mode(&n);
 }
 
+/*
+ * Returns non-zero if the given mode honors signed zero's, i.e.,
+ * a +0 and a -0 exists and handled differently.
+ */
+int mode_honor_signed_zeros(const ir_mode *mode)
+{
+  /* for floating point, we know that IEEE 754 has +0 and -0,
+   * but always handles it identical.
+   */
+  if (mode->sort == irms_float_number)
+    return mode->arithmetic == irma_ieee754 ? 0 : 1;
+  return 0;
+}
+
 void finish_mode(void) {
   obstack_free(&modes, 0);