On Tue, 23 Jul 2013 17:49:00 -0400, Charles Mills wrote: > >Why? Those of you following another thread I started know I am looking to >implement a 64-bit version of the UNIX library function ffs(), which returns >the bit number of the least significant one bit of a word. z architecture >provides the FLOGR instruction but it works MSB to LSB. > Subtract 1. XOR with the original value. The leftmost 1 bit of the result now occupies the position of the rightmost 1 bit of the original value AND with the original value yields the mask to reset that bit.
Zero must be treated as a special case. --gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN