summaryrefslogtreecommitdiffhomepage
path: root/Examples
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-16 15:58:46 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-16 15:58:46 +0200
commit56fd0994ae3a2f1b327ebac45f5927f7656d68a4 (patch)
tree69583e054edf12092a604104282f00e988109bfa /Examples
parenta656cb178c384bcb27b22fdc7ce1e10e49e8e5bd (diff)
Compiler: Improve codegen on PowerPC and fix ppc/x64/64k assemblers.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Examples')
-rw-r--r--Examples/ExampleCDialect.S29
-rw-r--r--Examples/ExampleCDialect.c8
2 files changed, 24 insertions, 13 deletions
diff --git a/Examples/ExampleCDialect.S b/Examples/ExampleCDialect.S
index d9613ef..2a5203a 100644
--- a/Examples/ExampleCDialect.S
+++ b/Examples/ExampleCDialect.S
@@ -1,23 +1,28 @@
# Path: Examples/ExampleCDialect.c
-# Language: PowerPC Assembly (Generated from ANSI C)
-# Build Date: 2024-4-4
+# Language: PowerPC Assembly (Generated from C)
+# Build Date: 2024-4-16
-dword export .code64 main
- lda r2,0x1000
- lda r12, import __MPCC_IF_PROC_417129812448
- #r12 = Code to jump on, r11 right cond, r10 left cond.
- beq r10, r11, r12
-dword export .code64 __MPCC_IF_PROC_417129812448
- ldw r19, import foo
- jlr
+dword export .code64 __ImageStart
- ldw r19, 57
- jlr
+ li r3,0x1000
+
+ cmpw r10, r11
+ beq import__MPCC_IF_PROC_6168864856
+dword export .code64 __MPCC_IF_PROC_6168864856
+
+
+
+ mr r31, r3
+ blr
+
+
+ mr r31, r0
+ blr
diff --git a/Examples/ExampleCDialect.c b/Examples/ExampleCDialect.c
index 899062c..8c65bf0 100644
--- a/Examples/ExampleCDialect.c
+++ b/Examples/ExampleCDialect.c
@@ -1,4 +1,10 @@
-int main(int argc, char const* argv[]) {
+struct {
+ int a;
+ int b;
+ int c;
+};
+
+int __ImageStart(int argc, char const* argv[]) {
int* foo = 0x1000;
if (foo == 57) {