From: Venkatraman Govindaraju Date: Fri, 7 Feb 2014 09:06:52 +0000 (+0000) Subject: [Sparc] Add support for parsing synthetic instruction 'mov'. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1826a526459e56c6f1606e22b4ab43aaa68801f5;p=oota-llvm.git [Sparc] Add support for parsing synthetic instruction 'mov'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200965 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Sparc/SparcInstrAliases.td b/lib/Target/Sparc/SparcInstrAliases.td index 2c7aba27e35..7242c59059a 100644 --- a/lib/Target/Sparc/SparcInstrAliases.td +++ b/lib/Target/Sparc/SparcInstrAliases.td @@ -134,3 +134,9 @@ def : InstAlias<"retl", (RETL 8)>; // ret -> RET 8 def : InstAlias<"ret", (RET 8)>; + +// mov reg, rd -> or %g0, reg, rd +def : InstAlias<"mov $rs2, $rd", (ORrr IntRegs:$rd, G0, IntRegs:$rs2)>; + +// mov simm13, rd -> or %g0, simm13, rd +def : InstAlias<"mov $simm13, $rd", (ORri IntRegs:$rd, G0, i32imm:$simm13)>; diff --git a/test/MC/Sparc/sparc-alu-instructions.s b/test/MC/Sparc/sparc-alu-instructions.s index 393b5df5f9d..5531bcca7af 100644 --- a/test/MC/Sparc/sparc-alu-instructions.s +++ b/test/MC/Sparc/sparc-alu-instructions.s @@ -70,3 +70,8 @@ ! CHECK: subxcc %g1, %g2, %g3 ! encoding: [0x86,0xe0,0x40,0x02] subxcc %g1, %g2, %g3 + ! CHECK: or %g0, %g1, %g3 ! encoding: [0x86,0x10,0x00,0x01] + mov %g1, %g3 + + ! CHECK: or %g0, 255, %g3 ! encoding: [0x86,0x10,0x20,0xff] + mov 0xff, %g3