scf.git
6 weeks agosupport auto gc for multi-return-values
yu.dongliang [Sat, 12 Oct 2024 16:39:35 +0000 (00:39 +0800)]
support auto gc for multi-return-values

6 weeks agomake auto gc module more clearly, move some repeated into a function
yu.dongliang [Thu, 10 Oct 2024 14:25:59 +0000 (22:25 +0800)]
make auto gc module more clearly, move some repeated into a function

6 weeks agodelete some unused or repeat code
yu.dongliang [Wed, 9 Oct 2024 10:38:30 +0000 (18:38 +0800)]
delete some unused or repeat code

6 weeks agooptimize common sub-expr after call() analysis
yu.dongliang [Tue, 8 Oct 2024 13:26:36 +0000 (21:26 +0800)]
optimize common sub-expr after call() analysis

6 weeks agooptimize operator handlers
yu.dongliang [Mon, 7 Oct 2024 05:08:08 +0000 (13:08 +0800)]
optimize operator handlers

6 weeks agofix: pointer ++ / -- / += / -= error
yu.dongliang [Sun, 6 Oct 2024 15:48:15 +0000 (23:48 +0800)]
fix: pointer ++ / -- / += / -= error

6 weeks agofix: core dump with ../examples/mat_mul_strassen.c
yu.dongliang [Sun, 6 Oct 2024 10:37:52 +0000 (18:37 +0800)]
fix: core dump with ../examples/mat_mul_strassen.c

7 weeks agofix: x64 SIB encode error for register r12, r13.
yu.dongliang [Sat, 5 Oct 2024 11:28:59 +0000 (19:28 +0800)]
fix: x64 SIB encode error for register r12, r13.
fix: DAG of call() error when function has no arg.
fix: change pointer add / sub to address of array.
fix: optimize 'const teq'

7 weeks agofix: macro pre-process error when arg has multi-words,
yu.dongliang [Fri, 4 Oct 2024 15:31:52 +0000 (23:31 +0800)]
fix: macro pre-process error when arg has multi-words,
fix: DAG error for auto type cast 'int n = 2; sizeof(int) * n * n',
fix: optimize const teq error for assert(0), macro extends as below:
do {
if (!0)
printf(...);
} while (0)

7 weeks agofor member array[0] in the end of a struct
yu.dongliang [Thu, 3 Oct 2024 06:07:56 +0000 (14:07 +0800)]
for member array[0] in the end of a struct

7 weeks agooptimize switch-case for "const literal string"
yu.dongliang [Wed, 2 Oct 2024 09:07:57 +0000 (17:07 +0800)]
optimize switch-case for "const literal string"

7 weeks agosupport "const literal string" in 'case' for 'switch'
yu.dongliang [Wed, 2 Oct 2024 04:30:07 +0000 (12:30 +0800)]
support "const literal string" in 'case' for 'switch'

7 weeks agoclose some debug logs
yu.dongliang [Tue, 1 Oct 2024 05:26:25 +0000 (13:26 +0800)]
close some debug logs

7 weeks agodelete ../core/scf_optimizer_dominators_reverse.c
yu.dongliang [Tue, 1 Oct 2024 04:25:04 +0000 (12:25 +0800)]
delete ../core/scf_optimizer_dominators_reverse.c

7 weeks agostruct & array init with '{.key = value, } ok
yu.dongliang [Mon, 30 Sep 2024 11:32:45 +0000 (19:32 +0800)]
struct & array init with '{.key = value, } ok

8 weeks agofix: scf_lex_word_clone() lost copy data when some type
yu.dongliang [Sun, 29 Sep 2024 06:15:47 +0000 (14:15 +0800)]
fix: scf_lex_word_clone() lost copy data when some type

8 weeks agoupdate lex for '.'
yu.dongliang [Sat, 28 Sep 2024 13:10:19 +0000 (21:10 +0800)]
update lex for '.'

8 weeks agouse 'while loop' instead of 'recursive call' for macro
yu.dongliang [Fri, 27 Sep 2024 09:27:26 +0000 (17:27 +0800)]
use 'while loop' instead of 'recursive call' for macro

8 weeks agosupport simple macro function, like A(x) --> #x --> x
yu.dongliang [Thu, 26 Sep 2024 15:18:45 +0000 (23:18 +0800)]
support simple macro function, like A(x) --> #x --> x

8 weeks agosupport simple macro define, rename some long struct name
yu.dongliang [Thu, 26 Sep 2024 07:07:21 +0000 (15:07 +0800)]
support simple macro define, rename some long struct name

2 months agofix: parse error for 'int main(int argc, char* argv[])', delete some unused code
yu.dongliang [Mon, 23 Sep 2024 08:31:05 +0000 (16:31 +0800)]
fix: parse error for 'int main(int argc, char* argv[])', delete some unused code

2 months agoREADME.md
yu.dongliang [Fri, 20 Sep 2024 12:02:20 +0000 (20:02 +0800)]
README.md

2 months agoupdate README.md for main()
yu.dongliang [Mon, 16 Sep 2024 03:24:28 +0000 (11:24 +0800)]
update README.md for main()

2 months agosupport [-s sysroot] of main() argv to select the sysroot dir
yu.dongliang [Mon, 2 Sep 2024 08:52:12 +0000 (16:52 +0800)]
support [-s sysroot] of main() argv to select the sysroot dir

2 months agosupport 'enum' & add a test examples/enum.c
yu.dongliang [Mon, 2 Sep 2024 06:47:01 +0000 (14:47 +0800)]
support 'enum' & add a test examples/enum.c

2 months agooptimize some code for lex & DFA module
yu.dongliang [Fri, 30 Aug 2024 07:44:20 +0000 (15:44 +0800)]
optimize some code for lex & DFA module

2 months agosupport argc & argv in main() for x64, support fopen(), fclose(), ...
yu.dongliang [Wed, 28 Aug 2024 08:56:16 +0000 (16:56 +0800)]
support argc & argv in main() for x64, support fopen(), fclose(), ...

2 months agofix: error when get the return err code of create(), such as examples/ret2_err.c
yu.dongliang [Tue, 27 Aug 2024 10:43:05 +0000 (18:43 +0800)]
fix: error when get the return err code of create(), such as examples/ret2_err.c

3 months agosupport Chinese Programming with UTF-8 in 0x4e00 ~ 0x9fa5, 支持中文编程. delete some 'assert()'
yu.dongliang [Fri, 23 Aug 2024 10:43:11 +0000 (18:43 +0800)]
support Chinese Programming with UTF-8 in 0x4e00 ~ 0x9fa5, 支持中文编程. delete some 'assert()'

5 months agoadd NAND / NOR / NOT gate in native/eda
yu.dongliang [Sun, 23 Jun 2024 11:20:02 +0000 (19:20 +0800)]
add NAND / NOR / NOT gate in native/eda

5 months agoadd MUL() in native/eda, fix 3ac error for 'pre ++'
yu.dongliang [Thu, 13 Jun 2024 09:24:31 +0000 (17:24 +0800)]
add MUL() in native/eda, fix 3ac error for 'pre ++'

5 months agosupport 'sub' in native/eda module
yu.dongliang [Mon, 10 Jun 2024 08:38:46 +0000 (16:38 +0800)]
support 'sub' in native/eda module

6 months agoclose some unused logs
yu.dongliang [Thu, 9 May 2024 13:12:22 +0000 (21:12 +0800)]
close some unused logs

7 months agoupdate native/eda
yu.dongliang [Sun, 21 Apr 2024 12:04:52 +0000 (20:04 +0800)]
update native/eda

7 months agochange resistance value from complex to real number in native/eda
yu.dongliang [Wed, 17 Apr 2024 08:53:24 +0000 (16:53 +0800)]
change resistance value from complex to real number in native/eda

7 months agosupport 'switch-case' & delete some unused code
yu.dongliang [Fri, 12 Apr 2024 12:08:30 +0000 (20:08 +0800)]
support 'switch-case' & delete some unused code

8 months agoREADME.md
yu.dongliang [Mon, 25 Mar 2024 10:19:37 +0000 (18:19 +0800)]
README.md

8 months agoREADME.md
yu.dongliang [Sat, 23 Mar 2024 15:46:29 +0000 (23:46 +0800)]
README.md

8 months agouse scf/pack instead of protobuf in native/eda
yu.dongliang [Sat, 9 Mar 2024 14:09:20 +0000 (22:09 +0800)]
use scf/pack instead of protobuf in native/eda

8 months agoscf/pack: add a simpile compression algorithm
yu.dongliang [Sat, 9 Mar 2024 05:40:21 +0000 (13:40 +0800)]
scf/pack: add a simpile compression algorithm

8 months agoscf/pack: support var array and object array
yu.dongliang [Mon, 4 Mar 2024 11:17:38 +0000 (19:17 +0800)]
scf/pack: support var array and object array

9 months agoadd a simple data pack module 'scf/pack'
yu.dongliang [Thu, 22 Feb 2024 04:01:08 +0000 (12:01 +0800)]
add a simple data pack module 'scf/pack'

10 months agodelete some unused code
yu.dongliang [Sat, 30 Dec 2023 14:46:48 +0000 (22:46 +0800)]
delete some unused code

10 months agodelete some unused code
yu.dongliang [Wed, 27 Dec 2023 16:45:56 +0000 (00:45 +0800)]
delete some unused code

10 months agodelete 'bb_list_head' in optimizer callback()
yu.dongliang [Tue, 26 Dec 2023 14:00:35 +0000 (22:00 +0800)]
delete 'bb_list_head' in optimizer callback()

11 months agodelete some unused code
yu.dongliang [Mon, 18 Dec 2023 15:01:27 +0000 (23:01 +0800)]
delete some unused code

11 months agoadd some free() code, delete some unused code
yu.dongliang [Mon, 18 Dec 2023 12:12:56 +0000 (20:12 +0800)]
add some free() code, delete some unused code

11 months agodelete some unused code
yu.dongliang [Thu, 7 Dec 2023 06:40:07 +0000 (14:40 +0800)]
delete some unused code

11 months ago1, delete some repeated code,
yu.dongliang [Sun, 3 Dec 2023 12:07:52 +0000 (20:07 +0800)]
1, delete some repeated code,
2, fix: x64 native code error for 'examples/x64_sib.c'

11 months agoupdate ../core/scf_optimizer_active_vars.c
yu.dongliang [Thu, 30 Nov 2023 07:09:02 +0000 (15:09 +0800)]
update ../core/scf_optimizer_active_vars.c

11 months agofix: 1, ELF core dump caused by GROUP peephole for '../examples/recursive_pointer.c'
yu.dongliang [Wed, 29 Nov 2023 08:34:35 +0000 (16:34 +0800)]
fix: 1, ELF core dump caused by GROUP peephole for '../examples/recursive_pointer.c'
     2, auto gc analysis failed for '../examples/recursive_pointer.c'

11 months agofix: core dump when x64 peephole like 'mov 1,eax', for ../examples/auto_gc_0.c
yu.dongliang [Wed, 29 Nov 2023 03:53:25 +0000 (11:53 +0800)]
fix: core dump when x64 peephole like 'mov 1,eax', for ../examples/auto_gc_0.c

11 months agoREADME.md
yu.dongliang [Tue, 28 Nov 2023 10:18:22 +0000 (18:18 +0800)]
README.md

11 months agofix: some bugs in pointer analysis
yu.dongliang [Tue, 28 Nov 2023 10:14:09 +0000 (18:14 +0800)]
fix: some bugs in pointer analysis

11 months agofix: pointer alias error in scf_p2a() of ../examples/scf_printf.c
yu.dongliang [Mon, 27 Nov 2023 07:26:16 +0000 (15:26 +0800)]
fix: pointer alias error in scf_p2a() of ../examples/scf_printf.c

11 months ago1, fix: core dump when multi-include same file in '../examples/complex.c',
yu.dongliang [Mon, 27 Nov 2023 04:52:30 +0000 (12:52 +0800)]
1, fix: core dump when multi-include same file in '../examples/complex.c',
2, add some examples

11 months agotmp
yu.dongliang [Mon, 27 Nov 2023 04:50:02 +0000 (12:50 +0800)]
tmp

11 months agodelete & revise some test code
yu.dongliang [Mon, 27 Nov 2023 04:27:41 +0000 (12:27 +0800)]
delete & revise some test code

11 months agoa simple 'malloc()' example: ../test/scf_malloc.c
yu.dongliang [Mon, 27 Nov 2023 04:00:54 +0000 (12:00 +0800)]
a simple 'malloc()' example: ../test/scf_malloc.c

11 months agooptimize pointer alias & add a test '../examples/pointer_opt.c'
yu.dongliang [Mon, 27 Nov 2023 03:50:17 +0000 (11:50 +0800)]
optimize pointer alias & add a test '../examples/pointer_opt.c'

