David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 1 | obj-$(CONFIG_RAID6_PQ) += raid6_pq.o |
| 2 | |
Yuanhan Liu | 4f8c55c | 2012-11-30 13:10:40 -0800 | [diff] [blame] | 3 | raid6_pq-y += algos.o recov.o tables.o int1.o int2.o int4.o \ |
| 4 | int8.o int16.o int32.o |
| 5 | |
| 6 | raid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o |
| 7 | raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o |
| 8 | |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 9 | hostprogs-y += mktables |
| 10 | |
| 11 | quiet_cmd_unroll = UNROLL $@ |
David Woodhouse | 2144381d | 2010-08-09 10:36:44 +0100 | [diff] [blame] | 12 | cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) \ |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 13 | < $< > $@ || ( rm -f $@ && exit 1 ) |
| 14 | |
| 15 | ifeq ($(CONFIG_ALTIVEC),y) |
| 16 | altivec_flags := -maltivec -mabi=altivec |
| 17 | endif |
| 18 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 19 | targets += int1.c |
| 20 | $(obj)/int1.c: UNROLL := 1 |
| 21 | $(obj)/int1.c: $(src)/int.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 22 | $(call if_changed,unroll) |
| 23 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 24 | targets += int2.c |
| 25 | $(obj)/int2.c: UNROLL := 2 |
| 26 | $(obj)/int2.c: $(src)/int.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 27 | $(call if_changed,unroll) |
| 28 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 29 | targets += int4.c |
| 30 | $(obj)/int4.c: UNROLL := 4 |
| 31 | $(obj)/int4.c: $(src)/int.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 32 | $(call if_changed,unroll) |
| 33 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 34 | targets += int8.c |
| 35 | $(obj)/int8.c: UNROLL := 8 |
| 36 | $(obj)/int8.c: $(src)/int.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 37 | $(call if_changed,unroll) |
| 38 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 39 | targets += int16.c |
| 40 | $(obj)/int16.c: UNROLL := 16 |
| 41 | $(obj)/int16.c: $(src)/int.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 42 | $(call if_changed,unroll) |
| 43 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 44 | targets += int32.c |
| 45 | $(obj)/int32.c: UNROLL := 32 |
| 46 | $(obj)/int32.c: $(src)/int.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 47 | $(call if_changed,unroll) |
| 48 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 49 | CFLAGS_altivec1.o += $(altivec_flags) |
| 50 | targets += altivec1.c |
| 51 | $(obj)/altivec1.c: UNROLL := 1 |
| 52 | $(obj)/altivec1.c: $(src)/altivec.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 53 | $(call if_changed,unroll) |
| 54 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 55 | CFLAGS_altivec2.o += $(altivec_flags) |
| 56 | targets += altivec2.c |
| 57 | $(obj)/altivec2.c: UNROLL := 2 |
| 58 | $(obj)/altivec2.c: $(src)/altivec.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 59 | $(call if_changed,unroll) |
| 60 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 61 | CFLAGS_altivec4.o += $(altivec_flags) |
| 62 | targets += altivec4.c |
| 63 | $(obj)/altivec4.c: UNROLL := 4 |
| 64 | $(obj)/altivec4.c: $(src)/altivec.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 65 | $(call if_changed,unroll) |
| 66 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 67 | CFLAGS_altivec8.o += $(altivec_flags) |
| 68 | targets += altivec8.c |
| 69 | $(obj)/altivec8.c: UNROLL := 8 |
| 70 | $(obj)/altivec8.c: $(src)/altivec.uc $(src)/unroll.awk FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 71 | $(call if_changed,unroll) |
| 72 | |
| 73 | quiet_cmd_mktable = TABLE $@ |
| 74 | cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 ) |
| 75 | |
David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [diff] [blame] | 76 | targets += tables.c |
| 77 | $(obj)/tables.c: $(obj)/mktables FORCE |
David Woodhouse | f5e70d0 | 2009-07-13 11:35:12 +0100 | [diff] [blame] | 78 | $(call if_changed,mktable) |