ce426f
commit d298c41635ce7f2dc7c3eccc842fe3aa754c0c8e
ce426f
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
ce426f
Date:   Thu May 22 14:48:38 2014 -0500
ce426f
ce426f
    PowerPC: Remove 64 bits instructions in PPC32 code
ce426f
    
ce426f
    This patch replaces the insrdi by insrwi in powerpc32 assembly.
ce426f
ce426f
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S
ce426f
===================================================================
ce426f
--- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power4/memset.S
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S
ce426f
@@ -52,7 +52,7 @@ L(_memset):
ce426f
 
ce426f
 /* Align to word boundary.  */
ce426f
 	cmplwi	cr5, rLEN, 31
ce426f
-	insrdi	rCHR, rCHR, 8, 48     /* Replicate byte to halfword.  */
ce426f
+	insrwi	rCHR, rCHR, 8, 16     /* Replicate byte to halfword.  */
ce426f
 	beq+	L(aligned)
ce426f
 	mtcrf	0x01, rMEMP0
ce426f
 	subfic	rALIGN, rALIGN, 4
ce426f
@@ -67,7 +67,7 @@ L(g0):
ce426f
 /* Handle the case of size < 31.  */
ce426f
 L(aligned):
ce426f
 	mtcrf	0x01, rLEN
ce426f
-	insrdi	rCHR, rCHR, 16, 32    /* Replicate halfword to word.  */
ce426f
+	insrwi	rCHR, rCHR, 16, 0    /* Replicate halfword to word.  */
ce426f
 	ble	cr5, L(medium)
ce426f
 /* Align to 32-byte boundary.  */
ce426f
 	andi.	rALIGN, rMEMP, 0x1C
ce426f
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S
ce426f
===================================================================
ce426f
--- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power6/memset.S
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S
ce426f
@@ -50,7 +50,7 @@ L(_memset):
ce426f
 	ble-	cr1, L(small)
ce426f
 /* Align to word boundary.  */
ce426f
 	cmplwi	cr5, rLEN, 31
ce426f
-	insrdi	rCHR, rCHR, 8, 48	/* Replicate byte to halfword.  */
ce426f
+	insrwi	rCHR, rCHR, 8, 16	/* Replicate byte to halfword.  */
ce426f
 	beq+	L(aligned)
ce426f
 	mtcrf	0x01, rMEMP0
ce426f
 	subfic	rALIGN, rALIGN, 4
ce426f
@@ -66,7 +66,7 @@ L(g0):
ce426f
 /* Handle the case of size < 31.  */
ce426f
 L(aligned):
ce426f
 	mtcrf	0x01, rLEN
ce426f
-	insrdi	rCHR, rCHR, 16, 32	/* Replicate halfword to word.  */
ce426f
+	insrwi	rCHR, rCHR, 16, 0	/* Replicate halfword to word.  */
ce426f
 	ble	cr5, L(medium)
ce426f
 /* Align to 32-byte boundary.  */
ce426f
 	andi.	rALIGN, rMEMP, 0x1C
ce426f
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S
ce426f
===================================================================
ce426f
--- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/memset.S
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S
ce426f
@@ -37,8 +37,8 @@ L(_memset):
ce426f
 	cfi_offset(31,-8)
ce426f
 
ce426f
 	/* Replicate byte to word.  */
ce426f
-	insrdi	4,4,8,48
ce426f
-	insrdi	4,4,16,32
ce426f
+	insrwi	4,4,8,16
ce426f
+	insrwi	4,4,16,0
ce426f
 
ce426f
 	ble	cr6,L(small)	/* If length <= 8, use short copy code.  */
ce426f
 
ce426f
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
ce426f
===================================================================
ce426f
--- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/rawmemchr.S
ce426f
@@ -29,8 +29,8 @@ ENTRY (BP_SYM(__rawmemchr))
ce426f
 	clrrwi	r8,r3,2	      /* Align the address to word boundary.  */
ce426f
 
ce426f
 	/* Replicate byte to word.  */
ce426f
-	rldimi	r4,r4,8,48
ce426f
-	rldimi	r4,r4,16,32
ce426f
+	insrwi	r4,r4,8,16
ce426f
+	insrwi	r4,r4,16,0
ce426f
 
ce426f
 	/* Now r4 has a word of c bytes.  */
ce426f
 
ce426f
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
ce426f
===================================================================
ce426f
--- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/strchr.S
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
ce426f
@@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr))
ce426f
 	beq	cr7,L(null_match)
ce426f
 
ce426f
 	/* Replicate byte to word.  */
ce426f
-	insrdi	r4,r4,8,48
ce426f
-	insrdi	r4,r4,16,32
ce426f
+	insrwi	r4,r4,8,16
ce426f
+	insrwi	r4,r4,16,0
ce426f
 
ce426f
 	/* Now r4 has a word of c bytes and r0 has
ce426f
 	   a word of null bytes.  */
ce426f
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S
ce426f
===================================================================
ce426f
--- glibc-2.17-c758a686.orig/sysdeps/powerpc/powerpc32/power7/strchrnul.S
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S
ce426f
@@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul))
ce426f
 	clrrwi	r8,r3,2	      /* Align the address to word boundary.  */
ce426f
 
ce426f
 	/* Replicate byte to word.  */
ce426f
-	insrdi	r4,r4,8,48
ce426f
-	insrdi	r4,r4,16,32
ce426f
+	insrwi  r4,r4,8,16
ce426f
+	insrwi  r4,r4,16,0
ce426f
 
ce426f
 	rlwinm	r6,r3,3,27,28 /* Calculate padding.  */
ce426f
 	lwz	r12,0(r8)     /* Load word from memory.  */