diff --git a/cc.c b/cc.c index 5802781..ad70e80 100644 --- a/cc.c +++ b/cc.c @@ -1,4 +1,5 @@ /* Copyright (C) 2016 Jeremiah Orians + * Copyright (C) 2020 deesix * This file is part of M2-Planet. * * M2-Planet is free software: you can redistribute it and/or modify @@ -77,11 +78,12 @@ int main(int argc, char** argv) else if(match("x86", arch)) Architecture = X86; else if(match("amd64", arch)) Architecture = AMD64; else if(match("armv7l", arch)) Architecture = ARMV7L; + else if(match("aarch64", arch)) Architecture = AARCH64; else { file_print("Unknown architecture: ", stderr); file_print(arch, stderr); - file_print(" know values are: knight-native, knight-posix, x86, amd64 and armv7l", stderr); + file_print(" know values are: knight-native, knight-posix, x86, amd64, armv7l and aarch64", stderr); exit(EXIT_FAILURE); } i = i + 2; diff --git a/cc.h b/cc.h index 911e0b1..5097cc4 100644 --- a/cc.h +++ b/cc.h @@ -1,4 +1,5 @@ /* Copyright (C) 2016 Jeremiah Orians + * Copyright (C) 2020 deesix * This file is part of M2-Planet. * * M2-Planet is free software: you can redistribute it and/or modify @@ -36,6 +37,8 @@ #define AMD64 3 // CONSTANT ARMV7L 4 #define ARMV7L 4 +// CONSTANT AARCH64 5 +#define AARCH64 5 char* copy_string(char* target, char* source); diff --git a/cc_types.c b/cc_types.c index 4feda01..c6d0c5a 100644 --- a/cc_types.c +++ b/cc_types.c @@ -1,4 +1,5 @@ /* Copyright (C) 2016 Jeremiah Orians + * Copyright (C) 2020 deesix * This file is part of M2-Planet. * * M2-Planet is free software: you can redistribute it and/or modify @@ -26,7 +27,7 @@ void require(int bool, char* error); /* Initialize default types */ void initialize_types() { - if(AMD64 == Architecture) register_size = 8; + if(AMD64 == Architecture || AARCH64 == Architecture) register_size = 8; else register_size = 4; /* Define void */ diff --git a/docs/M2-Planet.1 b/docs/M2-Planet.1 index 7c91c7e..c4d3012 100644 --- a/docs/M2-Planet.1 +++ b/docs/M2-Planet.1 @@ -23,8 +23,8 @@ break), asm, structs (with -> support) gotos (with labels) and return. With do and for loops, arrays and function pointers as nice extras .br The supported ARCHITECTURES are as follows: knight-native, -knight-posix, x86, amd64, armv7l. -(with planned ports to aarch64, z80 and 6502 planned) +knight-posix, x86, amd64, armv7l, aarch64. +(with planned ports to z80 and 6502) If you fail to specify an architecture, the default of knight-native will be used. diff --git a/test/test.answers b/test/test.answers index ac4354c..b76bc0f 100644 --- a/test/test.answers +++ b/test/test.answers @@ -53,10 +53,10 @@ a0ae067746e7a2b01d33950da1cf640e12c3a70a045ab331ea2025af59dec9af test/results/t e01b615db5df31392bd1054c45141dcff936b11dfb1cad270edc0aa67653f5a1 test/results/test10-knight-native-binary c1b5a2a3cd46c5e95e5540e871c2a916e028684ca80f51c001ef489342e27625 test/results/test10-knight-posix-binary b3e13d54aab689137628fb9c4487bfd8288f9bd18bef8fe756577c8d2dce1f1f test/results/test10-x86-binary -b6d253f059689246224c32c6af850b62d5bc898bfcf82d411d914f68e46f2cc8 test/results/test100-amd64-binary -821ca37664ae245a3127e2be0ec60fe5a7aef9cf54cf13b70659ccb73ea9ef8c test/results/test100-armv7l-binary -1b11bf81a2be91fb85620a801c65243f207edccc7919241e65c2bd05e0d8d813 test/results/test100-knight-posix-binary -4cea33c07306fe641a70b4e25572846ba3906f94b00e3282339400288355fe77 test/results/test100-x86-binary +e637a8ed8d30248bc2093e36b58f67018219f27a7b051e6c069ed718b0d625c6 test/results/test100-amd64-binary +c560cecfeb221cf76e24efdfa43cdaad627195f53812c5066cf4bdfddb1e314b test/results/test100-armv7l-binary +a516649bb595fbb8906bb30182b1909d9e274208eff36e0ea6203df6ba0dbefd test/results/test100-knight-posix-binary +e3624643ff747252dd55e4a5165e9d60b3d7126e0edc6515cc2a14775e1b8919 test/results/test100-x86-binary 34e6d535e30ef8826a4ad1a4d08b76cfa370c54595599ad3be784b64c9cd8ec5 test/results/test11-amd64-binary 893695e6f300a0fe055fad935a56abd549bba70d1d39c535a680f41bbb73f117 test/results/test11-armv7l-binary 7115c4a552eb4b2c1a868ac3dca43be7d040c8e89b7b66851d0522d298429af9 test/results/test11-knight-native-binary diff --git a/test/test100/proof.answer b/test/test100/proof.answer index d591913..83e4efb 100644 --- a/test/test100/proof.answer +++ b/test/test100/proof.answer @@ -1 +1 @@ -6f9fa3b156a89c4e4b52fe51a9792439d168b04d772c1dc99b6065aad512f5e9 test/test100/proof +ab19170f335226f182ef2371f91d17de8ea3a9f7316d48eceb8d0e99ec71b165 test/test100/proof