Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
723d598d
Commit
723d598d
authored
9 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/asmthumb: Allow to compile with -Wsign-compare and -Wunused-parameter.
parent
40274fec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/asmthumb.c
+3
-2
3 additions, 2 deletions
py/asmthumb.c
with
3 additions
and
2 deletions
py/asmthumb.c
+
3
−
2
View file @
723d598d
...
@@ -88,6 +88,7 @@ void asm_thumb_start_pass(asm_thumb_t *as, uint pass) {
...
@@ -88,6 +88,7 @@ void asm_thumb_start_pass(asm_thumb_t *as, uint pass) {
}
}
void
asm_thumb_end_pass
(
asm_thumb_t
*
as
)
{
void
asm_thumb_end_pass
(
asm_thumb_t
*
as
)
{
(
void
)
as
;
// could check labels are resolved...
// could check labels are resolved...
}
}
...
@@ -402,7 +403,7 @@ void asm_thumb_b_label(asm_thumb_t *as, uint label) {
...
@@ -402,7 +403,7 @@ void asm_thumb_b_label(asm_thumb_t *as, uint label) {
mp_uint_t
dest
=
get_label_dest
(
as
,
label
);
mp_uint_t
dest
=
get_label_dest
(
as
,
label
);
mp_int_t
rel
=
dest
-
as
->
code_offset
;
mp_int_t
rel
=
dest
-
as
->
code_offset
;
rel
-=
4
;
// account for instruction prefetch, PC is 4 bytes ahead of this instruction
rel
-=
4
;
// account for instruction prefetch, PC is 4 bytes ahead of this instruction
if
(
dest
!=
-
1
&&
rel
<=
-
4
)
{
if
(
dest
!=
(
mp_uint_t
)
-
1
&&
rel
<=
-
4
)
{
// is a backwards jump, so we know the size of the jump on the first pass
// is a backwards jump, so we know the size of the jump on the first pass
// calculate rel assuming 12 bit relative jump
// calculate rel assuming 12 bit relative jump
if
(
SIGNED_FIT12
(
rel
))
{
if
(
SIGNED_FIT12
(
rel
))
{
...
@@ -421,7 +422,7 @@ void asm_thumb_bcc_label(asm_thumb_t *as, int cond, uint label) {
...
@@ -421,7 +422,7 @@ void asm_thumb_bcc_label(asm_thumb_t *as, int cond, uint label) {
mp_uint_t
dest
=
get_label_dest
(
as
,
label
);
mp_uint_t
dest
=
get_label_dest
(
as
,
label
);
mp_int_t
rel
=
dest
-
as
->
code_offset
;
mp_int_t
rel
=
dest
-
as
->
code_offset
;
rel
-=
4
;
// account for instruction prefetch, PC is 4 bytes ahead of this instruction
rel
-=
4
;
// account for instruction prefetch, PC is 4 bytes ahead of this instruction
if
(
dest
!=
-
1
&&
rel
<=
-
4
)
{
if
(
dest
!=
(
mp_uint_t
)
-
1
&&
rel
<=
-
4
)
{
// is a backwards jump, so we know the size of the jump on the first pass
// is a backwards jump, so we know the size of the jump on the first pass
// calculate rel assuming 9 bit relative jump
// calculate rel assuming 9 bit relative jump
if
(
SIGNED_FIT9
(
rel
))
{
if
(
SIGNED_FIT9
(
rel
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment