Skip to content

Commit

Permalink
[Xtensa] Fix atomic swap for 8/16 bit operands.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreisfr committed Sep 28, 2023
1 parent f0b03b4 commit 2a920d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/Xtensa/XtensaISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ XtensaTargetLowering::emitAtomicSwap(MachineInstr &MI, MachineBasicBlock *BB,
unsigned R8 = MRI.createVirtualRegister(RC);

BuildMI(*BB, St, DL, TII.get(Xtensa::SSR)).addReg(BitOffs);
BuildMI(*BB, St, DL, TII.get(Xtensa::SLL), R8).addReg(AtomValLoop);
BuildMI(*BB, St, DL, TII.get(Xtensa::SRL), R8).addReg(AtomValLoop);

if (isByteOperand) {
BuildMI(*BB, St, DL, TII.get(Xtensa::SEXT), Res.getReg())
Expand Down

0 comments on commit 2a920d9

Please sign in to comment.