This is the mail archive of the 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]

Re: fixed-point support for c++ [patch]

On Wed, Apr 14, 2010 at 5:29 PM, Sean D'Epagnier <> wrote:
> Sorry for first email, it was premature.
> I have two patches for gcc. ?The first fixes some important bugs
> within gcc for fixed point support and applies to all languages and
> targets. ?The second is c++ related only, and adds support to the
> parser for fixed point.
> These are the first patches I have submitted to gcc and I would be
> glad to make any modifications or improvements as required.

Thus some comments.  Please create diffs with the -p option so
the function context is displayed in the diffs header (see
on how to teach svn to use an external diff tool).

+      /* Since fixed point types cannot perform bitwise and, or, etc..
+        don't try to convert to an expression with them.  */
+      if (TREE_CODE(type) == FIXED_POINT_TYPE)

space after TREE_CODE

+       return NULL_TREE;

+2010-04-14  Sean D'Epagnier <>
+       Fixed-point bugfixes
+       * fold-const.c (fold_binary_loc):  Avoid optimization that relies
+       on bitwise operations which are undefined for fixed point
+       * cse.c (fold_rtx0): Ditto from fold_binary_loc
+       * varasm.c (assemble_integer): Fix breakage caused on machines which
+       have a register size smaller than smallest fixed-point size of
+       a given type

don't post diffs of ChangeLog but rather paste the changelog entry
in the submission mail.  vertical space after the initial line, no
overall comment "Fixed-point bugfixes".  Sentences should terminate
with a fullstop.  Instead of "Ditto ..." simply use "Likewise."

+             if (is_shift && (VECTOR_MODE_P (mode)
+                              || ALL_FIXED_POINT_MODE_P (mode)))

line-break after is_shift

Index: gcc/varasm.c
--- gcc/varasm.c        (revision 158228)
+++ gcc/varasm.c        (working copy)
@@ -2709,7 +2709,7 @@
        mclass = MODE_INT;

-      omode = mode_for_size (subsize * BITS_PER_UNIT, mclass, 0);
+      omode = mode_for_size (subsize * BITS_PER_UNIT, MODE_INT, 0);
       imode = mode_for_size (size * BITS_PER_UNIT, mclass, 0);

I don't think that change is correct.


> I have a copyright assignment, and I have tested gcc and found no
> regressions with these patches.
> Thanks
> Sean

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