Filter: cast double directly to s64
[lttng-tools.git] / 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.023117 seconds and 4 git commands to generate.