public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang 0/5] extend unsined integers types (u8, u16, u64)
@ 2024-09-21  8:24 Carlos Maniero
  2024-09-21  8:24 ` [PATCH olang 1/5] parser: replace type enum to an struction string id representation Carlos Maniero
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Carlos Maniero @ 2024-09-21  8:24 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero

The olang was supporting only u32 yet there was an inconsistency because
we were always using 8 bytes to store information on stack when u32
actually requires only 4 bytes. We were also using rax for these
operations when 32bits operation should use eax.

This patch enables all unsigned types and use the proper
instruction/register.

Carlos Maniero (5):
  parser: replace type enum to an struction string id representation
  checker: scope: populate symbol's type
  codegen: fix map simbol list type
  codegen: calculate the variable offset based on symbol type
  codegen: perform mov instructions based on variable type

 src/ast.h                                     |  6 +-
 src/checker.c                                 | 98 ++++++++++++++++++-
 src/codegen_linux_x86_64.c                    | 90 +++++++++++++++--
 src/parser.c                                  |  7 +-
 src/pretty_print_ast.c                        |  4 +-
 src/scope.c                                   |  3 +-
 src/scope.h                                   |  4 +-
 src/type.h                                    | 42 ++++++++
 tests/integration/tests/0001_main_exit.ol     |  2 +-
 tests/integration/tests/0020_if_statement.ol  |  2 +-
 .../integration/tests/0023_else_statement.ol  |  2 +-
 .../integration/tests/0024_var_definition.ol  |  2 +-
 .../tests/0026_primitive_unsigneds.ol         | 27 +++++
 tests/unit/parser_test.c                      |  2 +-
 14 files changed, 262 insertions(+), 29 deletions(-)
 create mode 100644 src/type.h
 create mode 100644 tests/integration/tests/0026_primitive_unsigneds.ol


base-commit: 0d9ff9cbb463f044c7d482a4045d7668664e0d35
-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-09-22 14:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-21  8:24 [PATCH olang 0/5] extend unsined integers types (u8, u16, u64) Carlos Maniero
2024-09-21  8:24 ` [PATCH olang 1/5] parser: replace type enum to an struction string id representation Carlos Maniero
2024-09-21 17:59   ` Johnny Richard
2024-09-21  8:24 ` [PATCH olang 2/5] checker: scope: populate symbol's type Carlos Maniero
2024-09-21 18:47   ` Johnny Richard
2024-09-21 21:23     ` Carlos Maniero
2024-09-22 13:46       ` Johnny Richard
2024-09-21  8:24 ` [PATCH olang 3/5] codegen: fix map simbol list type Carlos Maniero
2024-09-21 18:50   ` Johnny Richard
2024-09-21  8:25 ` [PATCH olang 4/5] codegen: calculate the variable offset based on symbol type Carlos Maniero
2024-09-21 18:56   ` Johnny Richard
2024-09-21  8:25 ` [PATCH olang 5/5] codegen: perform mov instructions based on variable type Carlos Maniero
2024-09-21  8:26   ` [olang/patches/.build.yml] build success builds.sr.ht
2024-09-21 19:17   ` [PATCH olang 5/5] codegen: perform mov instructions based on variable type Johnny Richard
2024-09-21 21:30     ` Carlos Maniero
2024-09-22 14:16 ` [PATCH olang 0/5] extend unsined integers types (u8, u16, u64) Johnny Richard

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox