This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
MIPS header file question
- From: "Steve Ellcey " <sellcey at mips dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: <rdsandiford at googlemail dot com>
- Date: Tue, 6 May 2014 16:03:48 -0700
- Subject: MIPS header file question
- Authentication-results: sourceware.org; auth=none
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