diff mbox series

[for-4.0,v2,05/37] tcg/i386: Add constraints for r8 and r9

Message ID 20181123144558.5048-6-richard.henderson@linaro.org
State New
Headers show
Series tcg: Assorted cleanups | expand

Commit Message

Richard Henderson Nov. 23, 2018, 2:45 p.m. UTC
These are function call arguments for x86_64 we will need soon.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/i386/tcg-target.inc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.17.2

Comments

Alex Bennée Nov. 29, 2018, 3 p.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> These are function call arguments for x86_64 we will need soon.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  tcg/i386/tcg-target.inc.c | 8 ++++++++

>  1 file changed, 8 insertions(+)

>

> diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c

> index 4f66a0c5ae..8aef66e430 100644

> --- a/tcg/i386/tcg-target.inc.c

> +++ b/tcg/i386/tcg-target.inc.c

> @@ -233,6 +233,14 @@ static const char *target_parse_constraint(TCGArgConstraint *ct,

>          ct->ct |= TCG_CT_REG;

>          tcg_regset_set_reg(ct->u.regs, TCG_REG_EDI);

>          break;

> +    case 'E': /* "Eight", r8 */

> +        ct->ct |= TCG_CT_REG;

> +        tcg_regset_set_reg(ct->u.regs, TCG_REG_R8);

> +        break;

> +    case 'N': /* "Nine", r9 */

> +        ct->ct |= TCG_CT_REG;

> +        tcg_regset_set_reg(ct->u.regs, TCG_REG_R9);

> +        break;


I would be nice to flesh out the missing comments in tcg.h:

#define TCG_CT_ALIAS  0x80
#define TCG_CT_IALIAS 0x40
#define TCG_CT_NEWREG 0x20 /* output requires a new register */
#define TCG_CT_REG    0x01
#define TCG_CT_CONST  0x02 /* any constant of register size */

Anyway:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


>      case 'q':

>          /* A register that can be used as a byte operand.  */

>          ct->ct |= TCG_CT_REG;



--
Alex Bennée
diff mbox series

Patch

diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c
index 4f66a0c5ae..8aef66e430 100644
--- a/tcg/i386/tcg-target.inc.c
+++ b/tcg/i386/tcg-target.inc.c
@@ -233,6 +233,14 @@  static const char *target_parse_constraint(TCGArgConstraint *ct,
         ct->ct |= TCG_CT_REG;
         tcg_regset_set_reg(ct->u.regs, TCG_REG_EDI);
         break;
+    case 'E': /* "Eight", r8 */
+        ct->ct |= TCG_CT_REG;
+        tcg_regset_set_reg(ct->u.regs, TCG_REG_R8);
+        break;
+    case 'N': /* "Nine", r9 */
+        ct->ct |= TCG_CT_REG;
+        tcg_regset_set_reg(ct->u.regs, TCG_REG_R9);
+        break;
     case 'q':
         /* A register that can be used as a byte operand.  */
         ct->ct |= TCG_CT_REG;