From: Mathieu Desnoyers Date: Sat, 14 Jul 2012 03:33:09 +0000 (-0400) Subject: Filter: cast double directly to s64 X-Git-Tag: v2.1.0-rc1~85 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=29fefef89ab4dd5ad6be0ace2c30c0887749f925;p=lttng-tools.git Filter: cast double directly to s64 When we know that the child is a double we can cast it directly without letting the specializer do it. Signed-off-by: Mathieu Desnoyers --- diff --git a/src/lib/lttng-ctl/filter-visitor-generate-bytecode.c b/src/lib/lttng-ctl/filter-visitor-generate-bytecode.c index 7ee35fded..a9e741cd2 100644 --- a/src/lib/lttng-ctl/filter-visitor-generate-bytecode.c +++ b/src/lib/lttng-ctl/filter-visitor-generate-bytecode.c @@ -397,7 +397,11 @@ int visit_node_logical(struct filter_parser_ctx *ctx, struct ir_op *node) || node->u.binary.left->data_type == IR_DATA_FLOAT) { struct cast_op cast_insn; - cast_insn.op = FILTER_OP_CAST_TO_S64; + if (node->u.binary.left->data_type == IR_DATA_FIELD_REF) { + cast_insn.op = FILTER_OP_CAST_TO_S64; + } else { + cast_insn.op = FILTER_OP_CAST_DOUBLE_TO_S64; + } cast_insn.reg = REG_R0; ret = bytecode_push(&ctx->bytecode, &cast_insn, 1, sizeof(cast_insn)); @@ -431,7 +435,11 @@ int visit_node_logical(struct filter_parser_ctx *ctx, struct ir_op *node) || node->u.binary.right->data_type == IR_DATA_FLOAT) { struct cast_op cast_insn; - cast_insn.op = FILTER_OP_CAST_TO_S64; + if (node->u.binary.right->data_type == IR_DATA_FIELD_REF) { + cast_insn.op = FILTER_OP_CAST_TO_S64; + } else { + cast_insn.op = FILTER_OP_CAST_DOUBLE_TO_S64; + } cast_insn.reg = REG_R0; ret = bytecode_push(&ctx->bytecode, &cast_insn, 1, sizeof(cast_insn));