This is the mail archive of the cygwin mailing list for the Cygwin 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]

Bug fix to /proc/cpuinfo implementation


Hi

I hope I email to correct mailing list...

It seems that '/proc/cpuinfo' doesn't report 3dnow and 3dnowext support
correctly.

Because I had been using it for recognizing processor features I looked
briefly into fhandler_proc.cc (taken freshly from cvs) and I think I
fixed the problem. The changed file compiles and *should* correctly
detect presence of 3dnow instruction support (by using AMD's 0x8000..1
extended function). I haven't have time to test it (= figure out how
build+install process actually works) because I decided to write my own
cpuid detection routines from scratch instead.

Patch is under whatever license needed to make it possible to use it.

Thanks for cygwin people for doing good job and bringing unix to
windows.

-- 
Tomas Ukkonen
tomas.ukkonen@iki.fi


700a701,706
> 	  
> 	  // vendor identification
> 	  bool is_amd=false, is_intel=false;
> 	  if(!strcmp((char*)vendor_id, "AuthenticAMD"))      is_amd = true;
> 	  else if(!strcmp((char*)vendor_id, "GenuineIntel")) is_intel = true;
> 	  
867a874,892
> 	      
> 	      if(is_amd){
> 		// uses AMD extended calls to check
> 		// for 3dnow and 3dnow extended support
> 		// (source: AMD Athlon Processor Recognition Application Note)
> 		
> 		unsigned int _a = 0, _b, _c, _d;
> 		cpuid(&_a,&_b,&_c,&_d, 0x80000000);
> 		
> 		if(_a >= 0x80000001){ // has basic capabilities
> 		  cpuid(&_a,&_b,&_c,&_d, 0x80000001);
> 		  
> 		  if(_d & (1 << 30)) // 31th bit is on
> 		    print (" 3dnowext");
> 		  
> 		  if(_d & (1 << 31)) // 32th bit (highest) is on
> 		    print (" 3dnow");
> 		}
> 	      }
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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