public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
From: Carlos Maniero <carlos@maniero.me>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Carlos Maniero <carlos@maniero.me>
Subject: [PATCH olang 0/5] extend unsined integers types (u8, u16, u64)
Date: Sat, 21 Sep 2024 08:24:50 +0000 (UTC)	[thread overview]
Message-ID: <20240921082437.396691-1-carlos@maniero.me> (raw)

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


             reply	other threads:[~2024-09-21  8:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21  8:24 Carlos Maniero [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240921082437.396691-1-carlos@maniero.me \
    --to=carlos@maniero.me \
    --cc=~johnnyrichard/olang-devel@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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