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

golang needs MMX #57

Closed
opless opened this issue Nov 12, 2018 · 7 comments
Closed

golang needs MMX #57

opless opened this issue Nov 12, 2018 · 7 comments
Labels

Comments

@opless
Copy link

opless commented Nov 12, 2018

go 1.10.1.-r0 refuses to run stating 'This program can only be run of processors with MMX support'

Steps to reproduce:

  1. apk add go
  2. go

(PS. keep up the good work! I've been wanting something like this for a long time!)

@tbodt
Copy link
Member

tbodt commented Nov 12, 2018

Go is on the list.

(PS. thanks!)

@wenmin-wu
Copy link

@tbodt May I ask when do you plan to support MMX? Maybe we can create a slack channel to talk about what to do to support this. People like me who are interested in this can also contribute to this in spare time:)

@Rexogamer
Copy link
Contributor

@wenmin-wu we have a discord server

@skipikash
Copy link

What will it take to emulate MMX? I’m willing to contribute but don’t know where to start or what we even need. Are features being tracked somewhere? If not, might be a good idea to start doing that in the wiki.

it can definitely be done. Found this post from 2001, we got this guys 💪🏼
https://www-sop.inria.fr/members/Sylvain.Pion/progs/mmx-emu/

@tbodt
Copy link
Member

tbodt commented Apr 20, 2020

I’m willing to contribute but don’t know where to start or what we even need.

I don't really know what is needed for go to work. MMX adds 51 instructions, but it's possible go only uses 1 or 2 of those. As for where to start, there's unfortunately not any good documentation for hacking on the emulator, other than "read the code, figure out out how it works, change it." If you're serious about contributing, feel free to reach out to me on Discord or wherever and I'll try and help get you up to speed.

A good first step would be to change the cpuid in emu/cpuid.h to just set the bit that claims MMX is supported, then try running some go programs and seeing what crashes. dmesg after an illegal instruction will tell you the problematic machine code.

Are features being tracked somewhere?

I've been using GitHub issues for that.

www-sop.inria.fr/members/Sylvain.Pion/progs/mmx-emu

I had a look at the code and that might actually work in iSH, as a temporary solution. All it's doing is handling SIGILL.

tbodt added a commit that referenced this issue May 4, 2020
Turns out the "reg" part of the instruction will always be a register.
Who'd'a thunk

For #57
tbodt added a commit that referenced this issue May 4, 2020
tbodt added a commit that referenced this issue May 4, 2020
It turns out that go only needs one MMX instruction: movq, which it uses
for 64-bit atomic loads and stores. This wasn't too hard.

For #57
tbodt added a commit that referenced this issue May 4, 2020
Go's math/big has an initializer that creates a singleton 3, and doing
so involves fxtract

For #57
tbodt added a commit that referenced this issue May 4, 2020
Go uses waitid with WNOWAIT to wait for child processes.

For #57
@tbodt
Copy link
Member

tbodt commented May 4, 2020

I did it

@tbodt tbodt closed this as completed May 4, 2020
tbodt added a commit that referenced this issue May 4, 2020
It turns out that go only needs one MMX instruction: movq, which it uses
for 64-bit atomic loads and stores. This wasn't too hard.

For #57
tbodt added a commit that referenced this issue May 4, 2020
Go's math/big has an initializer that creates a singleton 3, and doing
so involves fxtract

For #57
tbodt added a commit that referenced this issue May 4, 2020
Go uses waitid with WNOWAIT to wait for child processes.

For #57
@idvorkin
Copy link

idvorkin commented May 4, 2020

w00t! Thanks

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

No branches or pull requests

6 participants