xref: /openbmc/linux/lib/raid6/Makefile (revision 04e85bbf)
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
124f8c55c5SYuanhan Liu
135f2fb52fSMasahiro Yamadahostprogs	+= mktables
14f5e70d0fSDavid Woodhouse
15f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y)
161fb3f5a7SAnton Blanchardaltivec_flags := -maltivec $(call cc-option,-mabi=altivec)
17*04e85bbfSAlexey Dobriyan# Enable <altivec.h>
18*04e85bbfSAlexey Dobriyanaltivec_flags += -isystem $(shell $(CC) -print-file-name=include)
19e213574aSJoel Stanley
20e213574aSJoel Stanleyifdef CONFIG_CC_IS_CLANG
21e213574aSJoel Stanley# clang ppc port does not yet support -maltivec when -msoft-float is
22e213574aSJoel Stanley# enabled. A future release of clang will resolve this
23e213574aSJoel Stanley# https://bugs.llvm.org/show_bug.cgi?id=31177
24e213574aSJoel StanleyCFLAGS_REMOVE_altivec1.o  += -msoft-float
25e213574aSJoel StanleyCFLAGS_REMOVE_altivec2.o  += -msoft-float
26e213574aSJoel StanleyCFLAGS_REMOVE_altivec4.o  += -msoft-float
27e213574aSJoel StanleyCFLAGS_REMOVE_altivec8.o  += -msoft-float
28e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor1.o += -msoft-float
29e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor2.o += -msoft-float
30e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor4.o += -msoft-float
31e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor8.o += -msoft-float
32e213574aSJoel Stanleyendif
33f5e70d0fSDavid Woodhouseendif
34f5e70d0fSDavid Woodhouse
357d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing
367d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
377d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y)
387d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding
39*04e85bbfSAlexey Dobriyan# Enable <arm_neon.h>
40*04e85bbfSAlexey DobriyanNEON_FLAGS += -isystem $(shell $(CC) -print-file-name=include)
417d11965dSArd Biesheuvelifeq ($(ARCH),arm)
42de9c0d49SNathan ChancellorNEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
437d11965dSArd Biesheuvelendif
446ec4e251SArd BiesheuvelCFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
457d11965dSArd Biesheuvelifeq ($(ARCH),arm64)
466ec4e251SArd BiesheuvelCFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
477d11965dSArd BiesheuvelCFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
487d11965dSArd BiesheuvelCFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
497d11965dSArd BiesheuvelCFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
507d11965dSArd BiesheuvelCFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
517d11965dSArd Biesheuvelendif
527d11965dSArd Biesheuvelendif
537d11965dSArd Biesheuvel
5472ad2107SMasahiro Yamadaquiet_cmd_unroll = UNROLL  $@
550c36d88cSJohn Millikin      cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
56f5e70d0fSDavid Woodhouse
5772ad2107SMasahiro Yamadatargets += int1.c int2.c int4.c int8.c int16.c int32.c
5872ad2107SMasahiro Yamada$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
59f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
60f5e70d0fSDavid Woodhouse
61cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags)
62cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags)
63cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags)
64cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags)
6572ad2107SMasahiro Yamadatargets += altivec1.c altivec2.c altivec4.c altivec8.c
6672ad2107SMasahiro Yamada$(obj)/altivec%.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
67f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
68f5e70d0fSDavid Woodhouse
69751ba79cSMatt BrownCFLAGS_vpermxor1.o += $(altivec_flags)
70751ba79cSMatt BrownCFLAGS_vpermxor2.o += $(altivec_flags)
71751ba79cSMatt BrownCFLAGS_vpermxor4.o += $(altivec_flags)
72751ba79cSMatt BrownCFLAGS_vpermxor8.o += $(altivec_flags)
73e2a280d2SMasahiro Yamadatargets += vpermxor1.c vpermxor2.c vpermxor4.c vpermxor8.c
7472ad2107SMasahiro Yamada$(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
75751ba79cSMatt Brown	$(call if_changed,unroll)
76751ba79cSMatt Brown
777d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS)
787d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS)
797d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS)
807d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS)
8172ad2107SMasahiro Yamadatargets += neon1.c neon2.c neon4.c neon8.c
8272ad2107SMasahiro Yamada$(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE
837d11965dSArd Biesheuvel	$(call if_changed,unroll)
847d11965dSArd Biesheuvel
85474fd6e8SMartin Schwidefskytargets += s390vx8.c
8672ad2107SMasahiro Yamada$(obj)/s390vx%.c: $(src)/s390vx.uc $(src)/unroll.awk FORCE
87474fd6e8SMartin Schwidefsky	$(call if_changed,unroll)
88474fd6e8SMartin Schwidefsky
89f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE   $@
90172caf19SMasahiro Yamada      cmd_mktable = $(obj)/mktables > $@
91f5e70d0fSDavid Woodhouse
92cc4589ebSDavid Woodhousetargets += tables.c
93cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE
94f5e70d0fSDavid Woodhouse	$(call if_changed,mktable)
95