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 64f8c55c5SYuanhan Liuraid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o 74f8c55c5SYuanhan Liuraid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o 8*7d11965dSArd Biesheuvelraid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o 94f8c55c5SYuanhan Liu 10f5e70d0fSDavid Woodhousehostprogs-y += mktables 11f5e70d0fSDavid Woodhouse 12f5e70d0fSDavid Woodhousequiet_cmd_unroll = UNROLL $@ 132144381dSDavid Woodhouse cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) \ 14f5e70d0fSDavid Woodhouse < $< > $@ || ( rm -f $@ && exit 1 ) 15f5e70d0fSDavid Woodhouse 16f5e70d0fSDavid Woodhouseifeq ($(CONFIG_ALTIVEC),y) 17f5e70d0fSDavid Woodhousealtivec_flags := -maltivec -mabi=altivec 18f5e70d0fSDavid Woodhouseendif 19f5e70d0fSDavid Woodhouse 20*7d11965dSArd Biesheuvel# The GCC option -ffreestanding is required in order to compile code containing 21*7d11965dSArd Biesheuvel# ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel) 22*7d11965dSArd Biesheuvelifeq ($(CONFIG_KERNEL_MODE_NEON),y) 23*7d11965dSArd BiesheuvelNEON_FLAGS := -ffreestanding 24*7d11965dSArd Biesheuvelifeq ($(ARCH),arm) 25*7d11965dSArd BiesheuvelNEON_FLAGS += -mfloat-abi=softfp -mfpu=neon 26*7d11965dSArd Biesheuvelendif 27*7d11965dSArd Biesheuvelifeq ($(ARCH),arm64) 28*7d11965dSArd BiesheuvelCFLAGS_REMOVE_neon1.o += -mgeneral-regs-only 29*7d11965dSArd BiesheuvelCFLAGS_REMOVE_neon2.o += -mgeneral-regs-only 30*7d11965dSArd BiesheuvelCFLAGS_REMOVE_neon4.o += -mgeneral-regs-only 31*7d11965dSArd BiesheuvelCFLAGS_REMOVE_neon8.o += -mgeneral-regs-only 32*7d11965dSArd Biesheuvelendif 33*7d11965dSArd Biesheuvelendif 34*7d11965dSArd Biesheuvel 35cc4589ebSDavid Woodhousetargets += int1.c 36cc4589ebSDavid Woodhouse$(obj)/int1.c: UNROLL := 1 37cc4589ebSDavid Woodhouse$(obj)/int1.c: $(src)/int.uc $(src)/unroll.awk FORCE 38f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 39f5e70d0fSDavid Woodhouse 40cc4589ebSDavid Woodhousetargets += int2.c 41cc4589ebSDavid Woodhouse$(obj)/int2.c: UNROLL := 2 42cc4589ebSDavid Woodhouse$(obj)/int2.c: $(src)/int.uc $(src)/unroll.awk FORCE 43f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 44f5e70d0fSDavid Woodhouse 45cc4589ebSDavid Woodhousetargets += int4.c 46cc4589ebSDavid Woodhouse$(obj)/int4.c: UNROLL := 4 47cc4589ebSDavid Woodhouse$(obj)/int4.c: $(src)/int.uc $(src)/unroll.awk FORCE 48f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 49f5e70d0fSDavid Woodhouse 50cc4589ebSDavid Woodhousetargets += int8.c 51cc4589ebSDavid Woodhouse$(obj)/int8.c: UNROLL := 8 52cc4589ebSDavid Woodhouse$(obj)/int8.c: $(src)/int.uc $(src)/unroll.awk FORCE 53f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 54f5e70d0fSDavid Woodhouse 55cc4589ebSDavid Woodhousetargets += int16.c 56cc4589ebSDavid Woodhouse$(obj)/int16.c: UNROLL := 16 57cc4589ebSDavid Woodhouse$(obj)/int16.c: $(src)/int.uc $(src)/unroll.awk FORCE 58f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 59f5e70d0fSDavid Woodhouse 60cc4589ebSDavid Woodhousetargets += int32.c 61cc4589ebSDavid Woodhouse$(obj)/int32.c: UNROLL := 32 62cc4589ebSDavid Woodhouse$(obj)/int32.c: $(src)/int.uc $(src)/unroll.awk FORCE 63f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 64f5e70d0fSDavid Woodhouse 65cc4589ebSDavid WoodhouseCFLAGS_altivec1.o += $(altivec_flags) 66cc4589ebSDavid Woodhousetargets += altivec1.c 67cc4589ebSDavid Woodhouse$(obj)/altivec1.c: UNROLL := 1 68cc4589ebSDavid Woodhouse$(obj)/altivec1.c: $(src)/altivec.uc $(src)/unroll.awk FORCE 69f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 70f5e70d0fSDavid Woodhouse 71cc4589ebSDavid WoodhouseCFLAGS_altivec2.o += $(altivec_flags) 72cc4589ebSDavid Woodhousetargets += altivec2.c 73cc4589ebSDavid Woodhouse$(obj)/altivec2.c: UNROLL := 2 74cc4589ebSDavid Woodhouse$(obj)/altivec2.c: $(src)/altivec.uc $(src)/unroll.awk FORCE 75f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 76f5e70d0fSDavid Woodhouse 77cc4589ebSDavid WoodhouseCFLAGS_altivec4.o += $(altivec_flags) 78cc4589ebSDavid Woodhousetargets += altivec4.c 79cc4589ebSDavid Woodhouse$(obj)/altivec4.c: UNROLL := 4 80cc4589ebSDavid Woodhouse$(obj)/altivec4.c: $(src)/altivec.uc $(src)/unroll.awk FORCE 81f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 82f5e70d0fSDavid Woodhouse 83cc4589ebSDavid WoodhouseCFLAGS_altivec8.o += $(altivec_flags) 84cc4589ebSDavid Woodhousetargets += altivec8.c 85cc4589ebSDavid Woodhouse$(obj)/altivec8.c: UNROLL := 8 86cc4589ebSDavid Woodhouse$(obj)/altivec8.c: $(src)/altivec.uc $(src)/unroll.awk FORCE 87f5e70d0fSDavid Woodhouse $(call if_changed,unroll) 88f5e70d0fSDavid Woodhouse 89*7d11965dSArd BiesheuvelCFLAGS_neon1.o += $(NEON_FLAGS) 90*7d11965dSArd Biesheuveltargets += neon1.c 91*7d11965dSArd Biesheuvel$(obj)/neon1.c: UNROLL := 1 92*7d11965dSArd Biesheuvel$(obj)/neon1.c: $(src)/neon.uc $(src)/unroll.awk FORCE 93*7d11965dSArd Biesheuvel $(call if_changed,unroll) 94*7d11965dSArd Biesheuvel 95*7d11965dSArd BiesheuvelCFLAGS_neon2.o += $(NEON_FLAGS) 96*7d11965dSArd Biesheuveltargets += neon2.c 97*7d11965dSArd Biesheuvel$(obj)/neon2.c: UNROLL := 2 98*7d11965dSArd Biesheuvel$(obj)/neon2.c: $(src)/neon.uc $(src)/unroll.awk FORCE 99*7d11965dSArd Biesheuvel $(call if_changed,unroll) 100*7d11965dSArd Biesheuvel 101*7d11965dSArd BiesheuvelCFLAGS_neon4.o += $(NEON_FLAGS) 102*7d11965dSArd Biesheuveltargets += neon4.c 103*7d11965dSArd Biesheuvel$(obj)/neon4.c: UNROLL := 4 104*7d11965dSArd Biesheuvel$(obj)/neon4.c: $(src)/neon.uc $(src)/unroll.awk FORCE 105*7d11965dSArd Biesheuvel $(call if_changed,unroll) 106*7d11965dSArd Biesheuvel 107*7d11965dSArd BiesheuvelCFLAGS_neon8.o += $(NEON_FLAGS) 108*7d11965dSArd Biesheuveltargets += neon8.c 109*7d11965dSArd Biesheuvel$(obj)/neon8.c: UNROLL := 8 110*7d11965dSArd Biesheuvel$(obj)/neon8.c: $(src)/neon.uc $(src)/unroll.awk FORCE 111*7d11965dSArd Biesheuvel $(call if_changed,unroll) 112*7d11965dSArd Biesheuvel 113f5e70d0fSDavid Woodhousequiet_cmd_mktable = TABLE $@ 114f5e70d0fSDavid Woodhouse cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 ) 115f5e70d0fSDavid Woodhouse 116cc4589ebSDavid Woodhousetargets += tables.c 117cc4589ebSDavid Woodhouse$(obj)/tables.c: $(obj)/mktables FORCE 118f5e70d0fSDavid Woodhouse $(call if_changed,mktable) 119