This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: disable avx instructions at runtime


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]