summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-12-21 17:45:43 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2023-12-21 17:47:36 -0800
commit9a3c49ee5d6dd3770c21ed8193e7efd64cd81a6e (patch)
tree99d68f43e9b7ebf33956f6795741f2ca205e25ca /test/ruby
parent0c05551f5812f29c24a30cfbcaa60beab22569d0 (diff)
RJIT: Convert opt_case_dispatch keys with #to_value
comptime_key is a Ruby object and the value is not valid in machine code. This PR also implements `CMP r/m64, imm32 (Mod 01: [reg]+disp8)` that is now needed for running mail.gem benchmark.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/rjit/test_assembler.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/ruby/rjit/test_assembler.rb b/test/ruby/rjit/test_assembler.rb
index a9ed6ce39e..fbf780d6c3 100644
--- a/test/ruby/rjit/test_assembler.rb
+++ b/test/ruby/rjit/test_assembler.rb
@@ -122,6 +122,7 @@ module RubyVM::RJIT
asm.cmp(BytePtr[:rax, 8], 8) # CMP r/m8, imm8 (Mod 01: [reg]+disp8)
asm.cmp(DwordPtr[:rax, 8], 0x100) # CMP r/m32, imm32 (Mod 01: [reg]+disp8)
asm.cmp([:rax, 8], 8) # CMP r/m64, imm8 (Mod 01: [reg]+disp8)
+ asm.cmp([:rbx, 8], 0x100) # CMP r/m64, imm32 (Mod 01: [reg]+disp8)
asm.cmp([:rax, 0x100], 8) # CMP r/m64, imm8 (Mod 10: [reg]+disp32)
asm.cmp(:rax, 8) # CMP r/m64, imm8 (Mod 11: reg)
asm.cmp(:rax, 0x100) # CMP r/m64, imm32 (Mod 11: reg)
@@ -132,12 +133,13 @@ module RubyVM::RJIT
0x0: cmp byte ptr [rax + 8], 8
0x4: cmp dword ptr [rax + 8], 0x100
0xb: cmp qword ptr [rax + 8], 8
- 0x10: cmp qword ptr [rax + 0x100], 8
- 0x18: cmp rax, 8
- 0x1c: cmp rax, 0x100
- 0x23: cmp qword ptr [rax + 8], rbx
- 0x27: cmp qword ptr [rax - 0x100], rbx
- 0x2e: cmp rax, rbx
+ 0x10: cmp qword ptr [rbx + 8], 0x100
+ 0x18: cmp qword ptr [rax + 0x100], 8
+ 0x20: cmp rax, 8
+ 0x24: cmp rax, 0x100
+ 0x2b: cmp qword ptr [rax + 8], rbx
+ 0x2f: cmp qword ptr [rax - 0x100], rbx
+ 0x36: cmp rax, rbx
EOS
end