[前][次][番号順一覧][スレッド一覧]

ruby-changes:68607

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:10:38 +0900 (JST)
Subject: [ruby-changes:68607] 12283c58da (master): Removed inc/dec instructions because usage not recommended.

https://git.ruby-lang.org/ruby.git/commit/?id=12283c58da

From 12283c58dab63eb9f8e916a8647758260a3e699b Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Sat, 3 Oct 2020 20:35:14 -0400
Subject: Removed inc/dec instructions because usage not recommended.

---
 ujit_asm.c       | 26 --------------------------
 ujit_asm.h       |  2 --
 ujit_asm_tests.c | 10 ----------
 3 files changed, 38 deletions(-)

diff --git a/ujit_asm.c b/ujit_asm.c
index 468aa4af7f..8efbee3f79 100644
--- a/ujit_asm.c
+++ b/ujit_asm.c
@@ -900,19 +900,6 @@ void cqo(codeblock_t* cb) https://github.com/ruby/ruby/blob/trunk/ujit_asm.c#L900
     cb_write_bytes(cb, 2, 0x48, 0x99);
 }
 
-// dec - Decrement integer by 1
-void dec(codeblock_t* cb, x86opnd_t opnd)
-{
-    write_rm_unary(
-        cb,
-        "dec",
-        0xFE, // opMemReg8
-        0xFF, // opMemRegPref
-        0x01, // opExt
-        opnd
-    );
-}
-
 /*
 // div - Unsigned integer division
 alias div = writeRMUnary!(
@@ -1011,19 +998,6 @@ void imul(CodeBlock cb, X86Opnd opnd0, X86Opnd opnd1, X86Opnd opnd2) https://github.com/ruby/ruby/blob/trunk/ujit_asm.c#L998
 }
 */
 
-// inc - Increment integer by 1
-void inc(codeblock_t* cb, x86opnd_t opnd)
-{
-    write_rm_unary(
-        cb,
-        "inc",
-        0xFE, // opMemReg8
-        0xFF, // opMemRegPref
-        0x00, // opExt
-        opnd
-    );
-}
-
 /// jcc - relative jumps to a label
 void ja  (codeblock_t* cb, size_t label_idx) { cb_write_jcc(cb, "ja"  , 0x0F, 0x87, label_idx); }
 void jae (codeblock_t* cb, size_t label_idx) { cb_write_jcc(cb, "jae" , 0x0F, 0x83, label_idx); }
diff --git a/ujit_asm.h b/ujit_asm.h
index 07295b23a9..265c4f894f 100644
--- a/ujit_asm.h
+++ b/ujit_asm.h
@@ -285,8 +285,6 @@ void cmovz(codeblock_t* cb, x86opnd_t dst, x86opnd_t src); https://github.com/ruby/ruby/blob/trunk/ujit_asm.h#L285
 void cmp(codeblock_t* cb, x86opnd_t opnd0, x86opnd_t opnd1);
 void cdq(codeblock_t* cb);
 void cqo(codeblock_t* cb);
-void dec(codeblock_t* cb, x86opnd_t opnd);
-void inc(codeblock_t* cb, x86opnd_t opnd);
 void ja(codeblock_t* cb, size_t label_idx);
 void jae(codeblock_t* cb, size_t label_idx);
 void jb(codeblock_t* cb, size_t label_idx);
diff --git a/ujit_asm_tests.c b/ujit_asm_tests.c
index 0c3417880b..afe8e15b93 100644
--- a/ujit_asm_tests.c
+++ b/ujit_asm_tests.c
@@ -116,10 +116,6 @@ void run_tests() https://github.com/ruby/ruby/blob/trunk/ujit_asm_tests.c#L116
     // cqo
     cb_set_pos(cb, 0); cqo(cb); check_bytes(cb, "4899");
 
-    // dec
-    cb_set_pos(cb, 0); dec(cb, CX); check_bytes(cb, "66FFC9");
-    cb_set_pos(cb, 0); dec(cb, EDX); check_bytes(cb, "FFCA");
-
     // div
     /*
     test(
@@ -132,12 +128,6 @@ void run_tests() https://github.com/ruby/ruby/blob/trunk/ujit_asm_tests.c#L128
     );
     */
 
-    // inc
-    cb_set_pos(cb, 0); inc(cb, BL); check_bytes(cb, "FEC3");
-    cb_set_pos(cb, 0); inc(cb, ESP); check_bytes(cb, "FFC4");
-    cb_set_pos(cb, 0); inc(cb, mem_opnd(32, RSP, 0)); check_bytes(cb, "FF0424");
-    cb_set_pos(cb, 0); inc(cb, mem_opnd(64, RSP, 4)); check_bytes(cb, "48FF442404");
-
     // jcc
     {
         cb_set_pos(cb, 0);
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]