Path: blob/main/lib/libc/powerpc64/string/bcopy_vsx.S
39530 views
/*-1* Copyright (c) 2018 Instituto de Pesquisas Eldorado2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12* 3. Neither the name of the author nor the names of its contributors may13* be used to endorse or promote products derived from this software14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#ifndef FN_NAME29#define FN_NAME __bcopy_vsx30#endif3132/*33* r3: dst34* r4: src35* r5: block increment36* r6: blocks to copy37* r7/r8/r9/r10: 16-byte offsets to copy38*/3940#define FN_PHASE2 \41mtctr %r6 ;\42.align 5 ;\43.Lphase2_loop: ;\44lxvd2x %vs6, %r7, %r4 ;\45lxvd2x %vs7, %r8, %r4 ;\46lxvd2x %vs8, %r9, %r4 ;\47lxvd2x %vs9, %r10, %r4 ;\48stxvd2x %vs6, %r7, %r3 ;\49stxvd2x %vs7, %r8, %r3 ;\50stxvd2x %vs8, %r9, %r3 ;\51stxvd2x %vs9, %r10, %r3 ;\52/* phase 2 increment */ ;\53add %r4, %r4, %r5 ;\54add %r3, %r3, %r5 ;\55\56bdnz .Lphase2_loop ;\5758#include "bcopy.S"596061