From 412ddc63e0496b2343fc610d553db09a4b6de0c3 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 26 Apr 2010 15:53:54 +0900 Subject: [PATCH] add jc/jnc --- COPYRIGHT | 94 +++++++++++++++++++++--------------------- gen/gen_code.cpp | 2 + readme.txt | 4 +- readme_e.txt | 8 ++-- test/make_nm.cpp | 2 + xbyak/xbyak.h | 6 +-- xbyak/xbyak_mnemonic.h | 8 +++- 7 files changed, 69 insertions(+), 55 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index bf32901..ed08fcd 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,47 +1,47 @@ - -Copyright (c) 2007-2009 MITSUNARI Shigeo -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. -Neither the name of the copyright owner nor the names of its contributors may -be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ -ソースコード形式かバイナリ形式か、変更するかしないかを問わず、以下の条件を満た -す場合に限り、再頒布および使用が許可されます。 - -ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、および下記免責条項 -を含めること。 -バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の資料に、上記の著作 -権表示、本条件一覧、および下記免責条項を含めること。 -書面による特別の許可なしに、本ソフトウェアから派生した製品の宣伝または販売促進 -に、著作権者の名前またはコントリビューターの名前を使用してはならない。 -本ソフトウェアは、著作権者およびコントリビューターによって「現状のまま」提供さ -れており、明示黙示を問わず、商業的な使用可能性、および特定の目的に対する適合性 -に関する暗黙の保証も含め、またそれに限定されない、いかなる保証もありません。 -著作権者もコントリビューターも、事由のいかんを問わず、 損害発生の原因いかんを -問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その他の)不法行為で -あるかを問わず、仮にそのような損害が発生する可能性を知らされていたとしても、 -本ソフトウェアの使用によって発生した(代替品または代用サービスの調達、使用の -喪失、データの喪失、利益の喪失、業務の中断も含め、またそれに限定されない)直接 -損害、間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害について、 -一切責任を負わないものとします。 + +Copyright (c) 2007-2010 MITSUNARI Shigeo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +Neither the name of the copyright owner nor the names of its contributors may +be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------------- +純若鴻潟若綵√ゃ綵√紊眼篁ヤ>散羣 +翫絽割戎荐怨障 + +純若鴻潟若絽翫筝荐篏罔茵腓冴>散筝荀с割荐莢♂ + +ゃ綵√у絽翫絽篁絮ャ<潟膈莖筝荐篏 +罔茵腓冴>散筝荀с割荐莢♂ +檎≪劫ャ荐怨純с≪羇丞茖遵絎d障莢紕俄 +篏罔障潟潟ャ若帥若篏睡 +純с≪篏罔潟潟潟ャ若帥若c憟吟障障箴 +腓咲腓冴罐篏睡醇с括劫絲障 +≪藥篆荐若障絎篆荐若障 +篏罔潟潟ャ若帥若篋宴 絎括榊 +よ岡篁祉号絅膣сウ取岡篁祉с鐚紊宴篁鐚筝羈茵冴 +篁絎潟榊醇сャ +純с≪篏睡c榊鐚篁f水障篁g泣若鴻茯翠篏睡 +紊宴若帥紊宴紊宴罐筝障絎鐚贋・ +絎潟・絎潟句榊絎潟劫ユ絎潟牙衆絎潟障腟絎潟ゃ +筝莢篁祉莢障 diff --git a/gen/gen_code.cpp b/gen/gen_code.cpp index f3af429..57512bf 100644 --- a/gen/gen_code.cpp +++ b/gen/gen_code.cpp @@ -361,9 +361,11 @@ void put() { 0, "o" }, { 1, "no" }, { 2, "b" }, + { 2, "c" }, { 2, "nae" }, { 3, "nb" }, { 3, "ae" }, + { 3, "nc" }, { 4, "e" }, { 4, "z" }, { 5, "ne" }, diff --git a/readme.txt b/readme.txt index 7885d5f..10da356 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ - C++x86(IA-32), x64(AMD64, x86-64) JIT≪祉潟 Xbyak version 2.24 + C++x86(IA-32), x64(AMD64, x86-64) JIT≪祉潟 Xbyak version 2.25 ----------------------------------------------------------------------------- 网荀 @@ -51,6 +51,7 @@ ret --> ret(); 祉≪激潟 (ptr|dword|word|byte) [base + index * (1|2|4|8) + displacement] + [rip + 32bit disp] ; x64 only 綵≪ф絎障鐚泣ゃ冴絎綽荀ptr篏帥違с鐚 祉帥泣若障鐚 @@ -198,6 +199,7 @@ sample/{echo,hello}.bf http://www.kmonos.net/alang/etc/brainfuck.php ----------------------------------------------------------------------------- 絮ユ +2010/04/26 ver 2.25 add jc/jnc(I forgot to implement them...) 2010/04/16 ver 2.24 change the prototype of rewrite() method 2010/04/15 ver 2.23 fix align() and xbyak_util.h for Mac 2010/02/16 ver 2.22 fix inLocalLabel()/outLocalLabel() diff --git a/readme_e.txt b/readme_e.txt index 3f4d5cc..63be433 100644 --- a/readme_e.txt +++ b/readme_e.txt @@ -1,5 +1,5 @@ - Xbyak 2.24 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++ + Xbyak 2.25 ; JIT assembler for x86(IA32), x64(AMD64, x86-64) by C++ ----------------------------------------------------------------------------- @@ -48,6 +48,7 @@ ret --> ret(); Addressing (ptr|dword|word|byte) [base + index * (1|2|4|8) + displacement] + [rip + 32bit disp] ; x64 only NASM Xbyak mov eax, [ebx+ecx] --> mov (eax, ptr[ebx+ecx]); @@ -147,6 +148,7 @@ http://www.opensource.org/licenses/bsd-license.php ----------------------------------------------------------------------------- +2010/Apr/26 ver 2.25 add jc/jnc(I forgot to implement them...) 2010/Apr/16 ver 2.24 change the prototype of rewrite() method 2010/Apr/15 ver 2.23 fix align() and xbyak_util.h for Mac 2010/Feb/16 ver 2.22 fix inLocalLabel()/outLocalLabel() @@ -181,5 +183,5 @@ http://www.opensource.org/licenses/bsd-license.php MITSUNARI Shigeo(herumi at nifty dot com) --- -$Revision: 1.43 $ -$Date: 2010/04/16 03:48:59 $ +$Revision: 1.45 $ +$Date: 2010/04/26 06:40:29 $ diff --git a/test/make_nm.cpp b/test/make_nm.cpp index 51a4add..0d0cc0b 100644 --- a/test/make_nm.cpp +++ b/test/make_nm.cpp @@ -682,8 +682,10 @@ class Test { "o", "no", "b", + "c", "nae", "nb", + "nc", "ae", "e", "z", diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 1e4b459..abef889 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -4,9 +4,9 @@ @file xbyak.h @brief Xbyak ; JIT assembler for x86(IA32)/x64 by C++ @author herumi - @version $Revision: 1.185 $ + @version $Revision: 1.186 $ @url http://homepage1.nifty.com/herumi/soft/xbyak.html - @date $Date: 2010/04/16 06:00:21 $ + @date $Date: 2010/04/26 06:40:29 $ @note modified new BSD license http://www.opensource.org/licenses/bsd-license.php */ @@ -55,7 +55,7 @@ namespace Xbyak { enum { DEFAULT_MAX_CODE_SIZE = 2048, - VERSION = 0x2240, /* 0xABCD = A.BC(D) */ + VERSION = 0x2250, /* 0xABCD = A.BC(D) */ }; #ifndef MIE_INTEGER_TYPE_DEFINED diff --git a/xbyak/xbyak_mnemonic.h b/xbyak/xbyak_mnemonic.h index abe3b4b..6fb7779 100644 --- a/xbyak/xbyak_mnemonic.h +++ b/xbyak/xbyak_mnemonic.h @@ -1,4 +1,4 @@ -const char *getVersionString() const { return "2.24"; } +const char *getVersionString() const { return "2.25"; } void packssdw(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x6B); } void packsswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x63); } void packuswb(const Mmx& mmx, const Operand& op) { opMMX(mmx, op, 0x67); } @@ -191,6 +191,9 @@ void setno(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 1); } void cmovb(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } void jb(const char *label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } void setb(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 2); } +void cmovc(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } +void jc(const char *label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } +void setc(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 2); } void cmovnae(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 2); } void jnae(const char *label, LabelType type = T_AUTO) { opJmp(label, type, 0x72, 0x82, 0x0F); } void setnae(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 2); } @@ -200,6 +203,9 @@ void setnb(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 3); } void cmovae(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } void jae(const char *label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } void setae(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 3); } +void cmovnc(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 3); } +void jnc(const char *label, LabelType type = T_AUTO) { opJmp(label, type, 0x73, 0x83, 0x0F); } +void setnc(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 3); } void cmove(const Reg32e& reg, const Operand& op) { opModRM(reg, op, op.isREG(i32e), op.isMEM(), 0x0F, B01000000 | 4); } void je(const char *label, LabelType type = T_AUTO) { opJmp(label, type, 0x74, 0x84, 0x0F); } void sete(const Operand& op) { opR_ModM(op, 8, 3, 0, 0x0F, B10010000 | 4); }