FreeBSD Bugzilla – Attachment 187177 Details for
Bug 223014
graphics/mesa-dri: enable NEON and AltiVec
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
standalone check
test_neon.c (text/plain), 876 bytes, created by
Jan Beich
on 2017-10-14 20:48:42 UTC
(
hide
)
Description:
standalone check
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2017-10-14 20:48:42 UTC
Size:
876 bytes
patch
obsolete
>#if __has_include(<sys/auxv.h>) >#include <sys/auxv.h> >#else >#include <sys/param.h> >#include <sys/sysctl.h> >#include <elf.h> >#include <errno.h> >#include <unistd.h> > >static unsigned long getauxval(unsigned long type) { > Elf_Auxinfo auxv[AT_COUNT]; > size_t len = sizeof(auxv); > int mib[] = { > CTL_KERN, > KERN_PROC, > KERN_PROC_AUXV, > getpid(), > }; > > if (sysctl(mib, nitems(mib), auxv, &len, NULL, 0) != -1) { > for (size_t i = 0; i < nitems(auxv); i++) > if ((unsigned long)auxv[i].a_type == type) > return auxv[i].a_un.a_val; > > errno = ENOENT; > } > return 0; >} >#endif > >#if defined __FreeBSD__ >#define AT_HWCAP 25 >#else >#define AT_HWCAP 16 >#endif > >#ifndef HWCAP_NEON >#define HWCAP_NEON (1 << 12) >#endif > >#include <stdio.h> > >int main() { > printf("NEON: %s supported\n", getauxval(AT_HWCAP) & HWCAP_NEON ? "" : "not"); > > 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 223014
:
187176
|
187177
|
207539