Bug 837964

Summary: support for iwMMXt in gcc
Product: [Fedora] Fedora Reporter: Peter Robinson <pbrobinson>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: blc, dsd, jakub, law, rh-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-19 21:06:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
iwmmxt patch for gcc-4.7.1 none

Description Peter Robinson 2012-07-05 22:59:23 UTC
The follow two upstream patches add support for Marvell's iwMMXt to gcc 4.7, it would be great to get the patches into rawhide/f17 to improve support for the OLPC XO 1.75 and the Armada XP

http://gcc.gnu.org/viewcvs?view=revision&revision=188497

http://gcc.gnu.org/viewcvs?view=revision&revision=188988

Comment 1 Brendan Conoboy 2012-08-15 22:47:32 UTC
Are these patches in the FSF 4.7 branch?  If so it'd be great to pull them in.

Comment 2 Daniel Drake 2012-08-17 00:04:10 UTC
Unfortunately they aren't - the patches took a long time to be reviewed and 4.7 had already been branched into fixes-only mode when they got applied.

We are hoping that Fedora would consider taking these patches (actually only one, since the other is documentation/testsuite only, not really necessary) for 4.7. I would be happy to be responsible for fixing the patch if it breaks. And it could obviously be dropped as soon as Fedora moves to 4.8, where the patch is already included.

To help ease this process I will turn the above link into a .patch, check that it applies against the current gcc shipped in Fedora, do a scratch build and test the functionality. I'll post results here when done.

Comment 3 Daniel Drake 2012-08-17 20:29:37 UTC
Created attachment 605261 [details]
iwmmxt patch for gcc-4.7.1

Here is the patch backported/rediffed to gcc-4.7.1.

There was a trivial reject easily solved, and also I found a small issue in the upstream commit (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54306) and included the fix here too.

I did a scratch build and tested this, it seems to be working fine and provides an impressive performance increase in pixman (which already is capable of exploiting this instruction set).

Jakub, what are your thoughts here? Can we ship this backported functionality until gcc-4.8 is in Fedora? As noted in the patch I'm happy to be held responsible for it.

Comment 4 Daniel Drake 2012-08-17 20:32:09 UTC
Just to clarify one detail: OLPC is currently developing against F18, which is the first Fedora release that includes a pixman capable of using this optimization, so there is no need to put this in F17.

Comment 5 Jakub Jelinek 2012-08-20 11:02:00 UTC
I'd prefer not to backport it, the patch is really large, needed follow-ups already, and while I backport even large patches from time to time, it is always in an area of my expertise, because such selective backports create a compiler that works differently from both the FSF release and upcoming FSF release, so there is a big chance of bugs that only reproduce with the GCC 4.x-RH branch and no FSF release.

Comment 6 Enrico Scholz 2012-08-29 17:43:41 UTC
fwiw, iwmmxt is broken on kernel side (last tested on 3.0 or so)

http://lists.infradead.org/pipermail/linux-arm/2010-June/000211.html

Comment 7 Daniel Drake 2012-09-19 21:06:56 UTC
Thanks Enrico, I will try the tests you provide to see if we can reproduce such failures.

Going back to the original patch inclusion request, we've found that there is a bug in gcc-4.7 that makes it hard to compile things with iwmmxt support enabled, and the same crash is hit with the iwmmxt2 paths patched here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40836

(fixed in gcc-4.8 only)

So I think Jakub is spot-on with his above comment - this is too risky. Best to wait for gcc-4.8 to be released.