This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline __isctype no longer available for C++ programs


On Thu, Aug 8, 2013 at 11:17 AM, Ryan S. Arnold <ryan.arnold@gmail.com> wrote:
> On Thu, Aug 8, 2013 at 11:02 AM, Andreas Schwab <schwab@suse.de> wrote:
>> Ryan S Arnold <rsa@linux.vnet.ibm.com> writes:
>>
>>> int is = __isctype('a',_ISupper | _ISalpha);
>>>
>>> rather than:
>>>
>>> int is = isupper(a) | isalpha(a);
>>
>> The compiler should be able to optimize the latter into the former.
>
> Good point.  I'll check the disassembled object files to see if it
> does indeed do this.  If it does there wouldn't really be a need for
> an inlined isctype function.
>
> I imagine this might be complicated by the fact that __isctype_f hides
> references into specification tables, are queried from thread specific
> data.

The GCC compiler does indeed optimize isupper(a) | isalpha(a) to same
instructions seqence as __isctype('a'|_ISupper | _ISalpha).

I think what we have is satisfactory.

Thanks Andreas.

Ryan.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]