xref: /openbmc/linux/lib/raid6/Makefile (revision 172caf19)
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 Woodhousequiet_cmd_unroll = UNROLL  $@
16172caf19SMasahiro Yamada      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) < $< > $@
17f5e70d0fSDavid Woodhouse
18f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y)
191fb3f5a7SAnton Blanchardaltivec_flags := -maltivec $(call cc-option,-mabi=altivec)
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_altivec8.o  += -msoft-float
30e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor1.o += -msoft-float
31e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor2.o += -msoft-float
32e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor4.o += -msoft-float
33e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor8.o += -msoft-float
34e213574aSJoel Stanleyendif
35f5e70d0fSDavid Woodhouseendif
36f5e70d0fSDavid Woodhouse
377d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing
387d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
397d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y)
407d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding
417d11965dSArd Biesheuvelifeq ($(ARCH),arm)
427d11965dSArd BiesheuvelNEON_FLAGS += -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
54cc4589ebSDavid Woodhousetargets += int1.c
55cc4589ebSDavid Woodhouse$(obj)/int1.c:   UNROLL := 1
56cc4589ebSDavid Woodhouse$(obj)/int1.c:   $(src)/int.uc $(src)/unroll.awk FORCE
57f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
58f5e70d0fSDavid Woodhouse
59cc4589ebSDavid Woodhousetargets += int2.c
60cc4589ebSDavid Woodhouse$(obj)/int2.c:   UNROLL := 2
61cc4589ebSDavid Woodhouse$(obj)/int2.c:   $(src)/int.uc $(src)/unroll.awk FORCE
62f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
63f5e70d0fSDavid Woodhouse
64cc4589ebSDavid Woodhousetargets += int4.c
65cc4589ebSDavid Woodhouse$(obj)/int4.c:   UNROLL := 4
66cc4589ebSDavid Woodhouse$(obj)/int4.c:   $(src)/int.uc $(src)/unroll.awk FORCE
67f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
68f5e70d0fSDavid Woodhouse
69cc4589ebSDavid Woodhousetargets += int8.c
70cc4589ebSDavid Woodhouse$(obj)/int8.c:   UNROLL := 8
71cc4589ebSDavid Woodhouse$(obj)/int8.c:   $(src)/int.uc $(src)/unroll.awk FORCE
72f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
73f5e70d0fSDavid Woodhouse
74cc4589ebSDavid Woodhousetargets += int16.c
75cc4589ebSDavid Woodhouse$(obj)/int16.c:  UNROLL := 16
76cc4589ebSDavid Woodhouse$(obj)/int16.c:  $(src)/int.uc $(src)/unroll.awk FORCE
77f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
78f5e70d0fSDavid Woodhouse
79cc4589ebSDavid Woodhousetargets += int32.c
80cc4589ebSDavid Woodhouse$(obj)/int32.c:  UNROLL := 32
81cc4589ebSDavid Woodhouse$(obj)/int32.c:  $(src)/int.uc $(src)/unroll.awk FORCE
82f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
83f5e70d0fSDavid Woodhouse
84cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags)
85cc4589ebSDavid Woodhousetargets += altivec1.c
86cc4589ebSDavid Woodhouse$(obj)/altivec1.c:   UNROLL := 1
87cc4589ebSDavid Woodhouse$(obj)/altivec1.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
88f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
89f5e70d0fSDavid Woodhouse
90cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags)
91cc4589ebSDavid Woodhousetargets += altivec2.c
92cc4589ebSDavid Woodhouse$(obj)/altivec2.c:   UNROLL := 2
93cc4589ebSDavid Woodhouse$(obj)/altivec2.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
94f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
95f5e70d0fSDavid Woodhouse
96cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags)
97cc4589ebSDavid Woodhousetargets += altivec4.c
98cc4589ebSDavid Woodhouse$(obj)/altivec4.c:   UNROLL := 4
99cc4589ebSDavid Woodhouse$(obj)/altivec4.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
100f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
101f5e70d0fSDavid Woodhouse
102cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags)
103cc4589ebSDavid Woodhousetargets += altivec8.c
104cc4589ebSDavid Woodhouse$(obj)/altivec8.c:   UNROLL := 8
105cc4589ebSDavid Woodhouse$(obj)/altivec8.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
106f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
107f5e70d0fSDavid Woodhouse
108751ba79cSMatt BrownCFLAGS_vpermxor1.o += $(altivec_flags)
109751ba79cSMatt Browntargets += vpermxor1.c
110751ba79cSMatt Brown$(obj)/vpermxor1.c: UNROLL := 1
111751ba79cSMatt Brown$(obj)/vpermxor1.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
112751ba79cSMatt Brown	$(call if_changed,unroll)
113751ba79cSMatt Brown
114751ba79cSMatt BrownCFLAGS_vpermxor2.o += $(altivec_flags)
115751ba79cSMatt Browntargets += vpermxor2.c
116751ba79cSMatt Brown$(obj)/vpermxor2.c: UNROLL := 2
117751ba79cSMatt Brown$(obj)/vpermxor2.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
118751ba79cSMatt Brown	$(call if_changed,unroll)
119751ba79cSMatt Brown
120751ba79cSMatt BrownCFLAGS_vpermxor4.o += $(altivec_flags)
121751ba79cSMatt Browntargets += vpermxor4.c
122751ba79cSMatt Brown$(obj)/vpermxor4.c: UNROLL := 4
123751ba79cSMatt Brown$(obj)/vpermxor4.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
124751ba79cSMatt Brown	$(call if_changed,unroll)
125751ba79cSMatt Brown
126751ba79cSMatt BrownCFLAGS_vpermxor8.o += $(altivec_flags)
127751ba79cSMatt Browntargets += vpermxor8.c
128751ba79cSMatt Brown$(obj)/vpermxor8.c: UNROLL := 8
129751ba79cSMatt Brown$(obj)/vpermxor8.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
130751ba79cSMatt Brown	$(call if_changed,unroll)
131751ba79cSMatt Brown
1327d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS)
1337d11965dSArd Biesheuveltargets += neon1.c
1347d11965dSArd Biesheuvel$(obj)/neon1.c:   UNROLL := 1
1357d11965dSArd Biesheuvel$(obj)/neon1.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1367d11965dSArd Biesheuvel	$(call if_changed,unroll)
1377d11965dSArd Biesheuvel
1387d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS)
1397d11965dSArd Biesheuveltargets += neon2.c
1407d11965dSArd Biesheuvel$(obj)/neon2.c:   UNROLL := 2
1417d11965dSArd Biesheuvel$(obj)/neon2.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1427d11965dSArd Biesheuvel	$(call if_changed,unroll)
1437d11965dSArd Biesheuvel
1447d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS)
1457d11965dSArd Biesheuveltargets += neon4.c
1467d11965dSArd Biesheuvel$(obj)/neon4.c:   UNROLL := 4
1477d11965dSArd Biesheuvel$(obj)/neon4.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1487d11965dSArd Biesheuvel	$(call if_changed,unroll)
1497d11965dSArd Biesheuvel
1507d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS)
1517d11965dSArd Biesheuveltargets += neon8.c
1527d11965dSArd Biesheuvel$(obj)/neon8.c:   UNROLL := 8
1537d11965dSArd Biesheuvel$(obj)/neon8.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1547d11965dSArd Biesheuvel	$(call if_changed,unroll)
1557d11965dSArd Biesheuvel
156474fd6e8SMartin Schwidefskytargets += s390vx8.c
157474fd6e8SMartin Schwidefsky$(obj)/s390vx8.c:   UNROLL := 8
158474fd6e8SMartin Schwidefsky$(obj)/s390vx8.c:   $(src)/s390vx.uc $(src)/unroll.awk FORCE
159474fd6e8SMartin Schwidefsky	$(call if_changed,unroll)
160474fd6e8SMartin Schwidefsky
161f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE   $@
162172caf19SMasahiro Yamada      cmd_mktable = $(obj)/mktables > $@
163f5e70d0fSDavid Woodhouse
164cc4589ebSDavid Woodhousetargets += tables.c
165cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE
166f5e70d0fSDavid Woodhouse	$(call if_changed,mktable)
167