This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR43610, try reversing floating-point comparisons even if !FLOAT_LIB_COMPARE_RETURNS_BOOL


The patch looks big, but it is mostly moving code around and splitting an if statement into two. The bulk is

       if (code_to_optab[reversed]
-         && (libfunc = optab_libfunc (code_to_optab[reversed], mode))
-         && FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, reversed))
+         && (libfunc = optab_libfunc (code_to_optab[reversed], mode)))

...

if (comparison == UNORDERED
- || FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
- comparison = reversed_p ? EQ : NE;
+ || FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison)
+ || reversed_p)
+ *ptest = gen_rtx_fmt_ee (reversed_p ? EQ : NE, VOIDmode, target, false_rtx);
+ else
+ *ptest = gen_rtx_fmt_ee (comparison, VOIDmode, target, const0_rtx);


- *ptest = gen_rtx_fmt_ee (comparison, VOIDmode, target, const0_rtx);

Tested by the reporter. Ok for 4.5.1 and 4.6?

Thanks,

Paolo

Attachment: pr43610.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]