xref: /openbmc/linux/lib/raid6/Makefile (revision f2091321)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2f5e70d0fSDavid Woodhouseobj-$(CONFIG_RAID6_PQ)	+= raid6_pq.o
3f5e70d0fSDavid Woodhouse
44f8c55c5SYuanhan Liuraid6_pq-y	+= algos.o recov.o tables.o int1.o int2.o int4.o \
54f8c55c5SYuanhan Liu		   int8.o int16.o int32.o
64f8c55c5SYuanhan Liu
713c520b2SGayatri Kammelaraid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o avx512.o recov_avx512.o
8751ba79cSMatt Brownraid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o \
9751ba79cSMatt Brown                              vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
106ec4e251SArd Biesheuvelraid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
11f5b55fa1SMartin Schwidefskyraid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
12*f2091321SWANG Xueruiraid6_pq-$(CONFIG_LOONGARCH) += loongarch_simd.o recov_loongarch_simd.o
134f8c55c5SYuanhan Liu
145f2fb52fSMasahiro Yamadahostprogs	+= mktables
15f5e70d0fSDavid Woodhouse
16f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y)
171fb3f5a7SAnton Blanchardaltivec_flags := -maltivec $(call cc-option,-mabi=altivec)
1804e85bbfSAlexey Dobriyan# Enable <altivec.h>
1904e85bbfSAlexey Dobriyanaltivec_flags += -isystem $(shell $(CC) -print-file-name=include)
20e213574aSJoel Stanley
21e213574aSJoel Stanleyifdef CONFIG_CC_IS_CLANG
22e213574aSJoel Stanley# clang ppc port does not yet support -maltivec when -msoft-float is
23e213574aSJoel Stanley# enabled. A future release of clang will resolve this
24e213574aSJoel Stanley# https://bugs.llvm.org/show_bug.cgi?id=31177
25e213574aSJoel StanleyCFLAGS_REMOVE_altivec1.o  += -msoft-float
26e213574aSJoel StanleyCFLAGS_REMOVE_altivec2.o  += -msoft-float
27e213574aSJoel StanleyCFLAGS_REMOVE_altivec4.o  += -msoft-float
28e213574aSJoel StanleyCFLAGS_REMOVE_altivec8.o  += -msoft-float
29e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor1.o += -msoft-float
30e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor2.o += -msoft-float
31e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor4.o += -msoft-float
32e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor8.o += -msoft-float
33e213574aSJoel Stanleyendif
34f5e70d0fSDavid Woodhouseendif
35f5e70d0fSDavid Woodhouse
367d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing
377d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
387d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y)
397d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding
4004e85bbfSAlexey Dobriyan# Enable <arm_neon.h>
4104e85bbfSAlexey DobriyanNEON_FLAGS += -isystem $(shell $(CC) -print-file-name=include)
427d11965dSArd Biesheuvelifeq ($(ARCH),arm)
43de9c0d49SNathan ChancellorNEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
447d11965dSArd Biesheuvelendif
456ec4e251SArd BiesheuvelCFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
467d11965dSArd Biesheuvelifeq ($(ARCH),arm64)
476ec4e251SArd BiesheuvelCFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
487d11965dSArd BiesheuvelCFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
497d11965dSArd BiesheuvelCFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
507d11965dSArd BiesheuvelCFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
517d11965dSArd BiesheuvelCFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
527d11965dSArd Biesheuvelendif
537d11965dSArd Biesheuvelendif
547d11965dSArd Biesheuvel
5572ad2107SMasahiro Yamadaquiet_cmd_unroll = UNROLL  $@
560c36d88cSJohn Millikin      cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
57f5e70d0fSDavid Woodhouse
5872ad2107SMasahiro Yamadatargets += int1.c int2.c int4.c int8.c int16.c int32.c
5972ad2107SMasahiro Yamada$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
60f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
61f5e70d0fSDavid Woodhouse
62cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags)
63cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags)
64cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags)
65cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags)
6672ad2107SMasahiro Yamadatargets += altivec1.c altivec2.c altivec4.c altivec8.c
6772ad2107SMasahiro Yamada$(obj)/altivec%.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
68f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
69f5e70d0fSDavid Woodhouse
70751ba79cSMatt BrownCFLAGS_vpermxor1.o += $(altivec_flags)
71751ba79cSMatt BrownCFLAGS_vpermxor2.o += $(altivec_flags)
72751ba79cSMatt BrownCFLAGS_vpermxor4.o += $(altivec_flags)
73751ba79cSMatt BrownCFLAGS_vpermxor8.o += $(altivec_flags)
74e2a280d2SMasahiro Yamadatargets += vpermxor1.c vpermxor2.c vpermxor4.c vpermxor8.c
7572ad2107SMasahiro Yamada$(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
76751ba79cSMatt Brown	$(call if_changed,unroll)
77751ba79cSMatt Brown
787d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS)
797d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS)
807d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS)
817d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS)
8272ad2107SMasahiro Yamadatargets += neon1.c neon2.c neon4.c neon8.c
8372ad2107SMasahiro Yamada$(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE
847d11965dSArd Biesheuvel	$(call if_changed,unroll)
857d11965dSArd Biesheuvel
86474fd6e8SMartin Schwidefskytargets += s390vx8.c
8772ad2107SMasahiro Yamada$(obj)/s390vx%.c: $(src)/s390vx.uc $(src)/unroll.awk FORCE
88474fd6e8SMartin Schwidefsky	$(call if_changed,unroll)
89474fd6e8SMartin Schwidefsky
90f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE   $@
91172caf19SMasahiro Yamada      cmd_mktable = $(obj)/mktables > $@
92f5e70d0fSDavid Woodhouse
93cc4589ebSDavid Woodhousetargets += tables.c
94cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE
95f5e70d0fSDavid Woodhouse	$(call if_changed,mktable)
96