* [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops
@ 2024-10-17 0:16 Carlos Maniero
2024-10-17 0:17 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-17 2:19 ` [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops Johnny Richard
0 siblings, 2 replies; 3+ messages in thread
From: Carlos Maniero @ 2024-10-17 0:16 UTC (permalink / raw)
To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero
There was some registers that was using the high bit instead.
Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
src/codegen_x86_64.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/codegen_x86_64.c b/src/codegen_x86_64.c
index 1951365..c4cef3c 100644
--- a/src/codegen_x86_64.c
+++ b/src/codegen_x86_64.c
@@ -967,7 +967,7 @@ get_reg_for(x86_64_register_type_t type, size_t bytes)
switch (type) {
case REG_ACCUMULATOR: {
if (bytes <= 1) {
- return "%ah";
+ return "%al";
} else if (bytes <= 2) {
return "%ax";
} else if (bytes <= 4) {
@@ -977,7 +977,7 @@ get_reg_for(x86_64_register_type_t type, size_t bytes)
}
case REG_BASE: {
if (bytes <= 1) {
- return "%bh";
+ return "%bl";
} else if (bytes <= 2) {
return "%bx";
} else if (bytes <= 4) {
@@ -987,7 +987,7 @@ get_reg_for(x86_64_register_type_t type, size_t bytes)
}
case REG_COUNTER: {
if (bytes <= 1) {
- return "%ch";
+ return "%cl";
} else if (bytes <= 2) {
return "%cx";
} else if (bytes <= 4) {
@@ -997,7 +997,7 @@ get_reg_for(x86_64_register_type_t type, size_t bytes)
}
case REG_DATA: {
if (bytes <= 1) {
- return "%dh";
+ return "%dl";
} else if (bytes <= 2) {
return "%dx";
} else if (bytes <= 4) {
base-commit: c01fa7cf444bdd2cc9d6befff462285783263413
--
2.46.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [olang/patches/.build.yml] build success
2024-10-17 0:16 [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops Carlos Maniero
@ 2024-10-17 0:17 ` builds.sr.ht
2024-10-17 2:19 ` [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops Johnny Richard
1 sibling, 0 replies; 3+ messages in thread
From: builds.sr.ht @ 2024-10-17 0:17 UTC (permalink / raw)
To: Carlos Maniero; +Cc: ~johnnyrichard/olang-devel
olang/patches/.build.yml: SUCCESS in 29s
[codegen: x64: use the low bit register for 8 bits ops][0] from [Carlos Maniero][1]
[0]: https://lists.sr.ht/~johnnyrichard/olang-devel/patches/55513
[1]: mailto:carlos@maniero.me
✓ #1352213 SUCCESS olang/patches/.build.yml https://builds.sr.ht/~johnnyrichard/job/1352213
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops
2024-10-17 0:16 [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops Carlos Maniero
2024-10-17 0:17 ` [olang/patches/.build.yml] build success builds.sr.ht
@ 2024-10-17 2:19 ` Johnny Richard
1 sibling, 0 replies; 3+ messages in thread
From: Johnny Richard @ 2024-10-17 2:19 UTC (permalink / raw)
To: Carlos Maniero; +Cc: ~johnnyrichard/olang-devel
Thanks! applied.
To git.sr.ht:~johnnyrichard/olang
c01fa7c..f8968c4 main -> main
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-17 0:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-17 0:16 [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops Carlos Maniero
2024-10-17 0:17 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-17 2:19 ` [PATCH olang v1] codegen: x64: use the low bit register for 8 bits ops 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