From d5707930a4e75c2fa47aa3b75fea13575e269009 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 23 Jul 2023 21:17:13 +0100 Subject: Add Patio code gen for int-eq --- .../java/org/shedlang/compiler/patio/PatioCodeGen.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java index f9bfd38b..63d5cd5e 100644 --- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java +++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java @@ -2,10 +2,7 @@ package org.shedlang.compiler.patio; import org.shedlang.compiler.patio.ast.PatioCompilationUnit; import org.shedlang.compiler.patio.ast.PatioVisibility; -import org.shedlang.compiler.patio.ast.instructions.PatioDataPtrToInt; -import org.shedlang.compiler.patio.ast.instructions.PatioIntAdd; -import org.shedlang.compiler.patio.ast.instructions.PatioLocalStore; -import org.shedlang.compiler.patio.ast.instructions.PatioReturn; +import org.shedlang.compiler.patio.ast.instructions.*; import org.shedlang.compiler.patio.ast.operands.PatioInt; import org.shedlang.compiler.patio.ast.operands.PatioLocalRef; import org.shedlang.compiler.patio.ast.types.PatioTypes; @@ -266,6 +263,18 @@ public class PatioCodeGen { context ); + case IntEqualsInstruction intEquals -> + generateBinaryOperation( + (target, left, right, operationContext) -> + operationContext.addInstruction(new PatioIntEquals( + target, + left, + right, + intEquals.source() + )), + context + ); + case LocalLoadInstruction localLoad -> { var local = context.stackIrLocalNameToLocal(localLoad.name()); -- cgit v1.2.3