File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ void statement_list_scanner_init()
116
116
CLR { loc (); return TOK_CLR_RLO; }
117
117
S { loc (); return TOK_SET; }
118
118
R { loc (); return TOK_RESET; }
119
+ NOT { loc (); return TOK_NOT; }
119
120
A { loc (); return TOK_AND; }
120
121
AN { loc (); return TOK_AND_NOT; }
121
122
O { loc (); return TOK_OR; }
Original file line number Diff line number Diff line change @@ -387,6 +387,8 @@ void statement_list_typecheckt::typecheck_statement_list_instruction(
387
387
typecheck_statement_list_accu_real_lte (op_code);
388
388
else if (ID_statement_list_accu_real_gte == statement)
389
389
typecheck_statement_list_accu_real_gte (op_code);
390
+ else if (ID_statement_list_not == statement)
391
+ typecheck_statement_list_not (op_code);
390
392
else if (ID_statement_list_and == statement)
391
393
typecheck_statement_list_and (op_code, tia_element);
392
394
else if (ID_statement_list_and_not == statement)
@@ -753,6 +755,20 @@ void statement_list_typecheckt::typecheck_statement_list_accu_real_gte(
753
755
typecheck_accumulator_compare_instruction (ID_ge);
754
756
}
755
757
758
+ void statement_list_typecheckt::typecheck_statement_list_not (
759
+ const codet &op_code)
760
+ {
761
+ typecheck_instruction_without_operand (op_code);
762
+ if (fc_bit)
763
+ {
764
+ const not_exprt unsimplified{rlo_bit};
765
+ rlo_bit = simplify_expr (unsimplified, namespacet (symbol_table));
766
+ or_bit = false ;
767
+ }
768
+ else
769
+ initialize_bit_expression (false_exprt{});
770
+ }
771
+
756
772
void statement_list_typecheckt::typecheck_statement_list_and (
757
773
const codet &op_code,
758
774
const symbolt &tia_element)
Original file line number Diff line number Diff line change @@ -364,6 +364,11 @@ class statement_list_typecheckt : public typecheckt
364
364
365
365
// Bit Logic instructions
366
366
367
+ // / Performs a typecheck on a STL boolean NOT instruction. Reads and modifies
368
+ // / the RLO, OR and FC bit.
369
+ // / \param op_code: OP code of the instruction.
370
+ void typecheck_statement_list_not (const codet &op_code);
371
+
367
372
// / Performs a typecheck on a STL boolean And instruction. Reads and modifies
368
373
// / the RLO, OR and FC bit.
369
374
// / \param op_code: OP code of the instruction.
You can’t perform that action at this time.
0 commit comments