On Tue, 8 May 2012, Andreas F?rber wrote:

> 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)

I'd much rather have the ifdefery scattered around the code than
having to remember what this function does, but that's just me,
not hard bent on it..

-- 
mailto:av1...@comtv.ru

Reply via email to