mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
Subtraction of small constant integers optimized with OP_ADDI
This commit is contained in:
parent
03cde80b58
commit
6ef366644f
4 changed files with 46 additions and 31 deletions
|
|
@ -293,6 +293,7 @@ checkK(function () return -(border + 1) end, -(sbx + 1.0))
|
|||
|
||||
-- immediate operands
|
||||
checkR(function (x) return x + k1 end, 10, 11, 'ADDI', 'MMBINI', 'RETURN1')
|
||||
checkR(function (x) return x - 127 end, 10, -117, 'ADDI', 'MMBINI', 'RETURN1')
|
||||
checkR(function (x) return 128 + x end, 0.0, 128.0,
|
||||
'ADDI', 'MMBINI', 'RETURN1')
|
||||
checkR(function (x) return x * -127 end, -1.0, 127.0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue