xref: /freebsd/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYInstrAlias.td (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1//===-- CSKYInstrAlias.td - Target Description for CSKY ----*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file describes the CSKY instructions alias.
10//
11//===----------------------------------------------------------------------===//
12
13def : InstAlias<"nop", (MOV16 R0, R0)>;
14def : InstAlias<"nop", (MOV32 R0, R0)>, Requires<[iHasE2]>;
15
16def : InstAlias<"bgeni16 $dst, $imm", (BGENI GPR:$dst, uimm5:$imm)>;
17def : InstAlias<"bgeni32 $dst, $imm", (BGENI GPR:$dst, uimm5:$imm)>;
18
19def : InstAlias<"bsr $dst", (BSR32 call_symbol:$dst)>;
20
21def : InstAlias<"grs\t$rz, $offset", (GRS32 GPR:$rz, bare_symbol:$offset)>;
22
23def : InstAlias<"jbsr\t$src1", (JBSR32 call_symbol:$src1)>;
24
25def : InstAlias<"jbr $dst", (JBR16 br_symbol_16bit:$dst)>;
26def : InstAlias<"jbt $dst", (JBT16 C, br_symbol_16bit:$dst)>;
27def : InstAlias<"jbf $dst", (JBF16 C, br_symbol_16bit:$dst)>;
28
29def : InstAlias<"lrw $rz, $src", (PseudoLRW16 mGPR:$rz, bare_symbol:$src)>;
30def : InstAlias<"lrw $rz, $src", (LRW16 mGPR:$rz, constpool_symbol_16bit:$src)>;
31def : InstAlias<"lrw $rz, $src", (PseudoLRW32 GPR:$rz, bare_symbol:$src)>;
32def : InstAlias<"lrw $rz, $src", (LRW32 GPR:$rz, constpool_symbol:$src)>;
33
34def : InstAlias<"jsri $dst", (PseudoJSRI32 call_symbol:$dst)>;
35def : InstAlias<"jsri $dst", (JSRI32 constpool_symbol:$dst)>;
36
37def : InstAlias<"jmpi $dst", (PseudoJMPI32 br_symbol:$dst)>;
38def : InstAlias<"jmpi $dst", (JMPI32 constpool_symbol:$dst)>;