summaryrefslogtreecommitdiff
path: root/tcg/x86_64
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-11 14:35:37 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-11 14:35:37 +0000
commit390efc54fb87e91ac9aeb47a7bc23806452b30cb (patch)
tree41e310b3e5a4a571bbb40a6995d2085a1ef26987 /tcg/x86_64
parent44cd42ee4082813cc4b45117bbb6156920957e47 (diff)
downloadqemu-390efc54fb87e91ac9aeb47a7bc23806452b30cb.tar.gz
Add TCG native negation op.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4426 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg/x86_64')
-rw-r--r--tcg/x86_64/tcg-target.c10
-rw-r--r--tcg/x86_64/tcg-target.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/tcg/x86_64/tcg-target.c b/tcg/x86_64/tcg-target.c
index f11bc669f2..7197f401c5 100644
--- a/tcg/x86_64/tcg-target.c
+++ b/tcg/x86_64/tcg-target.c
@@ -1092,6 +1092,13 @@ static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args,
tcg_out_opc(s, (0xc8 + (args[0] & 7)) | P_EXT | P_REXW, 0, args[0], 0);
break;
+ case INDEX_op_neg_i32:
+ tcg_out_modrm(s, 0xf7, 3, args[0]);
+ break;
+ case INDEX_op_neg_i64:
+ tcg_out_modrm(s, 0xf7 | P_REXW, 3, args[0]);
+ break;
+
case INDEX_op_qemu_ld8u:
tcg_out_qemu_ld(s, args, 0);
break;
@@ -1247,6 +1254,9 @@ static const TCGTargetOpDef x86_64_op_defs[] = {
{ INDEX_op_bswap_i32, { "r", "0" } },
{ INDEX_op_bswap_i64, { "r", "0" } },
+ { INDEX_op_neg_i32, { "r", "0" } },
+ { INDEX_op_neg_i64, { "r", "0" } },
+
{ INDEX_op_qemu_ld8u, { "r", "L" } },
{ INDEX_op_qemu_ld8s, { "r", "L" } },
{ INDEX_op_qemu_ld16u, { "r", "L" } },
diff --git a/tcg/x86_64/tcg-target.h b/tcg/x86_64/tcg-target.h
index c8421f7f03..cdb66a5840 100644
--- a/tcg/x86_64/tcg-target.h
+++ b/tcg/x86_64/tcg-target.h
@@ -57,6 +57,8 @@ enum {
/* optional instructions */
#define TCG_TARGET_HAS_bswap_i32
#define TCG_TARGET_HAS_bswap_i64
+#define TCG_TARGET_HAS_neg_i32
+#define TCG_TARGET_HAS_neg_i64
/* Note: must be synced with dyngen-exec.h */
#define TCG_AREG0 TCG_REG_R14