summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/opdefs/Makefile.am
blob: 6207906a946facee74980768c18ed6a9d4735e44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126

include ../../../../../tools/d2c/d2c.mk


D2C_BIN = ../../../../../tools/d2c/d2c
GEN_BIN = ../../../../../tools/d2c/d2c_genmakefile.sh

D2C_OUTDIR = $(PWD)/..

D2C_ARCH = armv7
D2C_HEADER = _ARCH_ARM_V7

D2C_ENCODINGS =							\
	-e A=arm_							\
	-e t=thumb_16_						\
	-e T=thumb_32_

D2C_MACROS =											\
    -M DefineAsReturn=g_arch_instruction_define_as_return		\
    -M SetFlags=g_armv7_instruction_define_setflags		\
    -M Condition=g_arm_instruction_set_cond				\
    -M Register=translate_armv7_register				\
    -M "ExpandImmC32=g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, " \
    -M SignExtend=sign_extend_armv7_imm					\
    -M SetInsFlag=g_arch_instruction_set_flag

ARMV7_DEFS = 							\
	adc_A881.d							\
	adc_A882.d							\
	add_A884.d							\
	add_A885.d							\
	add_A886.d							\
	add_A887.d							\
	add_A889.d							\
	adr_A8812.d							\
	and_A8813.d							\
	and_A8814.d							\
	asr_A8816.d							\
	b_A8818.d							\
	bic_A8821.d							\
	bic_A8822.d							\
	bl_A8825.d							\
	blx_A8826.d							\
	bx_A8827.d							\
	cbnz_A8829.d						\
	cmn_A8834.d							\
	cmn_A8835.d							\
	cmp_A8837.d							\
	cmp_A8838.d							\
	eor_A8846.d							\
	eor_A8847.d							\
	ldr_A8862.d							\
	ldr_A8863.d							\
	ldr_A8864.d							\
	ldr_A8865.d							\
	ldrb_A8867.d						\
	ldrb_A8868.d						\
	ldrb_A8870.d						\
	lsl_A8894.d							\
	lsr_A8896.d							\
	mla_A88100.d						\
	mls_A88101.d						\
	mov_A88102.d						\
	mov_A88103.d						\
	mov_A88104.d						\
	movt_A88106.d						\
	mul_A88114.d						\
	mvn_A88115.d						\
	mvn_A88116.d						\
	nop_A88119.d						\
	orr_A88122.d						\
	orr_A88123.d						\
	pop_A88131.d						\
	pop_A88132.d						\
	push_A88133.d						\
	rsb_A88152.d						\
	rsb_A88153.d						\
	rsc_A88155.d						\
	rsc_A88156.d						\
	sbc_A88161.d						\
	sbc_A88162.d						\
	smlal_A88178.d						\
	smull_A88189.d						\
	str_A88203.d						\
	str_A88204.d						\
	strb_A88206.d						\
	strb_A88207.d						\
	strb_A88208.d						\
	sub_A88221.d						\
	sub_A88222.d						\
	sub_A88223.d						\
	sub_A88225.d						\
	teq_A88237.d						\
	teq_A88238.d						\
	tst_A88240.d						\
	tst_A88241.d						\
	umaal_A88255.d						\
	umlal_A88256.d						\
	umull_A88257.d						\
	uxtb_A88274.d						\
	yield_A88426.d						\
	subs_B9320.d


all: $(ARMV7_DEFS:.d=.g) fmk.done fix_includes_in_c_templates fix_includes_in_h_templates untabify_disass

fmk.done: $(ARMV7_DEFS)
	$(GEN_BIN) ../opcodes/ ../opdefs/.gen ../../../../../tools/d2c/globalgen.mk arm thumb_32 thumb_16
	touch $@

fix_includes_in_c_templates:
	@for f in `find .gen/ -name '*tmpl.c'`; do			\
		if grep -q '##INCLUDES##' $$f; then				\
			$(fix_verbose)sed -i 's/##INCLUDES##/\n#include "..\/helpers.h"\n#include "..\/instruction.h"\n#include "..\/fetch.h"\n#include "..\/post.h"\n#include "..\/..\/instruction.h"\n#include "..\/..\/link.h"\n#include "..\/..\/..\/link.h"\n#include "..\/..\/..\/..\/common\/bconst.h"\n\n/' $$f;	\
		fi;												\
	done

fix_includes_in_h_templates:
	@for f in `find .gen/ -name '*tmpl.h'`; do			\
		if grep -q '##INCLUDES##' $$f; then				\
			$(fix_verbose)sed -i 's/##INCLUDES##/#include\ <stdint.h>\n\n#include "..\/..\/..\/instruction.h"/' $$f ;	\
		fi;												\
	done

clean:
	rm -rf $(ARMV7_DEFS:.d=.g) .gen fmk.done