From aec1b8dddc68ecb8288ec6132932e4c7b4bca09f Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Tue, 10 Jan 2023 11:05:21 +0000 Subject: getting close to done --- compiler_and_linker/unsorted/LoopOptimization.c | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'compiler_and_linker/unsorted/LoopOptimization.c') diff --git a/compiler_and_linker/unsorted/LoopOptimization.c b/compiler_and_linker/unsorted/LoopOptimization.c index 1c0b905..c2a360f 100644 --- a/compiler_and_linker/unsorted/LoopOptimization.c +++ b/compiler_and_linker/unsorted/LoopOptimization.c @@ -843,19 +843,19 @@ static void rewriteunknownloopwithBDNZ(Loop *loop) { if (loop->unknownCondition == ELESS) { branchOpcode = PC_BF; if (loop->lowerType == LOOP_BOUND_CONSTANT) { - branchCondition = 1; + branchCondition = 1; // GT value1 = loop->lower; reg1 = addiInstr->args[2].data.reg.reg; value2 = absStep - 1 - loop->lower; mode = 0; } else if (loop->upperType == LOOP_BOUND_CONSTANT) { - branchCondition = 0; + branchCondition = 0; // LT value1 = loop->upper; reg1 = addiInstr->args[1].data.reg.reg; value2 = absStep - 1 + loop->upper; mode = 1; } else { - branchCondition = 0; + branchCondition = 0; // LT reg1 = addiInstr->args[1].data.reg.reg; reg2 = addiInstr->args[2].data.reg.reg; value2 = absStep - 1; @@ -864,19 +864,19 @@ static void rewriteunknownloopwithBDNZ(Loop *loop) { } else if (loop->unknownCondition == ELESSEQU) { branchOpcode = PC_BT; if (loop->lowerType == LOOP_BOUND_CONSTANT) { - branchCondition = 0; + branchCondition = 0; // LT value1 = loop->lower; reg1 = addiInstr->args[2].data.reg.reg; value2 = absStep - loop->lower; mode = 0; } else if (loop->upperType == LOOP_BOUND_CONSTANT) { - branchCondition = 1; + branchCondition = 1; // GT value1 = loop->upper; reg1 = addiInstr->args[1].data.reg.reg; value2 = absStep + loop->upper; mode = 1; } else { - branchCondition = 1; + branchCondition = 1; // GT value1 = 0; reg1 = addiInstr->args[1].data.reg.reg; reg2 = addiInstr->args[2].data.reg.reg; @@ -886,19 +886,19 @@ static void rewriteunknownloopwithBDNZ(Loop *loop) { } else if (loop->unknownCondition == EGREATER) { branchOpcode = PC_BF; if (loop->lowerType == LOOP_BOUND_CONSTANT) { - branchCondition = 0; + branchCondition = 0; // LT value1 = loop->lower; reg1 = addiInstr->args[2].data.reg.reg; value2 = absStep - 1 + loop->lower; mode = 1; } else if (loop->upperType == LOOP_BOUND_CONSTANT) { - branchCondition = 1; + branchCondition = 1; // GT value1 = loop->upper; reg1 = addiInstr->args[1].data.reg.reg; value2 = absStep - 1 - loop->upper; mode = 0; } else { - branchCondition = 1; + branchCondition = 1; // GT value1 = 0; reg1 = addiInstr->args[1].data.reg.reg; reg2 = addiInstr->args[2].data.reg.reg; @@ -908,19 +908,19 @@ static void rewriteunknownloopwithBDNZ(Loop *loop) { } else if (loop->unknownCondition == EGREATEREQU) { branchOpcode = PC_BT; if (loop->lowerType == LOOP_BOUND_CONSTANT) { - branchCondition = 1; + branchCondition = 1; // GT value1 = loop->lower; reg1 = addiInstr->args[2].data.reg.reg; value2 = absStep + loop->lower; mode = 1; } else if (loop->upperType == LOOP_BOUND_CONSTANT) { - branchCondition = 0; + branchCondition = 0; // LT value1 = loop->upper; reg1 = addiInstr->args[1].data.reg.reg; value2 = absStep - loop->upper; mode = 0; } else { - branchCondition = 0; + branchCondition = 0; // LT reg1 = addiInstr->args[1].data.reg.reg; reg2 = addiInstr->args[2].data.reg.reg; value2 = absStep; @@ -928,7 +928,7 @@ static void rewriteunknownloopwithBDNZ(Loop *loop) { } } else if (loop->unknownCondition == ENOTEQU) { branchOpcode = PC_BT; - branchCondition = 2; + branchCondition = 2; // EQ if (loop->step > 0) { if (loop->lowerType == LOOP_BOUND_CONSTANT) { value1 = loop->lower; -- cgit v1.2.3