Skip to content

Commit 95a55e7

Browse files
authored
Merge pull request #175 from DrXiao/frontend/fix-log-or
Fix bad logical-or implementation
2 parents 07adb41 + 5faf26e commit 95a55e7

File tree

7 files changed

+567
-117
lines changed

7 files changed

+567
-117
lines changed

src/arm-codegen.c

-9
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ void update_elf_offset(ph2_ir_t *ph2_ir)
106106
case OP_geq:
107107
case OP_leq:
108108
case OP_log_not:
109-
case OP_log_or:
110109
elf_offset += 12;
111110
return;
112111
case OP_branch:
@@ -118,9 +117,6 @@ void update_elf_offset(ph2_ir_t *ph2_ir)
118117
case OP_return:
119118
elf_offset += 24;
120119
return;
121-
case OP_log_and:
122-
elf_offset += 28;
123-
return;
124120
default:
125121
printf("Unknown opcode\n");
126122
abort();
@@ -424,11 +420,6 @@ void emit_ph2_ir(ph2_ir_t *ph2_ir)
424420
emit(__mov_i(__NE, rd, 0));
425421
emit(__mov_i(__EQ, rd, 1));
426422
return;
427-
case OP_log_or:
428-
emit(__or_r(__AL, rd, rn, rm));
429-
emit(__teq(rd));
430-
emit(__mov_i(__NE, rd, 1));
431-
return;
432423
default:
433424
printf("Unknown opcode\n");
434425
abort();

src/defs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define MAX_FUNC_TRIES 2160
2424
#define MAX_BLOCKS 2048
2525
#define MAX_TYPES 64
26-
#define MAX_IR_INSTR 40000
26+
#define MAX_IR_INSTR 50000
2727
#define MAX_BB_PRED 128
2828
#define MAX_BB_DOM_SUCC 64
2929
#define MAX_BB_RDOM_SUCC 256
@@ -190,7 +190,7 @@ struct var {
190190
struct insn *last_assign;
191191
int consumed;
192192
bool is_ternary_ret;
193-
bool is_log_and_ret;
193+
bool is_logical_ret;
194194
bool is_const; /* whether a constant representaion or not */
195195
};
196196

0 commit comments

Comments
 (0)