Skip to content

Remove redundant C implemetations from MIPS directories#5751

Merged
martin-frbg merged 2 commits intoOpenMathLib:developfrom
chenx97:mips-dedup-c-impl
Apr 9, 2026
Merged

Remove redundant C implemetations from MIPS directories#5751
martin-frbg merged 2 commits intoOpenMathLib:developfrom
chenx97:mips-dedup-c-impl

Conversation

@chenx97
Copy link
Copy Markdown
Contributor

@chenx97 chenx97 commented Apr 8, 2026

... and factor out definitions found in both if and else branches.

@chenx97
Copy link
Copy Markdown
Contributor Author

chenx97 commented Apr 9, 2026

The key difference between arm/dot.c and mips/dot.c appears to be

@@ -50,8 +41,11 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
 
	while(i < n)
	{
-
-		dot += y[iy] * x[ix] ;
+#if defined(DSDOT)
+		dot += (double)y[iy] * (double)x[ix] ;
+#else
+		dot += y[iy] * x[ix];
+#endif
		ix  += inc_x ;
		iy  += inc_y ;
		i++ ;

Let me see if this change can be applied to arm/dot.c or not.

@chenx97 chenx97 force-pushed the mips-dedup-c-impl branch from f0757d2 to 6a5d214 Compare April 9, 2026 10:12
@martin-frbg
Copy link
Copy Markdown
Collaborator

Let me see if this change can be applied to arm/dot.c or not.

Yes, there should be no harm from this.

These duplications tended to happen when someone cloned an existing near-generic setup for a new architecture, I think riscv64 still carries a few duplicated "arm" files as well. But apart from carrying a couple of unnecessary files - all small - there was no harm.
(I guess eventually it may make sense to gather all the pure C kernels that popped up under kernel/arm (or similar) and move them to kernel/generic where they "properly" belong. But it would be a purely cosmetic change with a nonzero chance to break something...)

@martin-frbg martin-frbg added this to the 0.3.33 milestone Apr 9, 2026
@martin-frbg martin-frbg merged commit 646d0c9 into OpenMathLib:develop Apr 9, 2026
101 of 102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants