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

How does array upgrading work? #508

Open
lassik opened this issue Oct 3, 2022 · 3 comments
Open

How does array upgrading work? #508

lassik opened this issue Oct 3, 2022 · 3 comments

Comments

@lassik
Copy link

lassik commented Oct 3, 2022

Armed Bear Common Lisp 1.9.0
Java 19 Homebrew
OpenJDK 64-Bit Server VM

How does this:

> (upgraded-array-element-type '(unsigned-byte 16))
(UNSIGNED-BYTE 16)

> (upgraded-array-element-type '(unsigned-byte 17))
T

> (upgraded-array-element-type '(unsigned-byte 31))
T

> (upgraded-array-element-type '(unsigned-byte 32))
(UNSIGNED-BYTE 32)

result in this:

> (type-of (make-array 10 :element-type '(unsigned-byte 17)))
(SIMPLE-ARRAY (UNSIGNED-BYTE 32) (10))

> (type-of (make-array '(10 10) :element-type '(unsigned-byte 17)))
(SIMPLE-ARRAY (UNSIGNED-BYTE 32) (10 10))

> (type-of (make-array '(10 10 10) :element-type '(unsigned-byte 17)))
(SIMPLE-ARRAY (UNSIGNED-BYTE 32) (10 10 10))
@easye
Copy link
Collaborator

easye commented Aug 18, 2023

ABCL is making the decision to promote to a seventeen bit byte to (UNSIGNED-BYTE 32), which is the next optimized size.

It should be able to signal the Bear to attempt to optimize for size by the right declaim form, but that is currently not implementation.

@easye easye closed this as completed Aug 18, 2023
@lassik
Copy link
Author

lassik commented Aug 19, 2023

(upgraded-array-element-type '(unsigned-byte 17)) should return (UNSIGNED-BYTE 32)?

@easye
Copy link
Collaborator

easye commented Aug 20, 2023

(upgraded-array-element-type '(unsigned-byte 17)) should return (UNSIGNED-BYTE 32)?

Ah, I reproduced that as a bug now. Re-opening.

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

No branches or pull requests

2 participants