Skip to content

Conversation

SagarMaheshwari99
Copy link
Collaborator

No description provided.

@@ -1354,10 +1354,10 @@ INTRINSIC(void *) extract_address(v16int32 v, int idx) {
}
// broadcast from scalar (alternative syntax to broadcast to vector)
INTRINSIC(v64int8)
broadcast_s8(char b) { return b - v64int8{0}; }
broadcast_s8(int b) { return (char)b - v64int8{0}; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we update the tests as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

As I remember, we reused aie2 tests for aie2p as well. Since at it, can you please fix it for aie2 as well.

@@ -1354,10 +1354,10 @@ INTRINSIC(void *) extract_address(v16int32 v, int idx) {
}
// broadcast from scalar (alternative syntax to broadcast to vector)
INTRINSIC(v64int8)
broadcast_s8(char b) { return b - v64int8{0}; }
broadcast_s8(int b) { return (char)b - v64int8{0}; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

v64int8{b} doesn't work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, that will only initialize the first element of the vector with b.
But the subtraction (char)b - v64int8{0} is performed element-wise due to how vector types work, effectively resulting in a vector where each element is b.

We don't even need to specify 0 when initializing a v64int8 vector, since all elements of a vector are initialized to 0 by default.
So (char)b - v64int8{} will also work.


INTRINSIC(v32int16)
broadcast_s16(short b) { return b - v32int16{0}; }
broadcast_s16(int b) { return (short)b - v32int16{0}; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

why weren't we happy with implicit casting?

Copy link
Collaborator

Choose a reason for hiding this comment

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

short b is promoted to int

mgehre-amd pushed a commit that referenced this pull request Aug 21, 2025
[AutoBump] Merge with 465a3ce (Jan 09) (33)
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

Successfully merging this pull request may close these issues.

4 participants