aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cc_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-01-23 18:17:33 -0800
committerRichard Henderson <rth@twiddle.net>2013-02-19 23:05:18 -0800
commitcd7f97cafdd80d6bd4950ccfdcd9acb7850184b2 (patch)
tree92ee2c5da0c290d7b1fd967c432eed58963319d7 /target-i386/cc_helper.c
parente2c3c2c551bccd843135eab1ba202f8d2f86800b (diff)
target-i386: Implement ADX extension
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-i386/cc_helper.c')
-rw-r--r--target-i386/cc_helper.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/target-i386/cc_helper.c b/target-i386/cc_helper.c
index 5ea6a0aeae..6cf57a76b3 100644
--- a/target-i386/cc_helper.c
+++ b/target-i386/cc_helper.c
@@ -75,6 +75,24 @@ const uint8_t parity_table[256] = {
#endif
+static target_ulong compute_all_adcx(target_ulong dst, target_ulong src1,
+ target_ulong src2)
+{
+ return (src1 & ~CC_C) | (dst * CC_C);
+}
+
+static target_ulong compute_all_adox(target_ulong dst, target_ulong src1,
+ target_ulong src2)
+{
+ return (src1 & ~CC_O) | (src2 * CC_O);
+}
+
+static target_ulong compute_all_adcox(target_ulong dst, target_ulong src1,
+ target_ulong src2)
+{
+ return (src1 & ~(CC_C | CC_O)) | (dst * CC_C) | (src2 * CC_O);
+}
+
target_ulong helper_cc_compute_all(target_ulong dst, target_ulong src1,
target_ulong src2, int op)
{
@@ -162,6 +180,13 @@ target_ulong helper_cc_compute_all(target_ulong dst, target_ulong src1,
case CC_OP_BMILGL:
return compute_all_bmilgl(dst, src1);
+ case CC_OP_ADCX:
+ return compute_all_adcx(dst, src1, src2);
+ case CC_OP_ADOX:
+ return compute_all_adox(dst, src1, src2);
+ case CC_OP_ADCOX:
+ return compute_all_adcox(dst, src1, src2);
+
#ifdef TARGET_X86_64
case CC_OP_MULQ:
return compute_all_mulq(dst, src1);
@@ -210,6 +235,7 @@ target_ulong helper_cc_compute_c(target_ulong dst, target_ulong src1,
case CC_OP_SARW:
case CC_OP_SARL:
case CC_OP_SARQ:
+ case CC_OP_ADOX:
return src1 & 1;
case CC_OP_INCB:
@@ -228,6 +254,10 @@ target_ulong helper_cc_compute_c(target_ulong dst, target_ulong src1,
case CC_OP_MULQ:
return src1 != 0;
+ case CC_OP_ADCX:
+ case CC_OP_ADCOX:
+ return dst;
+
case CC_OP_ADDB:
return compute_c_addb(dst, src1);
case CC_OP_ADDW: