Could you please expand a little on how the position of the least
significant one bit affects integer promotion.  If the low order five bits
of a short are zero, won't the low order five bits of the corresponding int
be zero?  For that matter, even the position of the most significant one bit
shouldn't affect promotion since the promoted type is guaranteed to be at
least as large as the original type.

:>: -----Original Message-----
:>: From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
:>: Behalf Of Charles Mills
:>: Sent: Tuesday, July 23, 2013 2:49 PM
:>: To: IBM-MAIN@LISTSERV.UA.EDU
:>: Subject: Is there a "reverse bits" hardware instruction?

<snip>

:>: 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. I could
:>: potentially
:>: live with that but it would introduce some new complications, one of
:>: them
:>: being that counting from the LSB is much more compatible with how C
:>: promotes
:>: integer types. If I could flip the bits of a word in one or two hardware

<snip>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to