[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] [PATCH 0/9] Improve ARM inline assembler
From: |
Danny Milosavljevic |
Subject: |
Re: [Tinycc-devel] [PATCH 0/9] Improve ARM inline assembler |
Date: |
Mon, 28 Dec 2020 03:03:24 +0100 |
Improved unit tester:
#!/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 done differently on tcc than on as--but would
complicate the tcc assembler to do it the same way.
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" \
"#4" \
"#-4" \
""
do
echo "$s $args" > a.s
#cat a.s
if as -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
pgpoyex0hTOQN.pgp
Description: OpenPGP digital signature
- [Tinycc-devel] [PATCH 0/9] Improve ARM inline assembler, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 4/9] arm-asm: Warn if regset registers are not specified in ascending order, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 2/9] arm-asm: For data processing instructions, support shifts and rotations., Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 3/9] arm-asm: Support rotation for sxtb, sxth, uxtb, uxth, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 7/9] arm-asm: Print a warning if asm_binary_opcode is used with SP as operand, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 1/9] arm-asm: Add lsl, lsr, asr, ror, rrx, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 5/9] arm-asm: Add error case in asm_multiplication_opcode, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 9/9] arm-asm: Raise error if asm_data_processing_opcode and asm_shift_opcode try to use PC for register-controlled shifts, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 6/9] arm-asm: Raise an error if asm_binary_opcode is used with PC as operand, Danny Milosavljevic, 2020/12/27
- [Tinycc-devel] [PATCH 8/9] arm-asm: Raise error if more than two operands are specified on mov, mvn, cmp, cmn, tst, teq, Danny Milosavljevic, 2020/12/27
- Re: [Tinycc-devel] [PATCH 0/9] Improve ARM inline assembler,
Danny Milosavljevic <=
- Prev by Date:
[Tinycc-devel] [PATCH 8/9] arm-asm: Raise error if more than two operands are specified on mov, mvn, cmp, cmn, tst, teq
- Next by Date:
[Tinycc-devel] Tiny fix to build-tcc.bat
- Previous by thread:
[Tinycc-devel] [PATCH 8/9] arm-asm: Raise error if more than two operands are specified on mov, mvn, cmp, cmn, tst, teq
- Next by thread:
[Tinycc-devel] Tiny fix to build-tcc.bat
- Index(es):