Skip to content

MAINT: remove references to 256-bits extended precision types #28932

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

Merged
merged 2 commits into from
May 11, 2025

Conversation

jorenham
Copy link
Member

@jorenham jorenham commented May 8, 2025

Because int256, uint256, float256, and complex512, aren't a thing 🤷.

(first time I've touched the C code btw)

Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we can safely assume that these will never exist, I think.

EDIT: For clarity, these are currently only relevant for us as aliases to a native C type (i.e. long long). An int256_t could exist of course, but would be different.

(including float80 there seems also right. Not sure that ever exists either, it exists elsewhere in our source...)

@jorenham
Copy link
Member Author

jorenham commented May 8, 2025

(including float80 there seems also right. Not sure that ever exists either, it exists elsewhere in our source...)

I don't think the 80-bit ones can exist in python, but perhaps they can in C?

@jorenham
Copy link
Member Author

jorenham commented May 8, 2025

Should I also get rid of the int128 types, while we're at it?

@seberg
Copy link
Member

seberg commented May 8, 2025

I don't think the 80-bit ones can exist in python, but perhaps they can in C?

Those are the same thing. The question is if there is any hardware that packs 80bit longdouble into 80bits (i.e. doesn't care about alignment concerns).

Should I also get rid of the int128 types, while we're at it?

Good point, might as well. Since I am pretty sure our build would fail anyway in other places if it existed in practice.

@jorenham
Copy link
Member Author

jorenham commented May 8, 2025

The question is if there is any hardware that packs 80bit longdouble into 80bits

Wouldn't that require sizeof(double) + sizeof(long) == 80, or am I interpreting the long double too literally 🤔? So perhaps a 64-bits double and a 16-bits long on a 16-bit system, if those exist 🤷🏻

@seberg
Copy link
Member

seberg commented May 8, 2025

hahahaha, sorry but it's funny :). longdouble is a float at least as big as double. 80bits is typical, but it'll be padded for alignment, so its always stord as 96 or 128 bits.

@jorenham
Copy link
Member Author

jorenham commented May 8, 2025

hahahaha, sorry but it's funny :). longdouble is a float at least as big as double. 80bits is typical, but it'll be padded for alignment, so its always stord as 96 or 128 bits.

Lol yea I knew about how it's secretly 80 bits. But I just thought that the padding was a consequence of the double and long sizes, since it's padded to 64+32=96 on 64bit windows, and 64+64=128 on 64bit unix. But no idea if that's actually the reason behind the padding.

@charris
Copy link
Member

charris commented May 8, 2025

the reason behind the padding.

Alignment in memory.

@charris
Copy link
Member

charris commented May 10, 2025

close/reopen

@charris charris closed this May 10, 2025
@charris charris reopened this May 10, 2025
@jorenham
Copy link
Member Author

jorenham commented May 10, 2025

Probably needs a rebase for CI. I can't right now, so feel free to do so if you feel like it

@charris charris merged commit b63a009 into numpy:main May 11, 2025
136 of 138 checks passed
@charris
Copy link
Member

charris commented May 11, 2025

Thanks Joren.

@jorenham jorenham deleted the no-256 branch May 11, 2025 14:25
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy