Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumb instruction set. #21

Open
cristianowa opened this issue Mar 5, 2013 · 2 comments
Open

Thumb instruction set. #21

cristianowa opened this issue Mar 5, 2013 · 2 comments

Comments

@cristianowa
Copy link
Owner

Since arms processors supports both arm and thumb operation modes, we shall try both mode. Just a quick rembember :

Thumb mode is a smaller set, witch gives a smaller program memory footprint and has a small decoding machine ( less power ), but it also has limited access to registers.

Arm mode ( normal ) is bigger and uses all the processor can give, thus, spending more power.

The mode can be toogle through a instruction, so code can be splited in thumb and normal, but the processor must accept that.

Now the elua is being compiling with -mthumb. witch makes the processor use only thumb instructions. We shall test both with a cpu-intensive benchmark ( some taylor series maybe do the job ) and choose the best cost-benefit relation. We shall also seek for a way to compile with both instructions.

@jvportal
Copy link
Collaborator

jvportal commented Mar 5, 2013

As stated in http://www.arm.com/products/processors/cortex-m/cortex-m4-processor.php, Cortex-M4 only supports thumb and thumb2 instructions (see 'Specifications' tab). Thumb2 is an extension of thumb instructions, creating a mixed 16-bit and 32-bit instruction set. Information of thumb2 instructions: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344c/Beiiegaf.html .

I think that is not possible to use arm normal instructions in Cortex-M4. We shall concentrate in using Thumb2 instructions in the project.

@cristianowa
Copy link
Owner Author

According to jvpportal : the flag "-march=armv7-m " could be added to compile with thumb2 instructions.

I've used it, and I've also used the '-mtune=cortex-m4','-O3' and '-Os' flags. The memory footprint just got bigger or equal.
I think the options '-mcpu=cortex-m4' and '-mthumb' are fine enough to this port. We have to reduce
footprint in other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants