NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-hppa/58326: hppa libm is missing fma(3)



>Number:         58326
>Category:       port-hppa
>Synopsis:       hppa libm is missing fma(3)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-hppa-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 09 14:25:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The NetBSD/hppa Fmadation
>Environment:
>Description:
libm on hppa is missing the fma(3) fused multiply-add functions.  They're not defined as static inlines or builtins by the header file and they're not defined as symbols in libm.
>How-To-Repeat:
$ cat fma.c
#include <math.h>
#include <stdio.h>

volatile double x = 3, y = 4, z = 5;

int
main(void)
{

	printf("%a\n", fma(x, y, z));
	fflush(stdout);
	return ferror(stdout);
}
$ /home/riastradh/netbsd/current/obj.hppa/tooldir/bin/hppa--netbsd-gcc -g -O2 --sysroot=/home/riastradh/netbsd/current/obj.hppa/destdir.hppa   -o fma fma.c 
/home/riastradh/netbsd/current/obj.hppa/tooldir/bin/../lib/gcc/hppa--netbsd/10.5.0/../../../../hppa--netbsd/bin/ld: /tmp/riastradh/ccczEczb.o: in function `main':
/tmp/riastradh/fma.c:10: undefined reference to `fma'
collect2: error: ld returned 1 exit status

>Fix:
Yes, please!

Probably just a matter of adding

COMMON_SRCS+=	s_fma.c s_fmaf.c s_fmal.c

to src/lib/libm/Makefile but we should also have some automatic tests for fma to verify it worked.



Home | Main Index | Thread Index | Old Index