|
kusano |
2b45e8 |
/*********************************************************************/
|
|
kusano |
2b45e8 |
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
|
kusano |
2b45e8 |
/* All rights reserved. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* Redistribution and use in source and binary forms, with or */
|
|
kusano |
2b45e8 |
/* without modification, are permitted provided that the following */
|
|
kusano |
2b45e8 |
/* conditions are met: */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* 1. Redistributions of source code must retain the above */
|
|
kusano |
2b45e8 |
/* copyright notice, this list of conditions and the following */
|
|
kusano |
2b45e8 |
/* disclaimer. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* 2. Redistributions in binary form must reproduce the above */
|
|
kusano |
2b45e8 |
/* copyright notice, this list of conditions and the following */
|
|
kusano |
2b45e8 |
/* disclaimer in the documentation and/or other materials */
|
|
kusano |
2b45e8 |
/* provided with the distribution. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
|
|
kusano |
2b45e8 |
/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
|
|
kusano |
2b45e8 |
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
|
|
kusano |
2b45e8 |
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
|
|
kusano |
2b45e8 |
/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
|
|
kusano |
2b45e8 |
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
|
|
kusano |
2b45e8 |
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
|
|
kusano |
2b45e8 |
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
|
|
kusano |
2b45e8 |
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
|
|
kusano |
2b45e8 |
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
|
|
kusano |
2b45e8 |
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
|
|
kusano |
2b45e8 |
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
|
|
kusano |
2b45e8 |
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
|
|
kusano |
2b45e8 |
/* POSSIBILITY OF SUCH DAMAGE. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* The views and conclusions contained in the software and */
|
|
kusano |
2b45e8 |
/* documentation are those of the authors and should not be */
|
|
kusano |
2b45e8 |
/* interpreted as representing official policies, either expressed */
|
|
kusano |
2b45e8 |
/* or implied, of The University of Texas at Austin. */
|
|
kusano |
2b45e8 |
/*********************************************************************/
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#include <stdio.h></stdio.h>
|
|
kusano |
2b45e8 |
#include "common.h"
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLONG posY, FLOAT *b){
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
BLASLONG i, js, ii;
|
|
kusano |
2b45e8 |
BLASLONG X;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
FLOAT *ao1, *ao2, *ao3, *ao4, *ao5, *ao6, *ao7, *ao8;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lda += lda;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
js = (n >> 3);
|
|
kusano |
2b45e8 |
if (js > 0){
|
|
kusano |
2b45e8 |
do {
|
|
kusano |
2b45e8 |
X = posX;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (posX <= posY) {
|
|
kusano |
2b45e8 |
ao1 = a + posX * 2 + (posY + 0) * lda;
|
|
kusano |
2b45e8 |
ao2 = a + posX * 2 + (posY + 1) * lda;
|
|
kusano |
2b45e8 |
ao3 = a + posX * 2 + (posY + 2) * lda;
|
|
kusano |
2b45e8 |
ao4 = a + posX * 2 + (posY + 3) * lda;
|
|
kusano |
2b45e8 |
ao5 = a + posX * 2 + (posY + 4) * lda;
|
|
kusano |
2b45e8 |
ao6 = a + posX * 2 + (posY + 5) * lda;
|
|
kusano |
2b45e8 |
ao7 = a + posX * 2 + (posY + 6) * lda;
|
|
kusano |
2b45e8 |
ao8 = a + posX * 2 + (posY + 7) * lda;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
ao1 = a + posY * 2 + (posX + 0) * lda;
|
|
kusano |
2b45e8 |
ao2 = a + posY * 2 + (posX + 1) * lda;
|
|
kusano |
2b45e8 |
ao3 = a + posY * 2 + (posX + 2) * lda;
|
|
kusano |
2b45e8 |
ao4 = a + posY * 2 + (posX + 3) * lda;
|
|
kusano |
2b45e8 |
ao5 = a + posY * 2 + (posX + 4) * lda;
|
|
kusano |
2b45e8 |
ao6 = a + posY * 2 + (posX + 5) * lda;
|
|
kusano |
2b45e8 |
ao7 = a + posY * 2 + (posX + 6) * lda;
|
|
kusano |
2b45e8 |
ao8 = a + posY * 2 + (posX + 7) * lda;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
i = (m >> 3);
|
|
kusano |
2b45e8 |
if (i > 0) {
|
|
kusano |
2b45e8 |
do {
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
for (ii = 0; ii < 8; ii++){
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 0);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 1);
|
|
kusano |
2b45e8 |
b[ 10] = *(ao6 + 0);
|
|
kusano |
2b45e8 |
b[ 11] = *(ao6 + 1);
|
|
kusano |
2b45e8 |
b[ 12] = *(ao7 + 0);
|
|
kusano |
2b45e8 |
b[ 13] = *(ao7 + 1);
|
|
kusano |
2b45e8 |
b[ 14] = *(ao8 + 0);
|
|
kusano |
2b45e8 |
b[ 15] = *(ao8 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 2;
|
|
kusano |
2b45e8 |
ao2 += 2;
|
|
kusano |
2b45e8 |
ao3 += 2;
|
|
kusano |
2b45e8 |
ao4 += 2;
|
|
kusano |
2b45e8 |
ao5 += 2;
|
|
kusano |
2b45e8 |
ao6 += 2;
|
|
kusano |
2b45e8 |
ao7 += 2;
|
|
kusano |
2b45e8 |
ao8 += 2;
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += 8 * lda;
|
|
kusano |
2b45e8 |
ao2 += 8 * lda;
|
|
kusano |
2b45e8 |
ao3 += 8 * lda;
|
|
kusano |
2b45e8 |
ao4 += 8 * lda;
|
|
kusano |
2b45e8 |
ao5 += 8 * lda;
|
|
kusano |
2b45e8 |
ao6 += 8 * lda;
|
|
kusano |
2b45e8 |
ao7 += 8 * lda;
|
|
kusano |
2b45e8 |
ao8 += 8 * lda;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b += 128;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 0);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 1);
|
|
kusano |
2b45e8 |
b[ 10] = *(ao6 + 0);
|
|
kusano |
2b45e8 |
b[ 11] = *(ao6 + 1);
|
|
kusano |
2b45e8 |
b[ 12] = *(ao7 + 0);
|
|
kusano |
2b45e8 |
b[ 13] = *(ao7 + 1);
|
|
kusano |
2b45e8 |
b[ 14] = *(ao8 + 0);
|
|
kusano |
2b45e8 |
b[ 15] = *(ao8 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 16] = ZERO;
|
|
kusano |
2b45e8 |
b[ 17] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 18] = ONE;
|
|
kusano |
2b45e8 |
b[ 19] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 18] = *(ao2 + 2);
|
|
kusano |
2b45e8 |
b[ 19] = *(ao2 + 3);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 20] = *(ao3 + 2);
|
|
kusano |
2b45e8 |
b[ 21] = *(ao3 + 3);
|
|
kusano |
2b45e8 |
b[ 22] = *(ao4 + 2);
|
|
kusano |
2b45e8 |
b[ 23] = *(ao4 + 3);
|
|
kusano |
2b45e8 |
b[ 24] = *(ao5 + 2);
|
|
kusano |
2b45e8 |
b[ 25] = *(ao5 + 3);
|
|
kusano |
2b45e8 |
b[ 26] = *(ao6 + 2);
|
|
kusano |
2b45e8 |
b[ 27] = *(ao6 + 3);
|
|
kusano |
2b45e8 |
b[ 28] = *(ao7 + 2);
|
|
kusano |
2b45e8 |
b[ 29] = *(ao7 + 3);
|
|
kusano |
2b45e8 |
b[ 30] = *(ao8 + 2);
|
|
kusano |
2b45e8 |
b[ 31] = *(ao8 + 3);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 32] = ZERO;
|
|
kusano |
2b45e8 |
b[ 33] = ZERO;
|
|
kusano |
2b45e8 |
b[ 34] = ZERO;
|
|
kusano |
2b45e8 |
b[ 35] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 36] = ONE;
|
|
kusano |
2b45e8 |
b[ 37] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 36] = *(ao3 + 4);
|
|
kusano |
2b45e8 |
b[ 37] = *(ao3 + 5);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 38] = *(ao4 + 4);
|
|
kusano |
2b45e8 |
b[ 39] = *(ao4 + 5);
|
|
kusano |
2b45e8 |
b[ 40] = *(ao5 + 4);
|
|
kusano |
2b45e8 |
b[ 41] = *(ao5 + 5);
|
|
kusano |
2b45e8 |
b[ 42] = *(ao6 + 4);
|
|
kusano |
2b45e8 |
b[ 43] = *(ao6 + 5);
|
|
kusano |
2b45e8 |
b[ 44] = *(ao7 + 4);
|
|
kusano |
2b45e8 |
b[ 45] = *(ao7 + 5);
|
|
kusano |
2b45e8 |
b[ 46] = *(ao8 + 4);
|
|
kusano |
2b45e8 |
b[ 47] = *(ao8 + 5);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 48] = ZERO;
|
|
kusano |
2b45e8 |
b[ 49] = ZERO;
|
|
kusano |
2b45e8 |
b[ 50] = ZERO;
|
|
kusano |
2b45e8 |
b[ 51] = ZERO;
|
|
kusano |
2b45e8 |
b[ 52] = ZERO;
|
|
kusano |
2b45e8 |
b[ 53] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 54] = ONE;
|
|
kusano |
2b45e8 |
b[ 55] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 54] = *(ao4 + 6);
|
|
kusano |
2b45e8 |
b[ 55] = *(ao4 + 7);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 56] = *(ao5 + 6);
|
|
kusano |
2b45e8 |
b[ 57] = *(ao5 + 7);
|
|
kusano |
2b45e8 |
b[ 58] = *(ao6 + 6);
|
|
kusano |
2b45e8 |
b[ 59] = *(ao6 + 7);
|
|
kusano |
2b45e8 |
b[ 60] = *(ao7 + 6);
|
|
kusano |
2b45e8 |
b[ 61] = *(ao7 + 7);
|
|
kusano |
2b45e8 |
b[ 62] = *(ao8 + 6);
|
|
kusano |
2b45e8 |
b[ 63] = *(ao8 + 7);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 64] = ZERO;
|
|
kusano |
2b45e8 |
b[ 65] = ZERO;
|
|
kusano |
2b45e8 |
b[ 66] = ZERO;
|
|
kusano |
2b45e8 |
b[ 67] = ZERO;
|
|
kusano |
2b45e8 |
b[ 68] = ZERO;
|
|
kusano |
2b45e8 |
b[ 69] = ZERO;
|
|
kusano |
2b45e8 |
b[ 70] = ZERO;
|
|
kusano |
2b45e8 |
b[ 71] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 72] = ONE;
|
|
kusano |
2b45e8 |
b[ 73] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 72] = *(ao5 + 8);
|
|
kusano |
2b45e8 |
b[ 73] = *(ao5 + 9);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 74] = *(ao6 + 8);
|
|
kusano |
2b45e8 |
b[ 75] = *(ao6 + 9);
|
|
kusano |
2b45e8 |
b[ 76] = *(ao7 + 8);
|
|
kusano |
2b45e8 |
b[ 77] = *(ao7 + 9);
|
|
kusano |
2b45e8 |
b[ 78] = *(ao8 + 8);
|
|
kusano |
2b45e8 |
b[ 79] = *(ao8 + 9);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 80] = ZERO;
|
|
kusano |
2b45e8 |
b[ 81] = ZERO;
|
|
kusano |
2b45e8 |
b[ 82] = ZERO;
|
|
kusano |
2b45e8 |
b[ 83] = ZERO;
|
|
kusano |
2b45e8 |
b[ 84] = ZERO;
|
|
kusano |
2b45e8 |
b[ 85] = ZERO;
|
|
kusano |
2b45e8 |
b[ 86] = ZERO;
|
|
kusano |
2b45e8 |
b[ 87] = ZERO;
|
|
kusano |
2b45e8 |
b[ 88] = ZERO;
|
|
kusano |
2b45e8 |
b[ 89] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 90] = ONE;
|
|
kusano |
2b45e8 |
b[ 91] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 90] = *(ao6 + 10);
|
|
kusano |
2b45e8 |
b[ 91] = *(ao6 + 11);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 92] = *(ao7 + 10);
|
|
kusano |
2b45e8 |
b[ 93] = *(ao7 + 11);
|
|
kusano |
2b45e8 |
b[ 94] = *(ao8 + 10);
|
|
kusano |
2b45e8 |
b[ 95] = *(ao8 + 11);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 96] = ZERO;
|
|
kusano |
2b45e8 |
b[ 97] = ZERO;
|
|
kusano |
2b45e8 |
b[ 98] = ZERO;
|
|
kusano |
2b45e8 |
b[ 99] = ZERO;
|
|
kusano |
2b45e8 |
b[100] = ZERO;
|
|
kusano |
2b45e8 |
b[101] = ZERO;
|
|
kusano |
2b45e8 |
b[102] = ZERO;
|
|
kusano |
2b45e8 |
b[103] = ZERO;
|
|
kusano |
2b45e8 |
b[104] = ZERO;
|
|
kusano |
2b45e8 |
b[105] = ZERO;
|
|
kusano |
2b45e8 |
b[106] = ZERO;
|
|
kusano |
2b45e8 |
b[107] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[108] = ONE;
|
|
kusano |
2b45e8 |
b[109] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[108] = *(ao7 + 12);
|
|
kusano |
2b45e8 |
b[109] = *(ao7 + 13);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[110] = *(ao8 + 12);
|
|
kusano |
2b45e8 |
b[111] = *(ao8 + 13);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[112] = ZERO;
|
|
kusano |
2b45e8 |
b[113] = ZERO;
|
|
kusano |
2b45e8 |
b[114] = ZERO;
|
|
kusano |
2b45e8 |
b[115] = ZERO;
|
|
kusano |
2b45e8 |
b[116] = ZERO;
|
|
kusano |
2b45e8 |
b[117] = ZERO;
|
|
kusano |
2b45e8 |
b[118] = ZERO;
|
|
kusano |
2b45e8 |
b[119] = ZERO;
|
|
kusano |
2b45e8 |
b[120] = ZERO;
|
|
kusano |
2b45e8 |
b[121] = ZERO;
|
|
kusano |
2b45e8 |
b[122] = ZERO;
|
|
kusano |
2b45e8 |
b[123] = ZERO;
|
|
kusano |
2b45e8 |
b[124] = ZERO;
|
|
kusano |
2b45e8 |
b[125] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[126] = ONE;
|
|
kusano |
2b45e8 |
b[127] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[126] = *(ao8 + 14);
|
|
kusano |
2b45e8 |
b[127] = *(ao8 + 15);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 8 * lda;
|
|
kusano |
2b45e8 |
ao2 += 8 * lda;
|
|
kusano |
2b45e8 |
ao3 += 8 * lda;
|
|
kusano |
2b45e8 |
ao4 += 8 * lda;
|
|
kusano |
2b45e8 |
ao5 += 8 * lda;
|
|
kusano |
2b45e8 |
ao6 += 8 * lda;
|
|
kusano |
2b45e8 |
ao7 += 8 * lda;
|
|
kusano |
2b45e8 |
ao8 += 8 * lda;
|
|
kusano |
2b45e8 |
b += 128;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
X += 8;
|
|
kusano |
2b45e8 |
i --;
|
|
kusano |
2b45e8 |
} while (i > 0);
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
i = (m & 7);
|
|
kusano |
2b45e8 |
if (i) {
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
for (ii = 0; ii < i; ii++){
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 0);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 1);
|
|
kusano |
2b45e8 |
b[ 10] = *(ao6 + 0);
|
|
kusano |
2b45e8 |
b[ 11] = *(ao6 + 1);
|
|
kusano |
2b45e8 |
b[ 12] = *(ao7 + 0);
|
|
kusano |
2b45e8 |
b[ 13] = *(ao7 + 1);
|
|
kusano |
2b45e8 |
b[ 14] = *(ao8 + 0);
|
|
kusano |
2b45e8 |
b[ 15] = *(ao8 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 2;
|
|
kusano |
2b45e8 |
ao2 += 2;
|
|
kusano |
2b45e8 |
ao3 += 2;
|
|
kusano |
2b45e8 |
ao4 += 2;
|
|
kusano |
2b45e8 |
ao5 += 2;
|
|
kusano |
2b45e8 |
ao6 += 2;
|
|
kusano |
2b45e8 |
ao7 += 2;
|
|
kusano |
2b45e8 |
ao8 += 2;
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += i * lda;
|
|
kusano |
2b45e8 |
ao2 += i * lda;
|
|
kusano |
2b45e8 |
ao3 += i * lda;
|
|
kusano |
2b45e8 |
ao4 += i * lda;
|
|
kusano |
2b45e8 |
ao5 += i * lda;
|
|
kusano |
2b45e8 |
ao6 += i * lda;
|
|
kusano |
2b45e8 |
ao7 += i * lda;
|
|
kusano |
2b45e8 |
ao8 += i * lda;
|
|
kusano |
2b45e8 |
b += 16 * i;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 0);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 1);
|
|
kusano |
2b45e8 |
b[10] = *(ao6 + 0);
|
|
kusano |
2b45e8 |
b[11] = *(ao6 + 1);
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 0);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 1);
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 0);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 1);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if(i >= 2) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 2] = ONE;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 2);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 3);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 2);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 3);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 2);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 3);
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 2);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 3);
|
|
kusano |
2b45e8 |
b[10] = *(ao6 + 2);
|
|
kusano |
2b45e8 |
b[11] = *(ao6 + 3);
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 2);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 3);
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 2);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 3);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (i >= 3) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = ZERO;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 4] = ONE;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 4);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 5);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 4);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 5);
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 4);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 5);
|
|
kusano |
2b45e8 |
b[10] = *(ao6 + 4);
|
|
kusano |
2b45e8 |
b[11] = *(ao6 + 5);
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 4);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 5);
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 4);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 5);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (i >= 4) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = ZERO;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
b[ 4] = ZERO;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 6] = ONE;
|
|
kusano |
2b45e8 |
b[ 7] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 6);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 7);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 6);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 7);
|
|
kusano |
2b45e8 |
b[10] = *(ao6 + 6);
|
|
kusano |
2b45e8 |
b[11] = *(ao6 + 7);
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 6);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 7);
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 6);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 7);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (i >= 5) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = ZERO;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
b[ 4] = ZERO;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
b[ 6] = ZERO;
|
|
kusano |
2b45e8 |
b[ 7] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 8] = ONE;
|
|
kusano |
2b45e8 |
b[ 9] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 8] = *(ao5 + 8);
|
|
kusano |
2b45e8 |
b[ 9] = *(ao5 + 9);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[10] = *(ao6 + 8);
|
|
kusano |
2b45e8 |
b[11] = *(ao6 + 9);
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 8);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 9);
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 8);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 9);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (i >= 6) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = ZERO;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
b[ 4] = ZERO;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
b[ 6] = ZERO;
|
|
kusano |
2b45e8 |
b[ 7] = ZERO;
|
|
kusano |
2b45e8 |
b[ 8] = ZERO;
|
|
kusano |
2b45e8 |
b[ 9] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[10] = ONE;
|
|
kusano |
2b45e8 |
b[11] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[10] = *(ao6 + 10);
|
|
kusano |
2b45e8 |
b[11] = *(ao6 + 11);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 10);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 11);
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 10);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 11);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (i >= 7) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = ZERO;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
b[ 4] = ZERO;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
b[ 6] = ZERO;
|
|
kusano |
2b45e8 |
b[ 7] = ZERO;
|
|
kusano |
2b45e8 |
b[ 8] = ZERO;
|
|
kusano |
2b45e8 |
b[ 9] = ZERO;
|
|
kusano |
2b45e8 |
b[10] = ZERO;
|
|
kusano |
2b45e8 |
b[11] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[12] = ONE;
|
|
kusano |
2b45e8 |
b[13] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[12] = *(ao7 + 12);
|
|
kusano |
2b45e8 |
b[13] = *(ao7 + 13);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[14] = *(ao8 + 12);
|
|
kusano |
2b45e8 |
b[15] = *(ao8 + 13);
|
|
kusano |
2b45e8 |
b += 16;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
posY += 8;
|
|
kusano |
2b45e8 |
js --;
|
|
kusano |
2b45e8 |
} while (js > 0);
|
|
kusano |
2b45e8 |
} /* End of main loop */
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (n & 4){
|
|
kusano |
2b45e8 |
X = posX;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (posX <= posY) {
|
|
kusano |
2b45e8 |
ao1 = a + posX * 2 + (posY + 0) * lda;
|
|
kusano |
2b45e8 |
ao2 = a + posX * 2 + (posY + 1) * lda;
|
|
kusano |
2b45e8 |
ao3 = a + posX * 2 + (posY + 2) * lda;
|
|
kusano |
2b45e8 |
ao4 = a + posX * 2 + (posY + 3) * lda;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
ao1 = a + posY * 2 + (posX + 0) * lda;
|
|
kusano |
2b45e8 |
ao2 = a + posY * 2 + (posX + 1) * lda;
|
|
kusano |
2b45e8 |
ao3 = a + posY * 2 + (posX + 2) * lda;
|
|
kusano |
2b45e8 |
ao4 = a + posY * 2 + (posX + 3) * lda;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
i = (m >> 2);
|
|
kusano |
2b45e8 |
if (i > 0) {
|
|
kusano |
2b45e8 |
do {
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
for (ii = 0; ii < 4; ii++){
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 2;
|
|
kusano |
2b45e8 |
ao2 += 2;
|
|
kusano |
2b45e8 |
ao3 += 2;
|
|
kusano |
2b45e8 |
ao4 += 2;
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += 4 * lda;
|
|
kusano |
2b45e8 |
ao2 += 4 * lda;
|
|
kusano |
2b45e8 |
ao3 += 4 * lda;
|
|
kusano |
2b45e8 |
ao4 += 4 * lda;
|
|
kusano |
2b45e8 |
b += 32;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 8] = ZERO;
|
|
kusano |
2b45e8 |
b[ 9] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 10] = ONE;
|
|
kusano |
2b45e8 |
b[ 11] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 10] = *(ao2 + 2);
|
|
kusano |
2b45e8 |
b[ 11] = *(ao2 + 3);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 12] = *(ao3 + 2);
|
|
kusano |
2b45e8 |
b[ 13] = *(ao3 + 3);
|
|
kusano |
2b45e8 |
b[ 14] = *(ao4 + 2);
|
|
kusano |
2b45e8 |
b[ 15] = *(ao4 + 3);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 16] = ZERO;
|
|
kusano |
2b45e8 |
b[ 17] = ZERO;
|
|
kusano |
2b45e8 |
b[ 18] = ZERO;
|
|
kusano |
2b45e8 |
b[ 19] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 20] = ONE;
|
|
kusano |
2b45e8 |
b[ 21] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 20] = *(ao3 + 4);
|
|
kusano |
2b45e8 |
b[ 21] = *(ao3 + 5);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 22] = *(ao4 + 4);
|
|
kusano |
2b45e8 |
b[ 23] = *(ao4 + 5);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 24] = ZERO;
|
|
kusano |
2b45e8 |
b[ 25] = ZERO;
|
|
kusano |
2b45e8 |
b[ 26] = ZERO;
|
|
kusano |
2b45e8 |
b[ 27] = ZERO;
|
|
kusano |
2b45e8 |
b[ 28] = ZERO;
|
|
kusano |
2b45e8 |
b[ 29] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 30] = ONE;
|
|
kusano |
2b45e8 |
b[ 31] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 30] = *(ao4 + 6);
|
|
kusano |
2b45e8 |
b[ 31] = *(ao4 + 7);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 4 * lda;
|
|
kusano |
2b45e8 |
ao2 += 4 * lda;
|
|
kusano |
2b45e8 |
ao3 += 4 * lda;
|
|
kusano |
2b45e8 |
ao4 += 4 * lda;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b += 32;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
X += 4;
|
|
kusano |
2b45e8 |
i --;
|
|
kusano |
2b45e8 |
} while (i > 0);
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
i = (m & 3);
|
|
kusano |
2b45e8 |
if (i) {
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
for (ii = 0; ii < i; ii++){
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 2;
|
|
kusano |
2b45e8 |
ao2 += 2;
|
|
kusano |
2b45e8 |
ao3 += 2;
|
|
kusano |
2b45e8 |
ao4 += 2;
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += i * lda;
|
|
kusano |
2b45e8 |
ao2 += i * lda;
|
|
kusano |
2b45e8 |
ao3 += i * lda;
|
|
kusano |
2b45e8 |
ao4 += i * lda;
|
|
kusano |
2b45e8 |
b += 8 * i;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 0);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 1);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 0);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 1);
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if(i >= 2) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 2] = ONE;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 2);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 3);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 2);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 3);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 2);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 3);
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (i >= 3) {
|
|
kusano |
2b45e8 |
b[ 0] = ZERO;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = ZERO;
|
|
kusano |
2b45e8 |
b[ 3] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 4] = ONE;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 4] = *(ao3 + 4);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao3 + 5);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 6] = *(ao4 + 4);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao4 + 5);
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
posY += 4;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (n & 2){
|
|
kusano |
2b45e8 |
X = posX;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (posX <= posY) {
|
|
kusano |
2b45e8 |
ao1 = a + posX * 2 + (posY + 0) * lda;
|
|
kusano |
2b45e8 |
ao2 = a + posX * 2 + (posY + 1) * lda;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
ao1 = a + posY * 2 + (posX + 0) * lda;
|
|
kusano |
2b45e8 |
ao2 = a + posY * 2 + (posX + 1) * lda;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
i = (m >> 1);
|
|
kusano |
2b45e8 |
if (i > 0) {
|
|
kusano |
2b45e8 |
do {
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
b[ 4] = *(ao1 + 2);
|
|
kusano |
2b45e8 |
b[ 5] = *(ao1 + 3);
|
|
kusano |
2b45e8 |
b[ 6] = *(ao2 + 2);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao2 + 3);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 4;
|
|
kusano |
2b45e8 |
ao2 += 4;
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += 2 * lda;
|
|
kusano |
2b45e8 |
ao2 += 2 * lda;
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
b[ 4] = ZERO;
|
|
kusano |
2b45e8 |
b[ 5] = ZERO;
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 6] = ONE;
|
|
kusano |
2b45e8 |
b[ 7] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 6] = *(ao2 + 2);
|
|
kusano |
2b45e8 |
b[ 7] = *(ao2 + 3);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ao1 += 2 * lda;
|
|
kusano |
2b45e8 |
ao2 += 2 * lda;
|
|
kusano |
2b45e8 |
b += 8;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
X += 2;
|
|
kusano |
2b45e8 |
i --;
|
|
kusano |
2b45e8 |
} while (i > 0);
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (m & 1) {
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
ao1 += 2;
|
|
kusano |
2b45e8 |
ao2 += 2;
|
|
kusano |
2b45e8 |
b += 4;
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += 2 * lda;
|
|
kusano |
2b45e8 |
ao2 += 2 * lda;
|
|
kusano |
2b45e8 |
b += 4;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
b[ 2] = *(ao2 + 0);
|
|
kusano |
2b45e8 |
b[ 3] = *(ao2 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
b += 2;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
posY += 2;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (n & 1){
|
|
kusano |
2b45e8 |
X = posX;
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
if (posX <= posY) {
|
|
kusano |
2b45e8 |
ao1 = a + posX * 2 + (posY + 0) * lda;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
ao1 = a + posY * 2 + (posX + 0) * lda;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
i = m;
|
|
kusano |
2b45e8 |
if (m > 0) {
|
|
kusano |
2b45e8 |
do {
|
|
kusano |
2b45e8 |
if (X < posY) {
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
ao1 += 2;
|
|
kusano |
2b45e8 |
b += 2;
|
|
kusano |
2b45e8 |
} else
|
|
kusano |
2b45e8 |
if (X > posY) {
|
|
kusano |
2b45e8 |
ao1 += lda;
|
|
kusano |
2b45e8 |
b += 2;
|
|
kusano |
2b45e8 |
} else {
|
|
kusano |
2b45e8 |
#ifdef UNIT
|
|
kusano |
2b45e8 |
b[ 0] = ONE;
|
|
kusano |
2b45e8 |
b[ 1] = ZERO;
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
b[ 0] = *(ao1 + 0);
|
|
kusano |
2b45e8 |
b[ 1] = *(ao1 + 1);
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
ao1 += lda;
|
|
kusano |
2b45e8 |
b += 2;
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
X += 1;
|
|
kusano |
2b45e8 |
i --;
|
|
kusano |
2b45e8 |
} while (i > 0);
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
}
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
return 0;
|
|
kusano |
2b45e8 |
}
|