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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
card10
micropython
Commits
9b9e996d
Commit
9b9e996d
authored
Nov 3, 2013
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
Support for for-loop in native thumb.
parent
1a6633a7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/asmthumb.c
+7
-4
7 additions, 4 deletions
py/asmthumb.c
py/asmthumb.h
+1
-1
1 addition, 1 deletion
py/asmthumb.h
py/emitnative.c
+1
-3
1 addition, 3 deletions
py/emitnative.c
with
9 additions
and
8 deletions
py/asmthumb.c
+
7
−
4
View file @
9b9e996d
...
@@ -349,10 +349,13 @@ void asm_thumb_mov_reg_local(asm_thumb_t *as, uint rlo_dest, int local_num) {
...
@@ -349,10 +349,13 @@ void asm_thumb_mov_reg_local(asm_thumb_t *as, uint rlo_dest, int local_num) {
asm_thumb_write_op16
(
as
,
OP_LDR_FROM_SP_OFFSET
(
rlo_dest
,
word_offset
));
asm_thumb_write_op16
(
as
,
OP_LDR_FROM_SP_OFFSET
(
rlo_dest
,
word_offset
));
}
}
void
asm_thumb_mov_reg_local_addr
(
asm_thumb_t
*
as
,
uint
reg_dest
,
int
local_num
)
{
#define OP_ADD_REG_SP_OFFSET(rlo_dest, word_offset) (0xa800 | ((rlo_dest) << 8) | ((word_offset) & 0x00ff))
assert
(
0
);
// see format 12, load address
void
asm_thumb_mov_reg_local_addr
(
asm_thumb_t
*
as
,
uint
rlo_dest
,
int
local_num
)
{
asm_thumb_write_op16
(
as
,
0x0000
);
assert
(
rlo_dest
<
REG_R8
);
int
word_offset
=
as
->
num_locals
-
local_num
-
1
;
assert
(
as
->
pass
<
ASM_THUMB_PASS_3
||
word_offset
>=
0
);
asm_thumb_write_op16
(
as
,
OP_ADD_REG_SP_OFFSET
(
rlo_dest
,
word_offset
));
}
}
#define OP_ADD_REG_REG_REG(rlo_dest, rlo_src_a, rlo_src_b) (0x1800 | ((rlo_src_b) << 6) | ((rlo_src_a) << 3) | (rlo_dest))
#define OP_ADD_REG_REG_REG(rlo_dest, rlo_src_a, rlo_src_b) (0x1800 | ((rlo_src_b) << 6) | ((rlo_src_a) << 3) | (rlo_dest))
...
...
This diff is collapsed.
Click to expand it.
py/asmthumb.h
+
1
−
1
View file @
9b9e996d
...
@@ -71,7 +71,7 @@ void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, machine_uint_t i32_sr
...
@@ -71,7 +71,7 @@ void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, machine_uint_t i32_sr
void
asm_thumb_mov_reg_i32_optimised
(
asm_thumb_t
*
as
,
uint
reg_dest
,
int
i32_src
);
// convenience
void
asm_thumb_mov_reg_i32_optimised
(
asm_thumb_t
*
as
,
uint
reg_dest
,
int
i32_src
);
// convenience
void
asm_thumb_mov_local_reg
(
asm_thumb_t
*
as
,
int
local_num_dest
,
uint
rlo_src
);
// convenience
void
asm_thumb_mov_local_reg
(
asm_thumb_t
*
as
,
int
local_num_dest
,
uint
rlo_src
);
// convenience
void
asm_thumb_mov_reg_local
(
asm_thumb_t
*
as
,
uint
rlo_dest
,
int
local_num
);
// convenience
void
asm_thumb_mov_reg_local
(
asm_thumb_t
*
as
,
uint
rlo_dest
,
int
local_num
);
// convenience
void
asm_thumb_mov_reg_local_addr
(
asm_thumb_t
*
as
,
uint
r
eg
_dest
,
int
local_num
);
// convenience
void
asm_thumb_mov_reg_local_addr
(
asm_thumb_t
*
as
,
uint
r
lo
_dest
,
int
local_num
);
// convenience
void
asm_thumb_add_reg_reg_reg
(
asm_thumb_t
*
as
,
uint
rlo_dest
,
uint
rlo_src_a
,
uint
rlo_src_b
);
// convenience ?
void
asm_thumb_add_reg_reg_reg
(
asm_thumb_t
*
as
,
uint
rlo_dest
,
uint
rlo_src_a
,
uint
rlo_src_b
);
// convenience ?
void
asm_thumb_cmp_reg_reg
(
asm_thumb_t
*
as
,
uint
rlo_a
,
uint
rlo_b
);
// convenience ?
void
asm_thumb_cmp_reg_reg
(
asm_thumb_t
*
as
,
uint
rlo_a
,
uint
rlo_b
);
// convenience ?
...
...
This diff is collapsed.
Click to expand it.
py/emitnative.c
+
1
−
3
View file @
9b9e996d
...
@@ -965,10 +965,8 @@ static void emit_native_for_iter(emit_t *emit, int label) {
...
@@ -965,10 +965,8 @@ static void emit_native_for_iter(emit_t *emit, int label) {
asm_x64_cmp_r64_with_r64
(
emit
->
as
,
REG_RET
,
REG_TEMP1
);
asm_x64_cmp_r64_with_r64
(
emit
->
as
,
REG_RET
,
REG_TEMP1
);
asm_x64_jcc_label
(
emit
->
as
,
JCC_JE
,
label
);
asm_x64_jcc_label
(
emit
->
as
,
JCC_JE
,
label
);
#elif N_THUMB
#elif N_THUMB
assert
(
0
);
// XXX TODO
asm_thumb_cmp_reg_reg
(
emit
->
as
,
REG_RET
,
REG_TEMP1
);
asm_thumb_cmp_reg_reg
(
emit
->
as
,
REG_RET
,
REG_TEMP1
);
// use it, b?
asm_thumb_bcc_label
(
emit
->
as
,
THUMB_CC_EQ
,
label
);
asm_thumb_b_label
(
emit
->
as
,
label
);
#endif
#endif
emit_post_push_reg
(
emit
,
VTYPE_PYOBJ
,
REG_RET
);
emit_post_push_reg
(
emit
,
VTYPE_PYOBJ
,
REG_RET
);
}
}
...
...
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