Skip to content

[Bug] Vector types incorrectly passed as ptr #2427

Description

@zerkawei

The vector types in System.Numerics (float2, float4, int32_4, ...) when passed as a function argument are passed as ptr rather than using the proper <n x type>.

For example :

public static float4 Mult(float4 a, float4 b)
{
	return a * b;
}

becomes :

define <4 x float> @_ZN2bf8TestZone7Program4MultENS_6System8Numerics6float4ES4_(ptr %a, ptr %b) #0

This does not match C behavior regarding these types where :

typedef float vec4 __attribute__((vector_size(16)));

vec4 mult(vec4 lhs, vec4 rhs) {
    return lhs * rhs;
}

becomes :

define dso_local <4 x float> @mult(<4 x float> noundef %0, <4 x float> noundef %1) #0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions