From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AHviC9qC7mbLFQEAqHPOHw:P1 (envelope-from ) for ; Sat, 21 Sep 2024 10:24:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id AHviC9qC7mbLFQEAqHPOHw (envelope-from ) for ; Sat, 21 Sep 2024 10:24:58 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=LxEip1Wc; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=sBc8Wi1c; dmarc=pass (policy=none) header.from=maniero.me; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1726907098; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=maDYz3LhBtuGnXw8Q0qjQnNHppyWK9/GQQRifqINzw8=; b=dniHP/Dw5QBVw9iZVpCC2xkxLMnmVrHc6O/QoxYxQZPBQopdMTiI2RtTn/LcIRGGauoLPz 9uUFLTK83IAyO/J2E78vX9i9VprZKUx81h/rHnx90cSaK7ZpGpZzm2xihDKMcgq03izzyo PA8YIkQyxPXqGs4hdTkTi27+Rq5imLSZq6zgpV8EMjF/CWQJxjAxSHkW6i2jzOMwBVtd0q pet7wKCG9BweVUStngcQdpx0gdR9OxftNHufhOy8Lo+CzB8ANjW7du9dgTVV320rxSAKBh PFyVbNEzgmIw7iTLkZR+98zYjixDPiUaghJG3bNSqAqQvPM+jOx2OoiKxqQhrw== ARC-Seal: i=2; s=key1; d=johnnyrichard.com; t=1726907098; a=rsa-sha256; cv=pass; b=oxFznrODS5+AdDrc4xyBo5l2VBQN+wnboiVN+IDrJ0/3dIwWi8VnnJxmtMeIebb7h5U/fU rr8ZF0oeaHEutV0NnBIiCawbMG7bskaa2+eXWUHmDKrLVw5uTy36PHyE8DMssxcQR5Xf0R u+C7XMXwWFP3/IyuBO0hk8hpw3e6HKpuUb1kvNb84+JVQddxAdC7BEMnNY2y74N3EsQE2d EFCCU5q3SHobJNYnqgqu+rUulL5S3nhA2j8+lafpt4TrQP8vEyQFYaBA/Ku8hGOd9tGZbs nVxHsDsJahbCjBcI1uG5HaMKRpLMpsCoqyVI+4Pgv03kW4FlQuo3ybqNIprn+Q== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=LxEip1Wc; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=sBc8Wi1c; dmarc=pass (policy=none) header.from=maniero.me; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; arc=pass ("mailchannels.net:s=arc-2022:i=1") Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E64FD13C8F for ; Sat, 21 Sep 2024 10:24:57 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=WEH6idvBT3Cg3Z7IRDtif/gaLKN2OAYS3E/MkxJndhw=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:Date:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1726907097; v=1; b=LxEip1WcGN1Vw3ILsWqcogy0+ZRXVQrT3AyFAMoT5DqBHs4tCVMjbRcoZdmBfkthoCB4rSQ2 RzXuzUoZHeForoc+YMUYoV0amrtTPHEL4PlTfg9QCuv37FhROgnO1WTjqY5Vls7+L4BCNhQYvKy cpaPP5p9EVrViuw6/tb1V47UI5581EonPXVz8xRJeczzjCB9lBzoD++9qfcnbX1ZFTnqc/XEPIG xrJhD7K395jw2/lz02P9ujBBOQsmUPl07qIdmerki+gdzRNtX1pdiEQ1EvsM5UUIVRL4MCRu0JO jb66bqDBhYLQssCwLv0C5duxy+Evp0QwmRyu2VoAC+1hQ== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 0FED02024E for ; Sat, 21 Sep 2024 08:24:57 +0000 (UTC) Received: from cross.elm.relay.mailchannels.net (cross.elm.relay.mailchannels.net [23.83.212.46]) by mail-a.sr.ht (Postfix) with ESMTPS id 521D2201DC for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 21 Sep 2024 08:24:55 +0000 (UTC) X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 62CF78A4391 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 21 Sep 2024 08:24:53 +0000 (UTC) Received: from fr-int-smtpout5.hostinger.io (trex-5.trex.outbound.svc.cluster.local [100.99.97.152]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 85F658A5A82 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 21 Sep 2024 08:24:52 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1726907092; a=rsa-sha256; cv=none; b=i8hStxIGoka0slGKaTU5Qr0885rFCjzfnWb7Q0LINB/AWGNbVwG8310WiMVkdjLmVdiRqO 469++3cIulGBpWigo77vi2yDDa/O2ija11bdPz8LqKmBXvbGEQnlA2Au5mtD2nlK8p35cb yfLYaTvR+1wzY9/nRCaTUTw8agGpy/GIsupnFm3cZgWs4w7fves8stfhiVssYyyDU0FFxz uYWcM0y0POKHp1zn4lckTIvKY7a8Mftjq7qFSjuo8nxt6ycTJxTReZZ9k36U+FPMYEn4Va ebFbT+3YBdWqp5K1H1rrQNNMoL2GEDy+tesE6kRok8uxojNoj+Kyg2S1WarMwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1726907092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=maDYz3LhBtuGnXw8Q0qjQnNHppyWK9/GQQRifqINzw8=; b=3dPhVorCWvfWava6eGFUp8vHAD8jT/3KBDttizFqar9kSk3cAzMhk//ADahqYtEQ3BMUL9 KnNJ+th4sT7JTgCVgd6HrSFIjRV9uj8wCYlfm907OO6VLEeSDds5CcMp/864nIVfQWFdyF xy0l3ixa+2cG+UneS7TfbFbz/iKgHnaIdlNLffEjfTQ/FaHeU/wLvTdNgMJpS+tebk34sy dFrfrscccsy4iM2x4ZBDkZpy4TRDbhfWwpOwtCQqT7PLwZyw2umieJvSi4xIdfA5z2NXKR awH68rB9+MqdQoHBwLhxy/fWS6qdfM1vcILgNyOTaCUmXuDFu1I3yRIcXWk69A== ARC-Authentication-Results: i=1; rspamd-5b46bcd97f-9tw6t; auth=pass smtp.auth=hostingeremail smtp.mailfrom=carlos@maniero.me X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|carlos@maniero.me X-MailChannels-Auth-Id: hostingeremail X-Celery-Share: 026138eb47743aaa_1726907093044_693738340 X-MC-Loop-Signature: 1726907093044:123398730 X-MC-Ingress-Time: 1726907093043 Received: from fr-int-smtpout5.hostinger.io (fr-int-smtpout5.hostinger.io [89.116.146.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.99.97.152 (trex/7.0.2); Sat, 21 Sep 2024 08:24:53 +0000 From: Carlos Maniero DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1726907090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=maDYz3LhBtuGnXw8Q0qjQnNHppyWK9/GQQRifqINzw8=; b=sBc8Wi1cw43WR96qIkOuSwHpksOY7rvSntQAb21icf+XxdQg5lwMUS96r+nVmGzg6CTl9N 3iFcRCRBsBoxU4LHRSrbZshguZrzgxCAbBQVUB5s46LjguprUPFOEPLIu1LOiJc1/BW1VQ TJ/OgMthj9FojdAr/s52SvhKiv+2NDwFXE+qv92Rps6JU1QOyYUm8+6D+EmN5mlzNqTUMa lyB9nH4nVxl83BD+ZRAJuJuynCGHvS/0hns2GNnV6pjHgtb2+gx3lj7/4qwkeSQuHU8YlZ nTcRuF0A8GCTMCMkJUwz7XjbNE4z8yPY1vuDYSdXyuo9A4hYK0tRchD9wrOgXQ== To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Carlos Maniero Subject: [PATCH olang 0/5] extend unsined integers types (u8, u16, u64) Message-Id: <20240921082437.396691-1-carlos@maniero.me> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Sat, 21 Sep 2024 08:24:50 +0000 (UTC) X-CM-Envelope: MS4xfEvSfQ0YWLzCqgLZeYnG7Vd9dQ8RA4Ne5gS7p9HtypbeduHOECVEoHMgZGkr1o67fuENrzC4Ie4JtrVhPv/XnUJQKlJ82pLzhL38cu9Kd55StTQiR59d +bc+PFSSK5Y8MxK6gKRxvnX5mehQFlsM7RZ8Qs6N2rkRxbGslP3ufF+bYmAzjyDJ2OOwooxacerWtMWXZ8hIIldYmbb1/89C37xpREW8HwNQqUzrO8zspqVU X-CM-Analysis: v=2.4 cv=SpTC6+O0 c=1 sm=1 tr=0 ts=66ee82d2 a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=FNzI_FTkWIkFld0fkB8A:9 a=BXDaF_L80NY05PYiAFlV:22 X-AuthUser: carlos@maniero.me List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Country: NL X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.16 X-Spam-Score: -0.16 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: E64FD13C8F X-TUID: ilzptaVAtF+K 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