1dnl PowerPC 750 mpn_com -- mpn bitwise one's complement 2 3dnl Copyright 2002, 2003 Free Software Foundation, Inc. 4dnl 5dnl This file is part of the GNU MP Library. 6dnl 7dnl The GNU MP Library is free software; you can redistribute it and/or 8dnl modify it under the terms of the GNU Lesser General Public License as 9dnl published by the Free Software Foundation; either version 3 of the 10dnl License, or (at your option) any later version. 11dnl 12dnl The GNU MP Library is distributed in the hope that it will be useful, 13dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 14dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15dnl Lesser General Public License for more details. 16dnl 17dnl You should have received a copy of the GNU Lesser General Public License 18dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. 19 20include(`../config.m4') 21 22 23C cycles/limb 24C 603e: ? 25C 604e: 3.0 26C 75x (G3): 2.0 27C 7400,7410 (G4): 2.0 28C 744x,745x (G4+): 3.0 29 30C void mpn_com (mp_ptr dst, mp_srcptr src, mp_size_t size); 31C 32C This loop form is necessary for the claimed speed. 33 34ASM_START() 35PROLOGUE(mpn_com) 36 37 C r3 dst 38 C r4 src 39 C r5 size 40 41 mtctr r5 C size 42 lwz r5, 0(r4) C src low limb 43 44 sub r4, r4, r3 C src-dst 45 subi r3, r3, 4 C dst-4 46 47 addi r4, r4, 8 C src-dst+8 48 bdz L(one) 49 50L(top): 51 C r3 &dst[i-1] 52 C r4 src-dst 53 C r5 src[i] 54 C r6 scratch 55 56 not r6, r5 C ~src[i] 57 lwzx r5, r4,r3 C src[i+1] 58 59 stwu r6, 4(r3) C dst[i] 60 bdnz L(top) 61 62L(one): 63 not r6, r5 64 65 stw r6, 4(r3) C dst[size-1] 66 blr 67 68EPILOGUE() 69