MIPS header file question
Steve Ellcey
sellcey@mips.com
Tue May 6 23:03:00 GMT 2014
I have a question about the MIPS sysdeps/mips/sys/asm.h file in glibc.
It includes a bunch of macros for various assembly language instructions
such as INT_ADD, LONG_ADD, PTR_ADD, etc. There are also *_SUB macros and
some of these look very odd to me:
% grep _SUB sysdeps/mips/sys/asm.h | grep add
# define INT_SUB add
# define INT_SUB dadd
# define LONG_SUB add
# define LONG_SUB dadd
# define PTR_SUB add
# define PTR_SUB add
# define PTR_SUB dadd
Why are some of the *_SUB macros defined to do an add instruction?
There are other *_SUB macros (*_SUBU, *_SUBIU, *SUBI) that are defined
to do sub[iu] instructions. Is there any reason for this or is this
just a cut and paste error that has survived for a decade or so.
It would not surprise me to learn that no one uses these macros.
Steve Ellcey
sellcey@mips.com
More information about the Libc-alpha
mailing list