11 months agooptimize 3ac code of pointer alias
yu.dongliang [Sun, 26 Nov 2023 17:15:49 +0000 (01:15 +0800)]
optimize 3ac code of pointer alias

11 months agofix: core dump when test 'examples/declare_vars.c'
yu.dongliang [Sat, 25 Nov 2023 15:54:13 +0000 (23:54 +0800)]
fix: core dump when test 'examples/declare_vars.c'

12 months agodelete some unused member vars
yu.dongliang [Thu, 23 Nov 2023 08:30:17 +0000 (16:30 +0800)]
delete some unused member vars

12 months agofix: auto gc error for '../examples/str.c'
yu.dongliang [Sun, 19 Nov 2023 16:07:00 +0000 (00:07 +0800)]
fix: auto gc error for '../examples/str.c'

12 months agoadd '-t' option to generate 3ac code only
yu.dongliang [Sun, 19 Nov 2023 14:07:57 +0000 (22:07 +0800)]
add '-t' option to generate 3ac code only

12 months agonative/eda/scf_eda.proto
yu.dongliang [Mon, 13 Nov 2023 01:27:40 +0000 (09:27 +0800)]
native/eda/scf_eda.proto

12 months ago__eda_bit_adc()
yu.dongliang [Sat, 11 Nov 2023 14:28:15 +0000 (22:28 +0800)]
__eda_bit_adc()

13 months agoupdate 'ScfEpin' of native EDA module
yu.dongliang [Wed, 25 Oct 2023 07:00:41 +0000 (15:00 +0800)]
update 'ScfEpin' of native EDA module

13 months agouse 'NOR, NAND' in EDA module when make electronic graph, don't use 'OR, AND'
yu.dongliang [Thu, 19 Oct 2023 09:52:38 +0000 (17:52 +0800)]
use 'NOR, NAND' in EDA module when make electronic graph, don't use 'OR, AND'

13 months agonative/eda
yu.dongliang [Wed, 4 Oct 2023 15:54:00 +0000 (23:54 +0800)]
native/eda

14 months agoadd a test 'examples/oop.c', and fix some bugs caused by it
yu.dongliang [Wed, 13 Sep 2023 08:30:03 +0000 (16:30 +0800)]
add a test 'examples/oop.c', and fix some bugs caused by it

14 months agoupdate 'native/eda/scf_eda.proto'
yu.dongliang [Thu, 7 Sep 2023 14:35:28 +0000 (22:35 +0800)]
update 'native/eda/scf_eda.proto'

15 months ago1, fix: DAG optimize error for code 'for (pp = &h; *pp; pp = &(*pp)->next)',
yu.dongliang [Mon, 7 Aug 2023 08:38:55 +0000 (16:38 +0800)]
1, fix: DAG optimize error for code 'for (pp = &h; *pp; pp = &(*pp)->next)',
2, update scf_eda.proto

15 months agofix: x64 peephole
yu.dongliang [Sun, 6 Aug 2023 10:56:13 +0000 (18:56 +0800)]
fix: x64 peephole

15 months agochange scf_eda.proto for native/eda
yu.dongliang [Sat, 29 Jul 2023 13:39:46 +0000 (21:39 +0800)]
change scf_eda.proto for native/eda

16 months agoupdate the code of eda backend in scf native, electronic graph is ok for xor()
yu.dongliang [Sun, 16 Jul 2023 04:24:58 +0000 (12:24 +0800)]
update the code of eda backend in scf native, electronic graph is ok for xor()

16 months agoadd eda backend in scf native, to make a C code to digit electronic graph
yu.dongliang [Thu, 6 Jul 2023 13:06:34 +0000 (21:06 +0800)]
add eda backend in scf native, to make a C code to digit electronic graph

16 months agofix: arm64 for code below,
yu.dongliang [Thu, 29 Jun 2023 14:06:49 +0000 (22:06 +0800)]
fix: arm64 for code below,
bit xor(bit x, bit y)
{
return (x | y) & ~(x & y);
}

17 months agox64: re-open peephole optimizer
yu.dongliang [Fri, 23 Jun 2023 04:10:28 +0000 (12:10 +0800)]
x64: re-open peephole optimizer

17 months agox64: callee don't save no-used register, align to 16 bytes because libc needs
yu.dongliang [Thu, 22 Jun 2023 11:07:45 +0000 (19:07 +0800)]
x64: callee don't save no-used register, align to 16 bytes because libc needs

