aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao-ying Fu <fu@mips.com>2007-06-23 00:57:47 +0000
committerChao-ying Fu <fu@mips.com>2007-06-23 00:57:47 +0000
commit9fe33fbe801b30baadf51a372c37907cbdedd762 (patch)
tree975da5139d0ca7ba65227df54562d05605b85ffd
parentce83d70188b2e44cb59753dcf9c26ad51876c83d (diff)
* doc/c-tree.texi (FIXED_CST): Remove spaces.
* c-lex.c (interpret_fixed): Add one empty line after the comment. * optabs.c (expand_fixed_convert): Remove spaces. * tree.c (fixed_zerop): Add parentheses. (make_or_reuse_fract_type, make_or_reuse_accum_type): Add comments. * fold-const.c (fixed-value.h): Add include. * c-cppbuiltin.c (builtin_define_fixed_point_constants): Update comments and remove spaces. (c_cpp_builtins): Remove spaces. * df-scan.c (df_uses_record): Support CONST_FIXED. * double-int.c (double_int_scmp): Use explicit casts of unsigned HOST_WIDE_INT. * rtl.def (FRACT_CONVERT, SAT_FRACT): Remove spaces. * c-tree.h (c_typespec_keyword): Update comments. * machmode.def: Update spaces to tab. * expr.c (convert_move): Remove spaces. * stor-layout.c (make_fract_type, make_accum_type): Update comments. * c-typeck.c (c_common_type): Remove spaces. * genmodes.c (make_fixed_point_mode, emit_mode_ibit, emit_mode_fbit): Add comments. * emit-rtl.c (const_fixed_htab_hash): Add one empty line after comment. (const_fixed_htab_eq): Update comments and remove spaces. (lookup_const_fixed, const_fixed_from_fixed_value): Add one empty line after comments. (init_emit_once): Update comments. Delete the initialization of fconst1 for FRACT and UFRACT. * simplify-rtx.c (simplify_immed_subreg): Remove spaces. * fixed-value.c: Update copyright year. (check_real_for_fixed_mode, do_fixed_neg, fixed_convert): Remove spaces. * fixed-value.h: Update copyright year. Remove spaces. * c-common.c (fixed-value.h): New include. (overflow_warning, warnings_for_convert_and_check): Remove spaces. * c-parser.c (c_parser_declspecs): Update ref to n1169.pdf. * tree-ssa-reassoc.c (break_up_subtract_bb, reassociate_bb): Update comment.s * config/fixed-bit.c (SATFRACT): Remove spaces. * config/fixed-bit.h: Remove spaces. * convert.c (convert_to_fixed): Remove spaces. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/fixed-point@125966 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog41
-rw-r--r--gcc/c-common.c5
-rw-r--r--gcc/c-cppbuiltin.c9
-rw-r--r--gcc/c-lex.c1
-rw-r--r--gcc/c-parser.c2
-rw-r--r--gcc/c-tree.h2
-rw-r--r--gcc/c-typeck.c6
-rw-r--r--gcc/config/fixed-bit.c2
-rw-r--r--gcc/config/fixed-bit.h2
-rw-r--r--gcc/convert.c4
-rw-r--r--gcc/df-scan.c1
-rw-r--r--gcc/doc/c-tree.texi2
-rw-r--r--gcc/double-int.c4
-rw-r--r--gcc/emit-rtl.c39
-rw-r--r--gcc/expr.c4
-rw-r--r--gcc/fixed-value.c14
-rw-r--r--gcc/fixed-value.h10
-rw-r--r--gcc/fold-const.c1
-rw-r--r--gcc/genmodes.c7
-rw-r--r--gcc/machmode.def10
-rw-r--r--gcc/optabs.c2
-rw-r--r--gcc/rtl.def8
-rw-r--r--gcc/simplify-rtx.c4
-rw-r--r--gcc/stor-layout.c6
-rw-r--r--gcc/tree-ssa-reassoc.c8
-rw-r--r--gcc/tree.c8
26 files changed, 120 insertions, 82 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6f5ec972834..67247fe9efb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,44 @@
+2007-06-22 Chao-ying Fu <fu@mips.com>
+
+ * doc/c-tree.texi (FIXED_CST): Remove spaces.
+ * c-lex.c (interpret_fixed): Add one empty line after the comment.
+ * optabs.c (expand_fixed_convert): Remove spaces.
+ * tree.c (fixed_zerop): Add parentheses.
+ (make_or_reuse_fract_type, make_or_reuse_accum_type): Add comments.
+ * fold-const.c (fixed-value.h): Add include.
+ * c-cppbuiltin.c (builtin_define_fixed_point_constants): Update
+ comments and remove spaces.
+ (c_cpp_builtins): Remove spaces.
+ * df-scan.c (df_uses_record): Support CONST_FIXED.
+ * double-int.c (double_int_scmp): Use explicit casts of
+ unsigned HOST_WIDE_INT.
+ * rtl.def (FRACT_CONVERT, SAT_FRACT): Remove spaces.
+ * c-tree.h (c_typespec_keyword): Update comments.
+ * machmode.def: Update spaces to tab.
+ * expr.c (convert_move): Remove spaces.
+ * stor-layout.c (make_fract_type, make_accum_type): Update comments.
+ * c-typeck.c (c_common_type): Remove spaces.
+ * genmodes.c (make_fixed_point_mode, emit_mode_ibit, emit_mode_fbit):
+ Add comments.
+ * emit-rtl.c (const_fixed_htab_hash): Add one empty line after comment.
+ (const_fixed_htab_eq): Update comments and remove spaces.
+ (lookup_const_fixed, const_fixed_from_fixed_value): Add one empty
+ line after comments.
+ (init_emit_once): Update comments. Delete the initialization of
+ fconst1 for FRACT and UFRACT.
+ * simplify-rtx.c (simplify_immed_subreg): Remove spaces.
+ * fixed-value.c: Update copyright year.
+ (check_real_for_fixed_mode, do_fixed_neg, fixed_convert): Remove spaces.
+ * fixed-value.h: Update copyright year. Remove spaces.
+ * c-common.c (fixed-value.h): New include.
+ (overflow_warning, warnings_for_convert_and_check): Remove spaces.
+ * c-parser.c (c_parser_declspecs): Update ref to n1169.pdf.
+ * tree-ssa-reassoc.c (break_up_subtract_bb, reassociate_bb): Update
+ comment.s
+ * config/fixed-bit.c (SATFRACT): Remove spaces.
+ * config/fixed-bit.h: Remove spaces.
+ * convert.c (convert_to_fixed): Remove spaces.
+
2007-06-21 Adam Nemet <anemet@caviumnetworks.com>
* fold-const.c (debug_fold_checksum): Move it under
diff --git a/gcc/c-common.c b/gcc/c-common.c
index fad926ab676..be7891022f9 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -49,6 +49,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "real.h"
#include "cgraph.h"
#include "target-def.h"
+#include "fixed-value.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
@@ -963,7 +964,7 @@ overflow_warning (tree value)
case FIXED_CST:
warning (OPT_Woverflow, "fixed-point overflow in expression");
break;
-
+
case VECTOR_CST:
warning (OPT_Woverflow, "vector overflow in expression");
break;
@@ -1362,7 +1363,7 @@ warnings_for_convert_and_check (tree type, tree expr, tree result)
conversion_warning (type, expr);
}
else if ((TREE_CODE (result) == INTEGER_CST
- || TREE_CODE (result) == FIXED_CST) && TREE_OVERFLOW (result))
+ || TREE_CODE (result) == FIXED_CST) && TREE_OVERFLOW (result))
warning (OPT_Woverflow,
"overflow in implicit constant conversion");
else
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 7af64f091b7..7de8f07183d 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -341,10 +341,11 @@ builtin_define_decimal_float_constants (const char *name_prefix,
builtin_define_with_value (name, buf, 0);
}
-/* Define fixed-point constants for TYPE using NAME_PREFIX and SUFFIX. */
+/* Define fixed-point constants for TYPE using NAME_PREFIX and SUFFIX. */
+
static void
-builtin_define_fixed_point_constants (const char *name_prefix,
- const char *suffix,
+builtin_define_fixed_point_constants (const char *name_prefix,
+ const char *suffix,
tree type)
{
char name[64], buf[256], *new_buf;
@@ -542,7 +543,7 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_decimal_float_constants ("DEC64", "DD", dfloat64_type_node);
builtin_define_decimal_float_constants ("DEC128", "DL", dfloat128_type_node);
- /* For fixed-point fibt, ibit, max, min, and epsilon. */
+ /* For fixed-point fibt, ibit, max, min, and epsilon. */
if (targetm.fixed_point_supported_p ())
{
builtin_define_fixed_point_constants ("SFRACT", "HR",
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index f473ad4b77c..80f37a71c30 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -714,6 +714,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
/* Interpret TOKEN, a fixed-point number with FLAGS as classified
by cpplib. */
+
static tree
interpret_fixed (const cpp_token *token, unsigned int flags)
{
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 3455ccfcf78..20bc49117c3 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1513,7 +1513,7 @@ c_parser_asm_definition (c_parser *parser)
_Sat
(_Fract, _Accum, and _Sat are new from ISO/IEC DTR 18037:
- http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1021.pdf)
+ http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf)
Objective-C:
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index fbe3d789a73..dd0702d9e9d 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -203,7 +203,7 @@ enum c_storage_class {
};
/* A type specifier keyword "void", "_Bool", "char", "int", "float",
- "double", or none of these. */
+ "double", "_Fract", "_Accum", or none of these. */
enum c_typespec_keyword {
cts_none,
cts_void,
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 680cf994057..774050c9c3c 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -703,7 +703,7 @@ c_common_type (tree t1, tree t2)
fixed-point type.
Otherwise, the result type is signed. */
if ((TYPE_UNSIGNED (t1) && TYPE_UNSIGNED (t2)
- && code1 == FIXED_POINT_TYPE && code2 == FIXED_POINT_TYPE)
+ && code1 == FIXED_POINT_TYPE && code2 == FIXED_POINT_TYPE)
|| (code1 == FIXED_POINT_TYPE && code2 != FIXED_POINT_TYPE
&& TYPE_UNSIGNED (t1))
|| (code1 != FIXED_POINT_TYPE && code2 == FIXED_POINT_TYPE
@@ -737,7 +737,7 @@ c_common_type (tree t1, tree t2)
error ("machine mode is wrong");
m2 = mode_for_size (GET_MODE_PRECISION (m2), mclass, 0);
}
- }
+ }
if (code1 == FIXED_POINT_TYPE)
{
@@ -753,7 +753,7 @@ c_common_type (tree t1, tree t2)
if (code2 == FIXED_POINT_TYPE)
{
- fbit2 = GET_MODE_FBIT (m2);
+ fbit2 = GET_MODE_FBIT (m2);
ibit2 = GET_MODE_IBIT (m2);
}
else
diff --git a/gcc/config/fixed-bit.c b/gcc/config/fixed-bit.c
index cb0c95b5a41..d6246fee29b 100644
--- a/gcc/config/fixed-bit.c
+++ b/gcc/config/fixed-bit.c
@@ -800,7 +800,7 @@ SATFRACT (FROM_FIXED_C_TYPE a)
utemp = utemp >> (BIG_WIDTH - shift_amount);
high = ((BIG_UINT_C_TYPE)(high << shift_amount)) | utemp;
low = low << shift_amount;
-#elif TO_FBITS < FROM_FBITS /* Right shift. */
+#elif TO_FBITS < FROM_FBITS /* Right shift. */
shift_amount = FROM_FBITS - TO_FBITS;
low = low >> shift_amount;
#endif
diff --git a/gcc/config/fixed-bit.h b/gcc/config/fixed-bit.h
index 2717bbc0fd8..8b3cb610547 100644
--- a/gcc/config/fixed-bit.h
+++ b/gcc/config/fixed-bit.h
@@ -1194,7 +1194,7 @@ extern FIXED_C_TYPE FIXED_USASHL (FIXED_C_TYPE, word_type);
/* Different modes: don't append '2' to conversion function names */
#define FRACT FRACT_TEMP(FROM_MODE_NAME_S,TO_MODE_NAME_S)
#define SATFRACT SATFRACT_TEMP(FROM_MODE_NAME_S,TO_MODE_NAME_S)
-#endif
+#endif
extern TO_FIXED_C_TYPE FRACT (FROM_FIXED_C_TYPE);
extern TO_FIXED_C_TYPE SATFRACT (FROM_FIXED_C_TYPE);
diff --git a/gcc/convert.c b/gcc/convert.c
index a00adf68231..ce0ad4478ff 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -827,13 +827,13 @@ convert_to_fixed (tree type, tree expr)
if (expr == integer_zero_node)
{
tree fixed_zero_node = build_fixed (type, fconst0[TYPE_MODE (type)]);
- return fixed_zero_node;
+ return fixed_zero_node;
}
else if (expr == integer_one_node
&& ALL_SCALAR_ACCUM_MODE_P (TYPE_MODE (type)))
{
tree fixed_one_node = build_fixed (type, fconst1[TYPE_MODE (type)]);
- return fixed_one_node;
+ return fixed_one_node;
}
switch (TREE_CODE (TREE_TYPE (expr)))
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 97ce8aad162..17c22721ead 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2836,6 +2836,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
case CONST_INT:
case CONST:
case CONST_DOUBLE:
+ case CONST_FIXED:
case CONST_VECTOR:
case PC:
case CC0:
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi
index 9b6c11077a9..a53329a7a6b 100644
--- a/gcc/doc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -2101,7 +2101,7 @@ comparisons, and so forth.
These nodes represent fixed-point constants. The type of these constants
is obtained with @code{TREE_TYPE}. @code{TREE_FIXED_CST_PTR} points to
to struct fixed_value; @code{TREE_FIXED_CST} returns the structure itself.
-Struct fixed_value contains @code{data} with the size of two
+Struct fixed_value contains @code{data} with the size of two
HOST_BITS_PER_WIDE_INT and @code{mode} as the associated fixed-point
machine mode for @code{data}.
diff --git a/gcc/double-int.c b/gcc/double-int.c
index cc5c568b124..731f2e2f3f0 100644
--- a/gcc/double-int.c
+++ b/gcc/double-int.c
@@ -363,9 +363,9 @@ double_int_scmp (double_int a, double_int b)
return -1;
if (a.high > b.high)
return 1;
- if (a.low < b.low)
+ if ((unsigned HOST_WIDE_INT) a.low < (unsigned HOST_WIDE_INT) b.low)
return -1;
- if (a.low > b.low)
+ if ((unsigned HOST_WIDE_INT) a.low > (unsigned HOST_WIDE_INT) b.low)
return 1;
return 0;
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 4fe59a94afa..5a2d3d1410c 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -256,6 +256,7 @@ const_double_htab_eq (const void *x, const void *y)
}
/* Returns a hash code for X (which is really a CONST_FIXED). */
+
static hashval_t
const_fixed_htab_hash (const void *x)
{
@@ -269,7 +270,8 @@ const_fixed_htab_hash (const void *x)
}
/* Returns nonzero if the value represented by X (really a ...)
- is the same as that represented by Y (really a ...) */
+ is the same as that represented by Y (really a ...). */
+
static int
const_fixed_htab_eq (const void *x, const void *y)
{
@@ -277,8 +279,7 @@ const_fixed_htab_eq (const void *x, const void *y)
if (GET_MODE (a) != GET_MODE (b))
return 0;
- return fixed_identical (CONST_FIXED_VALUE (a),
- CONST_FIXED_VALUE (b));
+ return fixed_identical (CONST_FIXED_VALUE (a), CONST_FIXED_VALUE (b));
}
/* Returns a hash code for X (which is a really a mem_attrs *). */
@@ -489,6 +490,7 @@ const_double_from_real_value (REAL_VALUE_TYPE value, enum machine_mode mode)
/* Determine whether FIXED, a CONST_FIXED, already exists in the
hash table. If so, return its counterpart; otherwise add it
to the hash table and return it. */
+
static rtx
lookup_const_fixed (rtx fixed)
{
@@ -499,9 +501,9 @@ lookup_const_fixed (rtx fixed)
return (rtx) *slot;
}
-
/* Return a CONST_FIXED rtx for a fixed-point value specified by
VALUE in mode MODE. */
+
rtx
const_fixed_from_fixed_value (FIXED_VALUE_TYPE value, enum machine_mode mode)
{
@@ -5144,7 +5146,7 @@ init_emit_once (int line_numbers)
/* We need reg_raw_mode, so initialize the modes now. */
init_reg_modes_once ();
- /* Initialize the CONST_INT, CONST_DOUBLE, CONST_FIXED and memory attribute
+ /* Initialize the CONST_INT, CONST_DOUBLE, CONST_FIXED, and memory attribute
hash tables. */
const_int_htab = htab_create_ggc (37, const_int_htab_hash,
const_int_htab_eq, NULL);
@@ -5312,26 +5314,11 @@ init_emit_once (int line_numbers)
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
{
- double_int temp;
fconst0[mode].data.high = 0;
fconst0[mode].data.low = 0;
fconst0[mode].mode = mode;
const_tiny_rtx[0][(int) mode] = CONST_FIXED_FROM_FIXED_VALUE (
fconst0[mode], mode);
- /* We store the maximum value close to the value 1. */
- fconst1[mode].data.high = 0;
- fconst1[mode].data.low = 0;
- fconst1[mode].mode = mode;
- lshift_double (1, 0, GET_MODE_FBIT (mode),
- 2 * HOST_BITS_PER_WIDE_INT,
- &fconst1[mode].data.low, &fconst1[mode].data.high,
- SIGNED_FIXED_POINT_MODE_P (mode));
- temp.low = 1;
- temp.high = 0;
- fconst1[mode].data = double_int_add (fconst1[mode].data,
- double_int_neg (temp));
- const_tiny_rtx[1][(int) mode] = CONST_FIXED_FROM_FIXED_VALUE (
- fconst1[mode], mode);
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_UFRACT);
@@ -5343,14 +5330,6 @@ init_emit_once (int line_numbers)
fconst0[mode].mode = mode;
const_tiny_rtx[0][(int) mode] = CONST_FIXED_FROM_FIXED_VALUE (
fconst0[mode], mode);
- /* We store the maximum value close to the value 1. */
- fconst1[mode].mode = mode;
- fconst1[mode].data.high = -1;
- fconst1[mode].data.low = -1;
- fconst1[mode].data = double_int_ext (fconst1[mode].data,
- GET_MODE_FBIT (mode), 1);
- const_tiny_rtx[1][(int) mode] = CONST_FIXED_FROM_FIXED_VALUE (
- fconst1[mode], mode);
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_ACCUM);
@@ -5362,6 +5341,7 @@ init_emit_once (int line_numbers)
fconst0[mode].mode = mode;
const_tiny_rtx[0][(int) mode] = CONST_FIXED_FROM_FIXED_VALUE (
fconst0[mode], mode);
+
/* We store the value 1. */
fconst1[mode].data.high = 0;
fconst1[mode].data.low = 0;
@@ -5383,6 +5363,7 @@ init_emit_once (int line_numbers)
fconst0[mode].mode = mode;
const_tiny_rtx[0][(int) mode] = CONST_FIXED_FROM_FIXED_VALUE (
fconst0[mode], mode);
+
/* We store the value 1. */
fconst1[mode].data.high = 0;
fconst1[mode].data.low = 0;
@@ -5400,7 +5381,6 @@ init_emit_once (int line_numbers)
mode = GET_MODE_WIDER_MODE (mode))
{
const_tiny_rtx[0][(int) mode] = gen_const_vector (mode, 0);
- const_tiny_rtx[1][(int) mode] = gen_const_vector (mode, 1);
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_UFRACT);
@@ -5408,7 +5388,6 @@ init_emit_once (int line_numbers)
mode = GET_MODE_WIDER_MODE (mode))
{
const_tiny_rtx[0][(int) mode] = gen_const_vector (mode, 0);
- const_tiny_rtx[1][(int) mode] = gen_const_vector (mode, 1);
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_ACCUM);
diff --git a/gcc/expr.c b/gcc/expr.c
index 89bd5b6c155..d3d746bd189 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -340,7 +340,7 @@ init_expr (void)
}
/* Copy data from FROM to TO, where the machine modes are not the same.
- Both modes may be integer, or both may be floating, or both may be
+ Both modes may be integer, or both may be floating, or both may be
fixed-point.
UNSIGNEDP should be nonzero if FROM is an unsigned type.
This causes zero-extension instead of sign-extension. */
@@ -497,7 +497,7 @@ convert_move (rtx to, rtx from, int unsignedp)
}
/* Make sure both are fixed-point modes or both are not. */
- gcc_assert (ALL_SCALAR_FIXED_POINT_MODE_P (from_mode) ==
+ gcc_assert (ALL_SCALAR_FIXED_POINT_MODE_P (from_mode) ==
ALL_SCALAR_FIXED_POINT_MODE_P (to_mode));
if (ALL_SCALAR_FIXED_POINT_MODE_P (from_mode))
{
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c
index 4adbe59d767..646ea365a66 100644
--- a/gcc/fixed-value.c
+++ b/gcc/fixed-value.c
@@ -1,5 +1,5 @@
/* Fixed-point arithmetic support.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
@@ -85,12 +85,12 @@ check_real_for_fixed_mode (REAL_VALUE_TYPE *real_value, unsigned int mode)
real_from_string (&min_value, "0.0");
if (real_compare (LT_EXPR, real_value, &min_value))
- return 1;
+ return 1;
if (real_compare (EQ_EXPR, real_value, &max_value))
- return 3;
+ return 3;
real_arithmetic (&max_value, MINUS_EXPR, &max_value, &epsilon_value);
if (real_compare (GT_EXPR, real_value, &max_value))
- return 2;
+ return 2;
return 0;
}
@@ -707,7 +707,7 @@ do_fixed_neg (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a, int satp)
{
if (!(f->data.high == 0 && f->data.low == 0)
&& f->data.high == a->data.high && f->data.low == a->data.low )
- {
+ {
if (satp)
{
/* Saturate to the maximum by subtracting f->data by one. */
@@ -823,7 +823,7 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
*f = *a;
return overflow;
}
-
+
if (GET_MODE_FBIT (mode) > GET_MODE_FBIT (a->mode))
{
/* Left shift a to temp_high, temp_low based on a->mode. */
@@ -865,7 +865,7 @@ fixed_convert (FIXED_VALUE_TYPE *f, enum machine_mode mode,
else
overflow = true;
}
- else
+ else
overflow = fixed_saturate2 (f->mode, temp_high, temp_low,
&f->data, satp);
}
diff --git a/gcc/fixed-value.h b/gcc/fixed-value.h
index 734c65e7e6a..dc3d3c2cf6f 100644
--- a/gcc/fixed-value.h
+++ b/gcc/fixed-value.h
@@ -1,18 +1,18 @@
/* Fixed-point arithmetic support.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+
This file is part of GCC.
-
+
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
-
+
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4c4fedbd236..d22e9c447b3 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -55,6 +55,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "flags.h"
#include "tree.h"
#include "real.h"
+#include "fixed-value.h"
#include "rtl.h"
#include "expr.h"
#include "tm_p.h"
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 21cc98ba9f6..0a2e6f3c877 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -565,6 +565,9 @@ make_int_mode (const char *name,
#define UACCUM_MODE(N, Y, I, F) \
make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, __LINE__)
+/* Create a fixed-point mode by setting CL, NAME, BYTESIZE, IBIT, FBIT,
+ FILE, and LINE. */
+
static void
make_fixed_point_mode (enum mode_class cl,
const char *name,
@@ -1302,6 +1305,8 @@ emit_mode_adjustments (void)
puts ("}");
}
+/* Emit ibit for all modes. */
+
static void
emit_mode_ibit (void)
{
@@ -1318,6 +1323,8 @@ emit_mode_ibit (void)
print_closer ();
}
+/* Emit fbit for all modes. */
+
static void
emit_mode_fbit (void)
{
diff --git a/gcc/machmode.def b/gcc/machmode.def
index f4eca617829..51d6980579e 100644
--- a/gcc/machmode.def
+++ b/gcc/machmode.def
@@ -97,20 +97,20 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
floating point format FORMAT.
FRACT_MODE (MODE, BYTESIZE, FBIT);
- declares MODE to be of class FRACT and BYTESIZE bytes wide
+ declares MODE to be of class FRACT and BYTESIZE bytes wide
with FBIT fractional bits. There may be padding bits.
UFRACT_MODE (MODE, BYTESIZE, FBIT);
- declares MODE to be of class UFRACT and BYTESIZE bytes wide
+ declares MODE to be of class UFRACT and BYTESIZE bytes wide
with FBIT fractional bits. There may be padding bits.
ACCUM_MODE (MODE, BYTESIZE, IBIT, FBIT);
- declares MODE to be of class ACCUM and BYTESIZE bytes wide
+ declares MODE to be of class ACCUM and BYTESIZE bytes wide
with IBIT integral bits and FBIT fractional bits.
There may be padding bits.
UACCUM_MODE (MODE, BYTESIZE, FBIT);
- declares MODE to be of class UACCUM and BYTESIZE bytes wide
+ declares MODE to be of class UACCUM and BYTESIZE bytes wide
with IBIT integral bits and FBIT fractional bits.
There may be padding bits.
@@ -153,7 +153,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
ADJUST_FLOAT_FORMAT (MODE, EXPR);
ADJUST_IBIT (MODE, EXPR);
ADJUST_FBIT (MODE, EXPR);
- Arrange for the byte size, alignment, floating point format, ibit,
+ Arrange for the byte size, alignment, floating point format, ibit,
or fbit of MODE to be adjustable at run time. EXPR will be executed
once after processing all command line options, and should
evaluate to the desired byte size, alignment, format, ibit or fbit.
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 83dc278b8a2..b37a96b96c6 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5095,7 +5095,7 @@ expand_fixed_convert (rtx to, rtx from, int uintp, int satp)
1, from, from_mode);
insns = get_insns ();
end_sequence ();
-
+
emit_libcall_block (insns, to, value,
gen_rtx_fmt_e (tab->code, to_mode, from));
}
diff --git a/gcc/rtl.def b/gcc/rtl.def
index de48c8c232b..08c031e3fea 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -577,10 +577,10 @@ DEF_RTL_EXPR(UNSIGNED_FIX, "unsigned_fix", "e", RTX_UNARY)
/* Conversions involving fractional fixed-point types without saturation,
including:
- fractional to fractional (of different precision),
+ fractional to fractional (of different precision),
signed integer to fractional,
fractional to signed integer,
- floating point to fractional,
+ floating point to fractional,
fractional to floating point.
NOTE: fractional can be either signed or unsigned for conversions. */
DEF_RTL_EXPR(FRACT_CONVERT, "fract_convert", "e", RTX_UNARY)
@@ -594,9 +594,9 @@ DEF_RTL_EXPR(UNSIGNED_FRACT_CONVERT, "unsigned_fract_convert", "e", RTX_UNARY)
/* Conversions involving fractional fixed-point types with saturation,
including:
- fractional to fractional (of different precision),
+ fractional to fractional (of different precision),
signed integer to fractional,
- floating point to fractional.
+ floating point to fractional.
NOTE: fractional can be either signed or unsigned for conversions. */
DEF_RTL_EXPR(SAT_FRACT, "sat_fract", "e", RTX_UNARY)
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 038d031a3df..bad59659462 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -4554,12 +4554,12 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
case CONST_FIXED:
if (elem_bitsize <= HOST_BITS_PER_WIDE_INT)
{
- for (i = 0; i < elem_bitsize; i += value_bit)
+ for (i = 0; i < elem_bitsize; i += value_bit)
*vp++ = CONST_FIXED_VALUE_LOW (el) >> i;
}
else
{
- for (i = 0; i < HOST_BITS_PER_WIDE_INT; i += value_bit)
+ for (i = 0; i < HOST_BITS_PER_WIDE_INT; i += value_bit)
*vp++ = CONST_FIXED_VALUE_LOW (el) >> i;
for (; i < 2 * HOST_BITS_PER_WIDE_INT && i < elem_bitsize;
i += value_bit)
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index c9bd86a00d8..89d725d1b15 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1929,7 +1929,8 @@ make_unsigned_type (int precision)
return type;
}
-/* Create and return a type for fract of PRECISION bits. */
+/* Create and return a type for fract of PRECISION bits, UNSIGNEDP,
+ and SATP. */
tree
make_fract_type (int precision, int unsignedp, int satp)
@@ -1954,7 +1955,8 @@ make_fract_type (int precision, int unsignedp, int satp)
return type;
}
-/* Create and return a type for accum of PRECISION bits. */
+/* Create and return a type for accum of PRECISION bits, UNSIGNEDP,
+ and SATP. */
tree
make_accum_type (int precision, int unsignedp, int satp)
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 21ae905080a..cbbd357a49f 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1246,8 +1246,8 @@ break_up_subtract_bb (basic_block bb)
TREE_VISITED (stmt) = 0;
/* If unsafe math optimizations we can do reassociation for
- non-integral types.
- We can do reassociation for non-saturating fixed-point types. */
+ non-integral types. Or, we can do reassociation for
+ non-saturating fixed-point types. */
if ((!INTEGRAL_TYPE_P (TREE_TYPE (lhs))
|| !INTEGRAL_TYPE_P (TREE_TYPE (rhs)))
&& (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs))
@@ -1296,8 +1296,8 @@ reassociate_bb (basic_block bb)
continue;
/* If unsafe math optimizations we can do reassociation for
- non-integral types.
- We can do reassociation for non-saturating fixed-point types. */
+ non-integral types. Or, we can do reassociation for
+ non-saturating fixed-point types. */
if ((!INTEGRAL_TYPE_P (TREE_TYPE (lhs))
|| !INTEGRAL_TYPE_P (TREE_TYPE (rhs)))
&& (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs))
diff --git a/gcc/tree.c b/gcc/tree.c
index a9cf5484bc9..41cc07accf9 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1459,8 +1459,8 @@ integer_nonzerop (tree expr)
int
fixed_zerop (tree expr)
{
- return TREE_CODE (expr) == FIXED_CST
- && double_int_zero_p (TREE_FIXED_CST (expr).data);
+ return (TREE_CODE (expr) == FIXED_CST
+ && double_int_zero_p (TREE_FIXED_CST (expr).data));
}
/* Return the power of two represented by a tree node known to be a
@@ -6971,6 +6971,8 @@ make_or_reuse_type (unsigned size, int unsignedp)
return make_signed_type (size);
}
+/* Create or reuse a fract type by SIZE, UNSIGNEDP, and SATP. */
+
static tree
make_or_reuse_fract_type (unsigned size, int unsignedp, int satp)
{
@@ -7006,6 +7008,8 @@ make_or_reuse_fract_type (unsigned size, int unsignedp, int satp)
return make_fract_type (size, unsignedp, satp);
}
+/* Create or reuse an accum type by SIZE, UNSIGNEDP, and SATP. */
+
static tree
make_or_reuse_accum_type (unsigned size, int unsignedp, int satp)
{