diff mbox series

[for-4.0,v2,10/37] tcg/aarch64: Add constraints for x0, x1, x2

Message ID 20181123144558.5048-11-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 that we will need soon.

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

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

-- 
2.17.2

Comments

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

> These are function call arguments that we will need soon.

>

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


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


> ---

>  tcg/aarch64/tcg-target.inc.c | 12 ++++++++++++

>  1 file changed, 12 insertions(+)

>

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

> index 30091f6a69..148de0b7f2 100644

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

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

> @@ -125,6 +125,18 @@ static const char *target_parse_constraint(TCGArgConstraint *ct,

>                                             const char *ct_str, TCGType type)

>  {

>      switch (*ct_str++) {

> +    case 'a': /* x0 */

> +        ct->ct |= TCG_CT_REG;

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

> +        break;

> +    case 'b': /* x1 */

> +        ct->ct |= TCG_CT_REG;

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

> +        break;

> +    case 'c': /* x2 */

> +        ct->ct |= TCG_CT_REG;

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

> +        break;

>      case 'r': /* general registers */

>          ct->ct |= TCG_CT_REG;

>          ct->u.regs |= 0xffffffffu;



--
Alex Bennée
diff mbox series

Patch

diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c
index 30091f6a69..148de0b7f2 100644
--- a/tcg/aarch64/tcg-target.inc.c
+++ b/tcg/aarch64/tcg-target.inc.c
@@ -125,6 +125,18 @@  static const char *target_parse_constraint(TCGArgConstraint *ct,
                                            const char *ct_str, TCGType type)
 {
     switch (*ct_str++) {
+    case 'a': /* x0 */
+        ct->ct |= TCG_CT_REG;
+        tcg_regset_set_reg(ct->u.regs, TCG_REG_X0);
+        break;
+    case 'b': /* x1 */
+        ct->ct |= TCG_CT_REG;
+        tcg_regset_set_reg(ct->u.regs, TCG_REG_X1);
+        break;
+    case 'c': /* x2 */
+        ct->ct |= TCG_CT_REG;
+        tcg_regset_set_reg(ct->u.regs, TCG_REG_X2);
+        break;
     case 'r': /* general registers */
         ct->ct |= TCG_CT_REG;
         ct->u.regs |= 0xffffffffu;