Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 obj-$(CONFIG_RAID6_PQ)  += raid6_pq.o
0003 
0004 raid6_pq-y      += algos.o recov.o tables.o int1.o int2.o int4.o \
0005                    int8.o int16.o int32.o
0006 
0007 raid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o avx512.o recov_avx512.o
0008 raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o \
0009                               vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
0010 raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
0011 raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
0012 
0013 hostprogs       += mktables
0014 
0015 ifeq ($(CONFIG_ALTIVEC),y)
0016 altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
0017 # Enable <altivec.h>
0018 altivec_flags += -isystem $(shell $(CC) -print-file-name=include)
0019 
0020 ifdef CONFIG_CC_IS_CLANG
0021 # clang ppc port does not yet support -maltivec when -msoft-float is
0022 # enabled. A future release of clang will resolve this
0023 # https://bugs.llvm.org/show_bug.cgi?id=31177
0024 CFLAGS_REMOVE_altivec1.o  += -msoft-float
0025 CFLAGS_REMOVE_altivec2.o  += -msoft-float
0026 CFLAGS_REMOVE_altivec4.o  += -msoft-float
0027 CFLAGS_REMOVE_altivec8.o  += -msoft-float
0028 CFLAGS_REMOVE_vpermxor1.o += -msoft-float
0029 CFLAGS_REMOVE_vpermxor2.o += -msoft-float
0030 CFLAGS_REMOVE_vpermxor4.o += -msoft-float
0031 CFLAGS_REMOVE_vpermxor8.o += -msoft-float
0032 endif
0033 endif
0034 
0035 # The GCC option -ffreestanding is required in order to compile code containing
0036 # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
0037 ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
0038 NEON_FLAGS := -ffreestanding
0039 # Enable <arm_neon.h>
0040 NEON_FLAGS += -isystem $(shell $(CC) -print-file-name=include)
0041 ifeq ($(ARCH),arm)
0042 NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
0043 endif
0044 CFLAGS_recov_neon_inner.o += $(NEON_FLAGS)
0045 ifeq ($(ARCH),arm64)
0046 CFLAGS_REMOVE_recov_neon_inner.o += -mgeneral-regs-only
0047 CFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
0048 CFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
0049 CFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
0050 CFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
0051 endif
0052 endif
0053 
0054 quiet_cmd_unroll = UNROLL  $@
0055       cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
0056 
0057 targets += int1.c int2.c int4.c int8.c int16.c int32.c
0058 $(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
0059         $(call if_changed,unroll)
0060 
0061 CFLAGS_altivec1.o += $(altivec_flags)
0062 CFLAGS_altivec2.o += $(altivec_flags)
0063 CFLAGS_altivec4.o += $(altivec_flags)
0064 CFLAGS_altivec8.o += $(altivec_flags)
0065 targets += altivec1.c altivec2.c altivec4.c altivec8.c
0066 $(obj)/altivec%.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
0067         $(call if_changed,unroll)
0068 
0069 CFLAGS_vpermxor1.o += $(altivec_flags)
0070 CFLAGS_vpermxor2.o += $(altivec_flags)
0071 CFLAGS_vpermxor4.o += $(altivec_flags)
0072 CFLAGS_vpermxor8.o += $(altivec_flags)
0073 targets += vpermxor1.c vpermxor2.c vpermxor4.c vpermxor8.c
0074 $(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE
0075         $(call if_changed,unroll)
0076 
0077 CFLAGS_neon1.o += $(NEON_FLAGS)
0078 CFLAGS_neon2.o += $(NEON_FLAGS)
0079 CFLAGS_neon4.o += $(NEON_FLAGS)
0080 CFLAGS_neon8.o += $(NEON_FLAGS)
0081 targets += neon1.c neon2.c neon4.c neon8.c
0082 $(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE
0083         $(call if_changed,unroll)
0084 
0085 targets += s390vx8.c
0086 $(obj)/s390vx%.c: $(src)/s390vx.uc $(src)/unroll.awk FORCE
0087         $(call if_changed,unroll)
0088 
0089 quiet_cmd_mktable = TABLE   $@
0090       cmd_mktable = $(obj)/mktables > $@
0091 
0092 targets += tables.c
0093 $(obj)/tables.c: $(obj)/mktables FORCE
0094         $(call if_changed,mktable)