blob: c770570bfe4f2d939a1331657f45a43edade9467 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
David Woodhousef5e70d02009-07-13 11:35:12 +01002obj-$(CONFIG_RAID6_PQ) += raid6_pq.o
3
Yuanhan Liu4f8c55c2012-11-30 13:10:40 -08004raid6_pq-y += algos.o recov.o tables.o int1.o int2.o int4.o \
5 int8.o int16.o int32.o
6
Gayatri Kammela13c520b2016-08-12 18:03:20 -07007raid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o avx512.o recov_avx512.o
Matt Brown751ba792017-08-04 13:42:32 +10008raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o \
9 vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
Ard Biesheuvel6ec4e2512017-07-13 18:16:01 +010010raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
Martin Schwidefskyf5b55fa2016-08-31 09:27:35 +020011raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
Yuanhan Liu4f8c55c2012-11-30 13:10:40 -080012
Masahiro Yamada5f2fb522020-02-02 01:49:24 +090013hostprogs += mktables
David Woodhousef5e70d02009-07-13 11:35:12 +010014
David Woodhousef5e70d02009-07-13 11:35:12 +010015ifeq ($(CONFIG_ALTIVEC),y)
Anton Blanchard1fb3f5a2015-05-26 08:53:26 +100016altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
Joel Stanleye2135742018-11-02 11:14:55 +103017
18ifdef CONFIG_CC_IS_CLANG
19# clang ppc port does not yet support -maltivec when -msoft-float is
20# enabled. A future release of clang will resolve this
21# https://bugs.llvm.org/show_bug.cgi?id=31177
22CFLAGS_REMOVE_altivec1.o += -msoft-float
23CFLAGS_REMOVE_altivec2.o += -msoft-float
24CFLAGS_REMOVE_altivec4.o += -msoft-float
25CFLAGS_REMOVE_altivec8.o += -msoft-float
Joel Stanleye2135742018-11-02 11:14:55 +103026CFLAGS_REMOVE_vpermxor1.o += -msoft-float
27CFLAGS_REMOVE_vpermxor2.o += -msoft-float
28CFLAGS_REMOVE_vpermxor4.o += -msoft-float
29CFLAGS_REMOVE_vpermxor8.o += -msoft-float
30endif
David Woodhousef5e70d02009-07-13 11:35:12 +010031endif
32
Ard Biesheuvel7d119652013-05-16 17:20:32 +020033# The GCC option -ffreestanding is required in order to compile code containing
34# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
35ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
36NEON_FLAGS := -ffreestanding
37ifeq ($(ARCH),arm)
Nathan Chancellorde9c0d42019-02-02 03:34:36 +010038NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
Ard Biesheuvel7d119652013-05-16 17:20:32 +020039endif
Ard Biesheuvel6ec4e2512017-07-13 18:16:01 +010040CFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
Ard Biesheuvel7d119652013-05-16 17:20:32 +020041ifeq ($(ARCH),arm64)
Ard Biesheuvel6ec4e2512017-07-13 18:16:01 +010042CFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
Ard Biesheuvel7d119652013-05-16 17:20:32 +020043CFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
44CFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
45CFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
46CFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
47endif
48endif
49
Masahiro Yamada72ad2102019-06-17 02:48:05 +090050quiet_cmd_unroll = UNROLL $@
John Millikin0c36d882020-12-23 15:23:25 +090051 cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
David Woodhousef5e70d02009-07-13 11:35:12 +010052
Masahiro Yamada72ad2102019-06-17 02:48:05 +090053targets += int1.c int2.c int4.c int8.c int16.c int32.c
54$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
David Woodhousef5e70d02009-07-13 11:35:12 +010055 $(call if_changed,unroll)
56
David Woodhousecc4589e2010-08-11 00:19:05 +010057CFLAGS_altivec1.o += $(altivec_flags)
David Woodhousecc4589e2010-08-11 00:19:05 +010058CFLAGS_altivec2.o += $(altivec_flags)
David Woodhousecc4589e2010-08-11 00:19:05 +010059CFLAGS_altivec4.o += $(altivec_flags)
David Woodhousecc4589e2010-08-11 00:19:05 +010060CFLAGS_altivec8.o += $(altivec_flags)
Masahiro Yamada72ad2102019-06-17 02:48:05 +090061targets += altivec1.c altivec2.c altivec4.c altivec8.c
62$(obj)/altivec%.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
David Woodhousef5e70d02009-07-13 11:35:12 +010063 $(call if_changed,unroll)
64
Matt Brown751ba792017-08-04 13:42:32 +100065CFLAGS_vpermxor1.o += $(altivec_flags)
Matt Brown751ba792017-08-04 13:42:32 +100066CFLAGS_vpermxor2.o += $(altivec_flags)
Matt Brown751ba792017-08-04 13:42:32 +100067CFLAGS_vpermxor4.o += $(altivec_flags)
Matt Brown751ba792017-08-04 13:42:32 +100068CFLAGS_vpermxor8.o += $(altivec_flags)
Masahiro Yamadae2a280d2019-07-31 01:40:42 +090069targets += vpermxor1.c vpermxor2.c vpermxor4.c vpermxor8.c
Masahiro Yamada72ad2102019-06-17 02:48:05 +090070$(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
Matt Brown751ba792017-08-04 13:42:32 +100071 $(call if_changed,unroll)
72
Ard Biesheuvel7d119652013-05-16 17:20:32 +020073CFLAGS_neon1.o += $(NEON_FLAGS)
Ard Biesheuvel7d119652013-05-16 17:20:32 +020074CFLAGS_neon2.o += $(NEON_FLAGS)
Ard Biesheuvel7d119652013-05-16 17:20:32 +020075CFLAGS_neon4.o += $(NEON_FLAGS)
Ard Biesheuvel7d119652013-05-16 17:20:32 +020076CFLAGS_neon8.o += $(NEON_FLAGS)
Masahiro Yamada72ad2102019-06-17 02:48:05 +090077targets += neon1.c neon2.c neon4.c neon8.c
78$(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE
Ard Biesheuvel7d119652013-05-16 17:20:32 +020079 $(call if_changed,unroll)
80
Martin Schwidefsky474fd6e2016-08-23 13:30:24 +020081targets += s390vx8.c
Masahiro Yamada72ad2102019-06-17 02:48:05 +090082$(obj)/s390vx%.c: $(src)/s390vx.uc $(src)/unroll.awk FORCE
Martin Schwidefsky474fd6e2016-08-23 13:30:24 +020083 $(call if_changed,unroll)
84
David Woodhousef5e70d02009-07-13 11:35:12 +010085quiet_cmd_mktable = TABLE $@
Masahiro Yamada172caf12018-12-31 17:24:08 +090086 cmd_mktable = $(obj)/mktables > $@
David Woodhousef5e70d02009-07-13 11:35:12 +010087
David Woodhousecc4589e2010-08-11 00:19:05 +010088targets += tables.c
89$(obj)/tables.c: $(obj)/mktables FORCE
David Woodhousef5e70d02009-07-13 11:35:12 +010090 $(call if_changed,mktable)