Skip to content

Commit 3c08503

Browse files
omern1tru
authored andcommitted
[X86] Fix encoding for ATOMIC_LOGIC_OP
Fixes PR#61384. Differential Revision: https://reviews.llvm.org/D145930 (cherry picked from commit 2ebbcfa)
1 parent ba22382 commit 3c08503

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/X86/X86InstrCompiler.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,15 +896,15 @@ multiclass ATOMIC_LOGIC_OP<Format Form, string s> {
896896
multiclass ATOMIC_LOGIC_OP_RM<bits<8> Opc8, string s> {
897897
let Defs = [EFLAGS], mayLoad = 1, mayStore = 1, isCodeGenOnly = 1,
898898
SchedRW = [WriteBitTestSetRegRMW] in {
899-
def 16rm : Ii8<Opc8, MRMDestMem, (outs), (ins i16mem:$src1, GR16:$src2),
899+
def 16rm : I<Opc8, MRMDestMem, (outs), (ins i16mem:$src1, GR16:$src2),
900900
!strconcat(s, "{w}\t{$src2, $src1|$src1, $src2}"),
901901
[(set EFLAGS, (!cast<SDNode>("x86_rm_" # s) addr:$src1, GR16:$src2))]>,
902902
OpSize16, TB, LOCK;
903-
def 32rm : Ii8<Opc8, MRMDestMem, (outs), (ins i32mem:$src1, GR32:$src2),
903+
def 32rm : I<Opc8, MRMDestMem, (outs), (ins i32mem:$src1, GR32:$src2),
904904
!strconcat(s, "{l}\t{$src2, $src1|$src1, $src2}"),
905905
[(set EFLAGS, (!cast<SDNode>("x86_rm_" # s) addr:$src1, GR32:$src2))]>,
906906
OpSize32, TB, LOCK;
907-
def 64rm : RIi8<Opc8, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2),
907+
def 64rm : RI<Opc8, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2),
908908
!strconcat(s, "{q}\t{$src2, $src1|$src1, $src2}"),
909909
[(set EFLAGS, (!cast<SDNode>("x86_rm_" # s) addr:$src1, GR64:$src2))]>,
910910
TB, LOCK;

llvm/test/CodeGen/X86/pr61384.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ define i32 @atomic_global() nounwind {
88
; CHECK: # %bb.0: # %entry
99
; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
1010
; CHECK-NEXT: lock btsq %rax, a(%rip) # encoding: [0xf0,0x48,0x0f,0xab,0x05,A,A,A,A]
11-
; CHECK-NEXT: # fixup A - offset: 5, value: a-5, kind: reloc_riprel_4byte
11+
; CHECK-NEXT: # fixup A - offset: 5, value: a-4, kind: reloc_riprel_4byte
1212
; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
1313
; CHECK-NEXT: retq # encoding: [0xc3]
1414
entry:

0 commit comments

Comments
 (0)