Hi Alin! On Thu, 31 Jul 2003, Alin Nastac wrote:
> Bogdan Marinca wrote: > > >Hi Alin! > > > >On Thu, 31 Jul 2003, Alin Nastac wrote: > > > > > > > >>http://groups.google.com/groups?q=rorl+x86&start=10&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=359954C9.3B354F0%40cartsys.com&rnum=11 > >> > >>Omu' ala spune ca gcc i-a optimizat codul C > >> > >> n = (n >> b) | (n << (32 - b)); > >> > >>la > >>* rorl* $b, n > >> > >> > > > > > >Merci! > >Nu prea e constanta si o sa folosesc __asm__ . > > > > > Daca la tine b nu e constanta, nu te mai chinui sa folosesti rorl pt ca > din cite imi aduc eu aminte, aceasta instructiune nu se poate folosi > decit cu b constanta. Din fericire se poate. E adevarat ca exista si formatul in care b este un imediat dar el poate fi si registrul CL. " RCL/RCR/ROL/ROR-.Rotate (Continued) Description Shifts (rotates) the bits of the first operand (destination operand) the number of bit positions specified in the second operand (count operand) and stores the result in the destination operand. The destination operand can be a register or a memory location; the count operand is an unsigned integer that can be an immediate or a value in the CL register. The processor restricts the count to a number between 0 and 31 by masking all the bits in the count operand except the 5 leastsignificant bits. " IA-32 Intel� Architecture Software Developer.s Manual, Volume 2: Instruction Set Reference (Order Number 245471), pag. 3-659. > > >Dar chiar e surprinzator ca gcc "se prinde" ca poate optimiza cu un rorl ! > > > E remarcabil intradevar! > > >Bogdan Pai da. Pfui ce compilator bun avem! si stie saracu' si cross-compile asa ca sa vad cine o sa ma oblige sa lucrez pe alta plaforma! :)
