diff --git a/ext/opcache/jit/ir/ir.c b/ext/opcache/jit/ir/ir.c index 95a5d2b0ea8..5da5beaae4e 100644 --- a/ext/opcache/jit/ir/ir.c +++ b/ext/opcache/jit/ir/ir.c @@ -2369,6 +2369,24 @@ ir_ref _ir_CALL_5(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref ar return call; } +ir_ref _ir_CALL_6(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5, ir_ref arg6) +{ + ir_ref call; + + IR_ASSERT(ctx->control); + call = ir_emit_N(ctx, IR_OPT(IR_CALL, type), 8); + ir_set_op(ctx, call, 1, ctx->control); + ir_set_op(ctx, call, 2, func); + ir_set_op(ctx, call, 3, arg1); + ir_set_op(ctx, call, 4, arg2); + ir_set_op(ctx, call, 5, arg3); + ir_set_op(ctx, call, 6, arg4); + ir_set_op(ctx, call, 7, arg5); + ir_set_op(ctx, call, 8, arg6); + ctx->control = call; + return call; +} + ir_ref _ir_CALL_N(ir_ctx *ctx, ir_type type, ir_ref func, uint32_t count, ir_ref *args) { ir_ref call; @@ -2493,6 +2511,28 @@ void _ir_TAILCALL_5(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref _ir_UNREACHABLE(ctx); } +void _ir_TAILCALL_6(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5, ir_ref arg6) +{ + ir_ref call; + + IR_ASSERT(ctx->control); + if (ctx->ret_type == (ir_type)-1) { + ctx->ret_type = type; + } + IR_ASSERT(ctx->ret_type == type && "conflicting return type"); + call = ir_emit_N(ctx, IR_OPT(IR_TAILCALL, type), 8); + ir_set_op(ctx, call, 1, ctx->control); + ir_set_op(ctx, call, 2, func); + ir_set_op(ctx, call, 3, arg1); + ir_set_op(ctx, call, 4, arg2); + ir_set_op(ctx, call, 5, arg3); + ir_set_op(ctx, call, 6, arg4); + ir_set_op(ctx, call, 7, arg5); + ir_set_op(ctx, call, 8, arg6); + ctx->control = call; + _ir_UNREACHABLE(ctx); +} + void _ir_TAILCALL_N(ir_ctx *ctx, ir_type type, ir_ref func, uint32_t count, ir_ref *args) { ir_ref call; diff --git a/ext/opcache/jit/ir/ir_builder.h b/ext/opcache/jit/ir/ir_builder.h index 097c80e048a..0fbdcb3e045 100644 --- a/ext/opcache/jit/ir/ir_builder.h +++ b/ext/opcache/jit/ir/ir_builder.h @@ -514,6 +514,7 @@ extern "C" { #define ir_CALL_3(type, func, a1, a2, a3) _ir_CALL_3(_ir_CTX, type, func, a1, a2, a3) #define ir_CALL_4(type, func, a1, a2, a3, a4) _ir_CALL_4(_ir_CTX, type, func, a1, a2, a3, a4) #define ir_CALL_5(type, func, a1, a2, a3, a4, a5) _ir_CALL_5(_ir_CTX, type, func, a1, a2, a3, a4, a5) +#define ir_CALL_6(type, func, a, b, c, d, e, f) _ir_CALL_6(_ir_CTX, type, func, a, b, c, d, e, f) #define ir_CALL_N(type, func, count, args) _ir_CALL_N(_ir_CTX, type, func, count, args) #define ir_TAILCALL(type, func) _ir_TAILCALL(_ir_CTX, type, func) @@ -522,6 +523,7 @@ extern "C" { #define ir_TAILCALL_3(type, func, a1, a2, a3) _ir_TAILCALL_3(_ir_CTX, type, func, a1, a2, a3) #define ir_TAILCALL_4(type, func, a1, a2, a3, a4) _ir_TAILCALL_4(_ir_CTX, type, func, a1, a2, a3, a4) #define ir_TAILCALL_5(type, func, a1, a2, a3, a4, a5) _ir_TAILCALL_5(_ir_CTX, type, func, a1, a2, a3, a4, a5) +#define ir_TAILCALL_6(type, func, a, b, c, d, e, f) _ir_TAILCALL_6(_ir_CTX, type, func, a, b, c, d, e, f) #define ir_TAILCALL_N(type, func, count, args) _ir_TAILCALL_N(_ir_CTX, type, func, count, args) #define ir_ALLOCA(_size) _ir_ALLOCA(_ir_CTX, (_size)) @@ -636,6 +638,7 @@ ir_ref _ir_CALL_2(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref ar ir_ref _ir_CALL_3(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3); ir_ref _ir_CALL_4(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4); ir_ref _ir_CALL_5(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5); +ir_ref _ir_CALL_6(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5, ir_ref atg6); ir_ref _ir_CALL_N(ir_ctx *ctx, ir_type type, ir_ref func, uint32_t count, ir_ref *args); void _ir_TAILCALL(ir_ctx *ctx, ir_type type, ir_ref func); void _ir_TAILCALL_1(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1); @@ -643,6 +646,7 @@ void _ir_TAILCALL_2(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_re void _ir_TAILCALL_3(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3); void _ir_TAILCALL_4(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4); void _ir_TAILCALL_5(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5); +void _ir_TAILCALL_6(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5, ir_ref arg6); ir_ref _ir_TAILCALL_N(ir_ctx *ctx, ir_type type, ir_ref func, uint32_t count, ir_ref *args); ir_ref _ir_ALLOCA(ir_ctx *ctx, ir_ref size); void _ir_AFREE(ir_ctx *ctx, ir_ref size);