Re: [Tinycc-devel] [PATCH 0/9] Improve ARM inline assembler

2020-12-27 Thread Danny Milosavljevic
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

[Tinycc-devel] [PATCH 1/9] arm-asm: Add lsl, lsr, asr, ror, rrx

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 162 ++ arm-tok.h | 11 2 files changed, 173 insertions(+) diff --git a/arm-asm.c b/arm-asm.c index ce3ac80..6dc24c0 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -248,6 +248,14 @@ static void asm_binary_opcode(TCCState *s1, in

[Tinycc-devel] [PATCH 3/9] arm-asm: Support rotation for sxtb, sxth, uxtb, uxth

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 51 +-- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/arm-asm.c b/arm-asm.c index ef75091..f672301 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -201,6 +201,9 @@ static void asm_unary_opcode(TCCState *s1, int token) sta

[Tinycc-devel] [PATCH 6/9] arm-asm: Raise an error if asm_binary_opcode is used with PC as operand

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arm-asm.c b/arm-asm.c index 847a4f3..d6adc20 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -217,11 +217,21 @@ static void asm_binary_opcode(TCCState *s1, int token) return; } +if (ops[0].reg == 15) { +

[Tinycc-devel] [PATCH 8/9] arm-asm: Raise error if more than two operands are specified on mov, mvn, cmp, cmn, tst, teq

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/arm-asm.c b/arm-asm.c index 028f30c..b565127 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -466,8 +466,9 @@ static void asm_data_processing_opcode(TCCState *s1, int token) int nb_shift = 0; u

[Tinycc-devel] [PATCH 5/9] arm-asm: Add error case in asm_multiplication_opcode

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm-asm.c b/arm-asm.c index fd6275a..847a4f3 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -732,8 +732,8 @@ static void asm_multiplication_opcode(TCCState *s1, int token) memcpy(&ops[2], &ops[0], sizeof

[Tinycc-devel] [PATCH 0/9] Improve ARM inline assembler

2020-12-27 Thread Danny Milosavljevic
This patchset improves the ARM inline assembler I posted earlier. (Please apply it on top of the patchset I posted earlier--it does not replace it) First, I add support for the barrel shifter--supporting specifying both modifiers for the old ARM instructions and also the new ARM shift instruction

[Tinycc-devel] [PATCH 4/9] arm-asm: Warn if regset registers are not specified in ascending order

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arm-asm.c b/arm-asm.c index f672301..fd6275a 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -77,6 +77,8 @@ static void parse_operand(TCCState *s1, Operand *op) } else next(); // skip register name +

[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

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/arm-asm.c b/arm-asm.c index b565127..6eb680a 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -529,6 +529,13 @@ static void asm_data_processing_opcode(TCCState *s1, int token) return; } e

[Tinycc-devel] [PATCH 7/9] arm-asm: Print a warning if asm_binary_opcode is used with SP as operand

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arm-asm.c b/arm-asm.c index d6adc20..028f30c 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -222,6 +222,9 @@ static void asm_binary_opcode(TCCState *s1, int token) return; } +if (ops[0].reg == 13) +tcc_w

[Tinycc-devel] [PATCH 2/9] arm-asm: For data processing instructions, support shifts and rotations.

2020-12-27 Thread Danny Milosavljevic
--- arm-asm.c | 56 +++ arm-tok.h | 4 2 files changed, 52 insertions(+), 8 deletions(-) diff --git a/arm-asm.c b/arm-asm.c index 6dc24c0..ef75091 100644 --- a/arm-asm.c +++ b/arm-asm.c @@ -413,18 +413,55 @@ static void asm_data_processing

Re: [Tinycc-devel] [PATCH 00/16] Add ARM inline assembler

2020-12-27 Thread Michael Matz
Hello Danny, On Sat, 26 Dec 2020, Danny Milosavljevic wrote: This patchset adds an ARM inline assembler. Wonderful! I like the content and the form of presentation :) Cool stuff. Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.o

Re: [Tinycc-devel] [PATCH 00/16] Add ARM inline assembler

2020-12-27 Thread Jan Nieuwenhuizen
Danny Milosavljevic writes: Hello! > This patchset adds an ARM inline assembler. That's awesome! This is going to make the ARM bootstrap of tinycc so much nicer. In other news, I finally got setjmp/longjmp to work with tcc. Because has a different function pre- and post-amble than gcc it need

Re: [Tinycc-devel] tinycc manpage

2020-12-27 Thread Anton Shepelev
Sudipto Mallick: > I am new here, I do not know whose approval I need > to push the changes. Whom to ask for approval? Not being a contributor to TCC, I can't tell you. Since nobody has answered, chances are no one among the readers of this mailing list is interested in tranditional hand-

Re: [Tinycc-devel] Tcc code surprised me by being very slow and then some tcc code surprised me by being fast

2020-12-27 Thread Joshua Scholar
I forgot the link. https://developers.redhat.com/blog/2020/01/20/mir-a-lightweight-jit-compiler-project/ Joshua Scholar On Sun, Dec 27, 2020 at 3:32 AM Samir Ribić wrote: > Well, tcc is one of the fastest C compilers when we speak about > *compilation speed*. However, this is achieved by gener

Re: [Tinycc-devel] Tcc code surprised me by being very slow and then some tcc code surprised me by being fast

2020-12-27 Thread Joshua Scholar
I was just looking at a few projects that want to generate code quickly but in reasonable quality. This post here about a jit compiler project (as yet unfinished), says that for GCC there are about 300 passes, but that most of those don't buy you much. But he wrote "Recently, I did an experiment

Re: [Tinycc-devel] Tcc code surprised me by being very slow and then some tcc code surprised me by being fast

2020-12-27 Thread Samir Ribić
Well, tcc is one of the fastest C compilers when we speak about *compilation speed*. However, this is achieved by generating code almost simultaneously with syntax analysis, without intermediate steps that use some other compilers. Compilers like gcc do the following: - Perform syntax analysis and

Re: [Tinycc-devel] JIT compiler efficiency

2020-12-27 Thread Joshua Scholar
I've only been playing with libtcc for a week, so I don't have all the answers, but I am interested in a similar use. You might be interested in the questions I've asked and the answers I got. My impressions so far: 1) tcc is a c compiler, and doesn't have any features added to make it suitable f

[Tinycc-devel] JIT compiler efficiency

2020-12-27 Thread fm663-subs--- via Tinycc-devel
Hi TinyTCC developers Firstly I want to thank you guys for maintaining this amazing compiler that I have just discovered. My question is: When using libtcc as a JIT compiler, I would like to know if TCC already has some clever mechanism to reuse the results of - include libtcc.dll *.def and *.a.