Hi!
On 26.01.2011 02:40, Michael Hope wrote:
On Wed, Jan 26, 2011 at 3:54 AM, Peter Maydell peter.maydell@linaro.org wrote:
Christophe Lyon from ST has kindly released a large set of test cases of Neon intrinsics: http://gitorious.org/arm-neon-tests/arm-neon-tests
For the record, these tests aim at being exhaustive in the sense that: - each intrinsic variant is called - when there are corner cases to be expected, each intrinsics is called multiple times with different values. I am not sure the tests are readable enough for this to be obvious :-)
Note that they test only valid combinations (when parameters have mandatory ranges, armcc refuses to compile if the effective parameter is out of the range). It means that the tests could be enhanced in this respect, to make sure that GCC behaves correctly when fed with illegal parameters.
Obviously, I may have missed some corner cases :-)
# The tests currently fail to build with GCC/ARM: # - no support for Neon_Overflow/fpsrc register # - ICE when compiling ref_vldX.c, ref_vldX_lane.c, ref_vstX_lane.c
gcc-linaro-2011.01 no longer ICEs.
Good news! Indeed I only tested with the latest 2010 Linaro release.
# - fails to compile vst1_lane.c
The particular error is:
Cool, my README has been clear enough for you to rebuild ;-)
In file included from ref_vst1_lane.c:27:0: .../4.5.2/include/arm_neon.h: In function 'exec_vst1_lane': .../4.5.2/include/arm_neon.h:8424:33: error: argument must be a constant .../4.5.2/include/arm_neon.h:8448:33: error: argument must be a constant
A bit of bisection shows that these two lines:
TEST_VST1_LANE(q, int, s, 8, 16, 15); TEST_VST1_LANE(q, uint, u, 8, 16, 10);
are the cause. The other, similar lines are fine.
To save you some time, these 2 lines invoke the vst1q_lane_s8 with lane==15 and vst1q_lane_u8 with lane==10. I have tried lower values, and the test then compiles OK. However the prototypes are: vst1q_lane_s8 (int8_t * __a, int8x16_t __b, const int __c) vst1q_lane_u8 (uint8_t * __a, uint8x16_t __b, const int __c)
This makes me think that somewhere GCC knows that 'c' has a validity range, but this is hidden from the end-user.
ARM's armcc has such decorations: __is_constrange(0,15,lane)
# - missing include files: dspfns.h, armdsp.h
dspfns.h is: https://bugs.launchpad.net/gcc-linaro/+bug/625256
armdsp.h isn't tracked anywhere. Both of these are ARM specific and we should talk about it on Monday.
Although not exactly related to Neon, I may also mention that some ARM intrinsics are missing from GCC, such as __ssat, __usat (I have recently fixed bugs in qemu related to these two, which I discovered thanks to my tests). The list of missing intrinsics includes: __clz __qadd __qdbl __qsub __rbit __rev __ssat __usat
Maybe it's worth somebody having a look at this, at least enough to find out whether the ICEs are things we already know about or have perhaps already fixed in linaro gcc?
Richard Sandiford, could you have a look at the vst1_lane faults?
I hope I have provided info to save you some time investigating. We can have a look here too.
Christophe.