|
| 1 | +/*************************************************************************** |
| 2 | +Copyright (c) 2020, The OpenBLAS Project |
| 3 | +All rights reserved. |
| 4 | +Redistribution and use in source and binary forms, with or without |
| 5 | +modification, are permitted provided that the following conditions are |
| 6 | +met: |
| 7 | +1. Redistributions of source code must retain the above copyright |
| 8 | +notice, this list of conditions and the following disclaimer. |
| 9 | +2. Redistributions in binary form must reproduce the above copyright |
| 10 | +notice, this list of conditions and the following disclaimer in |
| 11 | +the documentation and/or other materials provided with the |
| 12 | +distribution. |
| 13 | +3. Neither the name of the OpenBLAS project nor the names of |
| 14 | +its contributors may be used to endorse or promote products |
| 15 | +derived from this software without specific prior written permission. |
| 16 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 | +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 19 | +ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE |
| 20 | +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 | +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 22 | +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 23 | +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
| 25 | +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | +*****************************************************************************/ |
| 27 | + |
| 28 | +#define HAVE_KERNEL_64 1 |
| 29 | + |
| 30 | +static void dcopy_kernel_64 (long n, double *x, double *y) |
| 31 | +{ |
| 32 | + __asm__ |
| 33 | + ( |
| 34 | + "lxvp 32, 0(%2) \n\t" |
| 35 | + "lxvp 34, 32(%2) \n\t" |
| 36 | + "lxvp 36, 64(%2) \n\t" |
| 37 | + "lxvp 38, 96(%2) \n\t" |
| 38 | + "lxvp 40, 128(%2) \n\t" |
| 39 | + "lxvp 42, 160(%2) \n\t" |
| 40 | + "lxvp 44, 192(%2) \n\t" |
| 41 | + "lxvp 46, 224(%2) \n\t" |
| 42 | + |
| 43 | + "lxvp 48, 256(%2) \n\t" |
| 44 | + "lxvp 50, 288(%2) \n\t" |
| 45 | + "lxvp 52, 320(%2) \n\t" |
| 46 | + "lxvp 54, 352(%2) \n\t" |
| 47 | + "lxvp 56, 384(%2) \n\t" |
| 48 | + "lxvp 58, 416(%2) \n\t" |
| 49 | + "lxvp 60, 448(%2) \n\t" |
| 50 | + "lxvp 62, 480(%2) \n\t" |
| 51 | + "addi %2, %2, 512 \n\t" |
| 52 | + |
| 53 | + "addic. %1, %1, -64 \n\t" |
| 54 | + "ble two%= \n\t" |
| 55 | + |
| 56 | + ".align 5 \n" |
| 57 | + "one%=: \n\t" |
| 58 | + |
| 59 | + "stxvp 32, 0(%3) \n\t" |
| 60 | + "lxvp 32, 0(%2) \n\t" |
| 61 | + "stxvp 34, 32(%3) \n\t" |
| 62 | + "lxvp 34, 32(%2) \n\t" |
| 63 | + "stxvp 36, 64(%3) \n\t" |
| 64 | + "lxvp 36, 64(%2) \n\t" |
| 65 | + "stxvp 38, 96(%3) \n\t" |
| 66 | + "lxvp 38, 96(%2) \n\t" |
| 67 | + |
| 68 | + "stxvp 40, 128(%3) \n\t" |
| 69 | + "lxvp 40, 128(%2) \n\t" |
| 70 | + "stxvp 42, 160(%3) \n\t" |
| 71 | + "lxvp 42, 160(%2) \n\t" |
| 72 | + "stxvp 44, 192(%3) \n\t" |
| 73 | + "lxvp 44, 192(%2) \n\t" |
| 74 | + "stxvp 46, 224(%3) \n\t" |
| 75 | + "lxvp 46, 224(%2) \n\t" |
| 76 | + |
| 77 | + "stxvp 48, 256(%3) \n\t" |
| 78 | + "lxvp 48, 256(%2) \n\t" |
| 79 | + "stxvp 50, 288(%3) \n\t" |
| 80 | + "lxvp 50, 288(%2) \n\t" |
| 81 | + "stxvp 52, 320(%3) \n\t" |
| 82 | + "lxvp 52, 320(%2) \n\t" |
| 83 | + "stxvp 54, 352(%3) \n\t" |
| 84 | + "lxvp 54, 352(%2) \n\t" |
| 85 | + "stxvp 56, 384(%3) \n\t" |
| 86 | + "lxvp 56, 384(%2) \n\t" |
| 87 | + "stxvp 58, 416(%3) \n\t" |
| 88 | + "lxvp 58, 416(%2) \n\t" |
| 89 | + "stxvp 60, 448(%3) \n\t" |
| 90 | + "lxvp 60, 448(%2) \n\t" |
| 91 | + "stxvp 62, 480(%3) \n\t" |
| 92 | + "lxvp 62, 480(%2) \n\t" |
| 93 | + |
| 94 | + "addi %3, %3, 512 \n\t" |
| 95 | + "addi %2, %2, 512 \n\t" |
| 96 | + |
| 97 | + "addic. %1, %1, -64 \n\t" |
| 98 | + "bgt one%= \n" |
| 99 | + |
| 100 | + "two%=: \n\t" |
| 101 | + |
| 102 | + "stxvp 32, 0(%3) \n\t" |
| 103 | + "stxvp 34, 32(%3) \n\t" |
| 104 | + "stxvp 36, 64(%3) \n\t" |
| 105 | + "stxvp 38, 96(%3) \n\t" |
| 106 | + "stxvp 40, 128(%3) \n\t" |
| 107 | + "stxvp 42, 160(%3) \n\t" |
| 108 | + "stxvp 44, 192(%3) \n\t" |
| 109 | + "stxvp 46, 224(%3) \n\t" |
| 110 | + "stxvp 48, 256(%3) \n\t" |
| 111 | + "stxvp 50, 288(%3) \n\t" |
| 112 | + "stxvp 52, 320(%3) \n\t" |
| 113 | + "stxvp 54, 352(%3) \n\t" |
| 114 | + "stxvp 56, 384(%3) \n\t" |
| 115 | + "stxvp 58, 416(%3) \n\t" |
| 116 | + "stxvp 60, 448(%3) \n\t" |
| 117 | + "stxvp 62, 480(%3) \n\t" |
| 118 | + |
| 119 | + "#n=%1 x=%4=%2 y=%0=%3" |
| 120 | + : |
| 121 | + "=m" (*y), |
| 122 | + "+r" (n), // 1 |
| 123 | + "+b" (x), // 2 |
| 124 | + "+b" (y) // 3 |
| 125 | + : |
| 126 | + "m" (*x) |
| 127 | + : |
| 128 | + "cr0", |
| 129 | + "vs32","vs33","vs34","vs35","vs36","vs37","vs38","vs39", |
| 130 | + "vs40","vs41","vs42","vs43","vs44","vs45","vs46","vs47", |
| 131 | + "vs48","vs49","vs50","vs51","vs52","vs53","vs54","vs55", |
| 132 | + "vs56","vs57","vs58","vs59","vs60","vs61","vs62","vs63" |
| 133 | + ); |
| 134 | +} |
0 commit comments