Skip to content

Conversation

@abhinay-anubola
Copy link
Collaborator

Also support get/set_status_reg in instruction selection for AIE2P

case AIE2::crF2FMask:
case AIE2::crF2IMask:
case AIE2::crFPMask:
return SrcConstVal % (1 << 5);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we can generalize this using getRegSizeInBits(Reg, MRI)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm. It looks as if their size is 32 bit...

// the register according to register width.
switch (CtrlReg) {
case AIE2::crSat:
return SrcConstVal % (1 << 2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

CHECK: this is mimicking the hardware when it would move it from a register source. To be frank, I would prefer a frontend error on writing an out of bound constant value.

// Check if the argument is constant for register map index.
const auto Idx = getIConstantVRegValWithLookThrough(IdxReg, MRI);
if (!Idx)
llvm_unreachable("Expected const value for control register map index.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

getIConstantVRegValWithLookThroughOrFail() could encapsulate the llvm_unreachable.

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.

3 participants