Filter: add floating point support
[lttng-tools.git] / src / lib / lttng-ctl / filter-visitor-generate-bytecode.c
index 25128b6a2fc6b9f2bd1826f66efbe8909d8f4a23..8e18a1a622ac65a918792012ada24c3719fc9f8c 100644 (file)
@@ -200,6 +200,24 @@ int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
                free(insn);
                return ret;
        }
+       case IR_DATA_FLOAT:
+       {
+               struct load_op *insn;
+               uint32_t insn_len = sizeof(struct load_op)
+                       + sizeof(struct literal_double);
+
+               insn = calloc(insn_len, 1);
+               if (!insn)
+                       return -ENOMEM;
+               insn->op = FILTER_OP_LOAD_DOUBLE;
+               insn->reg = reg_sel(node);
+               if (insn->reg == REG_ERROR)
+                       return -EINVAL;
+               *(double *) insn->data = node->u.load.u.flt;
+               ret = bytecode_push(&ctx->bytecode, insn, 1, insn_len);
+               free(insn);
+               return ret;
+       }
        case IR_DATA_FIELD_REF:
        {
                struct load_op *insn;
This page took 0.034514 seconds and 4 git commands to generate.