From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clive Davies To: "'Shaun Jackman'" , crossgcc@sources.redhat.com Cc: sdj@sfu.ca Subject: RE: ARM instructions -- CLZ Date: Sun, 19 Nov 2000 23:42:00 -0000 Message-id: <82B1591A280FD411B91200D0B75B484A9D0A14@sis-uk-msg01.altera.com> X-SW-Source: 2000-11/msg00065.html 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