Retarded Windows conventions

Discuss topics related to development here.
Post Reply
User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Retarded Windows conventions

Post by MarathonMan » Sun Dec 28, 2014 1:31 pm

__m128 types, arrays and strings are never passed by immediate value but rather a pointer is passed to memory allocated by the caller. Structs/unions of size 8, 16, 32, or 64 bits and __m64 are passed as if they were integers of the same size. Structs/unions other than these sizes are passed as a pointer to memory allocated by the caller. For these aggregate types passed as a pointer (including __m128), the caller-allocated temporary memory will be 16-byte aligned.
WHY?

mingw doesn't support __vectorcall, yet, either.

I'm this close to just saying "**** it" with Windows!

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: Retarded Windows conventions

Post by MarathonMan » Sun Dec 28, 2014 2:20 pm

So, it looks like GCC has plans for [[gnu::vectorcall]] and __vectorcall attributes, so I'm just going to basically use a pretty standards-conformant approach for Windows builds for the time being.

As a result, Windows builds with probably never get much of a RSP performance performance boost (compared to other builds) until __vectorcall gets supported, but I couldn't be bothered. I really don't want to kill off the ability to compile with MinGW and jump ship to MSVC just so performance gets slightly better.

User avatar
iwasaperson
Posts: 49
Joined: Tue Apr 22, 2014 12:50 am

Re: Retarded Windows conventions

Post by iwasaperson » Sun Dec 28, 2014 11:07 pm

You could always just go the libretro route and not worry about Windows, then again, I have no experience with that API.

User avatar
Sintendo
Posts: 25
Joined: Thu Oct 31, 2013 9:11 am

Re: Retarded Windows conventions

Post by Sintendo » Mon Dec 29, 2014 6:27 am

A libretro Windows build would suffer the same problem.

Is compiling with clang an option on Windows? A quick search reveals they added vectorcall support last November.

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: Retarded Windows conventions

Post by MarathonMan » Mon Dec 29, 2014 8:50 am

Sintendo wrote:A libretro Windows build would suffer the same problem.

Is compiling with clang an option on Windows? A quick search reveals they added vectorcall support last November.
I saw that; in the mailing list a GCC dev commented and asked them to add support for [[gnu::vectorcall]], so I imagine it should appear in GCC soon as well. Unfortunately, Clang's LTO doesn't appear to be that mature. When I build with Clang, I get like 80% of the performance I get from GCC (on Linux). Clang 3.5 vs. GCC 4.9.1 if it matters.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest