aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-04-20 10:31:56 +0200
committerCyril SIX <cyril.six@kalray.eu>2018-04-20 10:31:56 +0200
commitaa25ec270b651186154523ec71a3888b50994d70 (patch)
treea4572adf5cde4f97642885cb1f90f73a20d169cd /test/mppa
parent41a048fa4bb9ddefd4e4acff2207251bb3ddbf06 (diff)
downloadcompcert-kvx-aa25ec270b651186154523ec71a3888b50994d70.tar.gz
compcert-kvx-aa25ec270b651186154523ec71a3888b50994d70.zip
MPPA - Oshrximm + Mgetparam + FP is GPR10 + bug
Added Oshrximm and Mgetparam -> mmult.c divide & conqueer generates FP is now GPR10 instead of being a mix of GPR30 and GPR32 Corrected a bug where Pgoto and Pj_l were given the same interpretation, where in fact there's a fundamental difference : Pgoto is supposed to have a function name (symbol), while Pj_l is supposed to have a label name (print_label). This led to having undefinite labels in the code.
Diffstat (limited to 'test/mppa')
-rw-r--r--test/mppa/mmult/mmult.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/mppa/mmult/mmult.c b/test/mppa/mmult/mmult.c
index c9e7ad5e..dcbcfe17 100644
--- a/test/mppa/mmult/mmult.c
+++ b/test/mppa/mmult/mmult.c
@@ -39,7 +39,7 @@ typedef struct mblock {
#define MAT_XY(mat, x, y) (mat)[(x)*SIZE + (y)]
#define MAT_IJ(block, i, j) MAT_XY((block)->mat, (block)->imin + (i), block->jmin + (j))
-int strassen_mul(mblock *C, const mblock *A, const mblock *B){
+void divac_mul(mblock *C, const mblock *A, const mblock *B){
const int size = C->imax - C->imin;
for (int i = 0 ; i < size ; i++)
@@ -67,50 +67,50 @@ int strassen_mul(mblock *C, const mblock *A, const mblock *B){
newb.jmax = (block)->jmax;\
}
-int strassen_part(mblock *C, const mblock *A, const mblock *B);
+void divac_part(mblock *C, const mblock *A, const mblock *B);
-void strassen_wrap(mblock *C , char IC, char JC,
+void divac_wrap(mblock *C , char IC, char JC,
const mblock *A, char IA, char JA,
const mblock *B, char IB, char JB){
MAKE_MBLOCK(Cb, C, IC, JC);
MAKE_MBLOCK(Ab, A, IA, JA);
MAKE_MBLOCK(Bb, B, IB, JB);
- strassen_part(&Cb, &Ab, &Bb);
+ divac_part(&Cb, &Ab, &Bb);
}
-int strassen_part(mblock *C, const mblock *A, const mblock *B){
+void divac_part(mblock *C, const mblock *A, const mblock *B){
const int size = C->imax - C->imin;
if (size % 2 == 1)
- strassen_mul(C, A, B);
+ divac_mul(C, A, B);
else{
/* C_00 = A_00 B_00 + A_01 B_10 */
- strassen_wrap(C, 0, 0, A, 0, 0, B, 0, 0);
- strassen_wrap(C, 0, 0, A, 0, 1, B, 1, 0);
+ divac_wrap(C, 0, 0, A, 0, 0, B, 0, 0);
+ divac_wrap(C, 0, 0, A, 0, 1, B, 1, 0);
/* C_10 = A_10 B_00 + A_11 B_10 */
- strassen_wrap(C, 1, 0, A, 1, 0, B, 0, 0);
- strassen_wrap(C, 1, 0, A, 1, 1, B, 1, 0);
+ divac_wrap(C, 1, 0, A, 1, 0, B, 0, 0);
+ divac_wrap(C, 1, 0, A, 1, 1, B, 1, 0);
/* C_01 = A_00 B_01 + A_01 B_11 */
- strassen_wrap(C, 0, 1, A, 0, 0, B, 0, 1);
- strassen_wrap(C, 0, 1, A, 0, 1, B, 1, 1);
+ divac_wrap(C, 0, 1, A, 0, 0, B, 0, 1);
+ divac_wrap(C, 0, 1, A, 0, 1, B, 1, 1);
/* C_11 = A_10 B_01 + A_11 B_11 */
- strassen_wrap(C, 1, 1, A, 1, 0, B, 0, 1);
- strassen_wrap(C, 1, 1, A, 1, 1, B, 1, 1);
+ divac_wrap(C, 1, 1, A, 1, 0, B, 0, 1);
+ divac_wrap(C, 1, 1, A, 1, 1, B, 1, 1);
}
}
-void mmult_strassen(uint64_t C[][SIZE], uint64_t A[][SIZE], uint64_t B[][SIZE]){
+void mmult_divac(uint64_t C[][SIZE], uint64_t A[][SIZE], uint64_t B[][SIZE]){
mblock Cb = {.mat = (uint64_t *) C, .imin = 0, .imax = SIZE, .jmin = 0, .jmax = SIZE};
mblock Ab = {.mat = (uint64_t *) A , .imin = 0, .imax = SIZE, .jmin = 0, .jmax = SIZE};
mblock Bb = {.mat = (uint64_t *) B , .imin = 0, .imax = SIZE, .jmin = 0, .jmax = SIZE};
- strassen_part(&Cb, &Ab, &Bb);
+ divac_part(&Cb, &Ab, &Bb);
}
#ifdef __UNIT_TEST_MMULT__
@@ -128,7 +128,7 @@ int main(void){
mmult_row(C1, A, B);
mmult_col(C2, A, B);
- mmult_strassen(C3, A, B);
+ mmult_divac(C3, A, B);
for (int i = 0 ; i < SIZE ; i++)
for (int j = 0 ; j < SIZE ; j++)