/* Copyright (c) 2014, Ian Sutton * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. * * This code implements a simple matrix operation in C, to be * cross-compiled volatile into Loongson MIPS 32-bit instructions. * * (Header file) */ static void matrix_add(volatile int op1[MS][MS], volatile int op2[MS][MS], volatile int result_buf[MS][MS]); static void matrix_sub(volatile int op1[MS][MS], volatile int op2[MS][MS], volatile int result_buf[MS][MS]); static void matrix_mult(volatile int op1[MS][MS], volatile int op2[MS][MS], volatile int result_buf[MS][MS]); #ifdef DEBUG static void matrix_print(volatile int matrix[MS][MS]); #endif static void matrix_init0(volatile int matrix[MS][MS]);