blob: d3b93ff52ae84355b6c3d42e287de19e9ed4dcfe (
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
|
#!/bin/sh
OPCODES="AND EOR SUB RSB ADD ADC SBC RSC ORR BIC"
CMP_OPCODES="TST TEQ CMP CMN"
MOV_OPCODES="MOV MVN"
# $1: opcode list
# $2: template
gen() {
for i in $1; do
sed "s/<Op>/$i/g" $2.th
done
}
echo -e "/* Macros for DPI ops, auto-generated from template */\n"
echo -e "\n/* mov/mvn */\n"
gen "$MOV_OPCODES" mov_macros
echo -e "\n/* DPIs, arithmetic and logical */\n"
gen "$OPCODES" dpi_macros
echo -e "\n\n"
echo -e "\n/* DPIs, comparison */\n"
gen "$CMP_OPCODES" cmp_macros
echo -e "\n/* end generated */\n"
|