From 09e0ebc7275793be6e3adaa85bd9a53ff06c43b4 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 21 Jun 2005 14:08:28 +0000 Subject: [PATCH] mode_wrap_around() added CVS--------------------------------------------------------------------- [r6075] --- ir/ir/irmode.c | 12 ++++++++++++ ir/ir/irmode.h | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/ir/ir/irmode.c b/ir/ir/irmode.c index d34f3ea5f..96c00291d 100644 --- a/ir/ir/irmode.c +++ b/ir/ir/irmode.c @@ -960,6 +960,18 @@ int mode_overflow_on_unary_Minus(const ir_mode *mode) return 1; } +/* + * Returns non-zero if the mode has a reversed wrap-aound + * logic, especially (a + x) - x == a. + * + * This is normally true for integer modes, not for floating + * point modes. + */ +int mode_wrap_around(const ir_mode *mode) { + /* FIXME: better would be an extra mode property */ + return mode_is_int(mode); +} + void finish_mode(void) { obstack_free(&modes, 0); diff --git a/ir/ir/irmode.h b/ir/ir/irmode.h index 42b566c06..9c973b72a 100644 --- a/ir/ir/irmode.h +++ b/ir/ir/irmode.h @@ -452,4 +452,12 @@ int mode_honor_signed_zeros(const ir_mode *mode); */ int mode_overflow_on_unary_Minus(const ir_mode *mode); +/** + * Returns non-zero if the mode has a reversed wrap-aound + * logic, especially (a + x) - x == a. + * This is normally true for integer modes, not for floating + * point modes. + */ +int mode_wrap_around(const ir_mode *mode); + #endif /* _IRMODE_H_ */ -- 2.20.1