From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Earnshaw To: Clive Davies Cc: rearnsha@arm.com Subject: Re: ARM instructions -- CLZ Date: Mon, 20 Nov 2000 02:09:00 -0000 Message-id: <200011201009.KAA15442@cam-mail2.cambridge.arm.com> References: <82B1591A280FD411B91200D0B75B484A9D0A14@sis-uk-msg01.altera.com> X-SW-Source: 2000-11/msg00068.html Not quite. CLZ is part of the Architecture v5 extensions to the ARM. It will be added when v5 support goes in. Note, the arm7tdmi is architecture v4, so won't have CLZ. Richard. > clz is not an ARM instruction, so it won't be supported. > > Clive > > > -----Original Message----- > > From: Shaun Jackman [ mailto:sjackman@pathwayconnect.com ] > > Sent: 17 November 2000 19:07 > > To: crossgcc@sources.redhat.com > > Cc: sdj@sfu.ca > > Subject: ARM instructions -- CLZ > > > > > > Does binutils support the ARM CLZ instruction? > > I have an arm7tdmi and am compiling with -mcpu-arm7tdmi. > > > > This is the macro I'm using... > > > > #define count_leading_zeroes(a) \ > > ({ uint32 __value, __arg = (a); \ > > asm ("clz\t%0, %1": "=r" (__value): "r" (__arg)); \ > > __value; }) > > > > and the C is... > > > > unsigned count = count_leading_zeroes( num); > > > > which produces the proper assembler (in the .s file compiling with -S) > > clz r2, r3 > > (which makes sense in context) > > > > Unfortunately, it's a big crash and burn. > > /tmp/ccQbzMp6.s: Assembler messages: > > /tmp/ccQbzMp6.s:17: Error: bad instruction `clz r2,r3' > > > > Any thoughts? > > > > Thanks, > > Shaun Jackman > > > > > > ------ > > Want more information? See the CrossGCC FAQ, > http://www.objsw.com/CrossGCC/ > Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com > > ------ > Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ > Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com > ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com