Sure. Basically a C function prototyped as ffs64(uint64_t val) cannot tell whether val started out as a char or a doubleword. (It could with overloads but let's not go there.)
The fact that an "MSB-based" ffs64() would return 57 for unsigned char foo = 0x40; int bar = ffs64(foo) is a little counterintuitive. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of retired mainframer Sent: Wednesday, July 24, 2013 10:09 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Is there a "reverse bits" hardware instruction? 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. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN