Fix the build on i386
This change is a partial sync with the Linux version of this file. The
included fix for i386 is to recognise i586 as a define instead of just
i386. The change also includes some re-ordering and removal of sparc
support, but they should be no-ops.