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

[AIE2P] Support end to end bfp16 conversion C intrinsics #273

Merged
merged 3 commits into from
Jan 18, 2025

Conversation

khallouh
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@konstantinschwarz konstantinschwarz left a comment

Choose a reason for hiding this comment

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

Looks good!

clang/lib/Headers/aie2p_srs.h Show resolved Hide resolved
clang/lib/Headers/aie2pintrin.h Show resolved Hide resolved
@khallouh khallouh force-pushed the hamza.bfp16.conv branch 2 times, most recently from e6b647e to a50c1ba Compare January 17, 2025 22:43
@khallouh khallouh enabled auto-merge (rebase) January 17, 2025 22:50
BuiltinID == AIE::BI__builtin_aie2p_v64accfloat_to_v64bfp16ebs16)
Ops.push_back(EmitScalarExpr(E->getArg(E->getNumArgs() - 1)));
if (BuiltinID == AIE::BI__builtin_aie2p_v64bfp16ebs8_to_v64bfp16ebs16) {
Ops.push_back(EmitScalarExpr(E->getArg(E->getNumArgs() - 2)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think we can just use E->getArg(2) and E->getArg(3) here, similar to below


MachineInstrBuilder MI = MIB.buildInstr(OpCode, {DstReg}, {SrcReg});

auto MantCopyMI = MIB.buildInstr(TargetOpcode::COPY, {DstReg1}, {})
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: next time we write this COPY code, maybe introduce a helper function?


MachineInstrBuilder MI = MIB.buildInstr(OpCode, {DstReg}, {SrcReg});

auto MantCopyMI = MIB.buildInstr(TargetOpcode::COPY, {DstReg1}, {})
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, we could have a helper that creates the COPYs for mantissa and exponent

@khallouh khallouh merged commit 5cdf955 into aie-public Jan 18, 2025
8 checks passed
@konstantinschwarz konstantinschwarz deleted the hamza.bfp16.conv branch January 18, 2025 01:47
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.

2 participants