[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] arm-asm: Test script
From: |
Danny Milosavljevic |
Subject: |
[Tinycc-devel] arm-asm: Test script |
Date: |
Sun, 3 Jan 2021 16:13:57 +0100 |
Updated test script for all of this (should I also commit this? Where?):
#!/bin/sh
set -e
cd ~/src/tinycc-upstream/tinycc
cat arm-tok.h |grep DEF_ASM_CONDED |grep -v '#define' |grep -v '/[*]' |sed -e
's;DEF_ASM_CONDED.\(.*\).$;\1;'| grep -v 'not useful' >L
total_count=0
# Note: "{r3}" is definitely different--but would complicate the assembler.
for s in $(cat L)
do
ok=0
for args in "r3, r4, r5, r6" \
"r3, r4, r5" \
"r3, r4, r5, asl #7" \
"r3, r4, r5, lsl #7" \
"r3, r4, r5, asr #7" \
"r3, r4, r5, lsr #7" \
"r3, r4, r5, ror #7" \
"r3, r4, r5, rrx" \
"r3, r4, r5, asl r6" \
"r3, r4, r5, lsl r6" \
"r3, r4, r5, asr r6" \
"r3, r4, r5, lsr r6" \
"r3, r4, r5, ror r6" \
"r3, r4, #5, asl #7" \
"r3, r4, #5, lsl #7" \
"r3, r4, #5, asr #7" \
"r3, r4, #5, lsr #7" \
"r3, r4, #5, ror #7" \
"r3, r4, #5, rrx" \
"r3, #5, r4" \
"r3, #4, #8" \
"r3, r4, asl #5" \
"r3, r4, lsl #5" \
"r3, r4, asr #5" \
"r3, r4, lsr #5" \
"r3, r4, ror #5" \
"r3, r4, ror #8" \
"r3, r4, asl r5" \
"r3, r4, lsl r5" \
"r3, r4, asr r5" \
"r3, r4, lsr r5" \
"r3, r4, ror r5" \
"r3, r4, ror #8" \
"r3, r4, ror #16" \
"r3, r4, ror #24" \
"r3, r4, rrx" \
"r3, #4, asl #5" \
"r3, #4, lsl #5" \
"r3, #4, asr #5" \
"r3, #4, lsr #5" \
"r3, #4, ror #5" \
"r3, r4, rrx" \
"r3, r4" \
"r3" \
"{r3,r4,r5}" \
"{r3,r5,r4}" \
"r2!, {r3,r4,r5}" \
"r2!, {r3,r5,r4}" \
"r2, [r3, r4]" \
"r2, [r3, r4]!" \
"r2, [r3, -r4]" \
"r2, [r3, -r4]!" \
"r2, [r3], r4" \
"r2, [r3, #4]" \
"r2, [r3, #-4]" \
"r2, r3, #4" \
"r2, r3, #-4" \
"r2, #4" \
"r2, #-4" \
"r2, #0xEFFF" \
"r3, #0x0000" \
"r4, #0x0201" \
"r4, #0xFFFFFF00" \
"r2, #-4" \
"#4" \
"#-4" \
""
do
#echo ".syntax unified" > a.s
echo "$s $args" > a.s
#cat a.s
if "${CROSS_COMPILE}as" -mlittle-endian -o a.o a.s 2>err
then
cat err
total_count=`expr $total_count + 1`
objdump -S a.o |grep "^[ ]*0:" >a.expected
echo '__asm__("'"$s ${args}"'");' > a.c
if ./tcc -o a.o -c a.c
then
objdump -S a.o |grep "^[ ]*0:" >a.got
diff -u a.got a.expected || {
echo "warning: $s $args did not work in
tcc (see above)">&2
}
else
echo "warning: $s $args did not work in tcc">&2
fi
ok=1
fi
done
if [ "${ok}" -eq "0" ]
then
echo "warning: $s could not be used.">&2
continue
fi
done
echo "total count: ${total_count}">&2
pgpNKk5OEwvFr.pgp
Description: OpenPGP digital signature