This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Vector Comparison patch
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: Artem Shinkarov <artyom dot shinkaroff at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Richard Guenther <richard dot guenther at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Tue, 04 Oct 2011 11:32:37 +0200
- Subject: Re: Vector Comparison patch
- References: <CAFiYyc1F1_43DXHz8_JoL15-hfT9YZmwY3+zqJv4afwQp4gQ2A@mail.gmail.com> <CAFULd4bNzYBBjPrOiy0y59=35QGon0TSKBS_+WZJbWoFGh4gTg@mail.gmail.com> <CAFiYyc16spMBjvXrcekuV9EehvjKjmpv+n9gGteqYS=ZG8i8JA@mail.gmail.com> <CAFiYyc3A4DQE5010OqMcR_f4ngr+T+4CYHoO1k1kWMzNs4zugw@mail.gmail.com> <CABYV9SWThcvUPq7ivsGnznaka6d4SZaCK9-Bgg45wLHUJf-6nA@mail.gmail.com> <4E85D9DB.3080500@gjlay.de> <CABYV9SWQ_X+5pt7ERbd3CPrCjVrKnYtcja1mQQZ0eDJNFDTywg@mail.gmail.com> <4E85E20F.7090600@gjlay.de> <20110930154302.GN2687@tyan-ft48-01.lab.bos.redhat.com> <CABYV9SUur4pTyxZiFgqrY34HD4L3sMYvsUB6gTJtvKfjP6DvVQ@mail.gmail.com> <20110930155423.GO2687@tyan-ft48-01.lab.bos.redhat.com> <CABYV9SUkK4TNLpJG3FXcXRHMtPTgH4Sbr9LW-a=p7cQz5i+qRA@mail.gmail.com>
Artem Shinkarov schrieb:
> On Fri, Sep 30, 2011 at 4:54 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Fri, Sep 30, 2011 at 04:48:41PM +0100, Artem Shinkarov wrote:
>>> Most likely we can. The question is what do we really want to check
>>> with this test. My intention was to check that a programmer can
>>> statically get correspondence of the types, in a sense that sizeof
>>> (float) == sizeof (int) and sizeof (double) == sizeof (long long). As
>>> it seems my original assumption does not hold. Before using __typeof,
>>> I would try to make sure that there is no other way to determine these
>>> correspondences.
>> You can use preprocessor too, either just surround the whole test
>> with #if __SIZEOF_INT__ == __SIZEOF_FLOAT__ and similar,
>> or select the right type through preprocessor
>> #if __SIZEOF_INT__ == __SIZEOF_FLOAT__
>> #define FLOATCMPTYPE int
>> #elif __SIZEOF_LONG__ == __SIZEOF_FLOAT__
>> #define FLOATCMPTYPE long
>> #else
>> ...
>> or __typeof, etc.
>>
>> Jakub
>>
>
> Ok, here is a patch which uses __typeof. Passes on x86_64.
>
> Artem.
The patch from
http://gcc.gnu.org/ml/gcc-patches/2011-09/msg02060.html
http://gcc.gnu.org/ml/gcc-patches/2011-09/txt00337.txt
works for me.
If it's ok from maintainer I can apply it for you.
Johann