diff --git a/CHANGELOG.org b/CHANGELOG.org index e4d9c91..6284595 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -16,6 +16,29 @@ * Current ** Added +Added support for \a and \b +Added support for long +Added support for size_t +Added support for ssize_t +Added support for const keyword +Added support for alternate instructions for signed/unsigned combinations +Added is_signed data to all types +Added support for signed multiplication, division and modulus + +** Changed +Reordered types to prefer longs over unsigned over ints or chars + +** Fixed +Typo: Recieved -> Received +ARMv7l elf-header regression +Corrected AMD64's xchg rax, rbx into it's proper encoding + +** Removed +Removed bootstrap process as it belongs in mescc-tools-seed instead. +Removed need for fixup_int32 + +* 1.4 - 2019-06-23 +** Added ** Changed Tweaked cc_types.c to better match amd64 assembly diff --git a/cc_core.c b/cc_core.c index 6a965f1..0190bb9 100644 --- a/cc_core.c +++ b/cc_core.c @@ -44,9 +44,6 @@ char* numerate_number(int a); int numerate_string(char *a); char* number_to_hex(int a, int bytes); -/* Host touchy function will need custom on 64bit systems*/ -int fixup_int32(int a); - struct token_list* emit(char *s, struct token_list* head) { struct token_list* t = calloc(1, sizeof(struct token_list)); @@ -399,7 +396,7 @@ void primary_expr_number() { if((KNIGHT_POSIX == Architecture) || (KNIGHT_NATIVE == Architecture)) { - int size = fixup_int32(numerate_string(global_token->s)); + int size = numerate_string(global_token->s); if((32768 > size) && (size > -32768)) { emit_out("LOADI R0 "); diff --git a/functions/fixup.c b/functions/fixup.c deleted file mode 100644 index 45b438b..0000000 --- a/functions/fixup.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2016 Jeremiah Orians - * This file is part of M2-Planet. - * - * M2-Planet is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * M2-Planet is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with M2-Planet. If not, see . - */ - -/* This only works for 32bit architectures */ -int fixup_int32(int a) -{ - return a; -} diff --git a/test/common_amd64/amd64_defs.M1 b/test/common_amd64/amd64_defs.M1 index db6d77f..1fe9f80 100644 --- a/test/common_amd64/amd64_defs.M1 +++ b/test/common_amd64/amd64_defs.M1 @@ -87,5 +87,5 @@ DEFINE STORE_INTEGER 488903 DEFINE SUBTRACT_rax_from_rbx_into_rbx 4829C3 DEFINE SYSCALL 0F05 DEFINE TEST 4885C0 -DEFINE XCHG_rax_rbx 93 +DEFINE XCHG_rax_rbx 4893 DEFINE XOR_rbx_rax_into_rax 4831D8 diff --git a/test/common_amd64/functions/fixup.c b/test/common_amd64/functions/fixup.c deleted file mode 100644 index c178cdb..0000000 --- a/test/common_amd64/functions/fixup.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2016 Jeremiah Orians - * This file is part of M2-Planet. - * - * M2-Planet is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * M2-Planet is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with M2-Planet. If not, see . - */ - -/* Only works for AMD64 with the value in RAX */ -int fixup_int32(int a) -{ - asm("LOAD_EFFECTIVE_ADDRESS_rax %8" - "LOAD_INTEGER" - "MOVESX"); -} diff --git a/test/test.answers b/test/test.answers index bdbaeae..7f80960 100644 --- a/test/test.answers +++ b/test/test.answers @@ -53,10 +53,10 @@ a0ae067746e7a2b01d33950da1cf640e12c3a70a045ab331ea2025af59dec9af test/results/t 1154f39f25dcd6d914e9a542306f95280926baf985d011b2152c7ea0b87ab42d test/results/test10-knight-native-binary c1b5a2a3cd46c5e95e5540e871c2a916e028684ca80f51c001ef489342e27625 test/results/test10-knight-posix-binary b3e13d54aab689137628fb9c4487bfd8288f9bd18bef8fe756577c8d2dce1f1f test/results/test10-x86-binary -180fa840792e12a740bf1e1b11232f029497821ad3619bd0cf11c77d5b2b02fd test/results/test100-amd64-binary -58b48b1a10cf055e5ba14625c1ad268793bb0ec4947a45f37f1474c6dabcfbf5 test/results/test100-armv7l-binary -489d568eaf12223e9ea855e1ed207adeb336b92a1b20f5c67e1d49f60f3a7bb4 test/results/test100-knight-posix-binary -9e0ab712093f097497720c05aa6c08690ed9651ba97e70e9446af284020eeb99 test/results/test100-x86-binary +e6b0b70497950f9ce46b3e75e31f4ba0ac23d16075d735d40f33f7c80e86c535 test/results/test100-amd64-binary +256ddb2d0dd6968af9461c814089ddd8ddc62125f14b061f3a52b1c2de753f87 test/results/test100-armv7l-binary +9bf9ffddf01ea313f92f3f8cc3f7987c2303582eff469bf140c6bb287741effa test/results/test100-knight-posix-binary +724fd8d3c47712ac572623292f54e84d96186a32e9ea62ab445b621075212531 test/results/test100-x86-binary 34e6d535e30ef8826a4ad1a4d08b76cfa370c54595599ad3be784b64c9cd8ec5 test/results/test11-amd64-binary 893695e6f300a0fe055fad935a56abd549bba70d1d39c535a680f41bbb73f117 test/results/test11-armv7l-binary 955b564d2c89abf2cfc6c80d766cd11479d146b828dec69e654b0958a62d5e6e test/results/test11-knight-native-binary @@ -89,12 +89,12 @@ edbb413c0a1e97e57c08192190c37345759e05356394d1c9f43b2eb205b65769 test/results/t 25c03ca09cee551b898245f91106e78a551ddb09e55dc5d36138e7f3955be47d test/results/test17-knight-native-binary fae9fbfc8a37c06dbc363b7bcb48eae27fbebc8a6abf715fd7617b01a1699866 test/results/test17-knight-posix-binary 56a83f34aa57b10efdea636135491043d8c8b09dc09b451b58c27801ca82990e test/results/test17-x86-binary -e36ffaadf9d8e76a68af67429a60fded7bdfc13ba6b5e2fea5a1f6cf74b3d8ba test/results/test18-amd64-binary +1bbf386052ba9265cb89d078ac19cde1fd3170c0644f3a30f355ebba7f0ee739 test/results/test18-amd64-binary a72e9d90e28aa70ba0877a89f224a8469e066958e76c3eec1abcf3b63275ba55 test/results/test18-armv7l-binary 6aed160d00be97a25b0784a295fac4f5cd982b5f11db88a0a9ccfd8fcb648336 test/results/test18-knight-native-binary a349ede620824075e13967da7fd820fb6c470983797c1623658d9c7412411923 test/results/test18-knight-posix-binary 56f791e86536757d48990b870590c878c825f718c29af9628c02e73bfd6144ff test/results/test18-x86-binary -4db54ed2817771a68c68201cec3ba099dcab2485324fe6e0fba9ab69f461487c test/results/test19-amd64-binary +b0f1ff749f0ddc405af86db73cc3419f2778b264900ff736314baceac9908f69 test/results/test19-amd64-binary 1960ba445f1196db351d957ffc7848b7457c0cc377331d072797bd25dcc5fe11 test/results/test19-armv7l-binary 6ce1194d10113b7e43f60d31221852c7742b8e19a0ce14f75a0005907266d128 test/results/test19-knight-posix-binary 29902ee95385060d61eee2a6474375c95f156ada2ece6b6cce763e89ef1d4bde test/results/test19-x86-binary @@ -107,11 +107,11 @@ b80de35e17d341cda9cd280437acb6b217841e18a5b01faf86ca461f6bf0d246 test/results/t 23ad3fc1acc3741e32964e6ebcc206716a6d8ba9fabf4ffa872a382621b7b2a9 test/results/test21-armv7l-binary 3247980035c27673a914a6568fdc4075fe721bf1e1006a19886d1ece529187cb test/results/test21-knight-posix-binary f5d6430d6fade0d4acdaeda1662d9bfdeff881a75e2c877dc738f3485ddb4e63 test/results/test21-x86-binary -4550dfa5655df859b9f61cde276ab7846e6f30321d83bbdf4a734ac22f513dac test/results/test22-amd64-binary +fb8c7ef0a5d511efa02fd77e6f8cd55d88554737c4914e1aaa423fef94dad6e7 test/results/test22-amd64-binary 8a2dbf66b8c89c4be1bb3b03ffe2e5a6a3a3b0a0991e88d381f672b13d159e9d test/results/test22-armv7l-binary 308cbf387fd7c78c180e456683295ef85a69675678299114ebe6a9eb1c37fc82 test/results/test22-knight-posix-binary c2b54fabc592104ab0b26389191f47ba29ea0d4fc216e8fb28b314582134f532 test/results/test22-x86-binary -1ad56685d5d70c73f08234cc23458eb8181cc6a8c156b3230188c4622ffa0a2d test/results/test23-amd64-binary +81d9c5764a3e1433f8ca99a551da0e6b9959f6d1d39e94c56d91fb5513ff5887 test/results/test23-amd64-binary 8dfe0e371dec2a71448b1034b30534b6fcf8b08efa87fb0700718577173f7988 test/results/test23-armv7l-binary 304a07a1de7332e43f0ee8c0ff8104dee6906e32b18cd7d3088dcdc187456b40 test/results/test23-knight-posix-binary b3b6ec4e0c27d0f763dbf81401d829cdb110f048f18ba461081739d533d778e3 test/results/test23-x86-binary @@ -119,10 +119,10 @@ b3b6ec4e0c27d0f763dbf81401d829cdb110f048f18ba461081739d533d778e3 test/results/t 2c78c4dd802d801109f4deaa760bc8fa2331d035c36caf22b9cd74a060532167 test/results/test24-armv7l-binary 8502002b30ac65df6444119d065a514cb0f51894a32f695ce4bc470b3f108bb9 test/results/test24-knight-posix-binary adb392ddd4f3daab1a9afc1eb0bf00cb388a6c45db7754f8455f39757e7f62f6 test/results/test24-x86-binary -aa87c4e6fd6964bfbb4e0b221f1e1fb654c1eb35492b1a30cd4a2d05a1dc640b test/results/test25-amd64-binary +0aabcf5b94f95de30a69aa9e41cb5d2c50a17bf8a0efd4f39eef8df07c8111e3 test/results/test25-amd64-binary 32413f9e44359d121301b36dcda32890ba49cd67e4e9caefe98f8117be4ce224 test/results/test25-armv7l-binary 82c956e3a040d34f6328bd5f22d53c02696500806a6a27b41c8f654143827c5c test/results/test25-x86-binary -866607b7596cc0f56669ee37e83e0a9ecbdd20fdb7fc5fac54ca27fd3c67b54e test/results/test26-amd64-binary +4789d259acb33098d3280b74c845ef703a09107f90856e1849401aa2ba352d23 test/results/test26-amd64-binary 6b59f96ccead5c9541a9c3e4be5ec154e96914c548662a1ace5b0d68ef16c215 test/results/test26-armv7l-binary 5e49db8b34f658113a06f38e26691bc78ef27ba11698d407cf304ab3c2342f5b test/results/test26-x86-binary 717c42e1a1a91ef5b67ce298bc92a148418a5dec6761a358a52b22a01f16c928 test/results/test99-amd64-binary diff --git a/test/test100/hello-amd64.sh b/test/test100/hello-amd64.sh index e0d3d70..82116c3 100755 --- a/test/test100/hello-amd64.sh +++ b/test/test100/hello-amd64.sh @@ -27,7 +27,6 @@ set -ex -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f test/common_amd64/functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ @@ -73,7 +72,6 @@ then -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ diff --git a/test/test100/hello-armv7l.sh b/test/test100/hello-armv7l.sh index f41cfa1..c25f044 100755 --- a/test/test100/hello-armv7l.sh +++ b/test/test100/hello-armv7l.sh @@ -27,7 +27,6 @@ set -ex -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ @@ -73,7 +72,6 @@ then -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ diff --git a/test/test100/hello-knight-posix.sh b/test/test100/hello-knight-posix.sh index 68a4a67..a051be8 100755 --- a/test/test100/hello-knight-posix.sh +++ b/test/test100/hello-knight-posix.sh @@ -27,7 +27,6 @@ set -ex -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ @@ -68,7 +67,6 @@ then -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ diff --git a/test/test100/hello-x86.sh b/test/test100/hello-x86.sh index ac74080..d873462 100755 --- a/test/test100/hello-x86.sh +++ b/test/test100/hello-x86.sh @@ -27,7 +27,6 @@ set -ex -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ @@ -73,7 +72,6 @@ then -f functions/numerate_number.c \ -f functions/file_print.c \ -f functions/number_pack.c \ - -f functions/fixup.c \ -f functions/string.c \ -f cc.h \ -f cc_reader.c \ diff --git a/test/test100/hello.sh b/test/test100/hello.sh index 24570c6..f7032f2 100755 --- a/test/test100/hello.sh +++ b/test/test100/hello.sh @@ -46,7 +46,6 @@ ${CC} ${CFLAGS} \ functions/numerate_number.c \ functions/file_print.c \ functions/number_pack.c \ - functions/fixup.c \ functions/string.c \ cc_reader.c \ cc_strings.c \ diff --git a/test/test100/proof.answer b/test/test100/proof.answer index c9c52fd..571fb8a 100644 --- a/test/test100/proof.answer +++ b/test/test100/proof.answer @@ -1 +1 @@ -cf0f406a505877ed518fdbc27bfd9588f5de92bb58df619c81c242b1338ff4e6 test/test100/proof +2920e77d7f257741943e804ccadd44bc2a91494f0840cbe22756343511787412 test/test100/proof