From 03e29e2fa5f78469aa85a8607407059413daea4d Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Thu, 9 Apr 2026 07:53:13 -0500 Subject: [PATCH] teflon: Add minimum and maximum operations Add the plumbing for minimum and maximum operations. Signed-off-by: Rob Herring (Arm) Part-of: --- src/gallium/frontends/teflon/tfl_device.c | 16 ++++++++++++++++ src/gallium/include/pipe/p_state.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/gallium/frontends/teflon/tfl_device.c b/src/gallium/frontends/teflon/tfl_device.c index 0d7153d1877..012dfacd74f 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -182,6 +182,12 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi } break; } + case kTfLiteBuiltinMaximum: + operation->type = PIPE_ML_OPERATION_TYPE_MAXIMUM; + break; + case kTfLiteBuiltinMinimum: + operation->type = PIPE_ML_OPERATION_TYPE_MINIMUM; + break; case kTfLiteBuiltinMul: operation->type = PIPE_ML_OPERATION_TYPE_MUL; break; @@ -515,6 +521,12 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op case PIPE_ML_OPERATION_TYPE_RESIZE: teflon_debug("%-15s ", "RESIZE"); break; + case PIPE_ML_OPERATION_TYPE_MAXIMUM: + teflon_debug("%-15s ", "MAX"); + break; + case PIPE_ML_OPERATION_TYPE_MINIMUM: + teflon_debug("%-15s ", "MIN"); + break; case PIPE_ML_OPERATION_TYPE_MUL: teflon_debug("%-15s ", "MUL"); break; @@ -723,6 +735,10 @@ tflite_builtin_op_name(TfLiteBuiltinOperator op) return "DEQUANT"; case kTfLiteBuiltinHardSwish: return "HSWISH"; + case kTfLiteBuiltinMaximum: + return "MAX"; + case kTfLiteBuiltinMinimum: + return "MIN"; case kTfLiteBuiltinMul: return "MUL"; case kTfLiteBuiltinPad: diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 3e2224d24e4..cbce129eea2 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -1070,6 +1070,8 @@ enum pipe_ml_operation_type { PIPE_ML_OPERATION_TYPE_MUL, PIPE_ML_OPERATION_TYPE_LEAKY_RELU, PIPE_ML_OPERATION_TYPE_QUANTIZE, + PIPE_ML_OPERATION_TYPE_MAXIMUM, + PIPE_ML_OPERATION_TYPE_MINIMUM, }; enum pipe_ml_pooling_type {