xref: /openbmc/linux/lib/raid6/Makefile (revision e213574a)
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  $@
162144381dSDavid Woodhouse      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) \
17f5e70d0fSDavid Woodhouse                   < $< > $@ || ( rm -f $@ && exit 1 )
18f5e70d0fSDavid Woodhouse
19f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y)
201fb3f5a7SAnton Blanchardaltivec_flags := -maltivec $(call cc-option,-mabi=altivec)
21*e213574aSJoel Stanley
22*e213574aSJoel Stanleyifdef CONFIG_CC_IS_CLANG
23*e213574aSJoel Stanley# clang ppc port does not yet support -maltivec when -msoft-float is
24*e213574aSJoel Stanley# enabled. A future release of clang will resolve this
25*e213574aSJoel Stanley# https://bugs.llvm.org/show_bug.cgi?id=31177
26*e213574aSJoel StanleyCFLAGS_REMOVE_altivec1.o  += -msoft-float
27*e213574aSJoel StanleyCFLAGS_REMOVE_altivec2.o  += -msoft-float
28*e213574aSJoel StanleyCFLAGS_REMOVE_altivec4.o  += -msoft-float
29*e213574aSJoel StanleyCFLAGS_REMOVE_altivec8.o  += -msoft-float
30*e213574aSJoel StanleyCFLAGS_REMOVE_altivec8.o  += -msoft-float
31*e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor1.o += -msoft-float
32*e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor2.o += -msoft-float
33*e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor4.o += -msoft-float
34*e213574aSJoel StanleyCFLAGS_REMOVE_vpermxor8.o += -msoft-float
35*e213574aSJoel Stanleyendif
36f5e70d0fSDavid Woodhouseendif
37f5e70d0fSDavid Woodhouse
387d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing
397d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
407d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y)
417d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding
427d11965dSArd Biesheuvelifeq ($(ARCH),arm)
437d11965dSArd BiesheuvelNEON_FLAGS += -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
55cc4589ebSDavid Woodhousetargets += int1.c
56cc4589ebSDavid Woodhouse$(obj)/int1.c:   UNROLL := 1
57cc4589ebSDavid Woodhouse$(obj)/int1.c:   $(src)/int.uc $(src)/unroll.awk FORCE
58f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
59f5e70d0fSDavid Woodhouse
60cc4589ebSDavid Woodhousetargets += int2.c
61cc4589ebSDavid Woodhouse$(obj)/int2.c:   UNROLL := 2
62cc4589ebSDavid Woodhouse$(obj)/int2.c:   $(src)/int.uc $(src)/unroll.awk FORCE
63f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
64f5e70d0fSDavid Woodhouse
65cc4589ebSDavid Woodhousetargets += int4.c
66cc4589ebSDavid Woodhouse$(obj)/int4.c:   UNROLL := 4
67cc4589ebSDavid Woodhouse$(obj)/int4.c:   $(src)/int.uc $(src)/unroll.awk FORCE
68f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
69f5e70d0fSDavid Woodhouse
70cc4589ebSDavid Woodhousetargets += int8.c
71cc4589ebSDavid Woodhouse$(obj)/int8.c:   UNROLL := 8
72cc4589ebSDavid Woodhouse$(obj)/int8.c:   $(src)/int.uc $(src)/unroll.awk FORCE
73f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
74f5e70d0fSDavid Woodhouse
75cc4589ebSDavid Woodhousetargets += int16.c
76cc4589ebSDavid Woodhouse$(obj)/int16.c:  UNROLL := 16
77cc4589ebSDavid Woodhouse$(obj)/int16.c:  $(src)/int.uc $(src)/unroll.awk FORCE
78f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
79f5e70d0fSDavid Woodhouse
80cc4589ebSDavid Woodhousetargets += int32.c
81cc4589ebSDavid Woodhouse$(obj)/int32.c:  UNROLL := 32
82cc4589ebSDavid Woodhouse$(obj)/int32.c:  $(src)/int.uc $(src)/unroll.awk FORCE
83f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
84f5e70d0fSDavid Woodhouse
85cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags)
86cc4589ebSDavid Woodhousetargets += altivec1.c
87cc4589ebSDavid Woodhouse$(obj)/altivec1.c:   UNROLL := 1
88cc4589ebSDavid Woodhouse$(obj)/altivec1.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
89f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
90f5e70d0fSDavid Woodhouse
91cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags)
92cc4589ebSDavid Woodhousetargets += altivec2.c
93cc4589ebSDavid Woodhouse$(obj)/altivec2.c:   UNROLL := 2
94cc4589ebSDavid Woodhouse$(obj)/altivec2.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
95f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
96f5e70d0fSDavid Woodhouse
97cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags)
98cc4589ebSDavid Woodhousetargets += altivec4.c
99cc4589ebSDavid Woodhouse$(obj)/altivec4.c:   UNROLL := 4
100cc4589ebSDavid Woodhouse$(obj)/altivec4.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
101f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
102f5e70d0fSDavid Woodhouse
103cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags)
104cc4589ebSDavid Woodhousetargets += altivec8.c
105cc4589ebSDavid Woodhouse$(obj)/altivec8.c:   UNROLL := 8
106cc4589ebSDavid Woodhouse$(obj)/altivec8.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
107f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
108f5e70d0fSDavid Woodhouse
109751ba79cSMatt BrownCFLAGS_vpermxor1.o += $(altivec_flags)
110751ba79cSMatt Browntargets += vpermxor1.c
111751ba79cSMatt Brown$(obj)/vpermxor1.c: UNROLL := 1
112751ba79cSMatt Brown$(obj)/vpermxor1.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
113751ba79cSMatt Brown	$(call if_changed,unroll)
114751ba79cSMatt Brown
115751ba79cSMatt BrownCFLAGS_vpermxor2.o += $(altivec_flags)
116751ba79cSMatt Browntargets += vpermxor2.c
117751ba79cSMatt Brown$(obj)/vpermxor2.c: UNROLL := 2
118751ba79cSMatt Brown$(obj)/vpermxor2.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
119751ba79cSMatt Brown	$(call if_changed,unroll)
120751ba79cSMatt Brown
121751ba79cSMatt BrownCFLAGS_vpermxor4.o += $(altivec_flags)
122751ba79cSMatt Browntargets += vpermxor4.c
123751ba79cSMatt Brown$(obj)/vpermxor4.c: UNROLL := 4
124751ba79cSMatt Brown$(obj)/vpermxor4.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
125751ba79cSMatt Brown	$(call if_changed,unroll)
126751ba79cSMatt Brown
127751ba79cSMatt BrownCFLAGS_vpermxor8.o += $(altivec_flags)
128751ba79cSMatt Browntargets += vpermxor8.c
129751ba79cSMatt Brown$(obj)/vpermxor8.c: UNROLL := 8
130751ba79cSMatt Brown$(obj)/vpermxor8.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
131751ba79cSMatt Brown	$(call if_changed,unroll)
132751ba79cSMatt Brown
1337d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS)
1347d11965dSArd Biesheuveltargets += neon1.c
1357d11965dSArd Biesheuvel$(obj)/neon1.c:   UNROLL := 1
1367d11965dSArd Biesheuvel$(obj)/neon1.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1377d11965dSArd Biesheuvel	$(call if_changed,unroll)
1387d11965dSArd Biesheuvel
1397d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS)
1407d11965dSArd Biesheuveltargets += neon2.c
1417d11965dSArd Biesheuvel$(obj)/neon2.c:   UNROLL := 2
1427d11965dSArd Biesheuvel$(obj)/neon2.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1437d11965dSArd Biesheuvel	$(call if_changed,unroll)
1447d11965dSArd Biesheuvel
1457d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS)
1467d11965dSArd Biesheuveltargets += neon4.c
1477d11965dSArd Biesheuvel$(obj)/neon4.c:   UNROLL := 4
1487d11965dSArd Biesheuvel$(obj)/neon4.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1497d11965dSArd Biesheuvel	$(call if_changed,unroll)
1507d11965dSArd Biesheuvel
1517d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS)
1527d11965dSArd Biesheuveltargets += neon8.c
1537d11965dSArd Biesheuvel$(obj)/neon8.c:   UNROLL := 8
1547d11965dSArd Biesheuvel$(obj)/neon8.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1557d11965dSArd Biesheuvel	$(call if_changed,unroll)
1567d11965dSArd Biesheuvel
157474fd6e8SMartin Schwidefskytargets += s390vx8.c
158474fd6e8SMartin Schwidefsky$(obj)/s390vx8.c:   UNROLL := 8
159474fd6e8SMartin Schwidefsky$(obj)/s390vx8.c:   $(src)/s390vx.uc $(src)/unroll.awk FORCE
160474fd6e8SMartin Schwidefsky	$(call if_changed,unroll)
161474fd6e8SMartin Schwidefsky
162f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE   $@
163f5e70d0fSDavid Woodhouse      cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
164f5e70d0fSDavid Woodhouse
165cc4589ebSDavid Woodhousetargets += tables.c
166cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE
167f5e70d0fSDavid Woodhouse	$(call if_changed,mktable)
168