This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: disable avx instructions at runtime
- From: Andreas Jaeger <aj at suse dot com>
- To: Chris <Chris dot Gottbrath at roguewave dot com>
- Cc: libc-help at sourceware dot org
- Date: Tue, 16 Jul 2013 18:50:23 +0200
- Subject: Re: disable avx instructions at runtime
- References: <khi16n$tqf$1 at ger dot gmane dot org> <201303101729 dot 06096 dot vapier at gentoo dot org> <513CFCA1 dot 9040400 at klingt dot org> <201303102013 dot 36683 dot vapier at gentoo dot org> <loom dot 20130716T182821-916 at post dot gmane dot org>
On 07/16/2013 06:40 PM, Chris wrote:
> Mike Frysinger <vapier@...> writes:
>
>> On Sunday 10 March 2013 17:35:29 Tim Blechmann wrote:
>>>>> i'm using a debugger, that does not support avx instructions (at least
>>>>> the back-in-time functionality doesn't). unfortunately, glibc/libm uses
>>>>> some sort of runtime dispatching to provide an avx-implementation for
>>>>> mathematical functions like sin or cos.
>>>>
>>>> yes, it uses cpuid to detect support. there were bugs though in the
>>>> implementation in older releases that caused it to get used when it
>>>> shouldn't. try using glibc-2.17.
>
>>
>> sounds like your replay engine is broken then. i don't understand why people
>> don't just fix the source of the problem. valgrind had a similar issue -- it
>> didn't properly emulate cpuid, so people requested we disable things in glibc
>> instead of updating valgrind.
>> -mike
>>
>
> Tim,
>
> Hi!
>
> Mike,
>
> Sorry to come in on this discussion at a late date. I'm the product manager
> for TotalView, the product Tim is referring to.
>
> I'd like to chime in and point out that we're not blind to the problem and
> are actively working to extend TotalView ReplayEngine support to include AVX
> instructions. Unfortunately that turns out to not be a trivial task at all.
> Meanwhile, we are looking at possible work arounds to get this working for
> customers like Tim.
>
> Are you reasonably sure (or is there anyone else on this list who can
> chime in) that this dispatch mechanism in libm is based on the cpuid().
> If so that gives us a possible mechanism to provide at least an interim
> solution for our users.
>
> I'd be grateful for any insight you or the others on this list can provide.
Yes, it's based on cpuid, see for example the following files in the
glibc sources
sysdeps/x86_64/multiarch/init-arch.c
sysdeps/x86_64/fpu/multiarch/e_asin.c
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126