git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v7 0/1] refs.c: SSE4.2 optimizations for check_refname_component

From
David Turner <dturner@twopensource.com>
Date
Jun 13, 2014, 01:18 UTC
Message-ID
<1402622313.5629.45.camel@stross>
In-Reply-To
<53969FDF.3050506@viscovery.net>
On Tue, 2014-06-10 at 08:04 +0200, Johannes Sixt wrote:
Show 43 quoted lines
> Am 6/10/2014 1:05, schrieb Junio C Hamano:
> > Junio C Hamano <gitster@pobox.com> writes:
> > 
> >> David Turner <dturner@twopensource.com> writes:
> >>
> >>> Since Junio has picked up the first patch from previous versions of
> >>> this series, I'm just going to send the second (SSE) one.  I decided
> >>> not to s/NO_SSE42/!HAVE_SSE42/ because it looks like git mostly uses
> >>> the former convention (for instance, that's what GIT_PARSE_WITH
> >>> generates).
> >>
> >> Yeah but NO_FROTZ is used only when FROTZ is something everybody is
> >> expected to have (e.g. it's in posix, people ought to have it, but
> >> we do support those who don't), isn't it?  For a very arch specific
> >> stuff like sse42, I'd feel better to make it purely opt-in by
> >> forcing people to explicitly say HAVE_SSE42 to enable it.
> > 
> > Just FYI: I am getting
> > 
> > compat/cpuid.h:8:12: error: 'processor_supports_sse42' defined but
> > not used [-Werror=unused-function]
> > cc1: all warnings being treated as errors
> > 
> > while building 'pu'; I'll have to rebuild 'pu' without this patch
> > before I can push the day's result out.
> 
> And I get this when I compile on Windows with msysgit:
> 
>     CC abspath.o
> In file included from git-compat-util.h:694,
>                  from cache.h:4,
>                  from abspath.c:1:
> compat/cpuid.h: In function 'processor_supports_sse42':
> compat/cpuid.h:11: warning: implicit declaration of function '__cpuid'
> abspath.c: At top level:
> compat/cpuid.h:8: warning: 'processor_supports_sse42' defined but not used
> abspath.c: In function 'processor_supports_sse42':
> compat/cpuid.h:11: warning: 'eax' is used uninitialized in this function
> compat/cpuid.h:11: warning: 'ebx' is used uninitialized in this function
> compat/cpuid.h:11: warning: 'ecx' is used uninitialized in this function
> compat/cpuid.h:11: warning: 'edx' is used uninitialized in this function
> 
> Perhaps our gcc is too old?

It is too old for my patch because it doesn't support ifunc (and I suspect that no version of GCC for Windows supports ifunc). But that does not seem to be what is going on in your error message. Instead, when we #include <cpuid.h>, we get compat/cpuid.h rather than the system's cpuid.h. When I rename compat/cpuid.h to something else (and adjust the code accordingly), and add a check for gcc 4.5+ and for Windows before using ifunc, then everything works.

So tomorrow, I'm going to send a new patch (which also fixes the warnings Junio reported) which I've tested on Windows, GNU/Linux, and Mac OS X.

I'm testing on a Windows 8 VM from modern.ie with msysgit's "netinstaller" -- is that a reasonable test environment?

Previous: Junio C HamanoNext: Torsten Bögershausen
Message 10 of 12 in “refs.c: SSE4.2 optimizations for check_refname_component”
  1. 0/1 refs.c: SSE4.2 optimizations for check_refname_componentDavid Turner, Jun 5, 2014
  2. 1/1 refs.c: SSE4.2 optimizations for check_refname_componentDavid Turner, Jun 5, 2014
  3. Ondřej BílkaJun 14, 2014
  4. David TurnerJun 15, 2014
  5. Junio C HamanoJun 9, 2014
  6. David TurnerJun 9, 2014
  7. Junio C HamanoJun 9, 2014
  8. Johannes SixtJun 10, 2014
  9. Junio C HamanoJun 10, 2014
  10. David TurnerJun 13, 2014
  11. Torsten BögershausenJun 13, 2014
  12. Philip OakleyJun 14, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.