xref: /openbmc/linux/lib/raid6/Makefile (revision 72ad2107)
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
13f5e70d0fSDavid Woodhousehostprogs-y	+= mktables
14f5e70d0fSDavid Woodhouse
15f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y)
161fb3f5a7SAnton Blanchardaltivec_flags := -maltivec $(call cc-option,-mabi=altivec)
17e213574aSJoel Stanley
18e213574aSJoel Stanleyifdef CONFIG_CC_IS_CLANG
19e213574aSJoel Stanley# clang ppc port does not yet support -maltivec when -msoft-float is
20e213574aSJoel Stanley# enabled. A future release of clang will resolve this
21e213574aSJoel Stanley# https://bugs.llvm.org/show_bug.cgi?id=31177
22e213574aSJoel StanleyCFLAGS_REMOVE_altivec1.o  += -msoft-float
23e213574aSJoel StanleyCFLAGS_REMOVE_altivec2.o  += -msoft-float
24e213574aSJoel StanleyCFLAGS_REMOVE_altivec4.o  += -msoft-float
25e213574aSJoel StanleyCFLAGS_REMOVE_altivec8.o  += -msoft-float
26e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor1.o += -msoft-float
27e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor2.o += -msoft-float
28e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor4.o += -msoft-float
29e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor8.o += -msoft-float
30e213574aSJoel Stanleyendif
31f5e70d0fSDavid Woodhouseendif
32f5e70d0fSDavid Woodhouse
337d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing
347d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
357d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y)
367d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding
377d11965dSArd Biesheuvelifeq ($(ARCH),arm)
38de9c0d49SNathan ChancellorNEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
397d11965dSArd Biesheuvelendif
406ec4e251SArd BiesheuvelCFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
417d11965dSArd Biesheuvelifeq ($(ARCH),arm64)
426ec4e251SArd BiesheuvelCFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
437d11965dSArd BiesheuvelCFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
447d11965dSArd BiesheuvelCFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
457d11965dSArd BiesheuvelCFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
467d11965dSArd BiesheuvelCFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
477d11965dSArd Biesheuvelendif
487d11965dSArd Biesheuvelendif
497d11965dSArd Biesheuvel
5072ad2107SMasahiro Yamadaquiet_cmd_unroll = UNROLL  $@
5172ad2107SMasahiro Yamada      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$* < $< > $@
52f5e70d0fSDavid Woodhouse
5372ad2107SMasahiro Yamadatargets += int1.c int2.c int4.c int8.c int16.c int32.c
5472ad2107SMasahiro Yamada$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
55f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
56f5e70d0fSDavid Woodhouse
57cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags)
58cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags)
59cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags)
60cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags)
6172ad2107SMasahiro Yamadatargets += altivec1.c altivec2.c altivec4.c altivec8.c
6272ad2107SMasahiro Yamada$(obj)/altivec%.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
63f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
64f5e70d0fSDavid Woodhouse
65751ba79cSMatt BrownCFLAGS_vpermxor1.o += $(altivec_flags)
66751ba79cSMatt BrownCFLAGS_vpermxor2.o += $(altivec_flags)
67751ba79cSMatt BrownCFLAGS_vpermxor4.o += $(altivec_flags)
68751ba79cSMatt BrownCFLAGS_vpermxor8.o += $(altivec_flags)
6972ad2107SMasahiro Yamadatargets += vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
7072ad2107SMasahiro Yamada$(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
71751ba79cSMatt Brown	$(call if_changed,unroll)
72751ba79cSMatt Brown
737d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS)
747d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS)
757d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS)
767d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS)
7772ad2107SMasahiro Yamadatargets += neon1.c neon2.c neon4.c neon8.c
7872ad2107SMasahiro Yamada$(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE
797d11965dSArd Biesheuvel	$(call if_changed,unroll)
807d11965dSArd Biesheuvel
81474fd6e8SMartin Schwidefskytargets += s390vx8.c
8272ad2107SMasahiro Yamada$(obj)/s390vx%.c: $(src)/s390vx.uc $(src)/unroll.awk FORCE
83474fd6e8SMartin Schwidefsky	$(call if_changed,unroll)
84474fd6e8SMartin Schwidefsky
85f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE   $@
86172caf19SMasahiro Yamada      cmd_mktable = $(obj)/mktables > $@
87f5e70d0fSDavid Woodhouse
88cc4589ebSDavid Woodhousetargets += tables.c
89cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE
90f5e70d0fSDavid Woodhouse	$(call if_changed,mktable)
91