Sourceware Bugzilla – Attachment 7425 Details for
Bug 16600
Glibc floating-point tests fail on VFPv4 platforms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Testcase for MAD differences
mad.c (text/x-csrc), 837 bytes, created by
Yury Gribov
on 2014-02-18 07:16:54 UTC
(
hide
)
Description:
Testcase for MAD differences
Filename:
MIME Type:
Creator:
Yury Gribov
Created:
2014-02-18 07:16:54 UTC
Size:
837 bytes
patch
obsolete
>#include <stdio.h> > >float b = 1.12346; >float a = 0.956795; > >__attribute__((noinline)) >float multiply_add(float x, float y, float a) { > float yz = y * a; > asm volatile("" : "+w"(yz)); > return x - yz; >} > >__attribute__((noinline)) >float multiply_add_fused(float x, float y, float a) { > return x - y * a; >} > >__attribute__((noinline)) >float multiply_add_exact(float x, float y, float a) { > return (double)x - (double)y * (double)a; >} > >int main() { > union { > float f; > unsigned u; > } u; > > float f1 = multiply_add(a, b, a); > u.f = f1; > printf("Multiply and add : %g %a %u\n", f1, f1, u.u); > > float f2 = multiply_add_fused(a, b, a); > u.f = f2; > printf("Multiply and add (fused): %g %a %u\n", f2, f2, u.u); > > float f3 = multiply_add_exact(a, b, a); > u.f = f3; > printf("Multiply and add (exact): %g %a %u\n", f3, f3, u.u); > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 16600
:
7424
| 7425