This is an archive of the discontinued LLVM Phabricator instance.

[MC][ARM] vscclrm disassembles as vldmia
ClosedPublic

Authored by labrinea on Sep 25 2019, 7:21 AM.

Details

Summary

Happens only when the mve.fp subtarget feature is enabled:

$ llvm-mc -triple thumbv8.1m.main -mattr=+mve.fp,+8msecext -disassemble <<< "0x9f,0xec,0x08,0x0b"
	.text
	vldmia	pc, {d0, d1, d2, d3}
$ llvm-mc -triple thumbv8.1m.main -mattr=+8msecext -disassemble <<< "0x9f,0xec,0x08,0x0b"
	.text
	vscclrm	{d0, d1, d2, d3, vpr}

Assembling returns the correct encoding with or without mve.fp:

$ llvm-mc -triple thumbv8.1m.main -mattr=+mve.fp,+8msecext -show-encoding <<< "vscclrm {d0-d3, vpr}"
	.text
	vscclrm	{d0, d1, d2, d3, vpr}   @ encoding: [0x9f,0xec,0x08,0x0b]
$ llvm-mc -triple thumbv8.1m.main -mattr=+8msecext -show-encoding <<< "vscclrm {d0-d3, vpr}"
	.text
	vscclrm	{d0, d1, d2, d3, vpr}   @ encoding: [0x9f,0xec,0x08,0x0b]

The problem seems to be in the TableGen description of VSCCLRMD. The least significant bit should be set to zero.

Diff Detail

Repository
rL LLVM

Event Timeline

labrinea created this revision.Sep 25 2019, 7:21 AM
miyuki added inline comments.Sep 26 2019, 7:27 AM
llvm/test/MC/ARM/vscclrm-asm.s
7 ↗(On Diff #221755)

Why do we need a different prefix here? I.e. shouldn't the assembler behave the same way with "-mattr=+mve.fp,+8msecext" as with "-mattr=+8msecext"?
Same question the disassembler.

labrinea marked an inline comment as done.Sep 26 2019, 10:04 AM
labrinea added inline comments.
llvm/test/MC/ARM/vscclrm-asm.s
7 ↗(On Diff #221755)

Indeed, a separate label is not necessary. I will fix that.

labrinea updated this revision to Diff 221977.Sep 26 2019, 10:14 AM

Updated the Filecheck labels as suggested.

labrinea marked an inline comment as not done.Sep 26 2019, 10:15 AM
miyuki accepted this revision.Sep 26 2019, 10:28 AM
This revision is now accepted and ready to land.Sep 26 2019, 10:28 AM
This revision was automatically updated to reflect the committed changes.