Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 1 | From fdb2face4eeac3c20eedcca7520f4e7014225fb4 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 2 Dec 2021 19:57:42 -0800 |
| 4 | Subject: [PATCH] util/format: Check for NEON before using it |
| 5 | |
| 6 | This fixes build on rpi0-w and any other machine which does not have |
| 7 | neon unit and is not used as FPU unit |
| 8 | |
| 9 | Fixes errors e.g. |
| 10 | |
| 11 | In file included from ../mesa-21.3.0/src/util/format/u_format_unpack_neon.c:35: |
| 12 | /mnt/b/yoe/master/build/tmp/work/arm1176jzfshf-vfp-yoe-linux-gnueabi/mesa/2_21.3.0-r0/recipe-sysroot-native/usr/lib/clang/13.0.1/include/arm_neon.h:32:2: error: "NEON support not enabled" |
| 13 | |
| 14 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14032] |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 16 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 17 | --- |
| 18 | src/util/format/u_format.c | 2 +- |
| 19 | src/util/format/u_format_unpack_neon.c | 2 +- |
| 20 | 2 files changed, 2 insertions(+), 2 deletions(-) |
| 21 | |
| 22 | diff --git a/src/util/format/u_format.c b/src/util/format/u_format.c |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 23 | index 36c5e52..f0a0097 100644 |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 24 | --- a/src/util/format/u_format.c |
| 25 | +++ b/src/util/format/u_format.c |
| 26 | @@ -1138,7 +1138,7 @@ static void |
| 27 | util_format_unpack_table_init(void) |
| 28 | { |
| 29 | for (enum pipe_format format = PIPE_FORMAT_NONE; format < PIPE_FORMAT_COUNT; format++) { |
| 30 | -#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) |
| 31 | +#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) |
| 32 | const struct util_format_unpack_description *unpack = util_format_unpack_description_neon(format); |
| 33 | if (unpack) { |
| 34 | util_format_unpack_table[format] = unpack; |
| 35 | diff --git a/src/util/format/u_format_unpack_neon.c b/src/util/format/u_format_unpack_neon.c |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 36 | index a4a5cb1..1e4f794 100644 |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 37 | --- a/src/util/format/u_format_unpack_neon.c |
| 38 | +++ b/src/util/format/u_format_unpack_neon.c |
| 39 | @@ -23,7 +23,7 @@ |
| 40 | |
| 41 | #include <u_format.h> |
| 42 | |
| 43 | -#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) |
| 44 | +#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) |
| 45 | |
| 46 | /* armhf builds default to vfp, not neon, and refuses to compile neon intrinsics |
| 47 | * unless you tell it "no really". |