On 18/06/2016 06:03, Pranith Kumar wrote: > +typedef enum { > + TCG_MO_LD_LD = 1, > + TCG_MO_ST_LD = 2, > + TCG_MO_LD_ST = 4, > + TCG_MO_ST_ST = 8,
I like the idea of making this a bitmask. However, most of the code you wrote for the backends looks at these as an enum. For example, +static inline void tcg_out_mb(TCGContext *s, TCGArg a0) +{ + switch (a0 & TCG_MO_ALL) { + case TCG_MO_LD_LD: + tcg_out32(s, DMB_ISH | DMB_LD); + break; + case TCG_MO_ST_ST: + tcg_out32(s, DMB_ISH | DMB_ST); + break; + default: + tcg_out32(s, DMB_ISH | DMB_LD | DMB_ST); + break; + } +} should rather be if (a0 & (ST_LD|LD_ST)) { output dmb ish return } if (a0 & LD_LD) { output dmb ishld } if (a0 & LD_ST) { output dmb ishst } Paolo > + TCG_MO_ALL = 0xF, // OR of all above > +} TCGOrder; > + > +typedef enum { > + TCG_BAR_ACQ = 32, > + TCG_BAR_REL = 64, > + TCG_BAR_SC = 128, > +} TCGBar;