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

P1272 Byteswapping for fun&&nuf #270

Closed
jensmaurer opened this issue Jan 28, 2019 · 23 comments · Fixed by cplusplus/draft#5018
Closed

P1272 Byteswapping for fun&&nuf #270

jensmaurer opened this issue Jan 28, 2019 · 23 comments · Fixed by cplusplus/draft#5018
Labels
C++23 Targeted at C++23 CWG Core LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Projects
Milestone

Comments

@jensmaurer
Copy link
Member

jensmaurer commented Jan 28, 2019

P1272R0 Byteswapping for fun&&nuf (Isabella Muerte)

https://issues.isocpp.org/show_bug.cgi?id=560

@jensmaurer jensmaurer added this to the 2019-02 milestone Jan 28, 2019
@jensmaurer jensmaurer added LEWG Library Evolution SG14 Low Latency SG6 Numerics labels Jan 28, 2019
@jensmaurer jensmaurer changed the title P1272 Byteswapping for fun&&nuf P1272 Byteswapping for fun&&nuf Jan 28, 2019
@jensmaurer
Copy link
Member Author

jensmaurer commented Jan 28, 2019

Titus Winters 2018-11-10 04:17:10 UTC
Discussed in San Diego: http://wiki.edg.com/bin/view/Wg21sandiego2018/P1272

This goes into <bit>.
SF F N A SA
2 6 3 0 0

Require that bit-width is a power-of-two, forward to LWG for C++20.
SF F N A SA
3 8 0 0 0

@jensmaurer jensmaurer added LWG Library and removed LEWG Library Evolution labels Jan 28, 2019
@mclow
Copy link

mclow commented Feb 3, 2019

I'm going to schedule this in LWG.

@jensmaurer
Copy link
Member Author

@mclow, this might need some CWG attention (at your discretion), similar to bit_cast. For example, what about padding bits in the object representation of an integer?

@mclow
Copy link

mclow commented Feb 3, 2019

Interesting idea. Do we have any integral types that do not "completely fill" an even number of bytes? (bool and char/unsigned char, yes, I think we can just call disable them)

@jensmaurer
Copy link
Member Author

jensmaurer commented Feb 3, 2019

@mclow, note that "byte" equals (the size of) char/unsigned char in the C++ standard by definition (and might not be related to an octet, i.e. an 8-bit quantity); see [intro.memory].
For example, an implementation with 8-bit chars and 31-bit integers would be conforming. With the byte-swap feature, you'd presumably read one padding bit (unspecified value) and turn it into a value bit. Should we prevent that?
My view: Yes, let's make sure the facility does what it should do on today's architectures, and let's just remove the funny stuff from the overload set so that you get a controlled error on alien platforms.

@jensmaurer jensmaurer added the CWG Core label Feb 3, 2019
@jensmaurer jensmaurer added this to Ready for review in CWG Feb 3, 2019
@jensmaurer jensmaurer added this to Tuesday in LWG in Kona 2019 Feb 5, 2019
@jensmaurer jensmaurer moved this from Ready for review to Discussing in CWG Feb 18, 2019
@jensmaurer jensmaurer moved this from Discussing to Awaiting updated wording in CWG Feb 18, 2019
@Lawrence-Crowl
Copy link

SG6: Leave the issue to other committees.
No objection to unanimous consent.

@jensmaurer jensmaurer removed the SG6 Numerics label Feb 20, 2019
@mclow mclow added the straw-poll Straw poll label Feb 21, 2019
@mclow
Copy link

mclow commented Feb 22, 2019

