xref: /aosp_15_r20/external/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack/src/requantization/runtime-neon.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 /*
2  * Copyright (c) Facebook, Inc. and its affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
11 #include <arm_neon.h>
12 
13 PYTORCH_QNNP_INLINE uint16x8_t
sub_zero_point(const uint8x8_t va,const uint8x8_t vzp)14 sub_zero_point(const uint8x8_t va, const uint8x8_t vzp) {
15 #if PYTORCH_QNNPACK_RUNTIME_QUANTIZATION
16   // Run-time quantization
17   return vsubl_u8(va, vzp);
18 #else
19   // Design-time quantization
20   return vmovl_u8(va);
21 #endif
22 }
23