lkml.org 
[lkml]   [2018]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] MIPS: Introduce isa-rev.h to define MIPS_ISA_REV
On Mon, 26 Feb 2018, Matt Redfearn wrote:

> +/* If the compiler has defined __mips_isa_rev, believe it. */
> +#ifdef __mips_isa_rev
> +#define MIPS_ISA_REV __mips_isa_rev
> +#else
> +/* The compiler hasn't defined the isa rev so assume it's MIPS I - V (0) */
> +#define MIPS_ISA_REV 0
> +#endif

FYI, GCC has this:

/* The ISA revision level. This is 0 for MIPS I to V and N for
MIPS{32,64}rN. */
int mips_isa_rev;

and this:

if (mips_isa < 32)
mips_isa_rev = 0;
else
mips_isa_rev = (mips_isa & 31) + 1;

and then:

if (mips_isa_rev > 0) \
builtin_define_with_int_value ("__mips_isa_rev", \
mips_isa_rev); \

so your proposal looks like the right approach to me. I think we should
have the various target macros documented in the GCC manual.

Reviewed-by: Maciej W. Rozycki <macro@mips.com>

Maciej

\
 
 \ /
  Last update: 2018-02-26 21:09    [W:1.445 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site