Jack Carter
1327c08922
[mips][msa] Direct Object Emission for 3RF instructions.
...
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191461 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-26 21:31:43 +00:00
Jack Carter
00a5b53e14
[mips][msa] Updates encoding of 3RF instructions to match the latest revision of the MSA spec (1.06).
...
This does not affect any of the existing output.
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191460 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-26 21:18:57 +00:00
Jack Carter
9fa81ab838
[mips][msa] Direct Object Emission for 3R instructions.
...
This is the first set of instructions with a ".b" modifier thus we need to add the required code to disassemble a MSA128B register class.
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191415 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-26 00:09:46 +00:00
Jack Carter
afee613bf3
[mips][msa] Updates encoding of 3R instructions to match the latest revision of the MSA spec (1.06).
...
Internal changes only.
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-26 00:02:44 +00:00
Jack Carter
4167b88cf5
[mips][msa] Direct Object Emission for 2RF instructions.
...
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191413 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:56:25 +00:00
Jack Carter
42d9ca6299
[mips][msa] Direct Object Emission support for the MSA instruction set.
...
In more detail, this patch adds the ability to parse, encode and decode MSA registers ($w0-$w31). The format of 2RF instructions (MipsMSAInstrFormat.td) was updated so that we could attach a test case to this patch i.e., the test case parses, encodes and decodes 2 MSA instructions. Following patches will add the remainder of the instructions.
Note that DecodeMSA128BRegisterClass is missing from MipsDisassembler.td because it's not yet required at this stage and having it would cause a compiler warning (unused function).
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191412 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:50:44 +00:00
Jack Carter
825e5583b6
[mips][msa] Updates encoding of 2RF instructions to match the latest revision of the MSA spec (1.06).
...
This only changes internal encodings and doesn't affect output.
Patch by Matheus Almeida
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191411 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:42:03 +00:00
Daniel Sanders
3706eda52c
[mips][msa] Added support for matching pckev, and pckod from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191306 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 14:53:25 +00:00
Daniel Sanders
f515964d36
[mips][msa] Added support for matching ilv[lr], ilvod, and ilvev from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 14:36:12 +00:00
Daniel Sanders
93d995719e
[mips][msa] Added support for matching shf from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191302 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 14:20:00 +00:00
Daniel Sanders
7e0df9aa29
[mips][msa] Added support for matching vshf from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 14:02:15 +00:00
Daniel Sanders
acfa5a203c
[mips][msa] Remove the VSPLAT and VSPLATD nodes in favour of matching BUILD_VECTOR.
...
Most constant BUILD_VECTOR's are matched using ComplexPatterns which cover
bitcasted as well as normal vectors. However, it doesn't seem to be possible to
match ldi.[bhwd] in a type-agnostic manner (e.g. to support the widest range of
immediates, it should be possible to use ldi.b to load v2i64) using TableGen so
ldi.[bhwd] is matched using custom code in MipsSEISelDAGToDAG.cpp
This made the majority of the constant splat BUILD_VECTOR lowering redundant.
The only transformation remaining for constant splats is when an (up-to) 32-bit
constant splat is possible but the value does not fit into a 10-bit signed
integer. In this case, the BUILD_VECTOR is transformed into a bitcasted
BUILD_VECTOR so that fill.[bhw] can be used to splat the vector from a GPR32
register (which is initialized using the usual lui/addui sequence).
There are no additional tests since this is a re-implementation of previous
functionality. The change is intended to make it easier to implement some of
the upcoming instruction selection patches since they can rely on existing
support for BUILD_VECTOR's in the DAGCombiner.
compare_float.ll changed slightly because a BITCAST is no longer
introduced during legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 13:33:07 +00:00
Daniel Sanders
421dcc5921
[mips][msa] Added partial support for matching fmax_a from normal IR (i.e. not intrinsics)
...
This covers the case where fmax_a can be used to implement ISD::FABS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191296 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 13:02:08 +00:00
Daniel Sanders
930f2b5108
[mips][msa] Line wrapping.
...
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191295 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 12:45:36 +00:00
Daniel Sanders
c998bc9843
[mips][msa] Added support for matching andi, ori, nori, and xori from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191293 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 12:32:47 +00:00
Daniel Sanders
89d13c1b38
[mips][msa] Added support for matching max, maxi, min, mini from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191291 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 12:18:31 +00:00
Daniel Sanders
38a10ff063
[mips][msa] Added support for matching bsel and bseli from normal IR (i.e. not intrinsics)
...
This required correcting the definition of the bsel and bseli intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191290 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 12:04:44 +00:00
Daniel Sanders
ae1fb8fc19
[mips][msa] Added support for matching comparisons from normal IR (i.e. not intrinsics)
...
MIPS SelectionDAG changes:
* Added VCEQ, VCL[ET]_[SU] nodes to represent vector comparisons that produce a bitmask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191286 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 10:46:19 +00:00
Daniel Sanders
cfb1e17031
[mips][msa] Added support for matching slli, srai, and srli from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191285 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 10:28:18 +00:00
Daniel Sanders
e0187e51a1
[mips][msa] Added support for matching addvi, and subvi from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191203 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 14:29:55 +00:00
Daniel Sanders
9a1aaeb012
[mips][msa] Added support for matching insert and copy from normal IR (i.e. not intrinsics)
...
Changes to MIPS SelectionDAG:
* Added nodes VEXTRACT_[SZ]EXT_ELT to represent extract and extend in a single
operation and implemented the DAG combines necessary to fold sign/zero
extends into the extract.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191199 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 14:03:12 +00:00
Daniel Sanders
a399d698a8
[mips][msa] Added support for matching pcnt from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 13:40:21 +00:00
Daniel Sanders
915432ca13
[mips][msa] Added support for matching nor from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191195 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 13:22:24 +00:00
Daniel Sanders
4e812c1f4a
[mips][msa] Added support for matching and, or, and xor from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 12:57:42 +00:00
Daniel Sanders
da521cc1cc
[mips][msa] Implemented build_vector using ldi, fill, and custom SelectionDAG nodes (VSPLAT and VSPLATD)
...
Note: There's a later patch on my branch that re-implements this to select
build_vector without the custom SelectionDAG nodes. The future patch avoids
the constant-folding problems stemming from the custom node (i.e. it doesn't
need to re-implement all the DAG combines related to BUILD_VECTOR).
Changes to MIPS specific SelectionDAG nodes:
* Added VSPLAT
This is a special case of BUILD_VECTOR that covers the case the
BUILD_VECTOR is a splat operation.
* Added VSPLATD
This is a special case of VSPLAT that handles the cases when v2i64 is legal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191191 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 12:02:46 +00:00
Daniel Sanders
f2eb1e4286
[mips][msa] Added support for matching mulv, nlzc, sll, sra, srl, and subv from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190518 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 11:58:30 +00:00
Daniel Sanders
2ac1282921
[mips][msa] Added support for matching fadd, fdiv, flog2, fmul, frint, fsqrt, and fsub from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190512 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 10:51:30 +00:00
Daniel Sanders
ece929d623
[mips][msa] Added support for matching div_[su] from normal IR (i.e. not intrinsics)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190509 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 10:38:58 +00:00
Daniel Sanders
68831cbd41
[mips][msa] Added support for matching addv from normal IR (i.e. not intrinsics)
...
The corresponding intrinsic is now lowered into equivalent IR (ISD::ADD) before instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190507 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 10:28:16 +00:00
Daniel Sanders
8857294192
[mips][msa] Corrected the definition of the dotp_[su].[hwd] intrinsics
...
The elements of the operands should be half the width of the elements of
the result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190505 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 09:59:17 +00:00
Daniel Sanders
436f64567c
[mips][msa] Removed unsupported dot product instructions (dotp_[su].b)
...
The dotp_[su].b instructions never existed in any revision of the MSA spec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 09:51:43 +00:00
Akira Hatanaka
69f8e0935a
[mips] Use uimm5 and uimm6 instead of shamt and imm, if the immediate has to fit
...
into a 5-bit or 6-bit field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190226 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-07 00:02:02 +00:00
Daniel Sanders
a86062c4b1
[mips][msa] Indentation
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 13:25:06 +00:00
Daniel Sanders
5cb39b22fb
[mips][msa] Requires<[HasMSA]> is redundant, it is also supplied via inheritance
...
Tested with 'llvm-tblgen -print-records' which outputs identical records before
and after this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190155 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 13:15:05 +00:00
Daniel Sanders
3aaa3e31aa
[mips][msa] Made the operand register sets optional for the VEC formats
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 13:01:47 +00:00
Daniel Sanders
9e935a77a5
[mips][msa] Made the operand register sets optional for the ELM_INSVE formats
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:50:52 +00:00
Daniel Sanders
b9987d1aa1
[mips][msa] Made the operand register sets optional for the 3RF_4RF format
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190150 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:44:13 +00:00
Daniel Sanders
888497d8a2
[mips][msa] Made the operand register sets optional for the 3RF formats
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190146 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:32:57 +00:00
Daniel Sanders
6976d75415
[mips][msa] Made the operand register sets optional for the 3R_4R format
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:30:43 +00:00
Daniel Sanders
99d02d1325
[mips][msa] Made the operand register sets optional for the 2RF format
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:28:13 +00:00
Daniel Sanders
d31c238372
[mips][msa] Made the operand register sets optional for the I8 format
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:25:47 +00:00
Daniel Sanders
7d3da67611
[mips][msa] Made the operand register sets optional for the I5 and SI5 formats
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190141 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:23:19 +00:00
Daniel Sanders
bfb9bab243
[mips][msa] Made the operand register sets optional for the BIT_[BHWD] formats
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 12:10:24 +00:00
Daniel Sanders
e3273b3275
[mips][msa] Sorted MSA_BIT_[BHWD]_DESC_BASE into ascending order of element size
...
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190134 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 11:01:38 +00:00
Daniel Sanders
cc538affd2
[mips][msa] Made the operand register sets optional for the 3R format
...
Their default is to be the same as the result register set.
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190133 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 10:59:24 +00:00
Daniel Sanders
3f1acd55a8
[mips][msa] Made the InstrItinClass argument optional since it is always NoItinerary at the moment.
...
No functional change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190131 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 10:55:15 +00:00
Daniel Sanders
3c380d5e28
[mips][msa] Added bnz.df, bnz.v, bz.df, and bz.v
...
These intrinsics are legalized to V(ALL|ANY)_(NON)?ZERO nodes,
are matched as SN?Z_[BHWDV]_PSEUDO pseudo's, and emitted as
a branch/mov sequence to evaluate to 0 or 1.
Note: The resulting code is sub-optimal since it doesnt seem to be possible
to feed the result of an intrinsic directly into a brcond. At the moment
it uses (SETCC (VALL_ZERO $ws), 0, SETEQ) and similar which unnecessarily
evaluates the boolean twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189478 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 12:14:50 +00:00
Daniel Sanders
2fd3e67dc6
[mips][msa] Added load/store intrinsics.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189476 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 12:04:29 +00:00
Daniel Sanders
abbcf3bd47
[mips][msa] Added move.v
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 10:44:47 +00:00
Daniel Sanders
a6c3a4ee76
[mips][msa] Added cfcmsa, and ctcmsa
...
The MSA control registers have been added as reserved registers,
and are only used via ISD::Copy(To|From)Reg. The intrinsics are lowered
into these nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189468 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 10:26:24 +00:00