16
16
-fcall-saved-21 -fcall-saved-22 -ffixed-23 -fcall-saved-24 \
17
17
-ffixed-25 -ffixed-27
20
arch/$(ARCH)/__divqu.o \
21
arch/$(ARCH)/__remqu.o \
22
arch/$(ARCH)/__divq.o \
23
arch/$(ARCH)/__remq.o \
24
arch/$(ARCH)/__divlu.o \
25
arch/$(ARCH)/__remlu.o \
26
arch/$(ARCH)/__divl.o \
27
arch/$(ARCH)/__reml.o \
29
arch/$(ARCH)/setjmp.o \
30
arch/$(ARCH)/syscall.o \
31
arch/$(ARCH)/sysdual.o
33
ARCHSOOBJS = $(patsubst %.o,%.lo,$(ARCHOBJS))
35
arch/$(ARCH)/%.s: arch/$(ARCH)/%.ss
36
sed -e 's/\$$0\b/$$27/g' -e 's/\$$24\b/$$99/g' \
37
-e 's/\$$16\b/$$24/g' -e 's/\$$17\b/$$25/g' \
38
-e 's/\$$26\b/$$23/g' -e 's/\$$99\b/$$16/g' < $< > $@
40
arch/$(ARCH)/%.ls: arch/$(ARCH)/%.lss
41
sed -e 's/\$$0\b/$$27/g' -e 's/\$$24\b/$$99/g' \
42
-e 's/\$$16\b/$$24/g' -e 's/\$$17\b/$$25/g' \
43
-e 's/\$$26\b/$$23/g' -e 's/\$$99\b/$$16/g' < $< > $@
45
arch/$(ARCH)/__divqu.ss: arch/$(ARCH)/divide.c
46
$(CC) $(DIVCFLAGS) -DSIGNED=0 -DREM=0 -DBITS=64 -DNAME=__divqu -S -o $@ $<
48
arch/$(ARCH)/__remqu.ss: arch/$(ARCH)/divide.c
49
$(CC) $(DIVCFLAGS) -DSIGNED=0 -DREM=1 -DBITS=64 -DNAME=__remqu -S -o $@ $<
51
arch/$(ARCH)/__divq.ss: arch/$(ARCH)/divide.c
52
$(CC) $(DIVCFLAGS) -DSIGNED=1 -DREM=0 -DBITS=64 -DNAME=__divq -S -o $@ $<
54
arch/$(ARCH)/__remq.ss: arch/$(ARCH)/divide.c
55
$(CC) $(DIVCFLAGS) -DSIGNED=1 -DREM=1 -DBITS=64 -DNAME=__remq -S -o $@ $<
57
arch/$(ARCH)/__divlu.ss: arch/$(ARCH)/divide.c
58
$(CC) $(DIVCFLAGS) -DSIGNED=0 -DREM=0 -DBITS=32 -DNAME=__divlu -S -o $@ $<
60
arch/$(ARCH)/__remlu.ss: arch/$(ARCH)/divide.c
61
$(CC) $(DIVCFLAGS) -DSIGNED=0 -DREM=1 -DBITS=32 -DNAME=__remlu -S -o $@ $<
63
arch/$(ARCH)/__divl.ss: arch/$(ARCH)/divide.c
64
$(CC) $(DIVCFLAGS) -DSIGNED=1 -DREM=0 -DBITS=32 -DNAME=__divl -S -o $@ $<
66
arch/$(ARCH)/__reml.ss: arch/$(ARCH)/divide.c
67
$(CC) $(DIVCFLAGS) -DSIGNED=1 -DREM=1 -DBITS=32 -DNAME=__reml -S -o $@ $<
69
arch/$(ARCH)/__divqu.lss: arch/$(ARCH)/divide.c
70
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=0 -DREM=0 -DBITS=64 -DNAME=__divqu -S -o $@ $<
72
arch/$(ARCH)/__remqu.lss: arch/$(ARCH)/divide.c
73
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=0 -DREM=1 -DBITS=64 -DNAME=__remqu -S -o $@ $<
75
arch/$(ARCH)/__divq.lss: arch/$(ARCH)/divide.c
76
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=1 -DREM=0 -DBITS=64 -DNAME=__divq -S -o $@ $<
78
arch/$(ARCH)/__remq.lss: arch/$(ARCH)/divide.c
79
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=1 -DREM=1 -DBITS=64 -DNAME=__remq -S -o $@ $<
81
arch/$(ARCH)/__divlu.lss: arch/$(ARCH)/divide.c
82
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=0 -DREM=0 -DBITS=32 -DNAME=__divlu -S -o $@ $<
84
arch/$(ARCH)/__remlu.lss: arch/$(ARCH)/divide.c
85
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=0 -DREM=1 -DBITS=32 -DNAME=__remlu -S -o $@ $<
87
arch/$(ARCH)/__divl.lss: arch/$(ARCH)/divide.c
88
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=1 -DREM=0 -DBITS=32 -DNAME=__divl -S -o $@ $<
90
arch/$(ARCH)/__reml.lss: arch/$(ARCH)/divide.c
91
$(CC) $(DIVCFLAGS) -fPIC -DSIGNED=1 -DREM=1 -DBITS=32 -DNAME=__reml -S -o $@ $<
94
rm -f arch/$(ARCH)/*.ss arch/$(ARCH)/*.lss
19
ARCHOBJS := arch/$(ARCH)/pipe.o arch/$(ARCH)/setjmp.o
20
ARCHOBJS += arch/$(ARCH)/syscall.o arch/$(ARCH)/sysdual.o
22
DIVOBJS += arch/$(ARCH)/__divqu.o \
23
arch/$(ARCH)/__remqu.o \
24
arch/$(ARCH)/__divq.o \
25
arch/$(ARCH)/__remq.o \
26
arch/$(ARCH)/__divlu.o \
27
arch/$(ARCH)/__remlu.o \
28
arch/$(ARCH)/__divl.o \
31
ARCHOBJS += $(DIVOBJS)
33
quiet_cmd_regswap = REGSWAP $@
34
cmd_regswap = sed -e 's/\$$0\b/$$27/g' -e 's/\$$24\b/$$99/g' \
35
-e 's/\$$16\b/$$24/g' -e 's/\$$17\b/$$25/g' \
36
-e 's/\$$26\b/$$23/g' -e 's/\$$99\b/$$16/g' < $< > $@
38
# Use static pattern rule to avoid using a temporary file
39
$(addprefix $(obj)/,$(DIVOBJS:.o=.S)): $(obj)/arch/$(ARCH)/%.S: \
40
$(obj)/arch/$(ARCH)/%.ss
41
$(call if_changed,regswap)
43
quiet_cmd_genss = DIV-CC $@
44
cmd_genss = $(CC) $(DIVCFLAGS) $(FILE_CFLAGS) \
45
-DNAME=$(basename $(notdir $@)) -S -o $@ $<
47
$(obj)/arch/$(ARCH)/%.ss: $(obj)/arch/$(ARCH)/divide.c
48
$(call if_changed,genss)
50
$(obj)/arch/$(ARCH)/__divqu.ss: FILE_CFLAGS := -DSIGNED=0 -DREM=0 -DBITS=64
51
$(obj)/arch/$(ARCH)/__remqu.ss: FILE_CFLAGS := -DSIGNED=0 -DREM=1 -DBITS=64
52
$(obj)/arch/$(ARCH)/__divq.ss: FILE_CFLAGS := -DSIGNED=1 -DREM=0 -DBITS=64
53
$(obj)/arch/$(ARCH)/__remq.ss: FILE_CFLAGS := -DSIGNED=1 -DREM=1 -DBITS=64
54
$(obj)/arch/$(ARCH)/__divlu.ss: FILE_CFLAGS := -DSIGNED=0 -DREM=0 -DBITS=32
55
$(obj)/arch/$(ARCH)/__remlu.ss: FILE_CFLAGS := -DSIGNED=0 -DREM=1 -DBITS=32
56
$(obj)/arch/$(ARCH)/__divl.ss: FILE_CFLAGS := -DSIGNED=1 -DREM=0 -DBITS=32
57
$(obj)/arch/$(ARCH)/__reml.ss: FILE_CFLAGS := -DSIGNED=1 -DREM=1 -DBITS=32
59
targets += $(DIVOBJS:.o=.S) $(DIVOBJS:.o=.ss)
60
clean-files += $(DIVOBJS:.o=.S) $(DIVOBJS:.o=.ss)