diff options
author | MITSUNARI Shigeo <[email protected]> | 2015-09-14 16:04:30 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2015-09-14 16:06:29 +0900 |
commit | 9979094c3fc063e71d9767485d5f7ff9333912c4 (patch) | |
tree | 328db00ad8b6b784c3238fe25dc85c86fb994f07 | |
parent | 8c9059fbd7832dde605e09f4b19a418a497f44d3 (diff) | |
download | xbyak-9979094c3fc063e71d9767485d5f7ff9333912c4.tar.gz xbyak-9979094c3fc063e71d9767485d5f7ff9333912c4.zip |
disable warning for VC2015
-rw-r--r-- | test/make_nm.cpp | 171 | ||||
-rw-r--r-- | xbyak/xbyak.h | 12 |
2 files changed, 95 insertions, 88 deletions
diff --git a/test/make_nm.cpp b/test/make_nm.cpp index d0a932f..c7b9397 100644 --- a/test/make_nm.cpp +++ b/test/make_nm.cpp @@ -814,35 +814,37 @@ class Test { void putReg1() const { // (REG, REG|MEM) - static const char tbl[][16] = { - "adc", - "add", - "and", - "cmp", - "or", - "sbb", - "sub", - "xor", - }; - for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { - const char *p = tbl[i]; - put(p, REG32, REG32|MEM); - put(p, REG64, REG64|MEM); - put(p, REG16, REG16|MEM); - put(p, REG8|REG8_3, REG8|MEM); - put(p, MEM, REG32e|REG16|REG8|REG8_3); - - put(p, MEM8, IMM8|NEG8); - put(p, MEM16, IMM8|IMM16|NEG8|NEG16); - put(p, MEM32, IMM8|IMM32|NEG8|NEG32); - - put(p, REG64|RAX, IMM8|NEG8); - put(p, REG64|RAX, "0x12345678", "0x12345678"); - put(p, REG64|RAX, "192", "192"); - put(p, REG64|RAX, "0x1234", "0x1234"); - put(p, REG32|EAX, IMM8|IMM32|NEG8); - put(p, REG16|AX, IMM8|IMM16|NEG8|NEG16); - put(p, REG8|REG8_3|AL, IMM|NEG8); + { + static const char tbl[][16] = { + "adc", + "add", + "and", + "cmp", + "or", + "sbb", + "sub", + "xor", + }; + for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { + const char *p = tbl[i]; + put(p, REG32, REG32|MEM); + put(p, REG64, REG64|MEM); + put(p, REG16, REG16|MEM); + put(p, REG8|REG8_3, REG8|MEM); + put(p, MEM, REG32e|REG16|REG8|REG8_3); + + put(p, MEM8, IMM8|NEG8); + put(p, MEM16, IMM8|IMM16|NEG8|NEG16); + put(p, MEM32, IMM8|IMM32|NEG8|NEG32); + + put(p, REG64|RAX, IMM8|NEG8); + put(p, REG64|RAX, "0x12345678", "0x12345678"); + put(p, REG64|RAX, "192", "192"); + put(p, REG64|RAX, "0x1234", "0x1234"); + put(p, REG32|EAX, IMM8|IMM32|NEG8); + put(p, REG16|AX, IMM8|IMM16|NEG8|NEG16); + put(p, REG8|REG8_3|AL, IMM|NEG8); + } } { const char tbl[][8] = { @@ -964,40 +966,43 @@ class Test { } void putEtc() const { - const char *p = "ret"; - put(p); - put(p, IMM); - p = "mov"; - put(p, EAX|REG32|MEM|MEM_ONLY_DISP, REG32|EAX); - put(p, REG64|MEM|MEM_ONLY_DISP, REG64|RAX); - put(p, AX|REG16|MEM|MEM_ONLY_DISP, REG16|AX); - put(p, AL|REG8|REG8_3|MEM|MEM_ONLY_DISP, REG8|REG8_3|AL); - put(p, REG32e|REG16|REG8|RAX|EAX|AX|AL, MEM|MEM_ONLY_DISP); - put(p, MEM32|MEM16|MEM8, IMM); - put(p, REG64, "0x1234567890abcdefLL", "0x1234567890abcdef"); - put("movbe", REG16|REG32e, MEM); - put("movbe", MEM, REG16|REG32e); + { + const char *p = "ret"; + put(p); + put(p, IMM); + p = "mov"; + put(p, EAX|REG32|MEM|MEM_ONLY_DISP, REG32|EAX); + put(p, REG64|MEM|MEM_ONLY_DISP, REG64|RAX); + put(p, AX|REG16|MEM|MEM_ONLY_DISP, REG16|AX); + put(p, AL|REG8|REG8_3|MEM|MEM_ONLY_DISP, REG8|REG8_3|AL); + put(p, REG32e|REG16|REG8|RAX|EAX|AX|AL, MEM|MEM_ONLY_DISP); + put(p, MEM32|MEM16|MEM8, IMM); + put(p, REG64, "0x1234567890abcdefLL", "0x1234567890abcdef"); + put("movbe", REG16|REG32e, MEM); + put("movbe", MEM, REG16|REG32e); #ifdef XBYAK64 - put(p, RAX|EAX|AX|AL, "ptr [0x1234567890abcdefLL]", "[qword 0x1234567890abcdef]"); - put(p, "ptr [0x1234567890abcdefLL]", "[qword 0x1234567890abcdef]", RAX|EAX|AX|AL); - put(p, "qword [rax], 0"); - put(p, "qword [rax], 0x12"); - put(p, "qword [rax], 0x1234"); - put(p, "qword [rax], 0x12345678"); -// put(p, "qword [rax], 0x123456789ab"); - put(p, "qword [rax], 1000000"); - put(p, "rdx, qword [rax]"); + put(p, RAX|EAX|AX|AL, "ptr [0x1234567890abcdefLL]", "[qword 0x1234567890abcdef]"); + put(p, "ptr [0x1234567890abcdefLL]", "[qword 0x1234567890abcdef]", RAX|EAX|AX|AL); + put(p, "qword [rax], 0"); + put(p, "qword [rax], 0x12"); + put(p, "qword [rax], 0x1234"); + put(p, "qword [rax], 0x12345678"); +// put(p, "qword [rax], 0x123456789ab"); + put(p, "qword [rax], 1000000"); + put(p, "rdx, qword [rax]"); #endif - - const char tbl[][8] = { - "movsx", - "movzx", - }; - for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { - const char *p = tbl[i]; - put(p, REG64, REG16|REG8|MEM8|MEM16); - put(p, REG32, REG16|REG8|MEM8|MEM16); - put(p, REG16, REG8|MEM8); + } + { + const char tbl[][8] = { + "movsx", + "movzx", + }; + for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { + const char *p = tbl[i]; + put(p, REG64, REG16|REG8|MEM8|MEM16); + put(p, REG32, REG16|REG8|MEM8|MEM16); + put(p, REG16, REG8|MEM8); + } } #ifdef XBYAK64 put("movsxd", REG64, REG32|MEM32); @@ -1148,27 +1153,29 @@ class Test { } void putSSE4_2() const { - const char tbl[][16] = { - "blendpd", - "blendps", - "dppd", - "dpps", - "mpsadbw", - "pblendw", - "roundps", - "roundpd", - "roundss", - "roundsd", - "pcmpestrm", - "pcmpestri", - "pcmpistrm", - "pcmpistri", - "pclmulqdq", - "aeskeygenassist", - }; - for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { - const char *p = tbl[i]; - put(p, XMM, XMM|MEM, IMM); + { + const char tbl[][16] = { + "blendpd", + "blendps", + "dppd", + "dpps", + "mpsadbw", + "pblendw", + "roundps", + "roundpd", + "roundss", + "roundsd", + "pcmpestrm", + "pcmpestri", + "pcmpistrm", + "pcmpistri", + "pclmulqdq", + "aeskeygenassist", + }; + for (size_t i = 0; i < NUM_OF_ARRAY(tbl); i++) { + const char *p = tbl[i]; + put(p, XMM, XMM|MEM, IMM); + } } { const char tbl[][16] = { diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index ae9c16c..cea4b04 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -1445,9 +1445,9 @@ private: opR_ModM(op, 0, ext, (B11000000 | ((imm == 1 ? 1 : 0) << 4)), NONE, NONE, false, (imm != 1) ? 1 : 0); if (imm != 1) db(imm); } - void opShift(const Operand& op, const Reg8& cl, int ext) + void opShift(const Operand& op, const Reg8& _cl, int ext) { - if (cl.getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); + if (_cl.getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); opR_ModM(op, 0, ext, B11010010); } void opModRM(const Operand& op1, const Operand& op2, bool condR, bool condM, int code0, int code1 = NONE, int code2 = NONE, int immSize = 0) @@ -1460,11 +1460,11 @@ private: throw Error(ERR_BAD_COMBINATION); } } - void opShxd(const Operand& op, const Reg& reg, uint8 imm, int code, const Reg8 *cl = 0) + void opShxd(const Operand& op, const Reg& reg, uint8 imm, int code, const Reg8 *_cl = 0) { - if (cl && cl->getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); - opModRM(reg, op, (op.isREG(16 | i32e) && op.getBit() == reg.getBit()), op.isMEM() && (reg.isREG(16 | i32e)), 0x0F, code | (cl ? 1 : 0), NONE, cl ? 0 : 1); - if (!cl) db(imm); + if (_cl && _cl->getIdx() != Operand::CL) throw Error(ERR_BAD_COMBINATION); + opModRM(reg, op, (op.isREG(16 | i32e) && op.getBit() == reg.getBit()), op.isMEM() && (reg.isREG(16 | i32e)), 0x0F, code | (_cl ? 1 : 0), NONE, _cl ? 0 : 1); + if (!_cl) db(imm); } // (REG, REG|MEM), (MEM, REG) void opRM_RM(const Operand& op1, const Operand& op2, int code) |