Skip to content

Commit ec8bf18

Browse files
maciej-w-rozyckitsbogend
authored andcommitted
MIPS: Fix the GCC version check for `__multi3' workaround
It was only GCC 10 that fixed a MIPS64r6 code generation issue with a `__multi3' libcall inefficiently produced to perform 64-bit widening multiplication while suitable machine instructions exist to do such a calculation. The fix went in with GCC commit 48b2123f6336 ("re PR target/82981 (unnecessary __multi3 call for mips64r6 linux kernel)"). Adjust our code accordingly, removing build failures such as: mips64-linux-ld: lib/math/div64.o: in function `mul_u64_add_u64_div_u64': div64.c:(.text+0x84): undefined reference to `__multi3' with the GCC versions affected. Fixes: ebabcf1 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202601140146.hMLODc6v-lkp@intel.com/ Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Cc: stable@vger.kernel.org # v4.15+ Reviewed-by: David Laight <david.laight.linux@gmail.com. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent d62cf15 commit ec8bf18

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/mips/lib/multi3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#include "libgcc.h"
55

66
/*
7-
* GCC 7 & older can suboptimally generate __multi3 calls for mips64r6, so for
7+
* GCC 9 & older can suboptimally generate __multi3 calls for mips64r6, so for
88
* that specific case only we implement that intrinsic here.
99
*
1010
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82981
1111
*/
12-
#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 8)
12+
#if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ < 10)
1313

1414
/* multiply 64-bit values, low 64-bits returned */
1515
static inline long long notrace dmulu(long long a, long long b)
@@ -51,4 +51,4 @@ ti_type notrace __multi3(ti_type a, ti_type b)
5151
}
5252
EXPORT_SYMBOL(__multi3);
5353

54-
#endif /* 64BIT && CPU_MIPSR6 && GCC7 */
54+
#endif /* 64BIT && CPU_MIPSR6 && GCC9 */

0 commit comments

Comments
 (0)