From: Avi Kivity on 2 Dec 2009 09:20 On 12/02/2009 04:06 PM, Jan Beulich wrote: >>>> Ingo Molnar<mingo(a)elte.hu> 02.12.09 14:29>>> >>>> >> at first quick sight, this bit looks odd: >> >> + union { int i; bool b; } new; >> >> + return new.b; >> >> shouldnt that be short based, to work correctly in the 0-255 CPUs case? >> > No, I can't see why. In both instances, we're using (and had been > using previously, just with the added movzbl) the outcome of a > setCC instruction, which produces valid bool (single byte) values. > It is precisely that reason why I needed to introduce these unions, > since the upper bytes of the register aren't valid (and shouldn't be > looked at by the caller). > > Wouldn't 'u8 ret', as an additional argument be sufficient? gcc still ought to be able to use the same register for new and ret if we remove the early clobber. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Avi Kivity on 2 Dec 2009 09:40 On 12/02/2009 04:25 PM, Jan Beulich wrote: >>>> Avi Kivity<avi(a)redhat.com> 02.12.09 15:12>>> >>>> >> Wouldn't 'u8 ret', as an additional argument be sufficient? gcc still >> ought to be able to use the same register for new and ret if we remove >> the early clobber. >> > We can't (validly) remove the early-clobber, otherwise the compiler > would be permitted to use a register also used for addressing the lock > structure for "new". > I meant for 'ret'. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: Fat64 / exFat fs and Linux Next: copy_signal cleanup: clean tty_audit_fork() |