Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-06

about mips/mipsel chaos

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Fuxin Zhang

hi buddys,

Current trunk code use both CPUMIPS/CPUMIPS32/CPUMIPSEL etc. which make it easy to be wrong. For example, now the rtl code use only CPUMIPS, so for mipsel something will be wrong. It brings me some troubles while trying to integrate patches already.

Since mipsel/mips has most of the code equal(code is endian free or use endian setting in target_info), I would like to propose make such conventions:

define mips, cpumips, mips32 for use of common mips related code define mipsel/mipsel32 for little endian cpus
define mipseb/mipseb32 for big endian cpus

to avoid code like "if defined(mips) or defined(mipsel)" ... everywhere.

What do you think? If ok, I will go on to make the patches.

Regards

Reply by email

Mark Morgan Lloyd
to Fuxin Zhang
Fuxin Zhang wrote 18 lines
hi buddys, Current trunk code use both CPUMIPS/CPUMIPS32/CPUMIPSEL etc. which make it easy to be wrong. For example, now the rtl code use only CPUMIPS, so for mipsel something will be wrong. It brings me some troubles while trying to integrate patches already. Since mipsel/mips has most of the code equal(code is endian free or use endian setting in target_info), I would like to propose make such conventions: define mips, cpumips, mips32 for use of common mips related code define mipsel/mipsel32 for little endian cpus define mipseb/mipseb32 for big endian cpus to avoid code like "if defined(mips) or defined(mipsel)" ... everywhere. What do you think? If ok, I will go on to make the patches.

That definitely needs comment from Jonas, Florian, or another core developer. It's an issue I struggled with last Summer when I was trying to work through David Zhang's code.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Fuxin Zhang
Show quoted text 12 lines
> define mips, cpumips, mips32 for use of common mips related code > define mipsel/mipsel32 for little endian cpus > define mipseb/mipseb32 for big endian cpus > > to avoid code like "if defined(mips) or defined(mipsel)" ... > everywhere. > > What do you think? If ok, I will go on to make the patches. That definitely needs comment from Jonas, Florian, or another core developer. It's an issue I struggled with last Summer when I was trying to work through David Zhang's code.

Yes, I agree. Some long term constants are involved. But anyway current situation needs a clean up. 64 bit MIPS processors become more popular, we might have need to support mips64 soon. el/eb * 32/64 will be a headache...

Show quoted text 11 lines
-- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jonas Maebe
to Fuxin Zhang: Current trunk code use both CPUMIPS/CPUMIPS32/CPUMIPSEL etc. which make it easy to be…
Fuxin Zhang wrote 7 lines
Since mipsel/mips has most of the code equal(code is endian free or use endian setting in target_info), I would like to propose make such conventions: define mips, cpumips, mips32 for use of common mips related code define mipsel/mipsel32 for little endian cpus define mipseb/mipseb32 for big endian cpus

Ok, except that all of those defines have to start with "cpu". The compiler always only defines cpu*: cpui386, cpux86, cpupowerpc, cpupowerpc32, cpupowerpc64, ...

The non-cpu defines are only defined by the Makefiles while compiling the RTL and compiler (although in an ideal world, they would only be defined while compiling the compiler, because they are superfluous while compiling the RTL).

Jonas

Reply by email

Fuxin Zhang
Show quoted text 19 lines
On 08 Jun 2012, at 17:57, Fuxin Zhang wrote: > Since mipsel/mips has most of the code equal(code is endian free or use > endian setting in target_info), I would like to propose make such > conventions: > > define mips, cpumips, mips32 for use of common mips related code > define mipsel/mipsel32 for little endian cpus > define mipseb/mipseb32 for big endian cpus Ok, except that all of those defines have to start with "cpu". The compiler always only defines cpu*: cpui386, cpux86, cpupowerpc, cpupowerpc32, cpupowerpc64, ... The non-cpu defines are only defined by the Makefiles while compiling the RTL and compiler (although in an ideal world, they would only be defined while compiling the compiler, because they are superfluous while compiling the RTL).

Please review http://svn.freepascal.org/svn/fpc/branches/foxsen/mips: r21554:21557
log:
Make macro CPUMIPS common for big endian and little endian mips processors use CPUMIPSEL* for little endian systems
use CPUMIPSEB* for big endian systems

Jonas

Reply by email