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

Replace gsl::span for std::span (c++20) #7531

Merged
merged 5 commits into from May 30, 2021
Merged

Conversation

AniLeo
Copy link
Member

@AniLeo AniLeo commented Feb 19, 2020

This is just to track implementation progress of std::span in the main 3 compilers we use. It is not possible to do such change now because none of the compilers are ready for std::span.

  • Removes 3rdparty/span.
  • Replaces gsl::span with std::span.

Implemented on currently used compilers (0/3):

  • MSVC (19)
  • GCC (9)
  • Clang (10)

According to https://en.cppreference.com/w/cpp/compiler_support Clang should support it since version 7, but importing <span> doesn't work

@JohnHolmesII
Copy link
Contributor

Just for reference, here are some outputs. GCC and Clang are around the corner, but MSVC is just a confused child it seems.

Compiler tests

rpcs3/Emu/RSX/Common/surface_store.h Outdated Show resolved Hide resolved
@danilaml
Copy link
Contributor

danilaml commented Mar 18, 2020

@AniLeo clang does support std::span since 7.0 (although that's not really the correct term here, since it's a lib feature). You just need to use libc (or recent enough libstdc++): https://godbolt.org/z/DehT7d

.ci/build-mac.sh Outdated Show resolved Hide resolved
@bevanweiss
Copy link
Contributor

bevanweiss commented Aug 2, 2020

@AniLeo it looks like this might be good now.
https://en.cppreference.com/w/cpp/compiler_support
shows support from Clang v7, gcc v10, and VS2019 v16.6.
MS reference for when was brought in
https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=vs-2019

It just looks like a few files might not have gotten the full treatment (complain about Utilities\span.h not existing):
rpcs3\Emu\Cell\lv2\sys_prx.cpp
rpcs3\Emu\Cell\Modules\cellGame.cpp
rpcs3\Emu\Cell\Modules\cellSaveData.cpp
rpcs3\Emu\Cell\Modules\cellSysutil.cpp
rpcs3\Crypto\utils.cpp

@Andrix44
Copy link

Everything should work now if you update the compilers.

@elad335
Copy link
Contributor

elad335 commented Oct 28, 2020

Any update?

@JohnHolmesII
Copy link
Contributor

I have confirmed that span is fully replaceable, but the dockerfile will need to be updated to 18.04.
Windows build worked: azure link

@hcorion Is moving to 18.04 or even 20.04 an option for the docker files, or do you have other blockers? Only changes required are at least 18.04 and gcc=10 instead of 9

@hcorion
Copy link
Member

hcorion commented Dec 25, 2020

The AppImage requires support for the lowest still supported LTS Ubuntu version, which usually means you have to build on that version. 16.04 support ends April 2021, so the plan was to wait for that before making the move to 18.04. Though it is possible that a 18.04 generated binary might still work on 16.04, I haven't tested it

@JohnHolmesII
Copy link
Contributor

Makes sense. This isn't the most pressing, so it may just be worth waiting til april.

@Megamouse
Copy link
Contributor

Needs conflicts solved

@AniLeo AniLeo changed the title [Draft] Replace gsl::span for std::span (c++20) Replace gsl::span for std::span (c++20) May 17, 2021
@AniLeo AniLeo marked this pull request as ready for review May 17, 2021 15:01
@AniLeo AniLeo force-pushed the cpp20 branch 3 times, most recently from d359d23 to 9f6d37e Compare May 25, 2021 20:34
@AniLeo AniLeo marked this pull request as draft May 26, 2021 01:44
@Nekotekina Nekotekina marked this pull request as ready for review May 30, 2021 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants