From 7655b9e4e9265b817ad103aeb52bb6a302ed445a Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 20 Jul 2019 16:38:42 +0800 Subject: [PATCH] fix build on armv7 again ... --- src/layer/arm/convolution_arm.cpp | 7 +++++++ src/layer/arm/convolutiondepthwise_arm.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/layer/arm/convolution_arm.cpp b/src/layer/arm/convolution_arm.cpp index 39efb4bfc..eda9f719e 100644 --- a/src/layer/arm/convolution_arm.cpp +++ b/src/layer/arm/convolution_arm.cpp @@ -570,10 +570,17 @@ int Convolution_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Option float32x4_t _w2 = vld1q_f32( kptr + 8 ); float32x4_t _w3 = vld1q_f32( kptr + 12 ); +#if __aarch64__ _sum = vmlaq_laneq_f32(_sum, _w0, _val, 0); _sum = vmlaq_laneq_f32(_sum, _w1, _val, 1); _sum = vmlaq_laneq_f32(_sum, _w2, _val, 2); _sum = vmlaq_laneq_f32(_sum, _w3, _val, 3); +#else + _sum = vmlaq_lane_f32(_sum, _w0, vget_low_f32(_val), 0); + _sum = vmlaq_lane_f32(_sum, _w1, vget_low_f32(_val), 1); + _sum = vmlaq_lane_f32(_sum, _w2, vget_high_f32(_val), 0); + _sum = vmlaq_lane_f32(_sum, _w3, vget_high_f32(_val), 1); +#endif kptr += 16; } diff --git a/src/layer/arm/convolutiondepthwise_arm.cpp b/src/layer/arm/convolutiondepthwise_arm.cpp index c22de09e7..f0ccc4d80 100644 --- a/src/layer/arm/convolutiondepthwise_arm.cpp +++ b/src/layer/arm/convolutiondepthwise_arm.cpp @@ -621,10 +621,17 @@ int ConvolutionDepthWise_arm::forward(const Mat& bottom_blob, Mat& top_blob, con float32x4_t _w2 = vld1q_f32( kptr + 8 ); float32x4_t _w3 = vld1q_f32( kptr + 12 ); +#if __aarch64__ _sum = vmlaq_laneq_f32(_sum, _w0, _val, 0); _sum = vmlaq_laneq_f32(_sum, _w1, _val, 1); _sum = vmlaq_laneq_f32(_sum, _w2, _val, 2); _sum = vmlaq_laneq_f32(_sum, _w3, _val, 3); +#else + _sum = vmlaq_lane_f32(_sum, _w0, vget_low_f32(_val), 0); + _sum = vmlaq_lane_f32(_sum, _w1, vget_low_f32(_val), 1); + _sum = vmlaq_lane_f32(_sum, _w2, vget_high_f32(_val), 0); + _sum = vmlaq_lane_f32(_sum, _w3, vget_high_f32(_val), 1); +#endif kptr += 16; }