Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
76659a66
Unverified
Commit
76659a66
authored
Dec 01, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codegen.c: skip `ADDI/SUBI` for zero operand.
parent
7d6b8024
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+1
-0
No files found.
mrbgems/mruby-compiler/core/codegen.c
View file @
76659a66
...
...
@@ -781,6 +781,7 @@ gen_addsub(codegen_scope *s, uint8_t op, uint16_t dst)
/* OP_ADDI/OP_SUBI takes upto 16bits */
if
(
n
>
INT16_MAX
||
n
<
INT16_MIN
)
goto
normal
;
rewind_pc
(
s
);
if
(
n
==
0
)
return
;
if
(
n
>
0
)
{
if
(
op
==
OP_ADD
)
genop_2
(
s
,
OP_ADDI
,
dst
,
(
uint16_t
)
n
);
else
genop_2
(
s
,
OP_SUBI
,
dst
,
(
uint16_t
)
n
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment