Enable MICROPY_EMIT_X64/X86 with VC tool chain and Windows ABI

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
javen72
Posts: 2
Joined: Sat Dec 29, 2018 3:37 am

Enable MICROPY_EMIT_X64/X86 with VC tool chain and Windows ABI

Post by javen72 » Sat Dec 29, 2018 6:36 am

I've already made it work and would like to contribute the changes back. I've read the contributing guidelines but still have a few things not clear.

- VC toolchain doesn't support inline assembly in C file for 64-bit code. There have to be assembly files added to py folder (for nlr_push/jump). Does micropython project allows this? I didn't find any guide line for it.
- Do I need to submit a new tracker before creating pull request? I know some projects have a rule like each patch should have a corresponding tracker.
- What kind tests must I do? Just those in tests folder?
Thanks any help in advance.

stijn
Posts: 335
Joined: Thu Apr 24, 2014 9:13 am

Re: Enable MICROPY_EMIT_X64/X86 with VC tool chain and Windows ABI

Post by stijn » Sat Dec 29, 2018 9:28 am

Source files (assembly or C, doesn't matter) which are specific to one port should go in that port's directory. In this case ports/windows/msvc it seems (unless your files also work with the mingw toolchain but that's unlikely?).

You don't have to create a new issue: the pull request alone is fine. Just try to make sure the code adheres to the code style/standards, most of them described in contributing.md.

All current tests including asm related ones should be ran. No need for new tests (I think). However it will probably still need to be discussed whether this feature gets enabled by default or not. If not I suggest the build definition appveyor.yml gets adjusted to also build and test a version including this feature to make sure it keeps on working in the future.

javen72
Posts: 2
Joined: Sat Dec 29, 2018 3:37 am

Re: Enable MICROPY_EMIT_X64/X86 with VC tool chain and Windows ABI

Post by javen72 » Wed Jan 02, 2019 1:09 am

For the assembly files, I don't think they can be applied to mingw directly. I'm not quite familiar mingw. If I'm correct, mingw still uses gcc style assembly code, right? So ports/windows/msvc works for me. But, if necessary, I can add mingw version of assembly files in the future (I need time for it).

Sure. I'll check the coding style before pull request.

I would suggest to disable the feature by default. Maybe just for a while so that some guys interested in this feature can do some extra tests. Anyway, I'll update appveyor.yml like what you suggested.

Thank you very much for the advices.

stijn
Posts: 335
Joined: Thu Apr 24, 2014 9:13 am

Re: Enable MICROPY_EMIT_X64/X86 with VC tool chain and Windows ABI

Post by stijn » Wed Jan 02, 2019 9:35 am

mingw uses gcc indeed, not sure how 'necessary' it is to have emit_xxx working for it.. Might even be that it is actually supported, don't remember.

Post Reply