<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alunduil&#039;s Hosting &#187; isa</title>
	<atom:link href="http://www.alunduil.com/tag/isa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alunduil.com</link>
	<description>Gentoo Hackery and Other Fun ...</description>
	<lastBuildDate>Sun, 01 May 2011 22:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Optimizing Gentoo CFLAGS</title>
		<link>http://www.alunduil.com/2009/12/18/optimizing-gentoo-cflags/</link>
		<comments>http://www.alunduil.com/2009/12/18/optimizing-gentoo-cflags/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 06:39:52 +0000</pubDate>
		<dc:creator>Alex Brandt</dc:creator>
				<category><![CDATA[Linux Guides]]></category>
		<category><![CDATA[cflags]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[isa]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://www.alunduil.com/?p=63</guid>
		<description><![CDATA[Starting Off Make sure you&#8217;ve at least looked at the following document: Gentoo Optimization Guide. Checking Flags The only real change we want to make to our system are simple things we know will not break it. Thus, we only look at making sure that we have the correct flags for enabling all of the <a href='http://www.alunduil.com/2009/12/18/optimizing-gentoo-cflags/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<h1><strong>Starting Off</strong></h1>
<p>Make sure you&#8217;ve at least looked at the following document: <a href="http://www.gentoo.org/doc/en/gcc-optimization.xml">Gentoo Optimization Guide</a>.</p>
<h1><strong>Checking Flags</strong></h1>
<p>The only real change we want to make to our system are simple things we know will not break it.  Thus, we only look at making sure that we have the correct flags for enabling all of the instruction sets that our processor has available.</p>
<h1><strong>Checking Processor</strong></h1>
<p>grep flags /proc/cpuinfo | grep uniq</p>
<p>This pulls out all of the features of the processor as detected by the kernel.  Example output is shown (line breaks added for readability):</p>
<p>alunduil@elijah ~ $ grep flags /proc/cpuinfo | uniq<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr<br />
pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall<br />
nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good<br />
extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic<br />
cr8_legacy 3dnowprefetch</p>
<h1><strong>Checking Default Flags</strong></h1>
<p>gcc does a great job of determining what flags should be set by using the new -march=native flag (which you should have set by this point).  Using the following command we can double check that all of the instructions we want enabled are enabled:</p>
<p>gcc -Q -c -v -march=native &#8211;help=target | grep disabled</p>
<p>If anything appears in the resulting list, it&#8217;s not enabled and should be enabled by adding the appropriate -m flag.  For my cpu this results in: -msse3 -m3dnow.</p>
<h1><strong>Putting it Together</strong></h1>
<p>By adding the original guide with a check for instructions, we allow gcc to utilize the instructions that were specifically created for uses we may have (multimedia, extended math, etc).</p>
<p>The resulting CFLAG variable that I placed in my make.conf from the above discussion:</p>
<p>CFLAGS=&#8221;-march=native -O2 -pipe -msse3 -m3dnow&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alunduil.com/2009/12/18/optimizing-gentoo-cflags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (User agent is rejected)
Database Caching 2/6 queries in 0.005 seconds using memcached
Object Caching 250/250 objects using memcached

Served from: www.alunduil.com @ 2012-02-06 10:18:06 -->
