11/*
2- * Copyright (C) 2010-2022 Arm Limited or its affiliates.
2+ * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/ or its affiliates <open-source-office@arm.com>
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 *
2121 * Title: arm_max_pool_s8.c
2222 * Description: Pooling function implementations
2323 *
24- * $Date: 19 April 2022
25- * $Revision: V.3.0.0
24+ * $Date: 16 August 2022
25+ * $Revision: V.3.0.1
2626 *
2727 * Target Processor: Cortex-M CPUs
2828 *
@@ -40,7 +40,7 @@ static void compare_and_replace_if_larger_q7(q7_t *base, const q7_t *target, int
4040 mve_pred16_t p = vctp8q ((uint32_t )length );
4141 const int8x16_t op_1 = vldrbq_z_s8 (base , p );
4242 const int8x16_t op_2 = vldrbq_z_s8 (target , p );
43- const int8x16_t max = vmaxq_m_s8 ( vuninitializedq_s8 (), op_1 , op_2 , p );
43+ const int8x16_t max = vmaxq_x_s8 ( op_1 , op_2 , p );
4444 vstrbq_p_s8 (base , max , p );
4545 base += 16 ;
4646 target += 16 ;
@@ -98,15 +98,16 @@ static void clamp_output(q7_t *source, int32_t length, const int32_t act_min, co
9898{
9999#if defined(ARM_MATH_MVEI )
100100 int32_t loop_count = (length + 15 ) / 16 ;
101+ const int8x16_t vmin = vdupq_n_s8 ((int8_t )act_min );
102+ const int8x16_t vmax = vdupq_n_s8 ((int8_t )act_max );
103+
101104 for (int i = 0 ; i < loop_count ; i ++ )
102105 {
103106 mve_pred16_t p = vctp8q ((uint32_t )length );
104107 length -= 16 ;
105108 const int8x16_t src = vldrbq_z_s8 (source , p );
106- const int8x16_t predicated_min = vdupq_m_n_s8 (vuninitializedq_s8 (), (int8_t )act_min , p );
107- const int8x16_t predicated_max = vdupq_m_n_s8 (vuninitializedq_s8 (), (int8_t )act_max , p );
108- int8x16_t res = vmaxq_m_s8 (vuninitializedq_s8 (), src , predicated_min , p );
109- res = vminq_m_s8 (vuninitializedq_s8 (), res , predicated_max , p );
109+ int8x16_t res = vmaxq_x_s8 (src , vmin , p );
110+ res = vminq_x_s8 (res , vmax , p );
110111 vstrbq_p_s8 (source , res , p );
111112 source += 16 ;
112113 }
0 commit comments