Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Target/PowerPC/PPCInstr64Bit.td
Original file line number Diff line number Diff line change
Expand Up @@ -2000,7 +2000,7 @@ def : Pat<(int_ppc_darnraw), (DARN 2)>;

class X_RA5_RB5<bits<6> opcode, bits<10> xo, string opc, RegisterOperand ty,
InstrItinClass itin, list<dag> pattern>
: X_L1_RS5_RS5<opcode, xo, (outs), (ins ty:$RA, ty:$RB, u1imm:$L),
: X_L1_RS5_RS5<opcode, xo, (outs), (ins ty:$RA, ty:$RB),
!strconcat(opc, " $RA, $RB"), itin, pattern>{
let L = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it was meant to be used to generate the instr copy RA,RB,1.

In the class we have:

let Inst{10}    = L;

Even thought we set this explicitly to 1 on line 2005, I am not sure how that works.

I would think the generated instr needs to be fixed up here instead?

                 !strconcat(opc, " $RA, $RB, $L"), itin, pattern>{

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I could google, copy has only two operands. The L bit is bit 10, which has fixed value of 1 in the encoding.

Image

This is unlike paste instruction, which indeed has three operands:

Image

I guess you could call it a copy&paste bug 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was referring to Power ISA™ Version 3.1 (2020). In version 3.0 B (2017) paste is two operand as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right! I was looking at an older ISA.

}
Expand Down
Loading