LWG reviewed this on Thursday AM. U/consent for C++20 (after minor edits

@jensmaurer jensmaurer moved this from Awaiting updated wording to Ready for review in CWG Feb 22, 2019
@jensmaurer jensmaurer removed straw-poll Straw poll LWG Library labels Feb 23, 2019
@jensmaurer jensmaurer removed this from Ready for review in CWG Feb 25, 2019
@jensmaurer jensmaurer removed this from Tuesday in LWG in Kona 2019 Feb 25, 2019
@jensmaurer jensmaurer added this to Awaiting updated wording in CWG Feb 25, 2019
@wg21bot
Copy link
Collaborator

wg21bot commented Mar 20, 2019

P1272R1 Byteswapping for fun&&nuf (Isabella Muerte)

@wg21bot wg21bot modified the milestones: 2019-02, 2019-07 Mar 20, 2019
@wg21bot wg21bot added this to the 2020-telecon milestone Aug 1, 2020
@ben-craig ben-craig added B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 size - small paper size estimate labels Oct 17, 2020
@jensmaurer
Copy link
Member Author

jensmaurer commented Nov 5, 2020

D1272R3 approved by CWG in Cologne 2019.

@jensmaurer jensmaurer modified the milestones: 2020-telecon, 2021-telecon Dec 28, 2020
@JeffGarland JeffGarland added the lwg-fullreview Paper is ready for lwg full group review label Jan 27, 2021
@JeffGarland
Copy link
Member

Scheduled for LWG review 2021-01-29.

@JeffGarland
Copy link
Member

Discussed in LWG 2021-01-29. Author will clarify with core details w.r.t. to padding bits.

https://wiki.edg.com/bin/view/Wg21telecons2021/P1272-20210129

@JeffGarland JeffGarland added the needs-revision Paper needs changes before it can proceed label Jan 29, 2021
@jwakely
Copy link
Member

jwakely commented Mar 23, 2021

Note to self: CWG are tracking this so LWG should inform them when we decide on a final disposition.

@jensmaurer jensmaurer moved this from Approved for plenary vote to Ready for review in CWG Apr 23, 2021
@cor3ntin
Copy link

@jwakely The author reach out to me indicating she has no time to work on her papers at the moment.
You remember what core's input was needed for?

@JeffGarland
Copy link
Member

@cor3ntin I think @jwakely was setting a reminder, but if you look at the LWG notes from the session there's concerns about the mandates.

@jwakely
Copy link
Member

jwakely commented Sep 16, 2021

Mandates: value does not have padding bits.

The concern was that this is unimplementable by the library. The parameter is passed by value, we have no idea if it came from a bit-field.

However, reading it again, I'm not sure that's a problem. If a bit-field gets promoted and/or converted to an integral type then there are no padding bits, the "extra" bits are zero bits that are part of the value representation.

I think this is forbidding byte swapping something like __int20 which has 20 bits in the value representation and 12 padding bits. The library can enforce that.

I'll check with Core so Izzy doesn't need to.

@JeffGarland
Copy link
Member

New revision -- planned as backup paper for re-review on 2021-09-24

https://wiki.edg.com/pub/Wg21telecons2021/LibraryWorkingGroup/D1272R4.html

@JeffGarland JeffGarland added C++23 Targeted at C++23 and removed needs-revision Paper needs changes before it can proceed labels Sep 18, 2021
@JeffGarland
Copy link
Member

JeffGarland commented Sep 25, 2021

LWG reviewed and approved during 2021-09-24 telecom

https://wiki.edg.com/bin/view/Wg21telecons2021/P1272-20210924

poll: put P1272r4 into C++23

F A N
6 0 1

@JeffGarland JeffGarland added tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. and removed lwg-fullreview Paper is ready for lwg full group review B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 size - small paper size estimate labels Sep 25, 2021
@cor3ntin cor3ntin added plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. and removed tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. labels Oct 4, 2021
@jensmaurer jensmaurer moved this from Ready for review to Approved for plenary vote in CWG Oct 15, 2021
@wg21bot
Copy link
Collaborator

wg21bot commented Oct 26, 2021

P1272R4 Byteswapping for fun&&nuf (Isabella Muerte, Corentin Jabot)

@wg21bot
Copy link
Collaborator

wg21bot commented Oct 26, 2021

Adopted 2021-10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++23 Targeted at C++23 CWG Core LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Projects
CWG
Approved for plenary vote
Development

Successfully merging a pull request may close this issue.

8 participants