From c2d25e6aad7dd78fb2e1a4f2afd38a42f3ffa614 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sun, 21 Feb 2021 23:54:42 +0100 Subject: slice: remove unneeded len from OP_SLICE OP_SLICE::len is necessarily equal to the result size. So remove this redundancy. Signed-off-by: Luc Van Oostenryck --- Documentation/IR.rst | 2 +- linearize.c | 3 +-- linearize.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/IR.rst b/Documentation/IR.rst index 38df84ff..e1613402 100644 --- a/Documentation/IR.rst +++ b/Documentation/IR.rst @@ -408,7 +408,7 @@ Others Extract a "slice" from an aggregate. * .base: (pseudo_t) aggregate (alias .src) - * .from, .len: offet & size of the "slice" within the aggregate + * .from: offset of the "slice" within the aggregate * .target: result * .type: type of .target diff --git a/linearize.c b/linearize.c index 0c9b0e59..96a717bc 100644 --- a/linearize.c +++ b/linearize.c @@ -470,7 +470,7 @@ const char *show_instruction(struct instruction *insn) break; case OP_SLICE: - buf += sprintf(buf, "%s <- %s, %d, %d", show_pseudo(insn->target), show_pseudo(insn->base), insn->from, insn->len); + buf += sprintf(buf, "%s <- %s, %d", show_pseudo(insn->target), show_pseudo(insn->base), insn->from); break; case OP_NOT: case OP_NEG: @@ -1239,7 +1239,6 @@ static pseudo_t linearize_slice(struct entrypoint *ep, struct expression *expr) insn->target = new; insn->from = expr->r_bitpos; - insn->len = expr->r_nrbits; use_pseudo(insn, pre, &insn->base); add_one_insn(ep, insn); return new; diff --git a/linearize.h b/linearize.h index cf0cf066..4d83675c 100644 --- a/linearize.h +++ b/linearize.h @@ -129,7 +129,7 @@ struct instruction { }; struct /* slice */ { pseudo_t base; - unsigned from, len; + unsigned from; }; struct /* setval */ { struct expression *val; -- cgit 1.2.3-korg