Closed asl closed 15 years ago
This code (from the gcc testsuite) is a bad test. Only the low byte of the result is relevant (and not even that since the value is dead), so it doesn't matter whether llvm selects vmov.s8 or vmov.u8 in this case. I tried changing the code to return the value as a signed int, and we correctly generate vmov.s8. I don't think there is a bug here.
Extended Description
Consider the following code:
include "arm_neon.h"
void test_vget_lanes8 (void) { int8_t out_int8_t; int8x8_t arg0_int8x8_t;
out_int8_t = vget_lane_s8 (arg0_int8x8_t, 1); }
We're emitting invalid vmov.u8 here (in -O0) since the information about zero/sign extension is lost during frontend expansion.
Out current approach of deciding whether we need to do sign/zero extension is pretty fragile (based on DAG combiner hook), we really need to use an intrinsic to catch this behaviour for i8/i16.