aboutsummaryrefslogtreecommitdiffhomepage
path: root/gen/gen_code.cpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2024-10-08 15:04:14 +0900
committerMITSUNARI Shigeo <[email protected]>2024-10-08 15:04:14 +0900
commitcdaa396d7a421a11c2700670cf5adcc4f7b7c7ed (patch)
tree8685325517f1010c9cb465c08edd0b27fe6d9887 /gen/gen_code.cpp
parent4babe05d8ede40d9ffe6085c04d146b78f1daa9e (diff)
downloadxbyak-cdaa396d7a421a11c2700670cf5adcc4f7b7c7ed.tar.gz
xbyak-cdaa396d7a421a11c2700670cf5adcc4f7b7c7ed.zip
[fix] v{and,andn,or,xor} does not support {er}. v{max,min} support not {er} but {sae}
Diffstat (limited to 'gen/gen_code.cpp')
-rw-r--r--gen/gen_code.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp
index a3b5437..ad6806b 100644
--- a/gen/gen_code.cpp
+++ b/gen/gen_code.cpp
@@ -1308,25 +1308,32 @@ void put()
uint8_t code;
const char *name;
bool only_pd_ps;
+ int mode; // 0 : none, 1 : er, 2 : sae
} tbl[] = {
- { 0x58, "add", false },
- { 0x5C, "sub", false },
- { 0x59, "mul", false },
- { 0x5E, "div", false },
- { 0x5F, "max", false },
- { 0x5D, "min", false },
- { 0x54, "and", true },
- { 0x55, "andn", true },
- { 0x56, "or", true },
- { 0x57, "xor", true },
+ { 0x58, "add", false, 1 },
+ { 0x5C, "sub", false, 1 },
+ { 0x59, "mul", false, 1 },
+ { 0x5E, "div", false, 1 },
+ { 0x5F, "max", false, 2 },
+ { 0x5D, "min", false, 2 },
+ { 0x54, "and", true, 0 },
+ { 0x55, "andn", true, 0 },
+ { 0x56, "or", true, 0 },
+ { 0x57, "xor", true, 0 },
+ };
+ const char *xTbl[] = {
+ "", " | T_ER_X", " | T_SAE_X"
+ };
+ const char *zTbl[] = {
+ "", " | T_ER_Z", " | T_SAE_Z"
};
for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) {
const Tbl *p = &tbl[i];
- printf("void v%spd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_66 | T_EW1 | T_YMM | T_EVEX | T_ER_Z | T_B64, 0x%02X); }\n", p->name, p->code);
- printf("void v%sps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_EW0 | T_YMM | T_EVEX | T_ER_Z | T_B32, 0x%02X); }\n", p->name, p->code);
+ printf("void v%spd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_66 | T_EW1 | T_YMM | T_EVEX%s | T_B64, 0x%02X); }\n", p->name, zTbl[p->mode], p->code);
+ printf("void v%sps(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_EW0 | T_YMM | T_EVEX%s | T_B32, 0x%02X); }\n", p->name, zTbl[p->mode], p->code);
if (p->only_pd_ps) continue;
- printf("void v%ssd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F2 | T_EW1 | T_EVEX | T_ER_X | T_N8, 0x%02X); }\n", p->name, p->code);
- printf("void v%sss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F3 | T_EW0 | T_EVEX | T_ER_X | T_N4, 0x%02X); }\n", p->name, p->code);
+ printf("void v%ssd(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F2 | T_EW1 | T_EVEX%s | T_N8, 0x%02X); }\n", p->name, xTbl[p->mode], p->code);
+ printf("void v%sss(const Xmm& xmm, const Operand& op1, const Operand& op2 = Operand()) { opAVX_X_X_XM(xmm, op1, op2, T_0F | T_F3 | T_EW0 | T_EVEX%s | T_N4, 0x%02X); }\n", p->name, xTbl[p->mode], p->code);
}
}
putX_X_XM(false);