Fixing arm instructions

This commit is contained in:
Clément Grennerat 2026-03-02 11:11:40 +01:00
parent 5bd793e07e
commit b09a06d07a
6 changed files with 17 additions and 14 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
compiler/config.mk
compiler/build/
compiler/generated/
ifcc-test-output/

View File

@ -22,7 +22,11 @@ antlrcpp::Any CodeGenVisitor::visitReturn_stmt(ifccParser::Return_stmtContext *c
{
int retval = stoi(ctx->CONST()->getText());
std::cout << " movl $"<<retval<<", %eax\n" ;
#ifdef __APPLE__
std::cout << " mov w0, #"<<retval<<"\n" ;
#else
std::cout << " movl $"<<retval<<", %eax\n" ;
#endif
return 0;
}

View File

@ -1,4 +0,0 @@
# these values work with the "install-antlr.sh" script provided for the PLD
ANTLRJAR=../antlr/jar/antlr-4.9.2-complete.jar
ANTLRINC=../antlr/include
ANTLRLIB=../antlr/lib/libantlr4-runtime.a

View File

@ -1,3 +0,0 @@
ANTLRJAR=/home/$(USER)/antlr4-install/antlr-4.13.2-complete.jar
ANTLRINC=/usr/local/include/antlr4-runtime/
ANTLRLIB=/usr/local/lib/libantlr4-runtime.a

View File

@ -0,0 +1,3 @@
ANTLRJAR=$(shell brew --prefix antlr)/antlr-4.13.2-complete.jar
ANTLRINC=$(shell brew --prefix antlr4-cpp-runtime)/include/antlr4-runtime
ANTLRLIB=$(shell brew --prefix antlr4-cpp-runtime)/lib/libantlr4-runtime.a