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

Arbitrary-bit rotations are not implemented #43

Closed
gergoerdi opened this Issue May 1, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@gergoerdi
Collaborator

gergoerdi commented May 1, 2017

For this one, I don't have a nice small test case :( Full LLVM IR is at https://gist.github.com/gergoerdi/9f41a400d7611f7577cc83decf2dbbd4
The error message is:

LLVM ERROR: Cannot select: t44: i8 = rotl Constant:i8<-2>, t17
  t43: i8 = Constant<-2>
  t17: i8 = and t11, Constant:i8<7>
    t11: i8 = add t8, t10
      t8: i8,ch = CopyFromReg t0, Register:i8 %vreg6
        t7: i8 = Register %vreg6
      t10: i8,ch = CopyFromReg t0, Register:i8 %vreg23
        t9: i8 = Register %vreg23
    t16: i8 = Constant<7>
In function: main
@dylanmckay

This comment has been minimized.

Show comment
Hide comment
@dylanmckay

dylanmckay May 1, 2017

Member

It looks like we've got support for constant bit-rotations but rotation by anything that is not a constant is unsupported.

First off the bat, we need to add this to AVRISelLowering

setOperationAction(ISD::ROTL, MVT::i8, Custom);
setOperationAction(ISD::ROTL, MVT::i16, Custom);

That will let us us custom lowering hooks for this.

After that, we will need to add a new case for these two opcodes here

Member

dylanmckay commented May 1, 2017

It looks like we've got support for constant bit-rotations but rotation by anything that is not a constant is unsupported.

First off the bat, we need to add this to AVRISelLowering

setOperationAction(ISD::ROTL, MVT::i8, Custom);
setOperationAction(ISD::ROTL, MVT::i16, Custom);

That will let us us custom lowering hooks for this.

After that, we will need to add a new case for these two opcodes here

@dylanmckay dylanmckay changed the title from LLVM ERROR: Cannot select: t55: i8 = rotl Constant:i8<-2>, t32 to Arbitrary-bit rotations are not implemented May 1, 2017

@dylanmckay dylanmckay added the A-llvm label May 1, 2017

@dylanmckay

This comment has been minimized.

Show comment
Hide comment
@dylanmckay

dylanmckay May 1, 2017

Member

I've implemented n-bit rotations locally, will push up a patch soon.

Member

dylanmckay commented May 1, 2017

I've implemented n-bit rotations locally, will push up a patch soon.

@dylanmckay

This comment has been minimized.

Show comment
Hide comment
@dylanmckay

dylanmckay May 1, 2017

Member

Implemented in r301794

Member

dylanmckay commented May 1, 2017

Implemented in r301794

@dylanmckay

This comment has been minimized.

Show comment
Hide comment
@dylanmckay

dylanmckay May 1, 2017

Member

Backported in e7e0178.

If you pull master, this should now be fixed.

Cherry-picked from llvm-mirror/llvm@02f82ba

Member

dylanmckay commented May 1, 2017

Backported in e7e0178.

If you pull master, this should now be fixed.

Cherry-picked from llvm-mirror/llvm@02f82ba

@dylanmckay dylanmckay closed this May 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment