xref: /openbmc/linux/lib/raid6/Makefile (revision 6ec4e251)
1f5e70d0fSDavid Woodhouseobj-$(CONFIG_RAID6_PQ)	+= raid6_pq.o
2f5e70d0fSDavid Woodhouse
34f8c55c5SYuanhan Liuraid6_pq-y	+= algos.o recov.o tables.o int1.o int2.o int4.o \
44f8c55c5SYuanhan Liu		   int8.o int16.o int32.o
54f8c55c5SYuanhan Liu
613c520b2SGayatri Kammelaraid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o avx512.o recov_avx512.o
74f8c55c5SYuanhan Liuraid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o
8*6ec4e251SArd Biesheuvelraid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
9ae77cbc1SKen Steeleraid6_pq-$(CONFIG_TILEGX) += tilegx8.o
10f5b55fa1SMartin Schwidefskyraid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
114f8c55c5SYuanhan Liu
12f5e70d0fSDavid Woodhousehostprogs-y	+= mktables
13f5e70d0fSDavid Woodhouse
14f5e70d0fSDavid Woodhousequiet_cmd_unroll = UNROLL  $@
152144381dSDavid Woodhouse      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) \
16f5e70d0fSDavid Woodhouse                   < $< > $@ || ( rm -f $@ && exit 1 )
17f5e70d0fSDavid Woodhouse
18f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y)
191fb3f5a7SAnton Blanchardaltivec_flags := -maltivec $(call cc-option,-mabi=altivec)
20f5e70d0fSDavid Woodhouseendif
21f5e70d0fSDavid Woodhouse
227d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing
237d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
247d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y)
257d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding
267d11965dSArd Biesheuvelifeq ($(ARCH),arm)
277d11965dSArd BiesheuvelNEON_FLAGS += -mfloat-abi=softfp -mfpu=neon
287d11965dSArd Biesheuvelendif
29*6ec4e251SArd BiesheuvelCFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
307d11965dSArd Biesheuvelifeq ($(ARCH),arm64)
31*6ec4e251SArd BiesheuvelCFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
327d11965dSArd BiesheuvelCFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
337d11965dSArd BiesheuvelCFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
347d11965dSArd BiesheuvelCFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
357d11965dSArd BiesheuvelCFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
367d11965dSArd Biesheuvelendif
377d11965dSArd Biesheuvelendif
387d11965dSArd Biesheuvel
39cc4589ebSDavid Woodhousetargets += int1.c
40cc4589ebSDavid Woodhouse$(obj)/int1.c:   UNROLL := 1
41cc4589ebSDavid Woodhouse$(obj)/int1.c:   $(src)/int.uc $(src)/unroll.awk FORCE
42f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
43f5e70d0fSDavid Woodhouse
44cc4589ebSDavid Woodhousetargets += int2.c
45cc4589ebSDavid Woodhouse$(obj)/int2.c:   UNROLL := 2
46cc4589ebSDavid Woodhouse$(obj)/int2.c:   $(src)/int.uc $(src)/unroll.awk FORCE
47f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
48f5e70d0fSDavid Woodhouse
49cc4589ebSDavid Woodhousetargets += int4.c
50cc4589ebSDavid Woodhouse$(obj)/int4.c:   UNROLL := 4
51cc4589ebSDavid Woodhouse$(obj)/int4.c:   $(src)/int.uc $(src)/unroll.awk FORCE
52f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
53f5e70d0fSDavid Woodhouse
54cc4589ebSDavid Woodhousetargets += int8.c
55cc4589ebSDavid Woodhouse$(obj)/int8.c:   UNROLL := 8
56cc4589ebSDavid Woodhouse$(obj)/int8.c:   $(src)/int.uc $(src)/unroll.awk FORCE
57f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
58f5e70d0fSDavid Woodhouse
59cc4589ebSDavid Woodhousetargets += int16.c
60cc4589ebSDavid Woodhouse$(obj)/int16.c:  UNROLL := 16
61cc4589ebSDavid Woodhouse$(obj)/int16.c:  $(src)/int.uc $(src)/unroll.awk FORCE
62f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
63f5e70d0fSDavid Woodhouse
64cc4589ebSDavid Woodhousetargets += int32.c
65cc4589ebSDavid Woodhouse$(obj)/int32.c:  UNROLL := 32
66cc4589ebSDavid Woodhouse$(obj)/int32.c:  $(src)/int.uc $(src)/unroll.awk FORCE
67f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
68f5e70d0fSDavid Woodhouse
69cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags)
70cc4589ebSDavid Woodhousetargets += altivec1.c
71cc4589ebSDavid Woodhouse$(obj)/altivec1.c:   UNROLL := 1
72cc4589ebSDavid Woodhouse$(obj)/altivec1.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
73f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
74f5e70d0fSDavid Woodhouse
75cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags)
76cc4589ebSDavid Woodhousetargets += altivec2.c
77cc4589ebSDavid Woodhouse$(obj)/altivec2.c:   UNROLL := 2
78cc4589ebSDavid Woodhouse$(obj)/altivec2.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
79f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
80f5e70d0fSDavid Woodhouse
81cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags)
82cc4589ebSDavid Woodhousetargets += altivec4.c
83cc4589ebSDavid Woodhouse$(obj)/altivec4.c:   UNROLL := 4
84cc4589ebSDavid Woodhouse$(obj)/altivec4.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
85f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
86f5e70d0fSDavid Woodhouse
87cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags)
88cc4589ebSDavid Woodhousetargets += altivec8.c
89cc4589ebSDavid Woodhouse$(obj)/altivec8.c:   UNROLL := 8
90cc4589ebSDavid Woodhouse$(obj)/altivec8.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
91f5e70d0fSDavid Woodhouse	$(call if_changed,unroll)
92f5e70d0fSDavid Woodhouse
937d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS)
947d11965dSArd Biesheuveltargets += neon1.c
957d11965dSArd Biesheuvel$(obj)/neon1.c:   UNROLL := 1
967d11965dSArd Biesheuvel$(obj)/neon1.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
977d11965dSArd Biesheuvel	$(call if_changed,unroll)
987d11965dSArd Biesheuvel
997d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS)
1007d11965dSArd Biesheuveltargets += neon2.c
1017d11965dSArd Biesheuvel$(obj)/neon2.c:   UNROLL := 2
1027d11965dSArd Biesheuvel$(obj)/neon2.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1037d11965dSArd Biesheuvel	$(call if_changed,unroll)
1047d11965dSArd Biesheuvel
1057d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS)
1067d11965dSArd Biesheuveltargets += neon4.c
1077d11965dSArd Biesheuvel$(obj)/neon4.c:   UNROLL := 4
1087d11965dSArd Biesheuvel$(obj)/neon4.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1097d11965dSArd Biesheuvel	$(call if_changed,unroll)
1107d11965dSArd Biesheuvel
1117d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS)
1127d11965dSArd Biesheuveltargets += neon8.c
1137d11965dSArd Biesheuvel$(obj)/neon8.c:   UNROLL := 8
1147d11965dSArd Biesheuvel$(obj)/neon8.c:   $(src)/neon.uc $(src)/unroll.awk FORCE
1157d11965dSArd Biesheuvel	$(call if_changed,unroll)
1167d11965dSArd Biesheuvel
117ae77cbc1SKen Steeletargets += tilegx8.c
118ae77cbc1SKen Steele$(obj)/tilegx8.c:   UNROLL := 8
119ae77cbc1SKen Steele$(obj)/tilegx8.c:   $(src)/tilegx.uc $(src)/unroll.awk FORCE
120ae77cbc1SKen Steele	$(call if_changed,unroll)
121ae77cbc1SKen Steele
122474fd6e8SMartin Schwidefskytargets += s390vx8.c
123474fd6e8SMartin Schwidefsky$(obj)/s390vx8.c:   UNROLL := 8
124474fd6e8SMartin Schwidefsky$(obj)/s390vx8.c:   $(src)/s390vx.uc $(src)/unroll.awk FORCE
125474fd6e8SMartin Schwidefsky	$(call if_changed,unroll)
126474fd6e8SMartin Schwidefsky
127f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE   $@
128f5e70d0fSDavid Woodhouse      cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
129f5e70d0fSDavid Woodhouse
130cc4589ebSDavid Woodhousetargets += tables.c
131cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE
132f5e70d0fSDavid Woodhouse	$(call if_changed,mktable)
133