Filter: cast double directly to s64
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 14 Jul 2012 03:33:09 +0000 (23:33 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 14 Jul 2012 03:33:09 +0000 (23:33 -0400)
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 <mathieu.desnoyers@efficios.com>
src/lib/lttng-ctl/filter-visitor-generate-bytecode.c

index 7ee35fded2ac91a7642aff6450d092f6504fed70..a9e741cd21ae2983dbb1ba28d949bbb6e01643e6 100644 (file)
@@ -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));
This page took 0.02741 seconds and 5 git commands to generate.