Skip to content

Commit 4be0739

Browse files
SiFiveHollandakpm00
authored andcommitted
lib/raid6: use CC_FLAGS_FPU for NEON CFLAGS
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Link: https://lkml.kernel.org/r/20240329072441.591471-7-samuel.holland@sifive.com Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Borislav Petkov (AMD) <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nicolas Schier <nicolas@fjasle.eu> Cc: Palmer Dabbelt <palmer@rivosinc.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: WANG Xuerui <git@xen0n.name> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 7177089 commit 4be0739

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

lib/raid6/Makefile

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,6 @@ CFLAGS_REMOVE_vpermxor8.o += -msoft-float
3333
endif
3434
endif
3535

36-
# The GCC option -ffreestanding is required in order to compile code containing
37-
# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
38-
ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
39-
NEON_FLAGS := -ffreestanding
40-
# Enable <arm_neon.h>
41-
NEON_FLAGS += -isystem $(shell $(CC) -print-file-name=include)
42-
ifeq ($(ARCH),arm)
43-
NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
44-
endif
45-
CFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
46-
ifeq ($(ARCH),arm64)
47-
CFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
48-
CFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
49-
CFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
50-
CFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
51-
CFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
52-
endif
53-
endif
54-
5536
quiet_cmd_unroll = UNROLL $@
5637
cmd_unroll = $(AWK) -v N=$* -f $(src)/unroll.awk < $< > $@
5738

@@ -75,10 +56,16 @@ targets += vpermxor1.c vpermxor2.c vpermxor4.c vpermxor8.c
7556
$(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
7657
$(call if_changed,unroll)
7758

78-
CFLAGS_neon1.o += $(NEON_FLAGS)
79-
CFLAGS_neon2.o += $(NEON_FLAGS)
80-
CFLAGS_neon4.o += $(NEON_FLAGS)
81-
CFLAGS_neon8.o += $(NEON_FLAGS)
59+
CFLAGS_neon1.o += $(CC_FLAGS_FPU)
60+
CFLAGS_neon2.o += $(CC_FLAGS_FPU)
61+
CFLAGS_neon4.o += $(CC_FLAGS_FPU)
62+
CFLAGS_neon8.o += $(CC_FLAGS_FPU)
63+
CFLAGS_recov_neon_inner.o += $(CC_FLAGS_FPU)
64+
CFLAGS_REMOVE_neon1.o += $(CC_FLAGS_NO_FPU)
65+
CFLAGS_REMOVE_neon2.o += $(CC_FLAGS_NO_FPU)
66+
CFLAGS_REMOVE_neon4.o += $(CC_FLAGS_NO_FPU)
67+
CFLAGS_REMOVE_neon8.o += $(CC_FLAGS_NO_FPU)
68+
CFLAGS_REMOVE_recov_neon_inner.o += $(CC_FLAGS_NO_FPU)
8269
targets += neon1.c neon2.c neon4.c neon8.c
8370
$(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE
8471
$(call if_changed,unroll)

0 commit comments

Comments
 (0)