2013-09-27 18:42:22 +08:00
|
|
|
Code Generation Notes for MSA
|
|
|
|
=============================
|
|
|
|
|
|
|
|
Intrinsics are lowered to SelectionDAG nodes where possible in order to enable
|
|
|
|
optimisation, reduce the size of the ISel matcher, and reduce repetition in
|
|
|
|
the implementation. In a small number of cases, this can cause different
|
|
|
|
(semantically equivalent) instructions to be used in place of the requested
|
|
|
|
instruction, even when no optimisation has taken place.
|
|
|
|
|
|
|
|
Instructions
|
|
|
|
============
|
|
|
|
|
|
|
|
This section describes any quirks of instruction selection for MSA. For
|
|
|
|
example, two instructions might be equally valid for some given IR and one is
|
|
|
|
chosen in preference to the other.
|
|
|
|
|
|
|
|
vshf.w:
|
|
|
|
It is not possible to emit vshf.w when the shuffle description is
|
|
|
|
constant since shf.w covers exactly the same cases. shf.w is used
|
|
|
|
instead. It is also impossible for the shuffle description to be
|
|
|
|
unknown at compile-time due to the definition of shufflevector in
|
|
|
|
LLVM IR.
|
|
|
|
|
2013-10-30 21:07:44 +08:00
|
|
|
vshf.[bhwd]
|
|
|
|
When the shuffle description describes a splat operation, splat.[bhwd]
|
|
|
|
instructions will be selected instead of vshf.[bhwd]. Unlike the ilv*,
|
|
|
|
and pck* instructions, this is matched from MipsISD::VSHF instead of
|
|
|
|
a special-case MipsISD node.
|
|
|
|
|
2013-09-27 18:42:22 +08:00
|
|
|
ilvl.d, pckev.d:
|
|
|
|
It is not possible to emit ilvl.d, or pckev.d since ilvev.d covers the
|
|
|
|
same shuffle. ilvev.d will be emitted instead.
|
|
|
|
|
|
|
|
ilvr.d, ilvod.d, pckod.d:
|
|
|
|
It is not possible to emit ilvr.d, or pckod.d since ilvod.d covers the
|
|
|
|
same shuffle. ilvod.d will be emitted instead.
|
2013-09-27 19:48:57 +08:00
|
|
|
|
2013-10-30 21:07:44 +08:00
|
|
|
splat.[bhwd]
|
|
|
|
The intrinsic will work as expected. However, unlike other intrinsics
|
|
|
|
it lowers directly to MipsISD::VSHF instead of using common IR.
|
|
|
|
|
2013-09-27 19:48:57 +08:00
|
|
|
splati.w:
|
|
|
|
It is not possible to emit splati.w since shf.w covers the same cases.
|
|
|
|
shf.w will be emitted instead.
|
2013-09-27 21:04:21 +08:00
|
|
|
|
2013-10-30 22:45:14 +08:00
|
|
|
copy_s.w:
|
2013-09-27 21:04:21 +08:00
|
|
|
On MIPS32, the copy_u.d intrinsic will emit this instruction instead of
|
|
|
|
copy_u.w. This is semantically equivalent since the general-purpose
|
|
|
|
register file is 32-bits wide.
|
2013-10-30 22:45:14 +08:00
|
|
|
|
|
|
|
binsri.[bhwd], binsli.[bhwd]:
|
|
|
|
These two operations are equivalent to each other with the operands
|
|
|
|
swapped and condition inverted. The compiler may use either one as
|
|
|
|
appropriate.
|
|
|
|
Furthermore, the compiler may use bsel.[bhwd] for some masks that do
|
|
|
|
not survive the legalization process (this is a bug and will be fixed).
|