This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix for the 4-operand mtfsf instruction use in *context functions(powerpc)
- From: Carlos Eduardo Seo <cseo at linux dot vnet dot ibm dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 30 Mar 2009 21:42:59 -0300
- Subject: [PATCH] Fix for the 4-operand mtfsf instruction use in *context functions(powerpc)
- Openpgp: id=8BFFA900
Hello
A recent change added
.machine push
.machine "power6"
<mtfsf usage>
.machine pop
guard around the usage of a 4 operand mtfsf instruction in
set/swapcontext functions for Power when _ARCH_PWR6 is not defined
I noticed that we also need these when _ARCH_PWR6 is defined, since it
doesn't define .machine "power6", otherwise the build will fail. The
attached patch fixes this.
Tested this building glibc with --with-cpu=power6 in a POWER6 system.
Comments?
--
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center
2008-03-30 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
Added .machine "power6" when _ARCH_PWR6 is defined as well to deal
with the 4-operand mtfsf instruction on POWER6.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
Index: glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -201,8 +201,11 @@ ENTRY(__CONTEXT_FUNC_NAME)
lfd fp31,_UC_FREGS+(32*8)(r31)
lfd fp0,_UC_FREGS+(0*8)(r31)
# ifdef _ARCH_PWR6
+ .machine push
+ .machine "power6"
/* Use the extended four-operand version of the mtfsf insn. */
mtfsf 0xff,fp31,1,0
+ .machine pop
# else
.machine push
.machine "power6"
Index: glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -427,8 +427,11 @@ ENTRY(__CONTEXT_FUNC_NAME)
lfd fp31,_UC_FREGS+(32*8)(r31)
lfd fp0,_UC_FREGS+(0*8)(r31)
# ifdef _ARCH_PWR6
+ .machine push
+ .machine "power6"
/* Use the extended four-operand version of the mtfsf insn. */
mtfsf 0xff,fp31,1,0
+ .machine pop
# else
.machine push
.machine "power6"
Index: glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -84,8 +84,11 @@ ENTRY(__novec_setcontext)
lfd fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
# ifdef _ARCH_PWR6
+ .machine push
+ .machine "power6"
/* Use the extended four-operand version of the mtfsf insn. */
mtfsf 0xff,fp0,1,0
+ .machine pop
# else
.machine push
.machine "power6"
@@ -375,8 +378,11 @@ L(has_no_vec):
lfd fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
# ifdef _ARCH_PWR6
+ .machine push
+ .machine "power6"
/* Use the extended four-operand version of the mtfsf insn. */
mtfsf 0xff,fp0,1,0
+ .machine pop
# else
.machine push
.machine "power6"
Index: glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
===================================================================
--- glibc.orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -178,8 +178,11 @@ ENTRY(__novec_swapcontext)
lfd fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
lfd fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
# ifdef _ARCH_PWR6
+ .machine push
+ .machine "power6"
/* Use the extended four-operand version of the mtfsf insn. */
mtfsf 0xff,fp0,1,0
+ .machine pop
# else
.machine push
.machine "power6"
@@ -673,8 +676,11 @@ L(has_no_vec2):
lfd fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
lfd fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
# ifdef _ARCH_PWR6
+ .machine push
+ .machine "power6"
/* Use the extended four-operand version of the mtfsf insn. */
mtfsf 0xff,fp0,1,0
+ .machine pop
# else
.machine push
.machine "power6"