Skip to content

Commit ad38bd0

Browse files
committed
Fix failed cgemv and zgemv test case after using msa optimization
The cgemv and zgemv test case will call cgemv_n/t_msa.c zgemv_n/t_msa.c files in MIPS environment. When the macro CONJ is defined, the calculation result will be wrong due to the wrong definition of OP2. This patch updates the value of OP2 and passes the corresponding test.
1 parent 47b639c commit ad38bd0

File tree

4 files changed

+42
-18
lines changed

4 files changed

+42
-18
lines changed

kernel/mips/cgemv_n_msa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5656
#if !defined(XCONJ)
5757
#define OP0 +=
5858
#define OP1 -=
59-
#define OP2 -=
59+
#define OP2 +=
6060
#else
6161
#define OP0 -=
6262
#define OP1 -=
63-
#define OP2 +=
63+
#define OP2 -=
6464
#endif
6565
#endif
6666

kernel/mips/cgemv_t_msa.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,26 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
#undef OP1
3333
#undef OP2
3434

35-
#if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
36-
#define OP0 -=
37-
#define OP1 +=
38-
#define OP2 +=
35+
#if !defined(CONJ)
36+
#if !defined(XCONJ)
37+
#define OP0 -=
38+
#define OP1 +=
39+
#define OP2 +=
40+
#else
41+
#define OP0 +=
42+
#define OP1 +=
43+
#define OP2 -=
44+
#endif
3945
#else
40-
#define OP0 +=
41-
#define OP1 +=
42-
#define OP2 -=
46+
#if !defined(XCONJ)
47+
#define OP0 +=
48+
#define OP1 -=
49+
#define OP2 +=
50+
#else
51+
#define OP0 -=
52+
#define OP1 -=
53+
#define OP2 -=
54+
#endif
4355
#endif
4456

4557
#define CGEMV_T_8x4() \

kernel/mips/zgemv_n_msa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5656
#if !defined(XCONJ)
5757
#define OP0 +=
5858
#define OP1 -=
59-
#define OP2 -=
59+
#define OP2 +=
6060
#else
6161
#define OP0 -=
6262
#define OP1 -=
63-
#define OP2 +=
63+
#define OP2 -=
6464
#endif
6565
#endif
6666

kernel/mips/zgemv_t_msa.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,26 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3434
#undef OP3
3535
#undef OP4
3636

37-
#if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
38-
#define OP0 -=
39-
#define OP1 +=
40-
#define OP2 +=
37+
#if !defined(CONJ)
38+
#if !defined(XCONJ)
39+
#define OP0 -=
40+
#define OP1 +=
41+
#define OP2 +=
42+
#else
43+
#define OP0 +=
44+
#define OP1 +=
45+
#define OP2 -=
46+
#endif
4147
#else
42-
#define OP0 +=
43-
#define OP1 +=
44-
#define OP2 -=
48+
#if !defined(XCONJ)
49+
#define OP0 +=
50+
#define OP1 -=
51+
#define OP2 +=
52+
#else
53+
#define OP0 -=
54+
#define OP1 -=
55+
#define OP2 -=
56+
#endif
4557
#endif
4658

4759
#define ZGEMV_T_8x1() \

0 commit comments

Comments
 (0)