Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262603 - [toolchain-overlay] Add Intel Atom optimizations support to GCC-4.4 ebuilds
Summary: [toolchain-overlay] Add Intel Atom optimizations support to GCC-4.4 ebuilds
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-15 21:19 UTC by Alexey Charkov
Modified: 2009-05-22 06:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch containing the changes to trunk (gcc-atom.diff,92.61 KB, patch)
2009-03-15 21:22 UTC, Alexey Charkov
Details | Diff
Stripped-down contents of the commit 145624 (gcc-atom.diff,64.28 KB, patch)
2009-04-15 17:36 UTC, Alexey Charkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Charkov 2009-03-15 21:19:23 UTC
There is a branch of gcc-4.4 with Intel Atom optimizations support (-march=atom) available at svn://gcc.gnu.org/svn/gcc/branches/ix86/atom which is developed by Intel engineers and consists of only minimal possible differences from trunk. It would be great if snapshot ebuilds in toolchain-overlay were updated to include optional support for this, considering the increasing availability of Atom-based netbooks and nettops.

I currently have one Atom-based system completely built with C(XX)?FLAGS='-Os -march=atom -mfpmath=sse -fomit-frame-pointer -pipe', including a kernel built with -march=atom through manual editing of Makefiles, and it works flawlessly. It also seems to work faster as compared to one built with GCC-4.3 and -march=core2.

Reproducible: Always

Steps to Reproduce:
Comment 1 Alexey Charkov 2009-03-15 21:22:27 UTC
Created attachment 185113 [details, diff]
Patch containing the changes to trunk

Here is a patch obtained by `svn diff` of the forementioned branch to a relevant trunk revision. I tested it with gcc-4.4 snapshots dated 20090227 and 20090313, and it applies, builds and runs well, as far as I can tell.
Comment 2 SpanKY gentoo-dev 2009-03-17 19:26:59 UTC
you should be able to put the patch into the /etc/portage/patches/sys-devel/gcc-4.4.0_alphaXXXXXXXX dir and it'll automatically get applied

maybe extend the autopatch support so it also looks at ${PV:0:5} so you dont have to keep updating the dir ...
Comment 3 Alexey Charkov 2009-03-17 19:36:27 UTC
(In reply to comment #2)
> you should be able to put the patch into the
> /etc/portage/patches/sys-devel/gcc-4.4.0_alphaXXXXXXXX dir and it'll
> automatically get applied
> 
> maybe extend the autopatch support so it also looks at ${PV:0:5} so you dont
> have to keep updating the dir ...
> 

Well, I personally do quite well by just renaming a trivially modified ebuild that adds 'epatch ${FILESDIR}/gcc-atom.diff' when new snapshots are published. The point I was filing this bug for is that probably this feature is interesting enough so that other people could directly benefit from it. This would be way more accessible if overlay ebuilds were providing the patch (probably with USE=atom or similar), as few people seem to know about the very existence of this code. Of course, the 'get it and apply yourself' strategy works, but... :)
Comment 4 SpanKY gentoo-dev 2009-03-18 01:03:42 UTC
i know, i was just highlighting a simpler way for you to apply the patch rather than having to touch any ebuild
Comment 5 Alexey Charkov 2009-04-15 12:18:39 UTC
This seems to be in trunk since r145624, see here:
http://gcc.gnu.org/viewcvs?view=rev&revision=145624
Comment 6 Alexey Charkov 2009-04-15 17:36:59 UTC
Created attachment 188459 [details, diff]
Stripped-down contents of the commit 145624

This could be useful for those who wish to use Atom optimizations with pre-4.5 versions of GCC. Changelogs and non-critical diff information are stripped off to minimize size.
Comment 7 Philipp Leonhardt 2009-05-19 11:54:27 UTC
I've merged gcc-4.4.1_pre9999 from gcc-porting overlay but its not in there
zlib says "no valid march" on emerge -e world

could somebody please make an ebuild of the gcc atom branch
http://gcc.gnu.org/viewcvs/branches/ix86/atom/


Comment 8 Alexey Charkov 2009-05-19 19:44:44 UTC
(In reply to comment #7)
> I've merged gcc-4.4.1_pre9999 from gcc-porting overlay but its not in there
> zlib says "no valid march" on emerge -e world
> 
> could somebody please make an ebuild of the gcc atom branch
> http://gcc.gnu.org/viewcvs/branches/ix86/atom/
> 

The one you used is from the 4.4* branch, which does not include Atom support. Just use 4.5* snapshots and you are done. Alternatively, you can try to apply the patch that I posted to a 4.4* build (for example, consider what vapier suggests in comment #2).
Comment 9 Ryan Hill (RETIRED) gentoo-dev 2009-05-20 03:29:46 UTC
I would rather not try to maintain a 65KiB patch against a live svn build. :P

You should be able to use the existing ebuild to checkout the atom branch just by changing the ESVN_REPO_URI.
Comment 10 Alexey Charkov 2009-05-20 15:41:40 UTC
(In reply to comment #9)
> I would rather not try to maintain a 65KiB patch against a live svn build. :P
> 
> You should be able to use the existing ebuild to checkout the atom branch just
> by changing the ESVN_REPO_URI.
> 

There is no need, in fact. After the merge to mainline they seem to update trunk frequently with the changes made in atom branch, so I do not see any benefit of using atom branch over mainline 4.5. This made sense before 4.4 was branched out, though.
Comment 11 Philipp Leonhardt 2009-05-22 06:23:01 UTC
I am now using gcc 4.5 ebuilds from toolchain overlay with a bit fixes to let it merge properly
look here

http://bugs.gentoo.org/show_bug.cgi?id=270558

now i will test to remerge my whole system and adding kernel patch to activate inline pipelining.