Wireshark-dev: Re: [Wireshark-dev] How to define HAVE_SSE42 with autotools?

From: Anders Broman <anders.broman@xxxxxxxxxxxx>
Date: Tue, 10 Jun 2014 17:06:24 +0000

-----Original Message-----
>From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Guy Harris
>Sent: den 10 juni 2014 18:32
>To: Developer support list for Wireshark
>Subject: Re: [Wireshark-dev] How to define HAVE_SSE42 with autotools?
>
>HAVE_SSE42 is used in two places:
>
>	1) wsutil/ws_mempbrk_sse42.c, where it controls whether to build that file at all;
>
>	2) wsutil/ws_mempbrk.c, where it controls whether to check whether the CPU has SSE 4.2 and, if it does, call the SSE 4.2 version of the code.
>
>So what HAVE_SSE42 really seems to mean is "does the compiler support the intrinsics used in wsutil/ws_mempbrk_sse42.c?"
>
>Should we, instead, check for compiler support for those intrinsics?

Yes I guess...

>And will the compiler generate code for those intrinsics, using the SSE 4.2 instructions, even if you haven't told it, with a command-line option, to generate SSE 4.2 code in general?  Or does the >compiler not do a good job of supporting choosing whether to use SSE 4.2 instructions at run time rather than at compile time?

I have recently added some macros I found that define HAVE_SSE4_2 so at least the stuff compiles now on all the buildbots(I think).

I'm not sure if there should be a command line option or not. But ideally we should compile ws_mempbrk_sse42.c if the compiler supports it and check cpu_info() at runtime to use it or not.

Regards
Anders
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe