diff mbox

[MIPS] Fix *_SUB instruction macros

Message ID 2a90dec6-6775-4804-a913-63afdb498242@BAMAIL02.ba.imgtec.org
State New
Headers show

Commit Message

Steve Ellcey May 7, 2014, 5:42 p.m. UTC
While doing some work in glibc, I noticed that some of the *_SUB instruction
macros in sysdeps/mips/sys/asm.h are defined to do addition instructions
instead of subtraction instructions.  I don't know why this is but it seems
obviously wrong and it is different then the definitions in the linux kernel
which do define these as subtract instructions (arch/mips/include/asm/asm.h).

This patch changes the macros to do sub instructions instead of add.

OK to checkin?

Steve Ellcey
sellcey@mips.com



2014-05-07  Steve Ellcey  <sellcey@mips.com>

	* sysdeps/mips/sys/asm.h (INT_SUB): Fix definition.
	(LONG_SUB): Ditto.
	(PTR_SUB): Ditto.

Comments

Joseph Myers May 7, 2014, 6:09 p.m. UTC | #1
On Wed, 7 May 2014, Steve Ellcey  wrote:

> While doing some work in glibc, I noticed that some of the *_SUB instruction
> macros in sysdeps/mips/sys/asm.h are defined to do addition instructions
> instead of subtraction instructions.  I don't know why this is but it seems
> obviously wrong and it is different then the definitions in the linux kernel
> which do define these as subtract instructions (arch/mips/include/asm/asm.h).
> 
> This patch changes the macros to do sub instructions instead of add.
> 
> OK to checkin?

OK, but please file a bug in Bugzilla first (and the use the [BZ #N] 
notation in your ChangeLog entry, add the bug to the list of fixed bugs in 
NEWS and close the bug after checking in the fix), since this was a 
user-visible bug in releases.
diff mbox

Patch

diff --git a/sysdeps/mips/sys/asm.h b/sysdeps/mips/sys/asm.h
index 5015cb6..e479e9b 100644
--- a/sysdeps/mips/sys/asm.h
+++ b/sysdeps/mips/sys/asm.h
@@ -326,7 +326,7 @@  symbol		=	value
 # define INT_ADDI	addi
 # define INT_ADDU	addu
 # define INT_ADDIU	addiu
-# define INT_SUB	add
+# define INT_SUB	sub
 # define INT_SUBI	subi
 # define INT_SUBU	subu
 # define INT_SUBIU	subu
@@ -339,7 +339,7 @@  symbol		=	value
 # define INT_ADDI	daddi
 # define INT_ADDU	daddu
 # define INT_ADDIU	daddiu
-# define INT_SUB	dadd
+# define INT_SUB	dsub
 # define INT_SUBI	dsubi
 # define INT_SUBU	dsubu
 # define INT_SUBIU	dsubu
@@ -355,7 +355,7 @@  symbol		=	value
 # define LONG_ADDI	addi
 # define LONG_ADDU	addu
 # define LONG_ADDIU	addiu
-# define LONG_SUB	add
+# define LONG_SUB	sub
 # define LONG_SUBI	subi
 # define LONG_SUBU	subu
 # define LONG_SUBIU	subu
@@ -374,7 +374,7 @@  symbol		=	value
 # define LONG_ADDI	daddi
 # define LONG_ADDU	daddu
 # define LONG_ADDIU	daddiu
-# define LONG_SUB	dadd
+# define LONG_SUB	dsub
 # define LONG_SUBI	dsubi
 # define LONG_SUBU	dsubu
 # define LONG_SUBIU	dsubu
@@ -396,7 +396,7 @@  symbol		=	value
 # define PTR_ADDI	addi
 # define PTR_ADDU	addu
 # define PTR_ADDIU	addiu
-# define PTR_SUB	add
+# define PTR_SUB	sub
 # define PTR_SUBI	subi
 # define PTR_SUBU	subu
 # define PTR_SUBIU	subu
@@ -418,7 +418,7 @@  symbol		=	value
 # define PTR_ADDI	addi
 # define PTR_ADDU	add /* no u */
 # define PTR_ADDIU	addi /* no u */
-# define PTR_SUB	add
+# define PTR_SUB	sub
 # define PTR_SUBI	subi
 # define PTR_SUBU	sub /* no u */
 # define PTR_SUBIU	sub /* no u */
@@ -441,7 +441,7 @@  symbol		=	value
 # define PTR_ADDI	daddi
 # define PTR_ADDU	daddu
 # define PTR_ADDIU	daddiu
-# define PTR_SUB	dadd
+# define PTR_SUB	dsub
 # define PTR_SUBI	dsubi
 # define PTR_SUBU	dsubu
 # define PTR_SUBIU	dsubu