Skip to content

Commit

Permalink
EEOP_AGG
Browse files Browse the repository at this point in the history
  • Loading branch information
higuoxing committed Sep 1, 2024
1 parent aef932a commit 79413bb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion asmjit_expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,23 @@ bool AsmJitCompileExpr(ExprState *State) {
break;
}
case EEOP_AGG_PLAIN_PERGROUP_NULLCHECK: {
todo();
int jumpnull = Op->d.agg_plain_pergroup_nullcheck.jumpnull;

/*
* pergroup_allaggs = aggstate->all_pergroups
* [op->d.agg_plain_pergroup_nullcheck.setoff];
*/
x86::Gp v_aggstatep = emit_load_parent_from_ExprState(Jitcc, Expression);
x86::Gp v_allpergroupsp =
emit_load_all_pergroups_from_AggState(Jitcc, v_aggstatep);
x86::Gp v_pergroup_allaggs =
Jitcc.newUIntPtr("v_pergroup_allaggs.uintptr");
EmitLoadFromArray(Jitcc, v_allpergroupsp,
Op->d.agg_plain_pergroup_nullcheck.setoff,
v_pergroup_allaggs, sizeof(Datum));
Jitcc.cmp(v_pergroup_allaggs, jit::imm(0));
Jitcc.je(L_Opblocks[jumpnull]);
break;
}

case EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL:
Expand Down
2 changes: 2 additions & 0 deletions jit_types_info.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
TYPES_INFO(ExprState, Datum, resvalue, UIntPtr)
TYPES_INFO(ExprState, bool, resnull, Int8)
TYPES_INFO(ExprState, TupleTableSlot *, resultslot, UIntPtr)
TYPES_INFO(ExprState, struct PlanState *, parent, UIntPtr)
TYPES_INFO(ExprContext, TupleTableSlot *, ecxt_scantuple, UIntPtr)
TYPES_INFO(ExprContext, TupleTableSlot *, ecxt_innertuple, UIntPtr)
TYPES_INFO(ExprContext, TupleTableSlot *, ecxt_outertuple, UIntPtr)
Expand All @@ -25,3 +26,4 @@ TYPES_INFO(HeapTupleHeaderData, uint16, t_infomask, UInt16)
TYPES_INFO(HeapTupleHeaderData, uint8, t_hoff, UInt8)
TYPES_INFO(HeapTupleHeaderData, bits8 *, t_bits, UIntPtr)
TYPES_INFO(FunctionCallInfoBaseData, bool, isnull, Int8)
TYPES_INFO(AggState, AggStatePerGroup *, all_pergroups, UIntPtr)

0 comments on commit 79413bb

Please sign in to comment.