This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128
- From: Richard Henderson <rth at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 22 Apr 2014 08:58:25 -0700
- Subject: Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128
On 04/22/2014 08:52 AM, Josh Stone wrote:
> The trick in the original was that "(typeof (var)) __s.i" would extend
> the sign from the 7th bit, which I don't your mask will do.
Yes, that was another cut/paste error.
Not a great batting average this morning... ;-)
> So in total:
>
> struct { signed int i:7; } __s = { .i = __b };
> (var) |= (typeof (var)) __s.i * ((typeof (var)) 1 << ((nth) * 7));
>
> Better?
Yes, that's what I had in mind.
r~