From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uKRlH+3jAGe85AAAe85BDQ:P1 (envelope-from ) for ; Sat, 05 Oct 2024 08:59:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id uKRlH+3jAGe85AAAe85BDQ (envelope-from ) for ; Sat, 05 Oct 2024 08:59:57 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=PjevIY9K; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=HF4+qSGC; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; dmarc=pass (policy=none) header.from=maniero.me; 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=1728111597; 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=qCE5/3nSmhwCgUvYh8kquue/hmaMkm7be+IKJhJeu2Q=; b=bIUTPLt1VGHPamDugynLOPMOQLwwVqhBlaFlsOhQNYgbUd7omlyidDn+iVHTEefWZVdvk6 Jz3GNR37QV1QUa4Ide+MIWtzHy3lhx/CGmh1zb1gOKDMkQJpIVQtj0rMGgXTwU1OhWJTQ7 jp7xS7fJIU8r403RmxANGnvPhX/Q74/K5Yc3AhA2iHPLfir9TYekuEVFa3EmJtcWYJhLPD KHIn8WNzI9KY+6rQHB5dEwhRzG1CxgWvHHV4kY5T1VXSh3baLHRAOzrb9kU3QpsM0sedf4 amVXIM03JcGV+85ajo3VEOeN/ItBuWhQaOtW/XYaYooY54Rw7m9uqR2TdPdCHA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=PjevIY9K; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=HF4+qSGC; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; dmarc=pass (policy=none) header.from=maniero.me; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Seal: i=2; s=key1; d=johnnyrichard.com; t=1728111597; a=rsa-sha256; cv=pass; b=pdHGx50UayzWnlFj3vDBBWie5UZjzG8jdlAqvTjbWA2NFiFcEjUL70db+tHK51jwvG9pYP UwvqwfAsph2QtGQKIQ9Ibt5O5ZgA5fEpIb5OSK543kRK6QSXqf5EUAYMrrl7HnVkI4kPV7 2wbBjUrg5v5Yh26bwvr88qFZxwF9qSe/P+6vyrcwLrmfEC7Gs7sWY/yOkk/0giYMQVS9tx 7EXlhFvBmBoWjkrp7oOXtpuWI6uAuUHl2NZ0H2fBjG9j7o6kguOeFRPs8O2Mp2ZUFwbSFZ 1EXpP6wwkuVmPztP0f90FPFr+5O9Hgwbh7Tx/O5jz16HWC45Qw6D5l/P1EOE1w== 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 5A486467EB for ; Sat, 05 Oct 2024 08:59:56 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=3b1/vZiU5Q+jQ7W7vZOH5p3swroc7aSwLpRNrNwO7+U=; 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=1728111595; v=1; b=PjevIY9Km3kUjkFW/kKQzNMxrvX4hVChb8opghlB9DugLoFgRUwpMQwxSmGjwBV6az/mJ6OR BCO/vo0dFubfJvy62kgIF5Y3+meDD5dMDpN4r6ZcOQgH5jo8873AFid423bOvkdxoY0gPw82YZ6 mmUyadzeazG2WIThJXQphM1iKbD6Es6mFqIio1TPN9dmOSE8791glwOui7rWZnBwH9TvDP+6kO1 1HngZYy2kbQeWGmXNLwl5g9+4U8V459QBeD25/o6QJssqzd+NK2a7obfXYuItZFLcaKNrb3UzX6 0MlPCwe4VB21xO7fxvjkP2ma1vEL2iEurap6FT6FXAo/w== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id D8F052023F for ; Sat, 05 Oct 2024 06:59:55 +0000 (UTC) Received: from insect.birch.relay.mailchannels.net (insect.birch.relay.mailchannels.net [23.83.209.93]) by mail-a.sr.ht (Postfix) with ESMTPS id 5EC3A2021D for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 05 Oct 2024 06:59:54 +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 8774E839E0 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 5 Oct 2024 06:59:52 +0000 (UTC) Received: from uk-fast-smtpout10.hostinger.io (trex-9.trex.outbound.svc.cluster.local [100.96.88.222]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 8A551824DB for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 5 Oct 2024 06:59:50 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1728111590; a=rsa-sha256; cv=none; b=Q1IUIscItIa2Dw57Jxho6SAQ2AvqA/RoXk2XhERv22lr6VoP/yhe8tQ4O1TCVU4ybZGdz4 J5TWABtMWzgfdSoFyoyCg07hL+9gGcV8gWwr30trLisR9zkxNr+6gQ5PZRtYKdtl42qWns LvlhM+r/9ermzlpNKJ8FjkAobbSyVqolgUKR0mPqBvwBqQ736PVueErQjWuSM8keWpQBd3 vxwM+bppA3tJnhg3kGiGIgIInWbfN+PJzCMPbJQuvH/p4GbYOd2kaAoRHhCD0+zr6GsMRH XEMHG6mSSgWMTCFuaosPAbpVYo5JinowScKuDo5rg/uERiYagYnGCFnfZ9VAsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1728111590; 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=qCE5/3nSmhwCgUvYh8kquue/hmaMkm7be+IKJhJeu2Q=; b=80ArtFiLUbEu/bKJtbams/df2E0/dhZZbXNkLGbS8n+lDfpRvgHWk8Z3FpfyPq9gApZ1F1 ND3mwYEg+eXh5qb8J0gaCbviJvhF1u9XPq6uqmYB4qrn0jmw0qw8Or5AIHAu/9ybYTYKTu AXIDT+IxmqZ2kpnYCTPkyMrbol4VD6oNP7Wz5h4vktHdBdSWtd1PO97ZvB/+jj4/P94X2E bHV1/+9SgtkkaAg5IUqfSyXrwWpSDReP2OCmFwLgmfefbNKkhqUQyILD9YthhRgO7rK0iQ xc97uqzLef4vWgIfxKD5B5fK06j2Txel/aJl7ym8nMZ2MS9bfmiabPllSaRP3g== ARC-Authentication-Results: i=1; rspamd-5778c966d7-gkq4q; 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-Rock-Macabre: 7859ffcc6aa596d7_1728111591091_2682208025 X-MC-Loop-Signature: 1728111591091:1094531920 X-MC-Ingress-Time: 1728111591091 Received: from uk-fast-smtpout10.hostinger.io (uk-fast-smtpout10.hostinger.io [145.14.155.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.88.222 (trex/7.0.2); Sat, 05 Oct 2024 06:59:51 +0000 From: Carlos Maniero DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1728111588; 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=qCE5/3nSmhwCgUvYh8kquue/hmaMkm7be+IKJhJeu2Q=; b=HF4+qSGCwmHrXveFwK8TS08+huOF11Cq6Wm3P0ViQE4+ARch3QzfairTAeLh0MAhBY2qgZ cxl/gCGZaKpNxBthVL0bYPpX0SjbUH4+PUwm9UimQdLHXwZweDKcdc+pOCAFIIclKsghBI 9lrPYqrw21KraFIw1HhmzH5I77xJKrd59PRDwMhm/USYiHheGkwOvr5QN3budlhN9lwQOu I/OrDo76zteOCwbjj5/C381lEvl4ULwZqkvqN6ApyMFYIBWm4gn7lsro6JNXpB9+y/VskY GWJNhDPypfyfq9MKumZxA96u0N5KrTAKE8Xl1Wy3IR68Xxo40pA77zVTmUX2Qw== To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Carlos Maniero Subject: [PATCH olang v1 0/2] codegen: x64: evaluate expression considering the data return data Message-Id: <20241005065924.300710-1-carlos@maniero.me> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Sat, 05 Oct 2024 06:59:48 +0000 (UTC) X-CM-Envelope: MS4xfPnNaobaW5WtvMYIcqVchUUzxhYWU9XREB+3bxp0HD7A9J6b7+CWra7NlawgYW8Z+oX5oKXUKL9qyNPBi9KTyCeaAUQdzX7kLEQLoTgJ4dPMareeAZh3 aJncyu8fmAulwGWIGcbwGS1Orlc5YRRzA3/FKQsUbpjDdlXIdwYaVa9B3j4iVFdk3oWiHzDpekReixjIzYmLdcMMy9K3uGILPzpSRK0YB7mY8UynxVLBGMSB X-CM-Analysis: v=2.4 cv=TcnEtgQh c=1 sm=1 tr=0 ts=6700e3e4 a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=8pfKGgyzczpnAgBSIbMA: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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -1.63 X-Spam-Score: -1.63 X-Migadu-Queue-Id: 5A486467EB X-TUID: Es/+GKnY+9Wf We were not using the proper register size to evaluate expressions, instead we were always using 64 bits register. This patchset fixes this. Carlos Maniero (2): scope: register functions into the scope codegen: x64: evaluate expression considering the data return data size src/checker.c | 3 + src/codegen_linux_x86_64.c | 314 ++++++++++++++++++++++---------- tests/olc/0028_function_call.ol | 4 +- 3 files changed, 223 insertions(+), 98 deletions(-) base-commit: 4768477a7c34f07aeb853fa1e100c77f280d9a57 -- 2.34.1