aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadopenembedded-core-contrib-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch
new file mode 100644
index 0000000000..fa21b26554
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-csl-arm/gcc_optab_arm.patch
@@ -0,0 +1,95 @@
+ARM is the only architecture that has a helper function that returns
+an unbiased result. This fix is trivial enough that we can show it
+doesn't effect any of the other arches. Can we consider this a
+regression fix since it used to work until the helper was added :}
+
+Tested with no regressions on x86_64-pc-linux-gnu and arm-none-eabi.
+
+Cheers,
+Carlos.
+--
+Carlos O'Donell
+CodeSourcery
+carlos@codesourcery.com
+(650) 331-3385 x716
+
+gcc/
+
+2006-01-27 Carlos O'Donell <carlos@codesourcery.com>
+
+ * optabs.c (prepare_cmp_insn): If unbaised and unsigned then bias
+ the comparison routine return.
+
+gcc/testsuite/
+
+2006-01-27 Carlos O'Donell <carlos@codesourcery.com>
+
+ * gcc.dg/unsigned-long-compare.c: New test.
+
+Index: gcc/optabs.c
+===================================================================
+--- 1/gcc/optabs.c (revision 110300)
++++ 2/gcc/optabs.c (working copy)
+@@ -3711,18 +3711,24 @@
+ result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST_MAKE_BLOCK,
+ word_mode, 2, x, mode, y, mode);
+
++ /* There are two kinds of comparison routines. Biased routines
++ return 0/1/2, and unbiased routines return -1/0/1. Other parts
++ of gcc expect that the comparison operation is equivalent
++ to the modified comparison. For signed comparisons compare the
++ result against 1 in the unbiased case, and zero in the biased
++ case. For unsigned comparisons always compare against 1 after
++ biasing the unbased result by adding 1. This gives us a way to
++ represent LTU. */
+ *px = result;
+ *pmode = word_mode;
+- if (TARGET_LIB_INT_CMP_BIASED)
+- /* Integer comparison returns a result that must be compared
+- against 1, so that even if we do an unsigned compare
+- afterward, there is still a value that can represent the
+- result "less than". */
+- *py = const1_rtx;
+- else
++ *py = const1_rtx;
++
++ if (!TARGET_LIB_INT_CMP_BIASED)
+ {
+- *py = const0_rtx;
+- *punsignedp = 1;
++ if (*punsignedp)
++ *px = plus_constant (result, 1);
++ else
++ *py = const0_rtx;
+ }
+ return;
+ }
+Index: gcc/testsuite/gcc.dg/unsigned-long-compare.c
+===================================================================
+--- 1/gcc/testsuite/gcc.dg/unsigned-long-compare.c (revision 0)
++++ 2/gcc/testsuite/gcc.dg/unsigned-long-compare.c (revision 0)
+@@ -0,0 +1,24 @@
++/* Copyright (C) 2006 Free Software Foundation, Inc. */
++/* Contributed by Carlos O'Donell on 2006-01-27 */
++
++/* Test a division corner case where the expression simplifies
++ to a comparison, and the optab expansion is wrong. The optab
++ expansion emits a function whose return is unbiased and needs
++ adjustment. */
++/* Origin: Carlos O'Donell <carlos@codesourcery.com> */
++/* { dg-do run { target arm-*-*eabi* } } */
++/* { dg-options "" } */
++#include <stdlib.h>
++
++#define BIG_CONSTANT 0xFFFFFFFF80000000ULL
++
++int main (void)
++{
++ unsigned long long OneULL = 1ULL;
++ unsigned long long result;
++
++ result = OneULL / BIG_CONSTANT;
++ if (result)
++ abort ();
++ exit (0);
++}