Am 08.05.2012 21:42, schrieb Alexander Graf: > > On 08.05.2012, at 21:29, Andreas Färber wrote: > >> On patch 3/3 he didn't like my alignment macro. I don't have a better >> one though, suggestions or patches welcome. Ideal might be some >> ROUND_TO_ODD() macro, but the problem is that for Darwin/AIX where it's >> no-op it shouldn't result in a "statement without effect" warning. >> Therefore my do { } while (0) as opposed to ir = MACRO(ir). > > static inline int round_reg_i64(int input_reg) > { > #ifdef WHATEVER_CONDITION > if (input_reg % 2) { > reg++; > } > #endif > > return reg; > } > > [...] > > ir = round_reg_i64(ir);
I think he didn't like the mod check either but the suggestion <malc> [...] reg += reg & TCG_TARGET_CALL_ALIGN_ARGS [...] doesn't work well when TCG_TARGET_CALL_ALIGN_ARGS is undefined. And defining it with value 0 seems unsafe to me. What about the following? (untested) static inline int tcg_target_call_align_i64_reg(int reg) { #ifdef TCG_TARGET_CALL_ALIGN_ARGS /* Round up to next odd register */ return (reg & ~1) + 1; #else return reg; #endif } Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg