[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 283114] New: pthread_create new thread inherits parent's
From:       <arturomdn () gmail ! com>
Date:       2011-09-30 23:57:48
Message-ID: bug-283114-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=283114

           Summary: pthread_create new thread inherits parent's MXCSR.FTZ,
                    but not in valgrind
           Product: valgrind
           Version: 3.2.1
          Platform: Unlisted Binaries
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: jseward@acm.org
        ReportedBy: arturomdn@gmail.com


Version:           3.2.1
OS:                Linux

Flush To Zero is a mode of operation specified in the MXCSR for x86 processors.
 When enabled, a zero result will replace the result of floating point
operations that produce non-zero values smaller than the smallest normal
representable value, that is a subnormal value (denormal).  Threads created
with the pthread library inherit the setting of the MXCSR.FTZ bit, however this
doesn't happen with valgrind.

Reproducible: Always

Steps to Reproduce:
1) #include <xmmintrin.h>
2) Set FTZ mode with _MM_SET_FLUSH_ZERO_MODE (_MM_FLUSH_ZERO_ON);
3) Use pthread_create to create a thread
4) In the thread's function read the MXCSR.  To read the MXCSR do

        static inline void stmxcsr(int& mxcsr) {
            asm volatile ( "stmxcsr %0" : "=m"(mxcsr) :: "memory" );
        }

5) check bit 15 (logical and with 1<<15)  to test FTZ bit.

Actual Results:  
FTZ bit in step (5) above will be '0' when run with Valgrind

Expected Results:  
FTZ bit in step (5) above will be '1' when run without Valgrind

http://en.wikipedia.org/wiki/Denormal_number

http://software.intel.com/en-us/articles/x87-and-sse-floating-point-assists-in-ia-32-flush-to-zero-ftz-and-denormals-are-zero-daz/


http://software.intel.com/en-us/articles/how-to-avoid-performance-penalties-for-gradual-underflow-behavior/


-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic