Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: gcc/libgfortran/m4/minloc0.m4

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/libgfortran/m4/maxval.m4 ('k') | gcc/libgfortran/m4/minloc1.m4 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/libgfortran/m4/minloc0.m4
diff --git a/gcc/libgfortran/m4/minloc0.m4 b/gcc/libgfortran/m4/minloc0.m4
index 45b6e90880a648d2568738a3e36553a4ac4acd53..1345f2df472ef8896a81eeb87663e4478edee83a 100644
--- a/gcc/libgfortran/m4/minloc0.m4
+++ b/gcc/libgfortran/m4/minloc0.m4
@@ -34,28 +34,93 @@ include(iforeach.m4)dnl
`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
FOREACH_FUNCTION(
-` atype_name minval;
+` atype_name minval;
+#if defined('atype_nan`)
+ int fast = 0;
+#endif
- minval = atype_max;'
-,
-` if (*base < minval || !dest[0])
- {
- minval = *base;
- for (n = 0; n < rank; n++)
- dest[n * dstride] = count[n] + 1;
- }')
+#if defined('atype_inf`)
+ minval = atype_inf;
+#else
+ minval = atype_max;
+#endif',
+`#if defined('atype_nan`)
+ }
+ while (0);
+ if (unlikely (!fast))
+ {
+ do
+ {
+ if (*base <= minval)
+ {
+ fast = 1;
+ minval = *base;
+ for (n = 0; n < rank; n++)
+ dest[n * dstride] = count[n] + 1;
+ break;
+ }
+ base += sstride[0];
+ }
+ while (++count[0] != extent[0]);
+ if (likely (fast))
+ continue;
+ }
+ else do
+ {
+#endif
+ if (*base < minval)
+ {
+ minval = *base;
+ for (n = 0; n < rank; n++)
+ dest[n * dstride] = count[n] + 1;
+ }')
MASKED_FOREACH_FUNCTION(
` atype_name minval;
+ int fast = 0;
- minval = atype_max;'
-,
-` if (*mbase && (*base < minval || !dest[0]))
- {
- minval = *base;
- for (n = 0; n < rank; n++)
- dest[n * dstride] = count[n] + 1;
- }')
+#if defined('atype_inf`)
+ minval = atype_inf;
+#else
+ minval = atype_max;
+#endif',
+` }
+ while (0);
+ if (unlikely (!fast))
+ {
+ do
+ {
+ if (*mbase)
+ {
+#if defined('atype_nan`)
+ if (unlikely (dest[0] == 0))
+ for (n = 0; n < rank; n++)
+ dest[n * dstride] = count[n] + 1;
+ if (*base <= minval)
+#endif
+ {
+ fast = 1;
+ minval = *base;
+ for (n = 0; n < rank; n++)
+ dest[n * dstride] = count[n] + 1;
+ break;
+ }
+ }
+ base += sstride[0];
+ mbase += mstride[0];
+ }
+ while (++count[0] != extent[0]);
+ if (likely (fast))
+ continue;
+ }
+ else do
+ {
+ if (*mbase && *base < minval)
+ {
+ minval = *base;
+ for (n = 0; n < rank; n++)
+ dest[n * dstride] = count[n] + 1;
+ }')
SCALAR_FOREACH_FUNCTION(`0')
#endif
« no previous file with comments | « gcc/libgfortran/m4/maxval.m4 ('k') | gcc/libgfortran/m4/minloc1.m4 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698