yann@966: Fix memset on PowerPC 8xx, by Nye Liu: yann@966: http://sourceware.org/ml/crossgcc/2008-10/msg00067.html yann@966: yann@966: Quote: yann@966: I am working on a powerpc 860 toolchain, but I am having problems yann@966: convincing glibc to not emit code that uses the dcbz instruction (CPU15 yann@966: dcbX bug). The source of the problem is sysdeps/powerpc/power3/memset.S yann@966: yann@966: --- glibc-2.7/sysdeps/powerpc/powerpc32/memset.S 2007-03-26 13:09:07.000000000 -0700 yann@1016: +++ glibc-2.7/sysdeps/powerpc/powerpc32/memset.S.new 2008-10-23 20:28:52.000000000 -0700 yann@966: @@ -112,11 +112,13 @@ yann@966: clrrwi. rALIGN, rLEN, 5 yann@966: mtcrf 0x01, rLEN /* 40th instruction from .align */ yann@966: yann@966: +#ifndef BROKEN_PPC_8xx_CPU15 yann@966: /* Check if we can use the special case for clearing memory using dcbz. yann@966: This requires that we know the correct cache line size for this yann@966: processor. Getting the __cache_line_size may require establishing GOT yann@966: addressability, so branch out of line to set this up. */ yann@966: beq cr1, L(checklinesize) yann@966: +#endif yann@966: yann@966: /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary. yann@966: Can't assume that rCHR is zero or that the cache line size is either yann@1016: @@ -158,6 +160,7 @@ yann@1016: add rMEMP, rMEMP, rALIGN yann@1016: b L(medium_tail2) /* 72nd instruction from .align */ yann@1016: yann@1016: +#ifndef BROKEN_PPC_8xx_CPU15 yann@1016: .align 5 yann@1016: nop yann@1016: /* Clear cache lines of memory in 128-byte chunks. yann@1016: @@ -191,6 +194,7 @@ yann@1016: bdnz L(zloop) yann@1016: beqlr cr5 yann@1016: b L(medium_tail2) yann@1016: +#endif /* ! BROKEN_PPC_8xx_CPU15 */ yann@1016: yann@1016: .align 5 yann@1016: L(small): yann@1016: @@ -248,6 +252,7 @@ yann@966: stw rCHR, -8(rMEMP) yann@966: blr yann@966: yann@966: +#ifndef BROKEN_PPC_8xx_CPU15 yann@966: L(checklinesize): yann@966: #ifdef SHARED yann@966: mflr rTMP yann@1016: @@ -329,6 +334,7 @@ yann@966: L(handletail32): yann@966: clrrwi. rALIGN, rLEN, 5 yann@966: b L(nondcbz) yann@966: +#endif /* ! BROKEN_PPC_8xx_CPU15 */ yann@966: yann@966: END (BP_SYM (memset)) yann@966: libc_hidden_builtin_def (memset)