Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538636 - dev-util/catalyst: update MIPS targets
Summary: dev-util/catalyst: update MIPS targets
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-02-03 10:08 UTC by Joshua Kinard
Modified: 2015-10-11 18:05 UTC (History)
2 users (show)

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


Attachments
New MIPS targets for catalyst (catalyst-2.0.18-p4-mips-new-targets.patch,6.49 KB, patch)
2015-02-03 10:08 UTC, Joshua Kinard
Details | Diff
New MIPS targets for catalyst v2 (catalyst-2.0.18-p4-mips-new-targets.patch,6.41 KB, patch)
2015-02-04 10:20 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard gentoo-dev 2015-02-03 10:08:04 UTC
Created attachment 395438 [details, diff]
New MIPS targets for catalyst

I can't subscribe to the gentoo-catalyst mailing list right now, so I am attaching this patch as a bug.  It is independent of the other patches I'll be filing as bugs shortly.

This patch updates arch/mips.py to support the following new targets:

(MIPS II Big-endian)
mips2

(MIPS IV, R12000+, Big-endian)
mips4_r12k_plus
mips4_r12k_plus_n32
mips4_r12k_plus_n64
mips4_r12k_plus_multilib

(MIPS II Little-endian)
mipsel2

I am not sure why the mips2/mipsel2 targets were missing.  I thought they were added years ago.  The *_r12k_plus targets are for use when the target system (usually an SGI system) has either an R12000 or R14000 CPU (maybe hopefully in the future, R16000).  In this instance, -march=r12000 -mno-fix-r10000 is passed to gcc to disable the R10K ll/sc WAR that causes gcc to emit branch-likely instructions to avoid a silicon errata in R10000 v2.6 and earlier CPUs.  Since R12000/R14000's came long after those processors, they already have the specific errata fixed and can use standard branch instructions, which are slightly quicker to execute (and which were removed in MIPS R6, but that doesn't apply to these machines anyways).

It also fixes up the whitespace so that everything aligns better.
Comment 1 Matt Turner gentoo-dev 2015-02-03 22:37:01 UTC
(In reply to Joshua Kinard from comment #0)
> I am not sure why the mips2/mipsel2 targets were missing.  I thought they
> were added years ago.

Pretty sure I removed them at some point. They're useless. There aren't any mips2 machines we'll ever run on.

> The *_r12k_plus targets are for use when the target

Remove the _plus.

With those things fixed, the patch seems good to me.
Comment 2 Joshua Kinard gentoo-dev 2015-02-04 10:20:20 UTC
Created attachment 395506 [details, diff]
New MIPS targets for catalyst v2

True, we'll never support the R6000, since it only exists in a large supercomputer that now lives in a museum.  But MIPS-II is the branching point for MIPS32R* and MIPS-III, thus I've felt it was more suitable as a base porting stage than MIPS-I, since we'll probably never support R2000/R3000 machines with Gentoo (I don't want to know how long gcc will take on those platforms -- Debian can probably attest to that).  I actually think Debian's mips packages are all MIPS-II now -- they migrated off of MIPS-I around Lenny (I think, but I can't find a reference).

In any event, I don't think it's an issue keeping that target around -- just a few lines of Python.  But if that bit isn't accepted, I can still patch my local catalyst copy fairly easily.

Patch updated to remove the "_plus" bits (I thought that was better than a literal "+" character").
Comment 3 Joshua Kinard gentoo-dev 2015-02-04 10:37:53 UTC
Further thinking on it, I wonder if the MIPS target classes couldn't be converted to say, a class factory and a dict that keys by target name.  It'd be simpler to have a generic base class that returns a generated class derived from info stored in a dict.

The only real differences are the class names and the CFLAGS, and that can *easily* be converted into a dict.  Probably have to fiddle with the __metaclass__ property a bit.  I'll have to research it some and see if that might be able to trim mips.py down a fair bit or not.
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2015-02-04 11:05:49 UTC
Yeah, we have plans to do the change from classes to maybe even a confiparser or json file.  A dictionary would suit a json file easily.
Comment 5 Anthony Basile gentoo-dev 2015-02-05 11:02:18 UTC
(In reply to Brian Dolbec from comment #4)
> Yeah, we have plans to do the change from classes to maybe even a
> confiparser or json file.  A dictionary would suit a json file easily.

Not json please.  I don't see anything wrong with just a dict.
Comment 6 Brian Dolbec (RETIRED) gentoo-dev 2015-02-05 16:29:39 UTC
If I remember correctly, the original idea was to make them config files using configparser to load them.  It is just data, easily loaded when needed, that doesn't need to be in python classes like they currently are.
Comment 7 Anthony Basile gentoo-dev 2015-02-09 23:07:27 UTC
I think the original issue is done.  I'm closing this.  Reopen if there's more to discuss.
Comment 8 Matt Turner gentoo-dev 2015-02-10 02:53:57 UTC
(In reply to Anthony Basile from comment #7)
> I think the original issue is done.  I'm closing this.  Reopen if there's
> more to discuss.

Was Kumba's patch committed?
Comment 9 Brian Dolbec (RETIRED) gentoo-dev 2015-02-10 04:08:30 UTC
I certainly didn't.  I've been busy with portage and layman releases.

I do intend to apply it to master.  I was not sure if it is something that needs another 2.X bump for.

Checking just now, no it hasn't been applied to 2.X, master, pending, 3.0 branches.
Comment 10 Anthony Basile gentoo-dev 2015-02-10 11:29:26 UTC
(In reply to Brian Dolbec from comment #9)
> I certainly didn't.  I've been busy with portage and layman releases.
> 
> I do intend to apply it to master.  I was not sure if it is something that
> needs another 2.X bump for.
> 
> Checking just now, no it hasn't been applied to 2.X, master, pending, 3.0
> branches.

Sorry, I think I got confused with another issue.  Thanks for catching that Matt.

I assumed it was something for the 2.x branch.  I can commit it there.  Should it go into any other branches?  I only follow the 2.x branch for my releng work so I'm not too familiar with the workflow.
Comment 11 Anthony Basile gentoo-dev 2015-02-10 11:55:29 UTC
(In reply to Anthony Basile from comment #10)
> (In reply to Brian Dolbec from comment #9)
> > I certainly didn't.  I've been busy with portage and layman releases.
> > 
> > I do intend to apply it to master.  I was not sure if it is something that
> > needs another 2.X bump for.
> > 
> > Checking just now, no it hasn't been applied to 2.X, master, pending, 3.0
> > branches.
> 
> Sorry, I think I got confused with another issue.  Thanks for catching that
> Matt.
> 
> I assumed it was something for the 2.x branch.  I can commit it there. 
> Should it go into any other branches?  I only follow the 2.x branch for my
> releng work so I'm not too familiar with the workflow.

Okay I committed this to the 2.x branch.  You can cherry-pick it from there:

commit 1082054caa75f3162fdad811d787aaffe3d7d643
Author: Joshua Kinard <kumba@gentoo.org>
Date:   Tue Feb 10 06:57:18 2015 -0500

    arch/mips.py: update MIPS targets
    
    Signed-off-by: Anthony G. Basile <blueness@gentoo.org>