17 months agofix: x64 call argv register may be overlapped, sometimes like below:
yu.dongliang [Wed, 21 Jun 2023 17:11:31 +0000 (01:11 +0800)]
fix: x64 call argv register may be overlapped, sometimes like below:
int main()
{
int a[4] = {0, 1, 2, 3};
sort(a, 0, 3);
return 0;
}

17 months agofix: 3ac code for loop
yu.dongliang [Fri, 16 Jun 2023 07:19:43 +0000 (15:19 +0800)]
fix: 3ac code for loop

17 months agofix: core dump of 'while (i < 10); ' and 'for(i = 0; i < 1000; i++);'
yu.dongliang [Tue, 13 Jun 2023 10:43:13 +0000 (18:43 +0800)]
fix: core dump of 'while (i < 10); ' and 'for(i = 0; i < 1000; i++);'

17 months agofix:
yu.dongliang [Sat, 10 Jun 2023 08:53:56 +0000 (16:53 +0800)]
fix:
1, const local var print error,
2, break / continue in do while.

17 months agoadd ../examples/do_while.c
yu.dongliang [Thu, 8 Jun 2023 06:14:40 +0000 (14:14 +0800)]
add ../examples/do_while.c

17 months agosupport 'do {} while ()'
yu.dongliang [Thu, 8 Jun 2023 06:12:47 +0000 (14:12 +0800)]
support 'do {} while ()'

17 months agomove some code to ../lex/scf_lex_util.c
yu.dongliang [Sat, 27 May 2023 15:34:31 +0000 (23:34 +0800)]
move some code to ../lex/scf_lex_util.c

18 months agosupport arm32: printf() for double / float test ok.
yu.dongliang [Sat, 20 May 2023 15:49:04 +0000 (23:49 +0800)]
support arm32: printf() for double / float test ok.

18 months ago1, 64 bits add, sub, mul, .etc for arm32,
yu.dongliang [Fri, 19 May 2023 09:11:11 +0000 (17:11 +0800)]
1, 64 bits add, sub, mul, .etc for arm32,
2, use r12 for big disp when memory read / write, to decrease the complexity of register selection.

18 months agosupport arm32: 'qsort.c' of 'scf/examples' test ok
yu.dongliang [Mon, 15 May 2023 09:51:21 +0000 (17:51 +0800)]
support arm32: 'qsort.c' of 'scf/examples' test ok

18 months agosupport arm32: 'hanoi.c' and 'hello.c' of 'scf/examples' test ok
yu.dongliang [Sun, 14 May 2023 09:24:15 +0000 (17:24 +0800)]
support arm32: 'hanoi.c' and 'hello.c' of 'scf/examples' test ok

18 months agomake a framework for RISC register selection
yu.dongliang [Wed, 3 May 2023 07:21:57 +0000 (15:21 +0800)]
make a framework for RISC register selection

19 months agofix: pointer alias BUG
yu.dongliang [Sat, 22 Apr 2023 14:25:40 +0000 (22:25 +0800)]
fix: pointer alias BUG

19 months agoadd usage info
yu.dongliang [Wed, 19 Apr 2023 02:44:47 +0000 (10:44 +0800)]
add usage info

19 months agore-write README.md
yu.dongliang [Tue, 18 Apr 2023 16:36:51 +0000 (00:36 +0800)]
re-write README.md

19 months agoRevert "test"
yu.dongliang [Tue, 18 Apr 2023 16:19:42 +0000 (00:19 +0800)]
Revert "test"

This reverts commit df7a1fdbe60113b13b85cb7733c1b9e95715fa13.

19 months agotest
yu.dongliang [Tue, 18 Apr 2023 16:19:06 +0000 (00:19 +0800)]
test

19 months agofix linker can't find libc.so.6 in fedora, and update the main()'s argv parser
yu.dongliang [Tue, 18 Apr 2023 07:33:41 +0000 (15:33 +0800)]
fix linker can't find libc.so.6 in fedora, and update the main()'s argv parser

19 months agoRevert "tmp"
yu.dongliang [Mon, 3 Apr 2023 11:46:46 +0000 (19:46 +0800)]
Revert "tmp"

This reverts commit 6841f34fff82332aa92cf7bd09410b92dc99eb4f.

19 months agotmp
yu.dongliang [Mon, 3 Apr 2023 11:39:01 +0000 (19:39 +0800)]
tmp