diff options
author | Olof Johansson <olof@lixom.net> | 2007-03-22 10:34:13 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-12 13:55:13 -0400 |
commit | 3467bfd340f9ad48f3732415533a2e9c18240b62 (patch) | |
tree | 91f57918199d9508868aa0889a5b2aca4cc1da13 /arch/powerpc/lib/memcpy_64.S | |
parent | 569975591c5530fdc9c7a3c45122e5e46f075a74 (diff) |
[POWERPC] Use mtocrf instruction in asm when CONFIG_POWER4_ONLY=y
mtocrf is a faster single-field mtcrf (move to condition register
fields) instruction available in POWER4 and later processors. It can
make quite a difference in performance on some implementations, so use
it for CONFIG_POWER4_ONLY builds.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/lib/memcpy_64.S')
-rw-r--r-- | arch/powerpc/lib/memcpy_64.S | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S index 7173ba98f427..3f131129d1c1 100644 --- a/arch/powerpc/lib/memcpy_64.S +++ b/arch/powerpc/lib/memcpy_64.S | |||
@@ -12,7 +12,7 @@ | |||
12 | .align 7 | 12 | .align 7 |
13 | _GLOBAL(memcpy) | 13 | _GLOBAL(memcpy) |
14 | std r3,48(r1) /* save destination pointer for return value */ | 14 | std r3,48(r1) /* save destination pointer for return value */ |
15 | mtcrf 0x01,r5 | 15 | PPC_MTOCRF 0x01,r5 |
16 | cmpldi cr1,r5,16 | 16 | cmpldi cr1,r5,16 |
17 | neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry | 17 | neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry |
18 | andi. r6,r6,7 | 18 | andi. r6,r6,7 |
@@ -128,7 +128,7 @@ _GLOBAL(memcpy) | |||
128 | b .Ldo_tail | 128 | b .Ldo_tail |
129 | 129 | ||
130 | .Ldst_unaligned: | 130 | .Ldst_unaligned: |
131 | mtcrf 0x01,r6 # put #bytes to 8B bdry into cr7 | 131 | PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 |
132 | subf r5,r6,r5 | 132 | subf r5,r6,r5 |
133 | li r7,0 | 133 | li r7,0 |
134 | cmpldi r1,r5,16 | 134 | cmpldi r1,r5,16 |
@@ -143,7 +143,7 @@ _GLOBAL(memcpy) | |||
143 | 2: bf cr7*4+1,3f | 143 | 2: bf cr7*4+1,3f |
144 | lwzx r0,r7,r4 | 144 | lwzx r0,r7,r4 |
145 | stwx r0,r7,r3 | 145 | stwx r0,r7,r3 |
146 | 3: mtcrf 0x01,r5 | 146 | 3: PPC_MTOCRF 0x01,r5 |
147 | add r4,r6,r4 | 147 | add r4,r6,r4 |
148 | add r3,r6,r3 | 148 | add r3,r6,r3 |
149 | b .Ldst_aligned | 149 | b .Ldst_aligned |