Skip to content

Feature/const generics #49

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 13 commits into from
Jan 19, 2021
Merged

Feature/const generics #49

merged 13 commits into from
Jan 19, 2021

Conversation

calebzulawski
Copy link
Member

@calebzulawski calebzulawski commented Dec 6, 2020

This PR adds a few things:

  • Switch to generic-width vectors!
  • Overhaul masks (adds an opaque mask type with arbitrary layout, and a trait for using particular layouts)
  • Adds comparison operations (supersedes PR Feature/comparisons #44)

Quite a bit is going on in this PR, so it might be worth building the docs and reading those first to get a hold of the interface, then moving on to the implementation.

@calebzulawski calebzulawski mentioned this pull request Dec 14, 2020
@calebzulawski calebzulawski marked this pull request as ready for review December 14, 2020 05:46
@programmerjake
Copy link
Member

Looks good to me!

@KodrAus
Copy link
Contributor

KodrAus commented Dec 16, 2020

Looks like we're hitting a bug in the codegen:

Invalid bitcast

  %4 = bitcast <4 x i32> %1 to [4 x i32], !dbg !272

in function _ZN9core_simd11vectors_i3216SimdI32$LT$_$GT$8to_array17h1010e6a6315f7e36E

LLVM ERROR: Broken function found, compilation aborted!

@calebzulawski
Copy link
Member Author

I think this is the same issue from #48. I'm pretty sure it's a compiler bug and not our fault. Is the bitcast invalid because the source and destination types are the same?

@bjorn3
Copy link
Member

bjorn3 commented Dec 16, 2020

The source is a vector I think, the destination is an array.

@calebzulawski
Copy link
Member Author

It looks like arrays don't cast? This doesn't compile at all (https://llvm.godbolt.org/z/4xM1MY):

define [4 x i32] @cast([4 x float] %x) local_unnamed_addr #0 {
    %out = bitcast [4 x float] %x to [4 x i32]
    ret [4 x i32] %out
}

The equivalent with vectors works just fine.

@calebzulawski
Copy link
Member Author

Opened rust-lang/rust#80108 to address the error. Going to try to find a workaround :)

@calebzulawski calebzulawski mentioned this pull request Jan 7, 2021
@KodrAus KodrAus merged commit b931c15 into master Jan 19, 2021
@KodrAus KodrAus mentioned this pull request Jan 19, 2021
@KodrAus KodrAus deleted the feature/const-generics branch January 19, 2021 23:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants