Skip to content

Commit

Permalink
Add TODOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
higuoxing committed Aug 29, 2024
1 parent d235a6d commit af9a691
Showing 1 changed file with 196 additions and 4 deletions.
200 changes: 196 additions & 4 deletions asmjit_expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ static AsmJitContext *JitCreateContext(int JitFlags) {
return Context;
}

static void todo() { elog(ERROR, "TODO!"); }

static Datum ExecCompiledExpr(ExprState *State, ExprContext *EContext,
bool *IsNull) {
ExprStateEvalFunc Func = (ExprStateEvalFunc)State->evalfunc_private;
Expand Down Expand Up @@ -483,6 +485,30 @@ bool AsmJitCompileExpr(ExprState *State) {
BuildEvalXFunc3(ExecEvalFuncExprStrictFusage);
break;
}
/*
* Treat them the same for now, optimizer can remove
* redundancy. Could be worthwhile to optimize during emission
* though.
*/
case EEOP_BOOL_AND_STEP_FIRST:
case EEOP_BOOL_AND_STEP:
case EEOP_BOOL_AND_STEP_LAST: {
todo();
}
/*
* Treat them the same for now, optimizer can remove
* redundancy. Could be worthwhile to optimize during emission
* though.
*/
case EEOP_BOOL_OR_STEP_FIRST:
case EEOP_BOOL_OR_STEP:
case EEOP_BOOL_OR_STEP_LAST: {
todo();
}

case EEOP_BOOL_NOT_STEP: {
todo();
}

case EEOP_QUAL: {
jit::Label L_HandleNullOrFalse = Jitcc.newLabel();
Expand Down Expand Up @@ -517,6 +543,95 @@ bool AsmJitCompileExpr(ExprState *State) {
break;
}

case EEOP_JUMP: {
todo();
}

case EEOP_JUMP_IF_NULL: {
todo();
}

case EEOP_JUMP_IF_NOT_NULL: {
todo();
}

case EEOP_JUMP_IF_NOT_TRUE: {
todo();
}

case EEOP_NULLTEST_ISNULL: {
todo();
}

case EEOP_NULLTEST_ISNOTNULL: {
todo();
}

case EEOP_NULLTEST_ROWISNULL: {
todo();
}

case EEOP_NULLTEST_ROWISNOTNULL: {
todo();
}

case EEOP_BOOLTEST_IS_TRUE:
case EEOP_BOOLTEST_IS_NOT_FALSE:
case EEOP_BOOLTEST_IS_FALSE:
case EEOP_BOOLTEST_IS_NOT_TRUE: {
todo();
}

case EEOP_PARAM_EXEC: {
todo();
}

case EEOP_PARAM_EXTERN: {
todo();
}

case EEOP_PARAM_CALLBACK: {
todo();
}

case EEOP_PARAM_SET: {
todo();
}

case EEOP_SBSREF_SUBSCRIPTS: {
todo();
}

case EEOP_SBSREF_OLD:
case EEOP_SBSREF_ASSIGN:
case EEOP_SBSREF_FETCH: {
todo();
}

case EEOP_CASE_TESTVAL: {
todo();
}
case EEOP_MAKE_READONLY: {
todo();
}

case EEOP_IOCOERCE: {
todo();
}

case EEOP_IOCOERCE_SAFE: {
todo();
}

case EEOP_DISTINCT:
case EEOP_NOT_DISTINCT: {
todo();
}

case EEOP_NULLIF: {
todo();
}

case EEOP_SQLVALUEFUNCTION: {
BuildEvalXFunc2(ExecEvalSQLValueFunction);
break;
Expand Down Expand Up @@ -547,6 +662,14 @@ bool AsmJitCompileExpr(ExprState *State) {
break;
}

case EEOP_ROWCOMPARE_STEP: {
todo();
}

case EEOP_ROWCOMPARE_FINAL: {
todo();
}

case EEOP_MINMAX: {
BuildEvalXFunc2(ExecEvalMinMax);
break;
Expand All @@ -567,6 +690,10 @@ bool AsmJitCompileExpr(ExprState *State) {
break;
}

case EEOP_DOMAIN_TESTVAL: {
todo();
}

case EEOP_DOMAIN_NOTNULL: {
BuildEvalXFunc2(ExecEvalConstraintNotNull);
break;
Expand All @@ -577,6 +704,16 @@ bool AsmJitCompileExpr(ExprState *State) {
break;
}

case EEOP_HASHDATUM_SET_INITVAL: {
todo();
}
case EEOP_HASHDATUM_FIRST:
case EEOP_HASHDATUM_FIRST_STRICT:
case EEOP_HASHDATUM_NEXT32:
case EEOP_HASHDATUM_NEXT32_STRICT: {
todo();
}

case EEOP_CONVERT_ROWTYPE: {
BuildEvalXFunc3(ExecEvalConvertRowtype);
break;
Expand All @@ -597,16 +734,75 @@ bool AsmJitCompileExpr(ExprState *State) {
break;
}

case EEOP_JSON_CONSTRUCTOR: {
todo();
}

case EEOP_IS_JSON: {
todo();
}

case EEOP_JSONEXPR_PATH: {
todo();
}

case EEOP_JSONEXPR_COERCION: {
todo();
}
case EEOP_JSONEXPR_COERCION_FINISH: {
todo();
}

case EEOP_AGGREF: {
todo();
}

case EEOP_GROUPING_FUNC: {
BuildEvalXFunc2(ExecEvalGroupingFunc);
break;
}

case EEOP_WINDOW_FUNC: {
todo();
}

case EEOP_MERGE_SUPPORT_FUNC: {
todo();
}

case EEOP_SUBPLAN: {
BuildEvalXFunc3(ExecEvalSubPlan);
break;
}

case EEOP_AGG_STRICT_DESERIALIZE:
case EEOP_AGG_DESERIALIZE: {
todo();
}

case EEOP_AGG_STRICT_INPUT_CHECK_ARGS:
case EEOP_AGG_STRICT_INPUT_CHECK_NULLS: {
todo();
}
case EEOP_AGG_PLAIN_PERGROUP_NULLCHECK: {
todo();
}

case EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYVAL:
case EEOP_AGG_PLAIN_TRANS_STRICT_BYVAL:
case EEOP_AGG_PLAIN_TRANS_BYVAL:
case EEOP_AGG_PLAIN_TRANS_INIT_STRICT_BYREF:
case EEOP_AGG_PLAIN_TRANS_STRICT_BYREF:
case EEOP_AGG_PLAIN_TRANS_BYREF: {
todo();
}
case EEOP_AGG_PRESORTED_DISTINCT_SINGLE: {
todo();
}
case EEOP_AGG_PRESORTED_DISTINCT_MULTI: {
todo();
}

case EEOP_AGG_ORDERED_TRANS_DATUM: {
BuildEvalXFunc3(ExecEvalAggOrderedTransDatum);
break;
Expand All @@ -621,10 +817,6 @@ bool AsmJitCompileExpr(ExprState *State) {
Assert(false);
break;
}

default:
ereport(LOG, (errmsg("Jit for operator (%d) is not supported", Opcode)));
return false;
}
}

Expand Down

0 comments on commit af9a691

Please sign in to comment.