From b35d3a273321a570f9c2d938a840aabbd14dd336 Mon Sep 17 00:00:00 2001 From: Daniel Cederman Date: Thu, 27 Sep 2018 12:34:53 +0000 Subject: [PATCH] [Sparc] Add unimp alias Summary: Use 0 as the default immediate for the UNIMP instruction. This matches the behavior in gas. Reviewers: jyknight, venkatra Subscribers: fedor.sergeev, jrtc27, llvm-commits Differential Revision: https://reviews.llvm.org/D51526 llvm-svn: 343203 --- llvm/lib/Target/Sparc/SparcInstrAliases.td | 3 +++ llvm/test/MC/Sparc/sparc-misc-instructions.s | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 llvm/test/MC/Sparc/sparc-misc-instructions.s diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td index fc6844c..3598739 100644 --- a/llvm/lib/Target/Sparc/SparcInstrAliases.td +++ b/llvm/lib/Target/Sparc/SparcInstrAliases.td @@ -476,6 +476,9 @@ def : InstAlias<"pwr $simm13, %psr", (PWRPSRri G0, i32imm:$simm13), 0>; // flush -> flush %g0 def : InstAlias<"flush", (FLUSH), 0>; +// unimp -> unimp 0 +def : InstAlias<"unimp", (UNIMP 0), 0>; + def : MnemonicAlias<"iflush", "flush">; def : MnemonicAlias<"stub", "stb">; diff --git a/llvm/test/MC/Sparc/sparc-misc-instructions.s b/llvm/test/MC/Sparc/sparc-misc-instructions.s new file mode 100644 index 0000000..3ae7dee --- /dev/null +++ b/llvm/test/MC/Sparc/sparc-misc-instructions.s @@ -0,0 +1,8 @@ +! RUN: llvm-mc %s -arch=sparc -show-encoding | FileCheck %s +! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s + + ! CHECK: unimp 0 ! encoding: [0x00,0x00,0x00,0x00] + unimp + + ! CHECK: unimp 0 ! encoding: [0x00,0x00,0x00,0x00] + unimp 0 -- 2.7.4