llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.65k stars 11.84k forks source link

Information about the sign is lost for some NEON intrinsics #5205

Closed asl closed 15 years ago

asl commented 15 years ago
Bugzilla Link 4833
Resolution INVALID
Resolved on Aug 31, 2009 13:17
Version trunk
OS Linux

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.

llvmbot commented 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.