This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Two suggestions for gcc C compiler to extend C language (by WD Smith)
- From: <Paul_Koning at Dell dot com>
- To: <warren dot wds at gmail dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 26 Jul 2016 18:21:40 +0000
- Subject: Re: Two suggestions for gcc C compiler to extend C language (by WD Smith)
- Authentication-results: sourceware.org; auth=none
- References: <CAAJP7Y3cHYEOpdhZUXF1PZAJ=vkKoozRiPgwm2V_jH_T63XTKw@mail.gmail.com> <CAH6eHdRrmRWARhbcqWbqV07Y=SZp+Hsiv5-42y2k28CHqP4+UQ@mail.gmail.com> <CAAJP7Y0oRZmE4qS=shs4m7EWjWK2RfZdK2NSe1Kx1ZUT6W=QZw@mail.gmail.com> <57979B3B.3010405@westcontrol.com> <CAAJP7Y1SpgdXPubqZkJCTqUrg2uHTfRz2oVyCf0vDdnyTKAKCw@mail.gmail.com> <CAAJP7Y2-JcjiKXZ3xdpXnjPnAMj64SZQSY8s8euj4VZOo9SzLg@mail.gmail.com> <CAAJP7Y2Y+otT_Ad=95NvKcAACwiZHrFgiJ-UqfaGg5Ty6gbc3w@mail.gmail.com>
> On Jul 26, 2016, at 2:07 PM, Warren D Smith <warren.wds@gmail.com> wrote:
>
> To the guy who falsely claimed MIPS fails to provide an add with carry
> instruction,
> a google search in 1 minute finds this:
>
> stackoverflow.com/questions/1281806/adding-two-64-bit-numbers-in-assembly
>
> I defy you to find any processor not providing add with carry,
> (And I'm not talking about semantic bullshit. MIPS provides add with
> carry, even if they do not call it that, as this answer shows.)
Nonsense.
What that example shows is the standard assembly language coding for doing multi-precision addition in machines that do NOT have an add-with-carry instruction (or, as in the case of MIPS, even the concept of carry). The algorithm is simple: add low order parts, see if the result is unsigned less than one of the operands; if yes, add one to the sum of the high order parts.
Incidentally, note that this coding pattern only works for two's complement integers.
> ...
> But the thing is, I'm not willing to write that stuff for you unless
> you promise to actually add these things to GCC. So, will anybody
> make that promise?
I very much doubt it. You might as well stop trying.
paul