summaryrefslogtreecommitdiff
path: root/lib/ruby_vm/mjit/x86_assembler.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2022-12-28 13:50:24 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 22:11:20 -0800
commit9352f94a1b7874a254f124ec8e719151d2b02946 (patch)
treecda0f5762249b8de7ee3c1e06957707f0edccdac /lib/ruby_vm/mjit/x86_assembler.rb
parent4eb6f1dbb9062097c65077eda7945f791c7e4464 (diff)
Implement getlocal_WC_0
Diffstat (limited to 'lib/ruby_vm/mjit/x86_assembler.rb')
-rw-r--r--lib/ruby_vm/mjit/x86_assembler.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ruby_vm/mjit/x86_assembler.rb b/lib/ruby_vm/mjit/x86_assembler.rb
index 12f65f5432..1eef272eb4 100644
--- a/lib/ruby_vm/mjit/x86_assembler.rb
+++ b/lib/ruby_vm/mjit/x86_assembler.rb
@@ -256,7 +256,7 @@ module RubyVM::MJIT
@bytes.push(mod_rm)
end
if disp
- if disp < 0 || disp > 0xff # TODO: support displacement in 2 or 4 bytes as well
+ unless imm8?(disp) # TODO: support displacement in 2 or 4 bytes as well
raise NotImplementedError, "not-implemented disp: #{disp}"
end
@bytes.push(disp)
@@ -344,8 +344,7 @@ module RubyVM::MJIT
end
def imm8?(imm)
- raise "negative imm not supported: #{imm}" if imm.negative? # TODO: support this
- imm <= 0x7f # TODO: consider uimm
+ (-0x80..0x7f).include?(imm)
end
def imm32?(imm)