Message ID | 52FD6014.8020607@linaro.org |
---|---|
State | Not Applicable |
Headers | show |
On 14/02/14 11:24, Andrew Pinski wrote: > On Thu, Feb 13, 2014 at 4:15 PM, Kugan > <kugan.vivekanandarajah@linaro.org> wrote: >> Hi, >> >> Is there any reason why HFmode is not there in arm_preferred_simd_mode? >> NEON does support this. > > Most likely because there is no support for Half-float in the vectorizer. > I can see that get_vectype_for_scalar_type_and_size failing while building vector type (with build_vector_type) for Half-float. I guess we should add support there first. Thanks, Kugan
On 14/02/14 14:34, Kugan wrote: > > > On 14/02/14 11:24, Andrew Pinski wrote: >> On Thu, Feb 13, 2014 at 4:15 PM, Kugan >> <kugan.vivekanandarajah@linaro.org> wrote: >>> Hi, >>> >>> Is there any reason why HFmode is not there in arm_preferred_simd_mode? >>> NEON does support this. >> >> Most likely because there is no support for Half-float in the vectorizer. >> > > I can see that get_vectype_for_scalar_type_and_size failing while > building vector type (with build_vector_type) for Half-float. I guess we > should add support there first. Just for records, I was wrong here. ARM NEON that supports half float does not support vector arithmetic operations in half float; it supports vector conversions to float and operate on 32bit. Therefore HFmode is not really a preferred mode. And also, gcc vectorizer can support half floats. It is not valid in this case and hence ARM backend does not provide required patterns and hooks. Thanks, Kugan
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index b49f43e..bd90e85 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -28564,6 +28564,10 @@ arm_preferred_simd_mode (enum machine_mode mode) if (TARGET_NEON) switch (mode) { + case HFmode: + if (arm_fp16_format) + return TARGET_NEON_VECTORIZE_DOUBLE ? V4HFmode : V8HFmode; + break; case SFmode: return TARGET_NEON_VECTORIZE_DOUBLE ? V2SFmode : V4SFmode; case SImode: