Skip to content
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

[ARM] Correctly handle .inst in IT and VPT blocks #68902

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
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: 2 additions & 0 deletions llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11981,6 +11981,8 @@ bool ARMAsmParser::parseDirectiveInst(SMLoc Loc, char Suffix) {
}

getTargetStreamer().emitInst(Value->getValue(), CurSuffix);
forwardITPosition();
forwardVPTPosition();
return false;
};

Expand Down
26 changes: 26 additions & 0 deletions llvm/test/MC/ARM/inst-directive-it-vpt.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// RUN: llvm-mc %s -triple armv8m.main -mattr=+mve -filetype asm -o - | FileCheck %s

.thumb

// CHECK: it eq
// CHECK: .inst.n 0x3001
// CHECK: add.w r0, r0, #1
it eq
.inst.n 0x3001 // addeq r0, #1
add r0, #1

// CHECK: vpst
// CHECK: .inst.w 0xef220844
// CHECK: vadd.i32 q0, q1, q2
vpst
.inst.w 0xef220844 // vaddt.i32 q0, q1, q2
vadd.i32 q0, q1, q2

// CHECK: ite eq
// CHECK: .inst.n 0x3001
// CHECK: addne r0, #1
// CHECK: add.w r0, r0, #1
ite eq
.inst.n 0x3001 // addeq r0, #1
addne r0, #1
add r0, #1