[Bug c/53124] New: Arm NEON narrowing right shift instructions impose incorrect operand bounds (intrinsic and asm)
ksebov at rim dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 25 19:57:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53124
Bug #: 53124
Summary: Arm NEON narrowing right shift instructions impose
incorrect operand bounds (intrinsic and asm)
Classification: Unclassified
Product: gcc
Version: 4.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ksebov@rim.com
The following code produces "Constant out of range" compiler error, even though
it's supposed to allow any immediate up to (size(datatype) - 1), or 31 in this
case. See
http://infocenter.arm.com/help/topic/com.arm.doc.dui0489c/CIHGJIHA.html
Using inline assembly implementation doesn't work either resulting in "Error:
immediate out of range for narrowing operation".
int16x4_t rshift8_and_saturate_uint12( int32x4_t arg )
{
uint32x4_t saturated_at32 = vqshluq_n_s32( arg, 32-(8+12) );
#if 1
return vshrn_n_s32( vreinterpretq_s32_u32( saturated_at32 ), 32-12 );
#else
int16x4_t result;
asm volatile( "VSHRN.I32 %P0, %q1, #20" : "=w"(result) :
"w"(saturated_at32));
return result;
#endif
}
It appears similar to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41196
although in this case the ssembler code will probably need to be fixed as well.
Also, by looking at /gcc/config/arm/neon.md it seems all V[Q]SHR[U]N are
affected.
More information about the Gcc-bugs
mailing list