libretro / virtualjaguar-libretro

Hard fork of Virtual Jaguar (abandoned project) to Libretro
31 stars 34 forks source link

[WIP] Speedup rebase rebase #55

Closed JoeMatt closed 2 years ago

JoeMatt commented 2 years ago

Rebase of #53 as per @twinaphex requests.

There are diff's around controller input fixes that I reverted from #53 that should be looked into in a new PR.

specifically these commits

fb695b1b0e1f104136428834b2b609c2139c7f8c f4ebb99aa85369f774d41ba764a17a3e45a6889d 681a1f3ab40c60833e886f0f461b3d47d1ee4524 34ca42f3339dc83d1fcf68ed21802db2cd4c1df5

Original PR


I'm making a PR for some old optimizations I made for an iOS fork.

This PR is more for the devs to test and cherry-pick, I don't expect this code to be "merge quality", but certainly buildable/testable at least.

For instance, probably don't want these hacks that were specific to iOS loading, https://github.com/libretro/virtualjaguar-libretro/pull/53/commits/811e73f8b574ec2b34a69934fa36f66c3202f45b

The blitter really is the slowest part. I wanted to write something with SIMD or better vectorization or improved memcpy or something. That was by far the slowest part when I profiled this pretty heavily a while ago (at least it was excruciatingly slow on ARM without my C struct hacks to help the compiler optimize better.


Update: Forgot to mention I have these macros defined in my build (in XCode) that need to be added to a header or C compile flags

C

#define INLINE=inline 
#define USE_STRUCTS=1

flags

-DINLINE=inline -DUSE_STRUCTS=1 -D__GCCUNIX__  

Inline macro may need to be customized based on arch. Mac OS is using Clang/C99/gnu++11 syntax for inline.

I also have unroll loops aka -qunroll=no but i forget why.

JoeMatt commented 2 years ago

@twinaphex LMK if you want the #if USE_STRUCTS parts to just be the default and delete the other code paths.

JoeMatt commented 2 years ago

CI was failing and I noticed a few rebase merge issues and a small logical compare bug, pushed 2 updates to resolve.

lgtm-com[bot] commented 2 years ago

This pull request fixes 2 alerts when merging d691620ec1e68953760fc3f417296a5bf812951b into 4dade2048e91be761383a8e4022987a838121491 - view on LGTM.com

fixed alerts:

JoeMatt commented 2 years ago

#define USE_STRUCTS=1 No longer needed.

Pushed another commit to remove the older code.

lgtm-com[bot] commented 2 years ago

This pull request fixes 2 alerts when merging 1c12013fb7f9d6e588d7bddc9d9f520142f4e3ca into 4dade2048e91be761383a8e4022987a838121491 - view on LGTM.com

fixed alerts:

JoeMatt commented 2 years ago

Report of bugs after my rebase, looking into it. Changing PR to a draft for now.

lgtm-com[bot] commented 2 years ago

This pull request fixes 2 alerts when merging ab5f584ad4d1105edf8ee02d99afbd453184fb21 into 390c44ddd22657cec3757ffe260a10ad88416726 - view on LGTM.com

fixed alerts:

JoeMatt commented 2 years ago

closing for individual PRs

56 #57 #58 #59