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>
|| node->u.binary.left->data_type == IR_DATA_FLOAT) {
struct cast_op cast_insn;
|| 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));
cast_insn.reg = REG_R0;
ret = bytecode_push(&ctx->bytecode, &cast_insn,
1, sizeof(cast_insn));
|| node->u.binary.right->data_type == IR_DATA_FLOAT) {
struct cast_op cast_insn;
|| 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));
cast_insn.reg = REG_R0;
ret = bytecode_push(&ctx->bytecode, &cast_insn,
1, sizeof(cast_insn));