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

Memmap: Remove pointer casts #2903

Merged
merged 1 commit into from Aug 24, 2015
Merged

Memmap: Remove pointer casts #2903

merged 1 commit into from Aug 24, 2015

Conversation

lioncash
Copy link
Member

Gets rid of ugly casts, and also silences some ubsan asserts

@degasus
Copy link
Member

degasus commented Aug 24, 2015

I'm not sure, will this generate an as good assembly? This function is called quite often :/

@lioncash
Copy link
Member Author

Yes it will (https://goo.gl/50jAT7). memcpy is typically implemented as an intrinsic in compilers. Also, the previous code is technically undefined behavior (misaligned pointer dereferencing)

degasus added a commit that referenced this pull request Aug 24, 2015
Memmap: Remove pointer casts
@degasus degasus merged commit 0ad6fa8 into dolphin-emu:master Aug 24, 2015
@lioncash lioncash deleted the cast branch August 24, 2015 13:43
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • xenoblade-menu on ogl-lin-nv: diff

automated-fifoci-reporter

@comex
Copy link
Contributor

comex commented Aug 24, 2015

For the record, I just verified using that site that both gcc and clang do the right thing even at -O0 (which is fairly important - when I develop I build at -O0, for example). Does anyone want to check MSVC?

@degasus
Copy link
Member

degasus commented Aug 24, 2015

@comex Are you looking for a correct implementation, or a fast one? Personally, I don't care about the optimizations done at -O0

@comex
Copy link
Contributor

comex commented Aug 24, 2015

A fast one, though I guess a real call to memcpy probably wouldn't show up anyway among all the other unoptimized crap. Never mind me.

@phire
Copy link
Member

phire commented Aug 25, 2015

I don't really like compiling at -O0. Would rather read the -O2 assembly.

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