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

Richard Henderson posted 37 patches 7 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [PATCH for-4.0 v2 05/37] tcg/i386: Add constraints for r8 and r9
Posted by Richard Henderson 7 years, 2 months ago
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;
     case 'q':
         /* A register that can be used as a byte operand.  */
         ct->ct |= TCG_CT_REG;
-- 
2.17.2


Re: [Qemu-devel] [PATCH for-4.0 v2 05/37] tcg/i386: Add constraints for r8 and r9
Posted by Alex Bennée 7 years, 2 months ago
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