Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mips][microMIPSr6] Implement BALC and BC instructions
This patch implements BALC and BC instructions using mapping. Differential Revision: http://reviews.llvm.org/D8388 llvm-svn: 235302
- Loading branch information
Jozef Kolek
committed
Apr 20, 2015
1 parent
e4ab49e
commit 5de4a6c
Showing
4 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//=- MicroMips32r6InstrInfo.td - MicroMips r6 Instruction Information -*- tablegen -*-=// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file describes microMIPSr6 instructions. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
//===----------------------------------------------------------------------===// | ||
// | ||
// Instruction Encodings | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class BALC_MMR6_ENC : BRANCH_OFF26_FM<0b101101>; | ||
class BC_MMR6_ENC : BRANCH_OFF26_FM<0b100101>; | ||
|
||
//===----------------------------------------------------------------------===// | ||
// | ||
// Instruction Descriptions | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class BC_MMR6_DESC_BASE<string instr_asm, DAGOperand opnd> | ||
: BRANCH_DESC_BASE, MMR6Arch<instr_asm> { | ||
dag InOperandList = (ins opnd:$offset); | ||
dag OutOperandList = (outs); | ||
string AsmString = !strconcat(instr_asm, "\t$offset"); | ||
bit isBarrier = 1; | ||
} | ||
|
||
class BALC_MMR6_DESC : BC_MMR6_DESC_BASE<"balc", brtarget26> { | ||
bit isCall = 1; | ||
list<Register> Defs = [RA]; | ||
} | ||
class BC_MMR6_DESC : BC_MMR6_DESC_BASE<"bc", brtarget26>; | ||
|
||
//===----------------------------------------------------------------------===// | ||
// | ||
// Instruction Definitions | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
def BALC_MMR6 : R6MMR6Rel, BALC_MMR6_ENC, BALC_MMR6_DESC, ISA_MICROMIPS32R6; | ||
def BC_MMR6 : R6MMR6Rel, BC_MMR6_ENC, BC_MMR6_DESC, ISA_MICROMIPS32R6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r6 -mattr=micromips | FileCheck %s | ||
|
||
.set noat | ||
balc 14572256 # CHECK: balc 14572256 # encoding: [0xb4,0x37,0x96,0xb8] | ||
bc 14572256 # CHECK: bc 14572256 # encoding: [0x94,0x37,0x96,0xb8] |