summaryrefslogtreecommitdiffstats
path: root/lib/ffts/src/arch/arm/dpiops.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ffts/src/arch/arm/dpiops.sh')
-rwxr-xr-xlib/ffts/src/arch/arm/dpiops.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/ffts/src/arch/arm/dpiops.sh b/lib/ffts/src/arch/arm/dpiops.sh
new file mode 100755
index 0000000..d3b93ff
--- /dev/null
+++ b/lib/ffts/src/arch/arm/dpiops.sh
@@ -0,0 +1,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"