FreeBSD Bugzilla – Attachment 180600 Details for
Bug 217611
ARM VFP/NEON regs not preserved in signal delivery
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
FP registers vs. signals
fptst.c (text/plain), 1.73 KB, created by
Andrew "RhodiumToad" Gierth
on 2017-03-07 13:21:24 UTC
(
hide
)
Description:
FP registers vs. signals
Filename:
MIME Type:
Creator:
Andrew "RhodiumToad" Gierth
Created:
2017-03-07 13:21:24 UTC
Size:
1.73 KB
patch
obsolete
> >#include <stdio.h> >#include <stdlib.h> > >#include <unistd.h> >#include <sys/signal.h> >#include <sys/time.h> > >volatile sig_atomic_t sigcnt = 0; >volatile double z; > >void tick(int sig) >{ > double x; > > x = ++sigcnt; > x *= 2.1; > z += x; >} > >void show_result(const char *name, double actual, double expected) >{ > printf("%s: actual=%f expected=%f\n", name, actual, expected); >} > >void loops(void) >{ > double h0 = 0; > double h1 = 1; > double h2 = 2; > double h3 = 3; > double h4 = 4; > double h5 = 5; > double h6 = 6; > double h7 = 7; > int i; > int n = 100000000; > > for (i = 0; i < n; ++i) > { > /* all these lines add 1; the complexity is just to keep the > * VFP regs in play as much as possible */ > h0 += (h7 - h6) + (h6 - h5) + (h5 - h4) + (h4 - h3) + (h3 - h2) - 4; > h1 += (h7 - h6) + (h6 - h5) + (h5 - h4) + (h4 - h3) + (h3 - h2) - 4; > h2 += (h7 - h6) + (h6 - h5) + (h5 - h4) + (h4 - h3) + (h1 - h0) - 4; > h3 += (h7 - h6) + (h6 - h5) + (h5 - h4) + (h2 - h1) + (h1 - h0) - 4; > h4 += (h7 - h6) + (h6 - h5) + (h3 - h2) + (h2 - h1) + (h1 - h0) - 4; > h5 += (h7 - h6) + (h4 - h3) + (h3 - h2) + (h2 - h1) + (h1 - h0) - 4; > h6 += (h5 - h4) + (h4 - h3) + (h3 - h2) + (h2 - h1) + (h1 - h0) - 4; > h7 += (h5 - h4) + (h4 - h3) + (h3 - h2) + (h2 - h1) + (h1 - h0) - 4; > } > > show_result("h0", h0, n + 0.0); > show_result("h1", h1, n + 1.0); > show_result("h2", h2, n + 2.0); > show_result("h3", h3, n + 3.0); > show_result("h4", h4, n + 4.0); > show_result("h5", h5, n + 5.0); > show_result("h6", h6, n + 6.0); > show_result("h7", h7, n + 7.0); >} > >int main(int argc, char **argv) >{ > int i; > > signal(SIGALRM, tick); > if (argc > 1) > alarm(1); > > fprintf(stderr, "entering...\n"); > > loops(); > > 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 217611
: 180600 |
180669