Skip to content

Vector512.Create doesn't work as expected #97924

Closed

Description

@DomenPigeon

Description

Vector512.Create doesn't work as expected

Reproduction Steps

using System.Runtime.Intrinsics;
using System.Text;

var arr = new long[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };

var vec128_0 = Vector128.Create(arr, 0);
var vec128_2 = Vector128.Create(arr, 2);

Console.WriteLine(vec128_0);
Console.WriteLine(vec128_2);

var vec256_0 = Vector256.Create(arr, 0);
var vec256_4 = Vector256.Create(arr, 4);

Console.WriteLine(vec256_0);
Console.WriteLine(vec256_4);

var vec512_0 = Vector512.Create(arr, 0);
var vec512_8 = Vector512.Create(arr, 8);

Console.WriteLine(vec512_0);
Console.WriteLine(vec512_8);

Expected behavior

<1, 2>
<3, 4>
<1, 2, 3, 4>
<5, 6, 7, 8>
<1, 2, 3, 4, 5, 6, 7, 8>
<9, 10, 11, 12, 13, 14, 15, 16>

Actual behavior

<1, 2>
<3, 4>
<1, 2, 3, 4>
<5, 6, 7, 8>
<1, 2, 3, 4, 5, 6, 7, 8>
<2, 3, 4, 5, 6, 7, 8, 9>

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    untriaged
    on Feb 3, 2024
  2. ghost added
    area-CodeGen-coreclr
    on Feb 3, 2024
  3. tannergooding commented on Feb 3, 2024

    @tannergooding
    Member

    This is a similar bug to #94743, but in Create. Another place where a less safe pattern was used and done incorrectly, so its indexing from the 8th byte of the array, not the 8th element

  4. added this to the 9.0.0 milestone on Feb 5, 2024
  5. ghost removed
    untriaged
    on Feb 5, 2024
  6. added
    untriaged
    and removed
    area-CodeGen-coreclr
    on Feb 5, 2024
  7. removed
    untriaged
    on Feb 5, 2024
  8. ghost added
    in-pr
    on Feb 5, 2024
  9. ghost removed
    in-pr
    on Feb 7, 2024
  10. locked and limited conversation to collaborators on Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions