summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-04-10 06:02:14 +0200
committerEugen Wissner <belka@caraus.de>2026-04-10 06:02:14 +0200
commit5bff8c38a48bcafbad1388e84fdf7940a28dece8 (patch)
tree1144f0bbba580675c4499494cfefcea0f571ec23 /boot
parentf26a8b639ad4b32ee4fcf0acb4989c45d8ebd982 (diff)
downloadelna-5bff8c38a48bcafbad1388e84fdf7940a28dece8.tar.gz
Swap source and target operands for unary TAC operators
Diffstat (limited to 'boot')
-rw-r--r--boot/stage21/cl.elna12
1 files changed, 6 insertions, 6 deletions
diff --git a/boot/stage21/cl.elna b/boot/stage21/cl.elna
index 67b785a..b7cb3de 100644
--- a/boot/stage21/cl.elna
+++ b/boot/stage21/cl.elna
@@ -1123,11 +1123,11 @@ var
instruction: ^ElnaRtlInstruction;
rtl_operand: ElnaRtlOperand;
begin
- elna_rtl_operand_value(instructions, @tac_instruction^.operands[2], variable_map, @rtl_operand);
+ elna_rtl_operand_value(instructions, @tac_instruction^.operands[1], variable_map, @rtl_operand);
instruction := elna_rtl_instruction_create(rtl_operator);
elna_rtl_instruction_set_operand(instruction, 1, ElnaRtlKind.pseudo,
- tac_instruction^.operands[1].value, tac_instruction^.operands[1].length, 0);
+ tac_instruction^.operands[2].value, tac_instruction^.operands[2].length, 0);
elna_rtl_instruction_set_operand(instruction, 2, rtl_operand.kind, rtl_operand.value, rtl_operand.length, 0);
elna_list_append(instructions, instruction)
@@ -2331,15 +2331,15 @@ begin
elna_tac_make_variable(@operand^.kind, @operand^.value, @operand^.length, symbol_table);
instruction := elna_tac_instruction_create(ElnaTacOperator.negate);
- elna_tac_instruction_set_operand(instruction, 1, operand^.kind, operand^.value, operand^.length);
- elna_tac_instruction_set_operand(instruction, 2, base.kind, base.value, base.length);
+ elna_tac_instruction_set_operand(instruction, 1, base.kind, base.value, base.length);
+ elna_tac_instruction_set_operand(instruction, 2, operand^.kind, operand^.value, operand^.length);
elna_list_append(instructions, instruction)
elsif operator = '~' then
elna_tac_make_variable(@operand^.kind, @operand^.value, @operand^.length, symbol_table);
instruction := elna_tac_instruction_create(ElnaTacOperator.complement);
- elna_tac_instruction_set_operand(instruction, 1, operand^.kind, operand^.value, operand^.length);
- elna_tac_instruction_set_operand(instruction, 2, base.kind, base.value, base.length);
+ elna_tac_instruction_set_operand(instruction, 1, base.kind, base.value, base.length);
+ elna_tac_instruction_set_operand(instruction, 2, operand^.kind, operand^.value, operand^.length);
elna_list_append(instructions, instruction)
elsif operand_result.kind = ElnaTacOperandType.dereferenced_pointer then
elna_tac_make_variable(@operand^.kind, @operand^.value, @operand^.length, symbol_table);