summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2022-07-16 15:26:14 +0000
committerRobert Mustacchi <rm@fingolfin.org>2022-09-11 04:06:00 +0000
commit56726c7e321b6e5ecb2f10215f5386016547e68c (patch)
treec2962155102bc009959ab350494becc3204feef7 /usr/src/lib
parentf2ae17ede4a9a93585872a9aa83120497285bdd0 (diff)
downloadillumos-gate-56726c7e321b6e5ecb2f10215f5386016547e68c.tar.gz
14821 Add additional AVX512 capabilities
14822 Need new word of hardware capabilities 14823 aux vector feature mapping should use x86_featureset Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Patrick Mooney <pmooney@pfmooney.com> Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/libc/port/gen/getisax.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/lib/libc/port/gen/getisax.c b/usr/src/lib/libc/port/gen/getisax.c
index c721528fb3..85d60eb192 100644
--- a/usr/src/lib/libc/port/gen/getisax.c
+++ b/usr/src/lib/libc/port/gen/getisax.c
@@ -25,6 +25,7 @@
*/
/*
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright 2022 Oxide Computer Company
*/
#pragma weak _getisax = getisax
@@ -48,10 +49,12 @@ getisax(uint32_t *array, uint_t n)
int i;
static uint32_t auxv_hwcap;
static uint32_t auxv_hwcap_2;
+ static uint32_t auxv_hwcap_3;
if (auxv_hwcap == 0) {
auxv_hwcap = (uint32_t)___getauxval(AT_SUN_HWCAP);
auxv_hwcap_2 = (uint32_t)___getauxval(AT_SUN_HWCAP2);
+ auxv_hwcap_3 = (uint32_t)___getauxval(AT_SUN_HWCAP3);
}
if (n > 0) {
@@ -59,9 +62,15 @@ getisax(uint32_t *array, uint_t n)
array[0] = auxv_hwcap;
if (n >= 2)
array[1] = auxv_hwcap_2;
- for (i = 2; i < n; i++)
+ if (n >= 3)
+ array[2] = auxv_hwcap_3;
+ for (i = 3; i < n; i++)
array[i] = 0;
}
- return (auxv_hwcap == 0 ? 0 : n >= 2 ? 2 : 1);
+ if (auxv_hwcap == 0) {
+ return (0);
+ }
+
+ return (n >= 3 ? 3 : n);
}