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