{ "subject": "Auto-detect for 128-bit 4-way SSE2", "content": { "format": "html", "body": "<div class=\"post\">SVN rev 150 has some code to try to auto-detect whether to use 4-way SSE2. &nbsp;We need this because it's only faster on certain newer CPUs that have 128-bit SSE2 and not ones with 64-bit SSE2.<br/><br/>It uses the CPUID instruction to get the CPU brand, family, model number and stepping. &nbsp;That's the easy part. &nbsp;Knowing what to do with the model number is the hard part. &nbsp;I was not able to find any table of family, model and stepping numbers for CPUs. &nbsp;I had to go by various random reports I saw.<br/><br/>Here's what I ended up with:<br/><div class=\"codeheader\">Code:</div><div class=\"code\"> &nbsp;// We need Intel Nehalem or AMD K10 or better for 128bit SSE2<br/>&nbsp;&nbsp;// Nehalem = i3/i5/i7 and some Xeon<br/>&nbsp;&nbsp;// K10 = Opterons with 4 or more cores, Phenom, Phenom II, Athlon II<br/>&nbsp;&nbsp;// &nbsp;Intel Core i5 &nbsp;family 6, model 26 or 30<br/>&nbsp;&nbsp;// &nbsp;Intel Core i7 &nbsp;family 6, model 26 or 30<br/>&nbsp;&nbsp;// &nbsp;Intel Core i3 &nbsp;family 6, model 37<br/>&nbsp;&nbsp;// &nbsp;AMD Phenom &nbsp; &nbsp;family 16, model 10<br/>&nbsp;&nbsp;bool fUseSSE2 = ((fIntel &amp;&amp; nFamily * 10000 + nModel &gt;= &nbsp;60026) ||<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (fAMD &nbsp; &amp;&amp; nFamily * 10000 + nModel &gt;= 160010));<br/></div><br/>I saw some sporadic inconsistent model numbers for AMD CPUs, so I'm not sure if this will catch all capable AMDs.<br/><br/>If it's wrong, you can still override it with -4way or -4way=0.<br/><br/>It prints what it finds in debug.log. &nbsp;Search on CPUID.<br/><br/>This is only enabled if built with GCC.</div>" }, "source": { "name": "Bitcoin Forum", "url": "https://bitcointalk.org/index.php?topic=1007.msg12262#msg12262" }, "date": "2010-09-09T01:04:05Z" }
Inscription number 18,209,373
Genesis block 799,364
File type json
File size 2.36 KB
Creation date