* [PATCH] ARM fixed-point support [1/6]: comparison optab biasing
@ 2011-05-13 14:26 Julian Brown
2011-06-30 13:27 ` Richard Earnshaw
0 siblings, 1 reply; 2+ messages in thread
From: Julian Brown @ 2011-05-13 14:26 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 865 bytes --]
As per Joseph's suggestion here:
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00846.html
I am re-posting machine-independent parts of my ARM fixed-point support
patches, with explanations as to why each part is necessary.
This is the first: on ARM, TARGET_LIB_INT_CMP_BIASED is false for
TARGET_BPABI targets (i.e. most currently-interesting cases --
EABI comparison helper functions return -1/0/1 for lt/eq/gt rather than
0/1/2). However the fixed-point helper library uses biased comparisons
unconditionally. So, this patch just makes comparisons between
fixed-point quantities use the biasing rather than not. (Grepping
config/, in practice, this will only affect ARM.)
Tested in a series with other fixed-point patches. OK to apply?
Julian
ChangeLog
gcc/
* optabs.c (prepare_cmp_insn): Use correct biasing for fixed-point
comparison helpers.
[-- Attachment #2: fixed-point-optab-biasing-2.diff --]
[-- Type: text/x-patch, Size: 919 bytes --]
commit 12efebd5f56358c2d194659570ad05e089bbaaf3
Author: Julian Brown <julian@henry8.codesourcery.com>
Date: Fri May 13 05:42:15 2011 -0700
Correct biasing for fixed-point optabs.
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 62e123b..a1b85b8 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3930,11 +3930,13 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
result against 1 in the biased case, and zero in the unbiased
case. For unsigned comparisons always compare against 1 after
biasing the unbiased result by adding 1. This gives us a way to
- represent LTU. */
+ represent LTU.
+ The comparisons in the fixed-point helper library are always
+ biased. */
x = result;
y = const1_rtx;
- if (!TARGET_LIB_INT_CMP_BIASED)
+ if (!TARGET_LIB_INT_CMP_BIASED && !ALL_FIXED_POINT_MODE_P (mode))
{
if (unsignedp)
x = plus_constant (result, 1);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM fixed-point support [1/6]: comparison optab biasing
2011-05-13 14:26 [PATCH] ARM fixed-point support [1/6]: comparison optab biasing Julian Brown
@ 2011-06-30 13:27 ` Richard Earnshaw
0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2011-06-30 13:27 UTC (permalink / raw)
To: Julian Brown; +Cc: gcc-patches
On 13/05/11 14:57, Julian Brown wrote:
> As per Joseph's suggestion here:
>
> http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00846.html
>
> I am re-posting machine-independent parts of my ARM fixed-point support
> patches, with explanations as to why each part is necessary.
>
> This is the first: on ARM, TARGET_LIB_INT_CMP_BIASED is false for
> TARGET_BPABI targets (i.e. most currently-interesting cases --
> EABI comparison helper functions return -1/0/1 for lt/eq/gt rather than
> 0/1/2). However the fixed-point helper library uses biased comparisons
> unconditionally. So, this patch just makes comparisons between
> fixed-point quantities use the biasing rather than not. (Grepping
> config/, in practice, this will only affect ARM.)
>
> Tested in a series with other fixed-point patches. OK to apply?
>
> Julian
>
> ChangeLog
>
> gcc/
> * optabs.c (prepare_cmp_insn): Use correct biasing for fixed-point
> comparison helpers.
>
OK.
R.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-30 13:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-13 14:26 [PATCH] ARM fixed-point support [1/6]: comparison optab biasing Julian Brown
2011-06-30 13:27 ` Richard Earnshaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).