This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S/390: HW accelerated iconv module for iso-8859-1/cp37 conversions
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 13 Oct 2015 14:07:48 +0200
- Subject: Re: [PATCH] S/390: HW accelerated iconv module for iso-8859-1/cp37 conversions
- Authentication-results: sourceware.org; auth=none
- References: <20090223134953 dot GA1111 at bart> <49DB9D36 dot 2080200 at redhat dot com> <20090415141311 dot GA5673 at bart> <mvma8rnxd99 dot fsf at hawking dot suse dot de> <561CF00A dot 1000003 at linux dot vnet dot ibm dot com>
On 10/13/2015 01:50 PM, Andreas Krebbel wrote:
> On 10/13/2015 12:40 PM, Andreas Schwab wrote:
>> "Andreas Krebbel" <krebbel@linux.vnet.ibm.com> writes:
>>
>>> + asm volatile ("0: \n\t" \
>>> + " troo %0,%1 \n\t" \
>>> + " jz 1f \n\t" \
>>> + " jo 0b \n\t" \
>>> + " llgc %3,0(%1) \n\t" \
>>> + " la %3,0(%3,%4) \n\t" \
>>> + " mvc 0(1,%0),0(%3) \n\t" \
>>> + " aghi %1,1 \n\t" \
>>> + " aghi %0,1 \n\t" \
>>> + " aghi %2,-1 \n\t" \
>>> + " j 0b \n\t" \
>>> + "1: \n" \
>>> + \
>>> + : "+a" (pOutput), "+a" (pInput), "+d" (length), "=&a" (tmp) \
>>
>> That doesn't force %1 to be an even numbered register.
>>
>> ../iconv/loop.c: Assembler messages:
>> ../iconv/loop.c:326: Fatal error: odd numbered general purpose register specified as register pair
>
> Only %0 is required to be a register pair. This is enforced with the register asm definition above:
>
> register unsigned char *pOutput asm ("2") = outptr;
>
> So it looks like GCC is not respecting the register asm in your case?!
GCC can make a copy of the register variable before passing it to the
asm statement. The “+” in the constraint probably encourages that.
You either have to use a more specific constraint which reflects the
register requirements, or if none exists, drop pOutput from the list of
outputs and rely exclusively on the register value for getting data in
and out of the
Florian