On 05/31/2016 11:39 AM, Pranith Kumar wrote:
+********* Memory Barrier support
+
+* mb <$arg>

Document what $arg should be.

+Generate a target memory barrier instruction to ensure memory ordering as being
+enforced by a corresponding guest memory barrier instruction. The ordering
+enforced by the backend may be stricter than the ordering required by the 
guest.
+It cannot be weaker. This opcode takes an optional constant argument if 
required
+to generate the appropriate barrier instruction. The backend should take care 
to

The argument is *not* optional.

+void tcg_gen_mb(TCGArg a)
+{
+    /* ??? Enable only when MTTCG is enabled.  */
+    tcg_gen_op1(&tcg_ctx, INDEX_op_mb, 0);

Pass A to tcg_gen_op1, not 0.

+/* TCGOpmb args */
+#define TCG_MB_FULL             ((TCGArg)(0))
+#define TCG_MB_READ             ((TCGArg)(1))
+#define TCG_MB_WRITE            ((TCGArg)(2))
+#define TCG_MB_ACQUIRE          ((TCGArg)(3))
+#define TCG_MB_RELEASE          ((TCGArg)(4))

This is, IMO, confused. Either we should use the C++11 barrier types, or the Linux barrier types, but not both.


r~

Reply via email to