On 16.04.19 11:08, Richard Henderson wrote: > On 4/15/19 10:58 PM, David Hildenbrand wrote: >>> You could use >>> >>> tcg_gen_add2_i32(sum, tmp, sum, zero, tmp, zero); >>> tcg_gen_add_i32(sum, sum, tmp); >> That makes perfect sense, I will use that for now, thanks! >> > > Here's a funny one. We can do this in one operation: > > tcg_gen_add2_i32(tmp, sum, sum, sum, tmp, tmp);
:D I had to look at it 10 times. Very nice trick. > > The lower (sum+tmp) carries into the upper (sum+tmp). > We take the upper result and discard the lower. > > > r~ > -- Thanks, David / dhildenb