Commit 1de1f97f authored by Michael Beck's avatar Michael Beck
Browse files

added mode_honor_signed_zeros() function

[r5423]
parent bd584c8f
......@@ -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);
......
......@@ -433,4 +433,10 @@ ir_mode *find_signed_mode(const ir_mode *mode);
*/
ir_mode *find_double_bits_int_mode(const ir_mode *mode);
/**
* 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);
#endif /* _IRMODE_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment