[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
//===- PPCInstrVSX.td - The PowerPC VSX Extension --*- 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 the VSX extension to the PowerPC instruction set.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
[PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations
This patch adds a new SSA MI pass that runs on little-endian PPC64
code with VSX enabled. Loads and stores of 4x32 and 2x64 vectors
without alignment constraints are accomplished for little-endian using
lxvd2x/xxswapd and xxswapd/stxvd2x. The existence of the additional
xxswapd instructions hurts performance in comparison with big-endian
code, but they are necessary in the general case to support correct
semantics.
However, the general case does not apply to most vector code. Many
vector instructions are lane-insensitive; they do not "care" which
lanes the parallel computations are performed within, provided that
the resulting data is stored into the correct locations. Thus this
pass looks for computations that perform only lane-insensitive
operations, and remove the unnecessary swaps from loads and stores in
such computations.
Future improvements will allow computations using certain
lane-sensitive operations to also be optimized in this manner, by
modifying the lane-sensitive operations to account for the permuted
order of the lanes. However, this patch only adds the infrastructure
to permit this; no lane-sensitive operations are optimized at this
time.
This code is heavily exercised by the various vectorizing applications
in the projects/test-suite tree. For the time being, I have only added
one simple test case to demonstrate what the pass is doing. Although
it is quite simple, it provides coverage for much of the code,
including the special case handling of copies and subreg-to-reg
operations feeding the swaps. I plan to add additional tests in the
future as I fill in more of the "special handling" code.
Two existing tests were affected, because they expected the swaps to
be present, but they are now removed.
llvm-svn: 235910
2015-04-28 03:57:34 +08:00
|
|
|
// *********************************** NOTE ***********************************
|
|
|
|
// ** For POWER8 Little Endian, the VSX swap optimization relies on knowing **
|
|
|
|
// ** which VMX and VSX instructions are lane-sensitive and which are not. **
|
|
|
|
// ** A lane-sensitive instruction relies, implicitly or explicitly, on **
|
|
|
|
// ** whether lanes are numbered from left to right. An instruction like **
|
|
|
|
// ** VADDFP is not lane-sensitive, because each lane of the result vector **
|
|
|
|
// ** relies only on the corresponding lane of the source vectors. However, **
|
|
|
|
// ** an instruction like VMULESB is lane-sensitive, because "even" and **
|
|
|
|
// ** "odd" lanes are different for big-endian and little-endian numbering. **
|
|
|
|
// ** **
|
|
|
|
// ** When adding new VMX and VSX instructions, please consider whether they **
|
|
|
|
// ** are lane-sensitive. If so, they must be added to a switch statement **
|
|
|
|
// ** in PPCVSXSwapRemoval::gatherVectorInstructions(). **
|
|
|
|
// ****************************************************************************
|
|
|
|
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def PPCRegVSRCAsmOperand : AsmOperandClass {
|
|
|
|
let Name = "RegVSRC"; let PredicateMethod = "isVSRegNumber";
|
|
|
|
}
|
|
|
|
def vsrc : RegisterOperand<VSRC> {
|
|
|
|
let ParserMatchClass = PPCRegVSRCAsmOperand;
|
|
|
|
}
|
|
|
|
|
2014-03-29 13:29:01 +08:00
|
|
|
def PPCRegVSFRCAsmOperand : AsmOperandClass {
|
|
|
|
let Name = "RegVSFRC"; let PredicateMethod = "isVSRegNumber";
|
|
|
|
}
|
|
|
|
def vsfrc : RegisterOperand<VSFRC> {
|
|
|
|
let ParserMatchClass = PPCRegVSFRCAsmOperand;
|
|
|
|
}
|
|
|
|
|
2015-05-08 02:24:05 +08:00
|
|
|
def PPCRegVSSRCAsmOperand : AsmOperandClass {
|
|
|
|
let Name = "RegVSSRC"; let PredicateMethod = "isVSRegNumber";
|
|
|
|
}
|
|
|
|
def vssrc : RegisterOperand<VSSRC> {
|
|
|
|
let ParserMatchClass = PPCRegVSSRCAsmOperand;
|
|
|
|
}
|
|
|
|
|
2017-09-22 00:12:33 +08:00
|
|
|
def PPCRegSPILLTOVSRRCAsmOperand : AsmOperandClass {
|
|
|
|
let Name = "RegSPILLTOVSRRC"; let PredicateMethod = "isVSRegNumber";
|
|
|
|
}
|
|
|
|
|
|
|
|
def spilltovsrrc : RegisterOperand<SPILLTOVSRRC> {
|
|
|
|
let ParserMatchClass = PPCRegSPILLTOVSRRCAsmOperand;
|
|
|
|
}
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
// Little-endian-specific nodes.
|
|
|
|
def SDT_PPClxvd2x : SDTypeProfile<1, 1, [
|
|
|
|
SDTCisVT<0, v2f64>, SDTCisPtrTy<1>
|
|
|
|
]>;
|
|
|
|
def SDT_PPCstxvd2x : SDTypeProfile<0, 2, [
|
|
|
|
SDTCisVT<0, v2f64>, SDTCisPtrTy<1>
|
|
|
|
]>;
|
|
|
|
def SDT_PPCxxswapd : SDTypeProfile<1, 1, [
|
|
|
|
SDTCisSameAs<0, 1>
|
|
|
|
]>;
|
2016-07-05 17:22:29 +08:00
|
|
|
def SDTVecConv : SDTypeProfile<1, 2, [
|
|
|
|
SDTCisVec<0>, SDTCisVec<1>, SDTCisPtrTy<2>
|
|
|
|
]>;
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
|
|
|
|
def PPClxvd2x : SDNode<"PPCISD::LXVD2X", SDT_PPClxvd2x,
|
2017-01-27 02:59:15 +08:00
|
|
|
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
def PPCstxvd2x : SDNode<"PPCISD::STXVD2X", SDT_PPCstxvd2x,
|
|
|
|
[SDNPHasChain, SDNPMayStore]>;
|
|
|
|
def PPCxxswapd : SDNode<"PPCISD::XXSWAPD", SDT_PPCxxswapd, [SDNPHasChain]>;
|
2015-04-11 18:40:42 +08:00
|
|
|
def PPCmfvsr : SDNode<"PPCISD::MFVSR", SDTUnaryOp, []>;
|
|
|
|
def PPCmtvsra : SDNode<"PPCISD::MTVSRA", SDTUnaryOp, []>;
|
|
|
|
def PPCmtvsrz : SDNode<"PPCISD::MTVSRZ", SDTUnaryOp, []>;
|
2016-07-05 17:22:29 +08:00
|
|
|
def PPCsvec2fp : SDNode<"PPCISD::SINT_VEC_TO_FP", SDTVecConv, []>;
|
|
|
|
def PPCuvec2fp: SDNode<"PPCISD::UINT_VEC_TO_FP", SDTVecConv, []>;
|
2016-07-12 20:16:27 +08:00
|
|
|
def PPCswapNoChain : SDNode<"PPCISD::SWAP_NO_CHAIN", SDT_PPCxxswapd>;
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
|
2015-09-30 01:41:53 +08:00
|
|
|
multiclass XX3Form_Rcr<bits<6> opcode, bits<7> xo, string asmbase,
|
|
|
|
string asmstr, InstrItinClass itin, Intrinsic Int,
|
|
|
|
ValueType OutTy, ValueType InTy> {
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
let BaseName = asmbase in {
|
2015-09-30 01:41:53 +08:00
|
|
|
def NAME : XX3Form_Rc<opcode, xo, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
!strconcat(asmbase, !strconcat(" ", asmstr)), itin,
|
2015-09-30 01:41:53 +08:00
|
|
|
[(set OutTy:$XT, (Int InTy:$XA, InTy:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
let Defs = [CR6] in
|
2015-09-30 01:41:53 +08:00
|
|
|
def o : XX3Form_Rc<opcode, xo, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
!strconcat(asmbase, !strconcat(". ", asmstr)), itin,
|
2015-09-30 01:41:53 +08:00
|
|
|
[(set InTy:$XT,
|
|
|
|
(InTy (PPCvcmp_o InTy:$XA, InTy:$XB, xo)))]>,
|
|
|
|
isDOT;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-04 14:59:23 +08:00
|
|
|
// Instruction form with a single input register for instructions such as
|
|
|
|
// XXPERMDI. The reason for defining this is that specifying multiple chained
|
|
|
|
// operands (such as loads) to an instruction will perform both chained
|
|
|
|
// operations rather than coalescing them into a single register - even though
|
|
|
|
// the source memory location is the same. This simply forces the instruction
|
|
|
|
// to use the same register for both inputs.
|
|
|
|
// For example, an output DAG such as this:
|
|
|
|
// (XXPERMDI (LXSIBZX xoaddr:$src), (LXSIBZX xoaddr:$src ), 0))
|
|
|
|
// would result in two load instructions emitted and used as separate inputs
|
|
|
|
// to the XXPERMDI instruction.
|
|
|
|
class XX3Form_2s<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
|
|
|
|
InstrItinClass itin, list<dag> pattern>
|
|
|
|
: XX3Form_2<opcode, xo, OOL, IOL, asmstr, itin, pattern> {
|
|
|
|
let XB = XA;
|
|
|
|
}
|
|
|
|
|
2014-05-22 09:07:24 +08:00
|
|
|
def HasVSX : Predicate<"PPCSubTarget->hasVSX()">;
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
def IsLittleEndian : Predicate<"PPCSubTarget->isLittleEndian()">;
|
|
|
|
def IsBigEndian : Predicate<"!PPCSubTarget->isLittleEndian()">;
|
2016-09-22 17:52:19 +08:00
|
|
|
def HasOnlySwappingMemOps : Predicate<"!PPCSubTarget->hasP9Vector()">;
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
let Predicates = [HasVSX] in {
|
|
|
|
let AddedComplexity = 400 in { // Prefer VSX patterns over non-VSX patterns.
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
2014-11-26 08:46:26 +08:00
|
|
|
let hasSideEffects = 0 in { // VSX instructions don't have side effects.
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
let Uses = [RM] in {
|
|
|
|
|
|
|
|
// Load indexed instructions
|
2017-01-27 02:59:15 +08:00
|
|
|
let mayLoad = 1, mayStore = 0 in {
|
2016-10-04 19:25:52 +08:00
|
|
|
let CodeSize = 3 in
|
2014-10-10 01:51:35 +08:00
|
|
|
def LXSDX : XX1Form<31, 588,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins memrr:$src),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"lxsdx $XT, $src", IIC_LdStLFD,
|
|
|
|
[(set f64:$XT, (load xoaddr:$src))]>;
|
|
|
|
|
2017-11-20 22:38:30 +08:00
|
|
|
// Pseudo instruction XFLOADf64 will be expanded to LXSDX or LFDX later
|
|
|
|
let isPseudo = 1, CodeSize = 3 in
|
|
|
|
def XFLOADf64 : Pseudo<(outs vsfrc:$XT), (ins memrr:$src),
|
|
|
|
"#XFLOADf64",
|
|
|
|
[(set f64:$XT, (load xoaddr:$src))]>;
|
|
|
|
|
2016-09-22 17:52:19 +08:00
|
|
|
let Predicates = [HasVSX, HasOnlySwappingMemOps] in
|
2014-10-10 01:51:35 +08:00
|
|
|
def LXVD2X : XX1Form<31, 844,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
(outs vsrc:$XT), (ins memrr:$src),
|
|
|
|
"lxvd2x $XT, $src", IIC_LdStLFD,
|
[PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics
This patch enables the vec_vsx_ld and vec_vsx_st intrinsics for
PowerPC, which provide programmer access to the lxvd2x, lxvw4x,
stxvd2x, and stxvw4x instructions.
New LLVM intrinsics are provided to represent these four instructions
in IntrinsicsPowerPC.td. These are patterned after the similar
intrinsics for lvx and stvx (Altivec). In PPCInstrVSX.td, these
intrinsics are tied to the code gen patterns, with additional patterns
to allow plain vanilla loads and stores to still generate these
instructions.
At -O1 and higher the intrinsics are immediately converted to loads
and stores in InstCombineCalls.cpp. This will open up more
optimization opportunities while still allowing the correct
instructions to be generated. (Similar code exists for aligned
Altivec loads and stores.)
The new intrinsics are added to the code that checks for consecutive
loads and stores in PPCISelLowering.cpp, as well as to
PPCTargetLowering::getTgtMemIntrinsic().
There's a new test to verify the correct instructions are generated.
The loads and stores tend to be reordered, so the test just counts
their number. It runs at -O2, as it's not very effective to test this
at -O0, when many unnecessary loads and stores are generated.
I ended up having to modify vsx-fma-m.ll. It turns out this test case
is slightly unreliable, but I don't know a good way to prevent
problems with it. The xvmaddmdp instructions read and write the same
register, which is one of the multiplicands. Commutativity allows
either to be chosen. If the FMAs are reordered differently than
expected by the test, the register assignment can be different as a
result. Hopefully this doesn't change often.
There is a companion patch for Clang.
llvm-svn: 221767
2014-11-12 12:19:40 +08:00
|
|
|
[(set v2f64:$XT, (int_ppc_vsx_lxvd2x xoaddr:$src))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-10-10 01:51:35 +08:00
|
|
|
def LXVDSX : XX1Form<31, 332,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
(outs vsrc:$XT), (ins memrr:$src),
|
|
|
|
"lxvdsx $XT, $src", IIC_LdStLFD, []>;
|
|
|
|
|
2016-09-22 17:52:19 +08:00
|
|
|
let Predicates = [HasVSX, HasOnlySwappingMemOps] in
|
2014-10-10 01:51:35 +08:00
|
|
|
def LXVW4X : XX1Form<31, 780,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
(outs vsrc:$XT), (ins memrr:$src),
|
[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
Currently the VSX support enables use of lxvd2x and stxvd2x for 2x64
types, but does not yet use lxvw4x and stxvw4x for 4x32 types. This
patch adds that support.
As with lxvd2x/stxvd2x, this involves straightforward overriding of
the patterns normally recognized for lvx/stvx, with preference given
to the VSX patterns when VSX is enabled.
In addition, the logic for permitting misaligned memory accesses is
modified so that v4r32 and v4i32 are treated the same as v2f64 and
v2i64 when VSX is enabled. Finally, the DAG generation for unaligned
loads is changed to just use a normal LOAD (which will become lxvw4x)
on P8 and later hardware, where unaligned loads are preferred over
lvsl/lvx/lvx/vperm.
A number of tests now generate the VSX loads/stores instead of
lvx/stvx, so this patch adds VSX variants to those tests. I've also
added <4 x float> tests to the vsx.ll test case, and created a
vsx-p8.ll test case to be used for testing code generation for the
P8Vector feature. For now, that simply tests the unaligned load/store
behavior.
This has been tested along with a temporary patch to enable the VSX
and P8Vector features, with no new regressions encountered with or
without the temporary patch applied.
llvm-svn: 220047
2014-10-17 23:13:38 +08:00
|
|
|
"lxvw4x $XT, $src", IIC_LdStLFD,
|
2017-05-02 09:47:34 +08:00
|
|
|
[]>;
|
2015-05-08 02:24:05 +08:00
|
|
|
} // mayLoad
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
// Store indexed instructions
|
2017-01-27 02:59:15 +08:00
|
|
|
let mayStore = 1, mayLoad = 0 in {
|
2016-10-04 19:25:52 +08:00
|
|
|
let CodeSize = 3 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def STXSDX : XX1Form<31, 716,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs), (ins vsfrc:$XT, memrr:$dst),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"stxsdx $XT, $dst", IIC_LdStSTFD,
|
|
|
|
[(store f64:$XT, xoaddr:$dst)]>;
|
|
|
|
|
2017-11-20 22:38:30 +08:00
|
|
|
// Pseudo instruction XFSTOREf64 will be expanded to STXSDX or STFDX later
|
|
|
|
let isPseudo = 1, CodeSize = 3 in
|
|
|
|
def XFSTOREf64 : Pseudo<(outs), (ins vsfrc:$XT, memrr:$dst),
|
|
|
|
"#XFSTOREf64",
|
|
|
|
[(store f64:$XT, xoaddr:$dst)]>;
|
|
|
|
|
2016-09-22 17:52:19 +08:00
|
|
|
let Predicates = [HasVSX, HasOnlySwappingMemOps] in {
|
2016-09-22 18:32:03 +08:00
|
|
|
// The behaviour of this instruction is endianness-specific so we provide no
|
|
|
|
// pattern to match it without considering endianness.
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def STXVD2X : XX1Form<31, 972,
|
|
|
|
(outs), (ins vsrc:$XT, memrr:$dst),
|
|
|
|
"stxvd2x $XT, $dst", IIC_LdStSTFD,
|
2016-09-22 18:32:03 +08:00
|
|
|
[]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def STXVW4X : XX1Form<31, 908,
|
|
|
|
(outs), (ins vsrc:$XT, memrr:$dst),
|
[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
Currently the VSX support enables use of lxvd2x and stxvd2x for 2x64
types, but does not yet use lxvw4x and stxvw4x for 4x32 types. This
patch adds that support.
As with lxvd2x/stxvd2x, this involves straightforward overriding of
the patterns normally recognized for lvx/stvx, with preference given
to the VSX patterns when VSX is enabled.
In addition, the logic for permitting misaligned memory accesses is
modified so that v4r32 and v4i32 are treated the same as v2f64 and
v2i64 when VSX is enabled. Finally, the DAG generation for unaligned
loads is changed to just use a normal LOAD (which will become lxvw4x)
on P8 and later hardware, where unaligned loads are preferred over
lvsl/lvx/lvx/vperm.
A number of tests now generate the VSX loads/stores instead of
lvx/stvx, so this patch adds VSX variants to those tests. I've also
added <4 x float> tests to the vsx.ll test case, and created a
vsx-p8.ll test case to be used for testing code generation for the
P8Vector feature. For now, that simply tests the unaligned load/store
behavior.
This has been tested along with a temporary patch to enable the VSX
and P8Vector features, with no new regressions encountered with or
without the temporary patch applied.
llvm-svn: 220047
2014-10-17 23:13:38 +08:00
|
|
|
"stxvw4x $XT, $dst", IIC_LdStSTFD,
|
2017-05-02 09:47:34 +08:00
|
|
|
[]>;
|
2016-09-22 17:52:19 +08:00
|
|
|
}
|
2015-05-08 02:24:05 +08:00
|
|
|
} // mayStore
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
// Add/Mul Instructions
|
|
|
|
let isCommutable = 1 in {
|
|
|
|
def XSADDDP : XX3Form<60, 32,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsadddp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fadd f64:$XA, f64:$XB))]>;
|
|
|
|
def XSMULDP : XX3Form<60, 48,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsmuldp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fmul f64:$XA, f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVADDDP : XX3Form<60, 96,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvadddp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fadd v2f64:$XA, v2f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVADDSP : XX3Form<60, 64,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvaddsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fadd v4f32:$XA, v4f32:$XB))]>;
|
|
|
|
|
|
|
|
def XVMULDP : XX3Form<60, 112,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmuldp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fmul v2f64:$XA, v2f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVMULSP : XX3Form<60, 80,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmulsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fmul v4f32:$XA, v4f32:$XB))]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Subtract Instructions
|
|
|
|
def XSSUBDP : XX3Form<60, 40,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xssubdp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fsub f64:$XA, f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVSUBDP : XX3Form<60, 104,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvsubdp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fsub v2f64:$XA, v2f64:$XB))]>;
|
|
|
|
def XVSUBSP : XX3Form<60, 72,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvsubsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fsub v4f32:$XA, v4f32:$XB))]>;
|
|
|
|
|
|
|
|
// FMA Instructions
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XSMADDADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSMADDADP : XX3Form<60, 33,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsmaddadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fma f64:$XA, f64:$XB, f64:$XTi))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSMADDMDP : XX3Form<60, 41,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsmaddmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XSMSUBADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSMSUBADP : XX3Form<60, 49,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsmsubadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fma f64:$XA, f64:$XB, (fneg f64:$XTi)))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSMSUBMDP : XX3Form<60, 57,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsmsubmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XSNMADDADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSNMADDADP : XX3Form<60, 161,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsnmaddadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fneg (fma f64:$XA, f64:$XB, f64:$XTi)))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSNMADDMDP : XX3Form<60, 169,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsnmaddmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XSNMSUBADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSNMSUBADP : XX3Form<60, 177,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsnmsubadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fneg (fma f64:$XA, f64:$XB, (fneg f64:$XTi))))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSNMSUBMDP : XX3Form<60, 185,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XTi, vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsnmsubmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVMADDADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMADDADP : XX3Form<60, 97,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmaddadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fma v2f64:$XA, v2f64:$XB, v2f64:$XTi))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMADDMDP : XX3Form<60, 105,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmaddmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVMADDASP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMADDASP : XX3Form<60, 65,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmaddasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fma v4f32:$XA, v4f32:$XB, v4f32:$XTi))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMADDMSP : XX3Form<60, 73,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmaddmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVMSUBADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMSUBADP : XX3Form<60, 113,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmsubadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fma v2f64:$XA, v2f64:$XB, (fneg v2f64:$XTi)))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMSUBMDP : XX3Form<60, 121,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmsubmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVMSUBASP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMSUBASP : XX3Form<60, 81,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmsubasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fma v4f32:$XA, v4f32:$XB, (fneg v4f32:$XTi)))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMSUBMSP : XX3Form<60, 89,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvmsubmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVNMADDADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMADDADP : XX3Form<60, 225,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmaddadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fneg (fma v2f64:$XA, v2f64:$XB, v2f64:$XTi)))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMADDMDP : XX3Form<60, 233,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmaddmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVNMADDASP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMADDASP : XX3Form<60, 193,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmaddasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fneg (fma v4f32:$XA, v4f32:$XB, v4f32:$XTi)))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMADDMSP : XX3Form<60, 201,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmaddmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVNMSUBADP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMSUBADP : XX3Form<60, 241,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmsubadp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fneg (fma v2f64:$XA, v2f64:$XB, (fneg v2f64:$XTi))))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMSUBMDP : XX3Form<60, 249,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmsubmdp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-03-26 02:55:11 +08:00
|
|
|
let BaseName = "XVNMSUBASP" in {
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMSUBASP : XX3Form<60, 209,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmsubasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fneg (fma v4f32:$XA, v4f32:$XB, (fneg v4f32:$XTi))))]>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVNMSUBMSP : XX3Form<60, 217,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvnmsubmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
2014-03-26 02:55:11 +08:00
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
// Division Instructions
|
|
|
|
def XSDIVDP : XX3Form<60, 56,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xsdivdp $XT, $XA, $XB", IIC_FPDivD,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
[(set f64:$XT, (fdiv f64:$XA, f64:$XB))]>;
|
|
|
|
def XSSQRTDP : XX2Form<60, 75,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xssqrtdp $XT, $XB", IIC_FPSqrtD,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
[(set f64:$XT, (fsqrt f64:$XB))]>;
|
|
|
|
|
|
|
|
def XSREDP : XX2Form<60, 90,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsredp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfre f64:$XB))]>;
|
|
|
|
def XSRSQRTEDP : XX2Form<60, 74,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsrsqrtedp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfrsqrte f64:$XB))]>;
|
|
|
|
|
|
|
|
def XSTDIVDP : XX3Form_1<60, 61,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs crrc:$crD), (ins vsfrc:$XA, vsfrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xstdivdp $crD, $XA, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSTSQRTDP : XX2Form_1<60, 106,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs crrc:$crD), (ins vsfrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xstsqrtdp $crD, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVDIVDP : XX3Form<60, 120,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvdivdp $XT, $XA, $XB", IIC_FPDivD,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
[(set v2f64:$XT, (fdiv v2f64:$XA, v2f64:$XB))]>;
|
|
|
|
def XVDIVSP : XX3Form<60, 88,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvdivsp $XT, $XA, $XB", IIC_FPDivS,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
[(set v4f32:$XT, (fdiv v4f32:$XA, v4f32:$XB))]>;
|
|
|
|
|
|
|
|
def XVSQRTDP : XX2Form<60, 203,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvsqrtdp $XT, $XB", IIC_FPSqrtD,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
[(set v2f64:$XT, (fsqrt v2f64:$XB))]>;
|
|
|
|
def XVSQRTSP : XX2Form<60, 139,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvsqrtsp $XT, $XB", IIC_FPSqrtS,
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
[(set v4f32:$XT, (fsqrt v4f32:$XB))]>;
|
|
|
|
|
|
|
|
def XVTDIVDP : XX3Form_1<60, 125,
|
|
|
|
(outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvtdivdp $crD, $XA, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVTDIVSP : XX3Form_1<60, 93,
|
|
|
|
(outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvtdivsp $crD, $XA, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVTSQRTDP : XX2Form_1<60, 234,
|
|
|
|
(outs crrc:$crD), (ins vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvtsqrtdp $crD, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVTSQRTSP : XX2Form_1<60, 170,
|
|
|
|
(outs crrc:$crD), (ins vsrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xvtsqrtsp $crD, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVREDP : XX2Form<60, 218,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvredp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (PPCfre v2f64:$XB))]>;
|
|
|
|
def XVRESP : XX2Form<60, 154,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvresp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (PPCfre v4f32:$XB))]>;
|
|
|
|
|
|
|
|
def XVRSQRTEDP : XX2Form<60, 202,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrsqrtedp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (PPCfrsqrte v2f64:$XB))]>;
|
|
|
|
def XVRSQRTESP : XX2Form<60, 138,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrsqrtesp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (PPCfrsqrte v4f32:$XB))]>;
|
|
|
|
|
|
|
|
// Compare Instructions
|
|
|
|
def XSCMPODP : XX3Form_1<60, 43,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs crrc:$crD), (ins vsfrc:$XA, vsfrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xscmpodp $crD, $XA, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSCMPUDP : XX3Form_1<60, 35,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs crrc:$crD), (ins vsfrc:$XA, vsfrc:$XB),
|
2014-03-29 21:20:31 +08:00
|
|
|
"xscmpudp $crD, $XA, $XB", IIC_FPCompare, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
defm XVCMPEQDP : XX3Form_Rcr<60, 99,
|
2015-06-27 03:26:53 +08:00
|
|
|
"xvcmpeqdp", "$XT, $XA, $XB", IIC_VecFPCompare,
|
2015-09-30 01:41:53 +08:00
|
|
|
int_ppc_vsx_xvcmpeqdp, v2i64, v2f64>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
defm XVCMPEQSP : XX3Form_Rcr<60, 67,
|
2015-06-27 03:26:53 +08:00
|
|
|
"xvcmpeqsp", "$XT, $XA, $XB", IIC_VecFPCompare,
|
2015-09-30 01:41:53 +08:00
|
|
|
int_ppc_vsx_xvcmpeqsp, v4i32, v4f32>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
defm XVCMPGEDP : XX3Form_Rcr<60, 115,
|
2015-06-27 03:26:53 +08:00
|
|
|
"xvcmpgedp", "$XT, $XA, $XB", IIC_VecFPCompare,
|
2015-09-30 01:41:53 +08:00
|
|
|
int_ppc_vsx_xvcmpgedp, v2i64, v2f64>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
defm XVCMPGESP : XX3Form_Rcr<60, 83,
|
2015-06-27 03:26:53 +08:00
|
|
|
"xvcmpgesp", "$XT, $XA, $XB", IIC_VecFPCompare,
|
2015-09-30 01:41:53 +08:00
|
|
|
int_ppc_vsx_xvcmpgesp, v4i32, v4f32>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
defm XVCMPGTDP : XX3Form_Rcr<60, 107,
|
2015-06-27 03:26:53 +08:00
|
|
|
"xvcmpgtdp", "$XT, $XA, $XB", IIC_VecFPCompare,
|
2015-09-30 01:41:53 +08:00
|
|
|
int_ppc_vsx_xvcmpgtdp, v2i64, v2f64>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
defm XVCMPGTSP : XX3Form_Rcr<60, 75,
|
2015-06-27 03:26:53 +08:00
|
|
|
"xvcmpgtsp", "$XT, $XA, $XB", IIC_VecFPCompare,
|
2015-09-30 01:41:53 +08:00
|
|
|
int_ppc_vsx_xvcmpgtsp, v4i32, v4f32>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
// Move Instructions
|
|
|
|
def XSABSDP : XX2Form<60, 345,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsabsdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fabs f64:$XB))]>;
|
|
|
|
def XSNABSDP : XX2Form<60, 361,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsnabsdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fneg (fabs f64:$XB)))]>;
|
|
|
|
def XSNEGDP : XX2Form<60, 377,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsnegdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fneg f64:$XB))]>;
|
|
|
|
def XSCPSGNDP : XX3Form<60, 176,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xscpsgndp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fcopysign f64:$XB, f64:$XA))]>;
|
|
|
|
|
|
|
|
def XVABSDP : XX2Form<60, 473,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvabsdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fabs v2f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVABSSP : XX2Form<60, 409,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvabssp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fabs v4f32:$XB))]>;
|
|
|
|
|
|
|
|
def XVCPSGNDP : XX3Form<60, 240,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvcpsgndp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fcopysign v2f64:$XB, v2f64:$XA))]>;
|
|
|
|
def XVCPSGNSP : XX3Form<60, 208,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvcpsgnsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fcopysign v4f32:$XB, v4f32:$XA))]>;
|
|
|
|
|
|
|
|
def XVNABSDP : XX2Form<60, 489,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvnabsdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fneg (fabs v2f64:$XB)))]>;
|
|
|
|
def XVNABSSP : XX2Form<60, 425,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvnabssp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fneg (fabs v4f32:$XB)))]>;
|
|
|
|
|
|
|
|
def XVNEGDP : XX2Form<60, 505,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvnegdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fneg v2f64:$XB))]>;
|
|
|
|
def XVNEGSP : XX2Form<60, 441,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvnegsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fneg v4f32:$XB))]>;
|
|
|
|
|
|
|
|
// Conversion Instructions
|
|
|
|
def XSCVDPSP : XX2Form<60, 265,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xscvdpsp $XT, $XB", IIC_VecFP, []>;
|
|
|
|
def XSCVDPSXDS : XX2Form<60, 344,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-23 13:35:00 +08:00
|
|
|
"xscvdpsxds $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfctidz f64:$XB))]>;
|
2016-11-30 00:11:34 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XSCVDPSXDSs : XX2Form<60, 344,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xscvdpsxds $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfctidz f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSCVDPSXWS : XX2Form<60, 88,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-23 13:35:00 +08:00
|
|
|
"xscvdpsxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfctiwz f64:$XB))]>;
|
2016-11-30 00:11:34 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XSCVDPSXWSs : XX2Form<60, 88,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xscvdpsxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfctiwz f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSCVDPUXDS : XX2Form<60, 328,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-23 13:35:00 +08:00
|
|
|
"xscvdpuxds $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfctiduz f64:$XB))]>;
|
2016-11-30 00:11:34 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XSCVDPUXDSs : XX2Form<60, 328,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xscvdpuxds $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfctiduz f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSCVDPUXWS : XX2Form<60, 72,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-23 13:35:00 +08:00
|
|
|
"xscvdpuxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfctiwuz f64:$XB))]>;
|
2016-11-30 00:11:34 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XSCVDPUXWSs : XX2Form<60, 72,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xscvdpuxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfctiwuz f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSCVSPDP : XX2Form<60, 329,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xscvspdp $XT, $XB", IIC_VecFP, []>;
|
|
|
|
def XSCVSXDDP : XX2Form<60, 376,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-23 13:35:00 +08:00
|
|
|
"xscvsxddp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfcfid f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSCVUXDDP : XX2Form<60, 360,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
2014-03-23 13:35:00 +08:00
|
|
|
"xscvuxddp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (PPCfcfidu f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVCVDPSP : XX2Form<60, 393,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvdpsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (int_ppc_vsx_xvcvdpsp v2f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVDPSXDS : XX2Form<60, 472,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2014-03-27 03:13:54 +08:00
|
|
|
"xvcvdpsxds $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2i64:$XT, (fp_to_sint v2f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVDPSXWS : XX2Form<60, 216,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvdpsxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4i32:$XT, (int_ppc_vsx_xvcvdpsxws v2f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVDPUXDS : XX2Form<60, 456,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2014-03-27 03:13:54 +08:00
|
|
|
"xvcvdpuxds $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2i64:$XT, (fp_to_uint v2f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVDPUXWS : XX2Form<60, 200,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvdpuxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4i32:$XT, (int_ppc_vsx_xvcvdpuxws v2f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVCVSPDP : XX2Form<60, 457,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvspdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (int_ppc_vsx_xvcvspdp v4f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVSPSXDS : XX2Form<60, 408,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvcvspsxds $XT, $XB", IIC_VecFP, []>;
|
|
|
|
def XVCVSPSXWS : XX2Form<60, 152,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-30 00:11:34 +08:00
|
|
|
"xvcvspsxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4i32:$XT, (fp_to_sint v4f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVSPUXDS : XX2Form<60, 392,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvcvspuxds $XT, $XB", IIC_VecFP, []>;
|
|
|
|
def XVCVSPUXWS : XX2Form<60, 136,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-30 00:11:34 +08:00
|
|
|
"xvcvspuxws $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4i32:$XT, (fp_to_uint v4f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVSXDDP : XX2Form<60, 504,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2014-03-27 03:13:54 +08:00
|
|
|
"xvcvsxddp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (sint_to_fp v2i64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVSXDSP : XX2Form<60, 440,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvsxdsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (int_ppc_vsx_xvcvsxdsp v2i64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVSXWDP : XX2Form<60, 248,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvsxwdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (int_ppc_vsx_xvcvsxwdp v4i32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVSXWSP : XX2Form<60, 184,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-07-05 17:22:29 +08:00
|
|
|
"xvcvsxwsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (sint_to_fp v4i32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVUXDDP : XX2Form<60, 488,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2014-03-27 03:13:54 +08:00
|
|
|
"xvcvuxddp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (uint_to_fp v2i64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVUXDSP : XX2Form<60, 424,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvuxdsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (int_ppc_vsx_xvcvuxdsp v2i64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVUXWDP : XX2Form<60, 232,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-11 22:41:19 +08:00
|
|
|
"xvcvuxwdp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (int_ppc_vsx_xvcvuxwdp v4i32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVCVUXWSP : XX2Form<60, 168,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
2016-11-30 00:11:34 +08:00
|
|
|
"xvcvuxwsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (uint_to_fp v4i32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
// Rounding Instructions
|
|
|
|
def XSRDPI : XX2Form<60, 73,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsrdpi $XT, $XB", IIC_VecFP,
|
2016-08-19 04:08:15 +08:00
|
|
|
[(set f64:$XT, (fround f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSRDPIC : XX2Form<60, 107,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsrdpic $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fnearbyint f64:$XB))]>;
|
|
|
|
def XSRDPIM : XX2Form<60, 121,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsrdpim $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (ffloor f64:$XB))]>;
|
|
|
|
def XSRDPIP : XX2Form<60, 105,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsrdpip $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (fceil f64:$XB))]>;
|
|
|
|
def XSRDPIZ : XX2Form<60, 89,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XB),
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
"xsrdpiz $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f64:$XT, (ftrunc f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVRDPI : XX2Form<60, 201,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrdpi $XT, $XB", IIC_VecFP,
|
2016-08-19 04:08:15 +08:00
|
|
|
[(set v2f64:$XT, (fround v2f64:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVRDPIC : XX2Form<60, 235,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrdpic $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fnearbyint v2f64:$XB))]>;
|
|
|
|
def XVRDPIM : XX2Form<60, 249,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrdpim $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (ffloor v2f64:$XB))]>;
|
|
|
|
def XVRDPIP : XX2Form<60, 233,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrdpip $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (fceil v2f64:$XB))]>;
|
|
|
|
def XVRDPIZ : XX2Form<60, 217,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrdpiz $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v2f64:$XT, (ftrunc v2f64:$XB))]>;
|
|
|
|
|
|
|
|
def XVRSPI : XX2Form<60, 137,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrspi $XT, $XB", IIC_VecFP,
|
2016-08-19 04:08:15 +08:00
|
|
|
[(set v4f32:$XT, (fround v4f32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVRSPIC : XX2Form<60, 171,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrspic $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fnearbyint v4f32:$XB))]>;
|
|
|
|
def XVRSPIM : XX2Form<60, 185,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrspim $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (ffloor v4f32:$XB))]>;
|
|
|
|
def XVRSPIP : XX2Form<60, 169,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrspip $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (fceil v4f32:$XB))]>;
|
|
|
|
def XVRSPIZ : XX2Form<60, 153,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xvrspiz $XT, $XB", IIC_VecFP,
|
|
|
|
[(set v4f32:$XT, (ftrunc v4f32:$XB))]>;
|
|
|
|
|
|
|
|
// Max/Min Instructions
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in {
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSMAXDP : XX3Form<60, 160,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
2014-11-01 03:19:07 +08:00
|
|
|
"xsmaxdp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set vsfrc:$XT,
|
|
|
|
(int_ppc_vsx_xsmaxdp vsfrc:$XA, vsfrc:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XSMINDP : XX3Form<60, 168,
|
2014-03-29 13:29:01 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
2014-11-01 03:19:07 +08:00
|
|
|
"xsmindp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set vsfrc:$XT,
|
|
|
|
(int_ppc_vsx_xsmindp vsfrc:$XA, vsfrc:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVMAXDP : XX3Form<60, 224,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-11-01 03:19:07 +08:00
|
|
|
"xvmaxdp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set vsrc:$XT,
|
|
|
|
(int_ppc_vsx_xvmaxdp vsrc:$XA, vsrc:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMINDP : XX3Form<60, 232,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-11-01 03:19:07 +08:00
|
|
|
"xvmindp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set vsrc:$XT,
|
|
|
|
(int_ppc_vsx_xvmindp vsrc:$XA, vsrc:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
def XVMAXSP : XX3Form<60, 192,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-11-01 03:19:07 +08:00
|
|
|
"xvmaxsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set vsrc:$XT,
|
|
|
|
(int_ppc_vsx_xvmaxsp vsrc:$XA, vsrc:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XVMINSP : XX3Form<60, 200,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-11-01 03:19:07 +08:00
|
|
|
"xvminsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set vsrc:$XT,
|
|
|
|
(int_ppc_vsx_xvminsp vsrc:$XA, vsrc:$XB))]>;
|
2014-03-24 23:07:28 +08:00
|
|
|
} // isCommutable
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
} // Uses = [RM]
|
|
|
|
|
|
|
|
// Logical Instructions
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXLAND : XX3Form<60, 130,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-26 12:55:40 +08:00
|
|
|
"xxland $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (and v4i32:$XA, v4i32:$XB))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXLANDC : XX3Form<60, 138,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-26 12:55:40 +08:00
|
|
|
"xxlandc $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (and v4i32:$XA,
|
|
|
|
(vnot_ppc v4i32:$XB)))]>;
|
2014-03-24 23:07:28 +08:00
|
|
|
let isCommutable = 1 in {
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXLNOR : XX3Form<60, 162,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-26 12:55:40 +08:00
|
|
|
"xxlnor $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (vnot_ppc (or v4i32:$XA,
|
|
|
|
v4i32:$XB)))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXLOR : XX3Form<60, 146,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-26 12:55:40 +08:00
|
|
|
"xxlor $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (or v4i32:$XA, v4i32:$XB))]>;
|
2014-03-29 13:29:01 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XXLORf: XX3Form<60, 146,
|
|
|
|
(outs vsfrc:$XT), (ins vsfrc:$XA, vsfrc:$XB),
|
|
|
|
"xxlor $XT, $XA, $XB", IIC_VecGeneral, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXLXOR : XX3Form<60, 154,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
2014-03-26 12:55:40 +08:00
|
|
|
"xxlxor $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (xor v4i32:$XA, v4i32:$XB))]>;
|
2014-03-24 23:07:28 +08:00
|
|
|
} // isCommutable
|
2016-09-23 21:25:31 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XXLXORz : XX3Form_Zero<60, 154, (outs vsrc:$XT), (ins),
|
|
|
|
"xxlxor $XT, $XT, $XT", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (v4i32 immAllZerosV))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2016-10-25 01:31:09 +08:00
|
|
|
let isCodeGenOnly = 1 in {
|
|
|
|
def XXLXORdpz : XX3Form_SetZero<60, 154,
|
|
|
|
(outs vsfrc:$XT), (ins),
|
|
|
|
"xxlxor $XT, $XT, $XT", IIC_VecGeneral,
|
|
|
|
[(set f64:$XT, (fpimm0))]>;
|
|
|
|
def XXLXORspz : XX3Form_SetZero<60, 154,
|
|
|
|
(outs vssrc:$XT), (ins),
|
|
|
|
"xxlxor $XT, $XT, $XT", IIC_VecGeneral,
|
|
|
|
[(set f32:$XT, (fpimm0))]>;
|
|
|
|
}
|
|
|
|
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
// Permutation Instructions
|
|
|
|
def XXMRGHW : XX3Form<60, 18,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xxmrghw $XT, $XA, $XB", IIC_VecPerm, []>;
|
|
|
|
def XXMRGLW : XX3Form<60, 50,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xxmrglw $XT, $XA, $XB", IIC_VecPerm, []>;
|
|
|
|
|
|
|
|
def XXPERMDI : XX3Form_2<60, 10,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u2imm:$DM),
|
2017-05-31 21:09:57 +08:00
|
|
|
"xxpermdi $XT, $XA, $XB, $DM", IIC_VecPerm,
|
|
|
|
[(set v2i64:$XT, (PPCxxpermdi v2i64:$XA, v2i64:$XB,
|
|
|
|
imm32SExt16:$DM))]>;
|
2016-12-06 19:47:14 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XXPERMDIs : XX3Form_2s<60, 10, (outs vsrc:$XT), (ins vsfrc:$XA, u2imm:$DM),
|
2016-10-04 14:59:23 +08:00
|
|
|
"xxpermdi $XT, $XA, $XA, $DM", IIC_VecPerm, []>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXSEL : XX4Form<60, 3,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, vsrc:$XC),
|
|
|
|
"xxsel $XT, $XA, $XB, $XC", IIC_VecPerm, []>;
|
|
|
|
|
|
|
|
def XXSLDWI : XX3Form_2<60, 2,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u2imm:$SHW),
|
2016-07-13 05:00:10 +08:00
|
|
|
"xxsldwi $XT, $XA, $XB, $SHW", IIC_VecPerm,
|
|
|
|
[(set v4i32:$XT, (PPCvecshl v4i32:$XA, v4i32:$XB,
|
|
|
|
imm32SExt16:$SHW))]>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def XXSPLTW : XX2Form_2<60, 164,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XB, u2imm:$UIM),
|
2016-05-05 00:04:02 +08:00
|
|
|
"xxspltw $XT, $XB, $UIM", IIC_VecPerm,
|
|
|
|
[(set v4i32:$XT,
|
|
|
|
(PPCxxsplt v4i32:$XB, imm32SExt16:$UIM))]>;
|
2016-10-04 14:59:23 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def XXSPLTWs : XX2Form_2<60, 164,
|
|
|
|
(outs vsrc:$XT), (ins vfrc:$XB, u2imm:$UIM),
|
|
|
|
"xxspltw $XT, $XB, $UIM", IIC_VecPerm, []>;
|
2014-11-26 08:46:26 +08:00
|
|
|
} // hasSideEffects
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2014-10-22 21:13:40 +08:00
|
|
|
// SELECT_CC_* - Used to implement the SELECT_CC DAG operation. Expanded after
|
|
|
|
// instruction selection into a branch sequence.
|
|
|
|
let usesCustomInserter = 1, // Expanded after instruction selection.
|
|
|
|
PPC970_Single = 1 in {
|
|
|
|
|
|
|
|
def SELECT_CC_VSRC: Pseudo<(outs vsrc:$dst),
|
|
|
|
(ins crrc:$cond, vsrc:$T, vsrc:$F, i32imm:$BROPC),
|
|
|
|
"#SELECT_CC_VSRC",
|
|
|
|
[]>;
|
2014-10-23 00:58:20 +08:00
|
|
|
def SELECT_VSRC: Pseudo<(outs vsrc:$dst),
|
|
|
|
(ins crbitrc:$cond, vsrc:$T, vsrc:$F),
|
|
|
|
"#SELECT_VSRC",
|
2014-10-22 21:13:40 +08:00
|
|
|
[(set v2f64:$dst,
|
|
|
|
(select i1:$cond, v2f64:$T, v2f64:$F))]>;
|
2014-10-23 00:58:20 +08:00
|
|
|
def SELECT_CC_VSFRC: Pseudo<(outs f8rc:$dst),
|
|
|
|
(ins crrc:$cond, f8rc:$T, f8rc:$F,
|
|
|
|
i32imm:$BROPC), "#SELECT_CC_VSFRC",
|
|
|
|
[]>;
|
|
|
|
def SELECT_VSFRC: Pseudo<(outs f8rc:$dst),
|
|
|
|
(ins crbitrc:$cond, f8rc:$T, f8rc:$F),
|
|
|
|
"#SELECT_VSFRC",
|
|
|
|
[(set f64:$dst,
|
|
|
|
(select i1:$cond, f64:$T, f64:$F))]>;
|
2015-05-08 02:24:05 +08:00
|
|
|
def SELECT_CC_VSSRC: Pseudo<(outs f4rc:$dst),
|
|
|
|
(ins crrc:$cond, f4rc:$T, f4rc:$F,
|
|
|
|
i32imm:$BROPC), "#SELECT_CC_VSSRC",
|
|
|
|
[]>;
|
|
|
|
def SELECT_VSSRC: Pseudo<(outs f4rc:$dst),
|
|
|
|
(ins crbitrc:$cond, f4rc:$T, f4rc:$F),
|
|
|
|
"#SELECT_VSSRC",
|
|
|
|
[(set f32:$dst,
|
|
|
|
(select i1:$cond, f32:$T, f32:$F))]>;
|
2014-10-23 00:58:20 +08:00
|
|
|
} // usesCustomInserter
|
|
|
|
} // AddedComplexity
|
2014-10-22 21:13:40 +08:00
|
|
|
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def : InstAlias<"xvmovdp $XT, $XB",
|
|
|
|
(XVCPSGNDP vsrc:$XT, vsrc:$XB, vsrc:$XB)>;
|
|
|
|
def : InstAlias<"xvmovsp $XT, $XB",
|
|
|
|
(XVCPSGNSP vsrc:$XT, vsrc:$XB, vsrc:$XB)>;
|
|
|
|
|
|
|
|
def : InstAlias<"xxspltd $XT, $XB, 0",
|
|
|
|
(XXPERMDI vsrc:$XT, vsrc:$XB, vsrc:$XB, 0)>;
|
|
|
|
def : InstAlias<"xxspltd $XT, $XB, 1",
|
|
|
|
(XXPERMDI vsrc:$XT, vsrc:$XB, vsrc:$XB, 3)>;
|
|
|
|
def : InstAlias<"xxmrghd $XT, $XA, $XB",
|
|
|
|
(XXPERMDI vsrc:$XT, vsrc:$XA, vsrc:$XB, 0)>;
|
|
|
|
def : InstAlias<"xxmrgld $XT, $XA, $XB",
|
|
|
|
(XXPERMDI vsrc:$XT, vsrc:$XA, vsrc:$XB, 3)>;
|
|
|
|
def : InstAlias<"xxswapd $XT, $XB",
|
|
|
|
(XXPERMDI vsrc:$XT, vsrc:$XB, vsrc:$XB, 2)>;
|
2016-12-06 19:47:14 +08:00
|
|
|
def : InstAlias<"xxspltd $XT, $XB, 0",
|
|
|
|
(XXPERMDIs vsrc:$XT, vsfrc:$XB, 0)>;
|
|
|
|
def : InstAlias<"xxspltd $XT, $XB, 1",
|
|
|
|
(XXPERMDIs vsrc:$XT, vsfrc:$XB, 3)>;
|
|
|
|
def : InstAlias<"xxswapd $XT, $XB",
|
|
|
|
(XXPERMDIs vsrc:$XT, vsfrc:$XB, 2)>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
let AddedComplexity = 400 in { // Prefer VSX patterns over non-VSX patterns.
|
2014-12-10 00:43:32 +08:00
|
|
|
|
2016-09-27 16:42:12 +08:00
|
|
|
def : Pat<(v4i32 (vnot_ppc v4i32:$A)),
|
|
|
|
(v4i32 (XXLNOR $A, $A))>;
|
2014-12-10 00:43:32 +08:00
|
|
|
let Predicates = [IsBigEndian] in {
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def : Pat<(v2f64 (scalar_to_vector f64:$A)),
|
2014-03-29 13:29:01 +08:00
|
|
|
(v2f64 (SUBREG_TO_REG (i64 1), $A, sub_64))>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
2015-12-12 03:20:16 +08:00
|
|
|
def : Pat<(f64 (extractelt v2f64:$S, 0)),
|
2014-03-29 13:29:01 +08:00
|
|
|
(f64 (EXTRACT_SUBREG $S, sub_64))>;
|
2015-12-12 03:20:16 +08:00
|
|
|
def : Pat<(f64 (extractelt v2f64:$S, 1)),
|
2014-03-29 13:29:01 +08:00
|
|
|
(f64 (EXTRACT_SUBREG (XXPERMDI $S, $S, 2), sub_64))>;
|
2014-12-10 00:43:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsLittleEndian] in {
|
|
|
|
def : Pat<(v2f64 (scalar_to_vector f64:$A)),
|
|
|
|
(v2f64 (XXPERMDI (SUBREG_TO_REG (i64 1), $A, sub_64),
|
|
|
|
(SUBREG_TO_REG (i64 1), $A, sub_64), 0))>;
|
|
|
|
|
2015-12-12 03:20:16 +08:00
|
|
|
def : Pat<(f64 (extractelt v2f64:$S, 0)),
|
2014-12-10 00:43:32 +08:00
|
|
|
(f64 (EXTRACT_SUBREG (XXPERMDI $S, $S, 2), sub_64))>;
|
2015-12-12 03:20:16 +08:00
|
|
|
def : Pat<(f64 (extractelt v2f64:$S, 1)),
|
2014-12-10 00:43:32 +08:00
|
|
|
(f64 (EXTRACT_SUBREG $S, sub_64))>;
|
|
|
|
}
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
|
|
|
|
// Additional fnmsub patterns: -a*c + b == -(a*c - b)
|
|
|
|
def : Pat<(fma (fneg f64:$A), f64:$C, f64:$B),
|
|
|
|
(XSNMSUBADP $B, $C, $A)>;
|
|
|
|
def : Pat<(fma f64:$A, (fneg f64:$C), f64:$B),
|
|
|
|
(XSNMSUBADP $B, $C, $A)>;
|
|
|
|
|
|
|
|
def : Pat<(fma (fneg v2f64:$A), v2f64:$C, v2f64:$B),
|
|
|
|
(XVNMSUBADP $B, $C, $A)>;
|
|
|
|
def : Pat<(fma v2f64:$A, (fneg v2f64:$C), v2f64:$B),
|
|
|
|
(XVNMSUBADP $B, $C, $A)>;
|
|
|
|
|
|
|
|
def : Pat<(fma (fneg v4f32:$A), v4f32:$C, v4f32:$B),
|
|
|
|
(XVNMSUBASP $B, $C, $A)>;
|
|
|
|
def : Pat<(fma v4f32:$A, (fneg v4f32:$C), v4f32:$B),
|
|
|
|
(XVNMSUBASP $B, $C, $A)>;
|
|
|
|
|
2014-04-02 03:24:27 +08:00
|
|
|
def : Pat<(v2f64 (bitconvert v4f32:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def : Pat<(v2f64 (bitconvert v4i32:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
|
|
|
def : Pat<(v2f64 (bitconvert v8i16:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
|
|
|
def : Pat<(v2f64 (bitconvert v16i8:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
|
|
|
|
2014-04-02 03:24:27 +08:00
|
|
|
def : Pat<(v4f32 (bitconvert v2f64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
def : Pat<(v4i32 (bitconvert v2f64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
def : Pat<(v8i16 (bitconvert v2f64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
def : Pat<(v16i8 (bitconvert v2f64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
|
2014-04-02 03:24:27 +08:00
|
|
|
def : Pat<(v2i64 (bitconvert v4f32:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
2014-03-27 00:12:58 +08:00
|
|
|
def : Pat<(v2i64 (bitconvert v4i32:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
|
|
|
def : Pat<(v2i64 (bitconvert v8i16:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
|
|
|
def : Pat<(v2i64 (bitconvert v16i8:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC)>;
|
|
|
|
|
2014-04-02 03:24:27 +08:00
|
|
|
def : Pat<(v4f32 (bitconvert v2i64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
2014-03-27 00:12:58 +08:00
|
|
|
def : Pat<(v4i32 (bitconvert v2i64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
def : Pat<(v8i16 (bitconvert v2i64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
def : Pat<(v16i8 (bitconvert v2i64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
|
2014-03-27 02:26:30 +08:00
|
|
|
def : Pat<(v2f64 (bitconvert v2i64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
def : Pat<(v2i64 (bitconvert v2f64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
|
2015-05-06 00:10:44 +08:00
|
|
|
def : Pat<(v2f64 (bitconvert v1i128:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
def : Pat<(v1i128 (bitconvert v2f64:$A)),
|
|
|
|
(COPY_TO_REGCLASS $A, VRRC)>;
|
|
|
|
|
2014-03-30 21:22:59 +08:00
|
|
|
// sign extension patterns
|
|
|
|
// To extend "in place" from v2i32 to v2i64, we have input data like:
|
|
|
|
// | undef | i32 | undef | i32 |
|
|
|
|
// but xvcvsxwdp expects the input in big-Endian format:
|
|
|
|
// | i32 | undef | i32 | undef |
|
|
|
|
// so we need to shift everything to the left by one i32 (word) before
|
|
|
|
// the conversion.
|
|
|
|
def : Pat<(sext_inreg v2i64:$C, v2i32),
|
|
|
|
(XVCVDPSXDS (XVCVSXWDP (XXSLDWI $C, $C, 1)))>;
|
|
|
|
def : Pat<(v2f64 (sint_to_fp (sext_inreg v2i64:$C, v2i32))),
|
|
|
|
(XVCVSXWDP (XXSLDWI $C, $C, 1))>;
|
|
|
|
|
2016-07-05 17:22:29 +08:00
|
|
|
def : Pat<(v2f64 (PPCsvec2fp v4i32:$C, 0)),
|
|
|
|
(v2f64 (XVCVSXWDP (v2i64 (XXMRGHW $C, $C))))>;
|
|
|
|
def : Pat<(v2f64 (PPCsvec2fp v4i32:$C, 1)),
|
|
|
|
(v2f64 (XVCVSXWDP (v2i64 (XXMRGLW $C, $C))))>;
|
|
|
|
|
|
|
|
def : Pat<(v2f64 (PPCuvec2fp v4i32:$C, 0)),
|
|
|
|
(v2f64 (XVCVUXWDP (v2i64 (XXMRGHW $C, $C))))>;
|
|
|
|
def : Pat<(v2f64 (PPCuvec2fp v4i32:$C, 1)),
|
|
|
|
(v2f64 (XVCVUXWDP (v2i64 (XXMRGLW $C, $C))))>;
|
|
|
|
|
[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
Currently the VSX support enables use of lxvd2x and stxvd2x for 2x64
types, but does not yet use lxvw4x and stxvw4x for 4x32 types. This
patch adds that support.
As with lxvd2x/stxvd2x, this involves straightforward overriding of
the patterns normally recognized for lvx/stvx, with preference given
to the VSX patterns when VSX is enabled.
In addition, the logic for permitting misaligned memory accesses is
modified so that v4r32 and v4i32 are treated the same as v2f64 and
v2i64 when VSX is enabled. Finally, the DAG generation for unaligned
loads is changed to just use a normal LOAD (which will become lxvw4x)
on P8 and later hardware, where unaligned loads are preferred over
lvsl/lvx/lvx/vperm.
A number of tests now generate the VSX loads/stores instead of
lvx/stvx, so this patch adds VSX variants to those tests. I've also
added <4 x float> tests to the vsx.ll test case, and created a
vsx-p8.ll test case to be used for testing code generation for the
P8Vector feature. For now, that simply tests the unaligned load/store
behavior.
This has been tested along with a temporary patch to enable the VSX
and P8Vector features, with no new regressions encountered with or
without the temporary patch applied.
llvm-svn: 220047
2014-10-17 23:13:38 +08:00
|
|
|
// Loads.
|
2016-09-22 17:52:19 +08:00
|
|
|
let Predicates = [HasVSX, HasOnlySwappingMemOps] in {
|
|
|
|
def : Pat<(v2f64 (PPClxvd2x xoaddr:$src)), (LXVD2X xoaddr:$src)>;
|
|
|
|
|
|
|
|
// Stores.
|
|
|
|
def : Pat<(int_ppc_vsx_stxvd2x v2f64:$rS, xoaddr:$dst),
|
|
|
|
(STXVD2X $rS, xoaddr:$dst)>;
|
2016-11-15 22:25:56 +08:00
|
|
|
def : Pat<(int_ppc_vsx_stxvd2x_be v2f64:$rS, xoaddr:$dst),
|
|
|
|
(STXVD2X $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(int_ppc_vsx_stxvw4x_be v4i32:$rS, xoaddr:$dst),
|
|
|
|
(STXVW4X $rS, xoaddr:$dst)>;
|
2016-09-22 17:52:19 +08:00
|
|
|
def : Pat<(PPCstxvd2x v2f64:$rS, xoaddr:$dst), (STXVD2X $rS, xoaddr:$dst)>;
|
|
|
|
}
|
2016-09-22 18:32:03 +08:00
|
|
|
let Predicates = [IsBigEndian, HasVSX, HasOnlySwappingMemOps] in {
|
|
|
|
def : Pat<(v2f64 (load xoaddr:$src)), (LXVD2X xoaddr:$src)>;
|
|
|
|
def : Pat<(v2i64 (load xoaddr:$src)), (LXVD2X xoaddr:$src)>;
|
|
|
|
def : Pat<(v4i32 (load xoaddr:$src)), (LXVW4X xoaddr:$src)>;
|
2017-05-02 09:47:34 +08:00
|
|
|
def : Pat<(v4i32 (int_ppc_vsx_lxvw4x xoaddr:$src)), (LXVW4X xoaddr:$src)>;
|
2016-09-22 18:32:03 +08:00
|
|
|
def : Pat<(store v2f64:$rS, xoaddr:$dst), (STXVD2X $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(store v2i64:$rS, xoaddr:$dst), (STXVD2X $rS, xoaddr:$dst)>;
|
2017-05-02 09:47:34 +08:00
|
|
|
def : Pat<(store v4i32:$XT, xoaddr:$dst), (STXVW4X $XT, xoaddr:$dst)>;
|
|
|
|
def : Pat<(int_ppc_vsx_stxvw4x v4i32:$rS, xoaddr:$dst),
|
|
|
|
(STXVW4X $rS, xoaddr:$dst)>;
|
2016-09-22 18:32:03 +08:00
|
|
|
}
|
[PowerPC 1/4] Little-endian adjustments for VSX loads/stores
This patch addresses the inherent big-endian bias in the lxvd2x,
lxvw4x, stxvd2x, and stxvw4x instructions. These instructions load
vector elements into registers left-to-right (with the first element
loaded into the high-order bits of the register), regardless of the
endian setting of the processor. However, these are the only
vector memory instructions that permit unaligned storage accesses, so
we want to use them for little-endian.
To make this work, a lxvd2x or lxvw4x is replaced with an lxvd2x
followed by an xxswapd, which swaps the doublewords. This works for
lxvw4x as well as lxvd2x, because for lxvw4x on an LE system the
vector elements are in LE order (right-to-left) within each
doubleword. (Thus after lxvw2x of a <4 x float> the elements will
appear as 1, 0, 3, 2. Following the swap, they will appear as 3, 2,
0, 1, as desired.) For stores, an stxvd2x or stxvw4x is replaced
with an stxvd2x preceded by an xxswapd.
Introduction of extra swap instructions provides correctness, but
obviously is not ideal from a performance perspective. Future patches
will address this with optimizations to remove most of the introduced
swaps, which have proven effective in other implementations.
The introduction of the swaps is performed during lowering of LOAD,
STORE, INTRINSIC_W_CHAIN, and INTRINSIC_VOID operations. The latter
are used to translate intrinsics that specify the VSX loads and stores
directly into equivalent sequences for little endian. Thus code that
uses vec_vsx_ld and vec_vsx_st does not have to be modified to be
ported from BE to LE.
We introduce new PPCISD opcodes for LXVD2X, STXVD2X, and XXSWAPD for
use during this lowering step. In PPCInstrVSX.td, we add new SDType
and SDNode definitions for these (PPClxvd2x, PPCstxvd2x, PPCxxswapd).
These are recognized during instruction selection and mapped to the
correct instructions.
Several tests that were written to use -mcpu=pwr7 or pwr8 are modified
to disable VSX on LE variants because code generation changes with
this and subsequent patches in this set. I chose to include all of
these in the first patch than try to rigorously sort out which tests
were broken by one or another of the patches. Sorry about that.
The new test vsx-ldst-builtin-le.ll, and the changes to vsx-ldst.ll,
are disabled until LE support is enabled because of breakages that
occur as noted in those tests. They are re-enabled in patch 4/4.
llvm-svn: 223783
2014-12-10 00:35:51 +08:00
|
|
|
|
|
|
|
// Permutes.
|
|
|
|
def : Pat<(v2f64 (PPCxxswapd v2f64:$src)), (XXPERMDI $src, $src, 2)>;
|
|
|
|
def : Pat<(v2i64 (PPCxxswapd v2i64:$src)), (XXPERMDI $src, $src, 2)>;
|
|
|
|
def : Pat<(v4f32 (PPCxxswapd v4f32:$src)), (XXPERMDI $src, $src, 2)>;
|
|
|
|
def : Pat<(v4i32 (PPCxxswapd v4i32:$src)), (XXPERMDI $src, $src, 2)>;
|
2016-07-12 20:16:27 +08:00
|
|
|
def : Pat<(v2f64 (PPCswapNoChain v2f64:$src)), (XXPERMDI $src, $src, 2)>;
|
[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
Currently the VSX support enables use of lxvd2x and stxvd2x for 2x64
types, but does not yet use lxvw4x and stxvw4x for 4x32 types. This
patch adds that support.
As with lxvd2x/stxvd2x, this involves straightforward overriding of
the patterns normally recognized for lvx/stvx, with preference given
to the VSX patterns when VSX is enabled.
In addition, the logic for permitting misaligned memory accesses is
modified so that v4r32 and v4i32 are treated the same as v2f64 and
v2i64 when VSX is enabled. Finally, the DAG generation for unaligned
loads is changed to just use a normal LOAD (which will become lxvw4x)
on P8 and later hardware, where unaligned loads are preferred over
lvsl/lvx/lvx/vperm.
A number of tests now generate the VSX loads/stores instead of
lvx/stvx, so this patch adds VSX variants to those tests. I've also
added <4 x float> tests to the vsx.ll test case, and created a
vsx-p8.ll test case to be used for testing code generation for the
P8Vector feature. For now, that simply tests the unaligned load/store
behavior.
This has been tested along with a temporary patch to enable the VSX
and P8Vector features, with no new regressions encountered with or
without the temporary patch applied.
llvm-svn: 220047
2014-10-17 23:13:38 +08:00
|
|
|
|
2017-05-25 07:48:29 +08:00
|
|
|
// PPCvecshl XT, XA, XA, 2 can be selected to both XXSLDWI XT,XA,XA,2 and
|
|
|
|
// XXSWAPD XT,XA (i.e. XXPERMDI XT,XA,XA,2), the later one is more profitable.
|
|
|
|
def : Pat<(v4i32 (PPCvecshl v4i32:$src, v4i32:$src, 2)), (XXPERMDI $src, $src, 2)>;
|
|
|
|
|
2014-10-22 21:13:40 +08:00
|
|
|
// Selects.
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETLT)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSRC (CRANDC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETULT)),
|
2014-10-22 21:13:40 +08:00
|
|
|
(SELECT_VSRC (CRANDC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETLE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSRC (CRORC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETULE)),
|
2014-10-22 21:13:40 +08:00
|
|
|
(SELECT_VSRC (CRORC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETEQ)),
|
|
|
|
(SELECT_VSRC (CREQV $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETGE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSRC (CRORC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETUGE)),
|
2014-10-22 21:13:40 +08:00
|
|
|
(SELECT_VSRC (CRORC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETGT)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSRC (CRANDC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETUGT)),
|
2014-10-22 21:13:40 +08:00
|
|
|
(SELECT_VSRC (CRANDC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(v2f64 (selectcc i1:$lhs, i1:$rhs, v2f64:$tval, v2f64:$fval, SETNE)),
|
|
|
|
(SELECT_VSRC (CRXOR $lhs, $rhs), $tval, $fval)>;
|
|
|
|
|
2014-10-23 00:58:20 +08:00
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETLT)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSFRC (CRANDC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETULT)),
|
2014-10-23 00:58:20 +08:00
|
|
|
(SELECT_VSFRC (CRANDC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETLE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSFRC (CRORC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETULE)),
|
2014-10-23 00:58:20 +08:00
|
|
|
(SELECT_VSFRC (CRORC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETEQ)),
|
|
|
|
(SELECT_VSFRC (CREQV $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETGE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSFRC (CRORC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETUGE)),
|
2014-10-23 00:58:20 +08:00
|
|
|
(SELECT_VSFRC (CRORC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETGT)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSFRC (CRANDC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETUGT)),
|
2014-10-23 00:58:20 +08:00
|
|
|
(SELECT_VSFRC (CRANDC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETNE)),
|
|
|
|
(SELECT_VSFRC (CRXOR $lhs, $rhs), $tval, $fval)>;
|
|
|
|
|
2014-11-14 20:10:40 +08:00
|
|
|
// Divides.
|
|
|
|
def : Pat<(int_ppc_vsx_xvdivsp v4f32:$A, v4f32:$B),
|
|
|
|
(XVDIVSP $A, $B)>;
|
|
|
|
def : Pat<(int_ppc_vsx_xvdivdp v2f64:$A, v2f64:$B),
|
|
|
|
(XVDIVDP $A, $B)>;
|
|
|
|
|
2015-07-15 01:25:20 +08:00
|
|
|
// Reciprocal estimate
|
|
|
|
def : Pat<(int_ppc_vsx_xvresp v4f32:$A),
|
|
|
|
(XVRESP $A)>;
|
|
|
|
def : Pat<(int_ppc_vsx_xvredp v2f64:$A),
|
|
|
|
(XVREDP $A)>;
|
|
|
|
|
2015-07-05 14:03:51 +08:00
|
|
|
// Recip. square root estimate
|
|
|
|
def : Pat<(int_ppc_vsx_xvrsqrtesp v4f32:$A),
|
|
|
|
(XVRSQRTESP $A)>;
|
|
|
|
def : Pat<(int_ppc_vsx_xvrsqrtedp v2f64:$A),
|
|
|
|
(XVRSQRTEDP $A)>;
|
|
|
|
|
2016-07-18 23:30:00 +08:00
|
|
|
let Predicates = [IsLittleEndian] in {
|
|
|
|
def : Pat<(f64 (PPCfcfid (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f64 (XSCVSXDDP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfid (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f64 (XSCVSXDDP (COPY_TO_REGCLASS (f64 (COPY_TO_REGCLASS $S, VSRC)), VSFRC)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f64 (XSCVUXDDP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f64 (XSCVUXDDP (COPY_TO_REGCLASS (f64 (COPY_TO_REGCLASS $S, VSRC)), VSFRC)))>;
|
|
|
|
} // IsLittleEndian
|
|
|
|
|
|
|
|
let Predicates = [IsBigEndian] in {
|
|
|
|
def : Pat<(f64 (PPCfcfid (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f64 (XSCVSXDDP (COPY_TO_REGCLASS $S, VSFRC)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfid (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f64 (XSCVSXDDP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f64 (XSCVUXDDP (COPY_TO_REGCLASS $S, VSFRC)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f64 (XSCVUXDDP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
} // IsBigEndian
|
|
|
|
|
[PowerPC] Initial support for the VSX instruction set
VSX is an ISA extension supported on the POWER7 and later cores that enhances
floating-point vector and scalar capabilities. Among other things, this adds
<2 x double> support and generally helps to reduce register pressure.
The interesting part of this ISA feature is the register configuration: there
are 64 new 128-bit vector registers, the 32 of which are super-registers of the
existing 32 scalar floating-point registers, and the second 32 of which overlap
with the 32 Altivec vector registers. This makes things like vector insertion
and extraction tricky: this can be free but only if we force a restriction to
the right register subclass when needed. A new "minipass" PPCVSXCopy takes care
of this (although it could do a more-optimal job of it; see the comment about
unnecessary copies below).
Please note that, currently, VSX is not enabled by default when targeting
anything because it is not yet ready for that. The assembler and disassembler
are fully implemented and tested. However:
- CodeGen support causes miscompiles; test-suite runtime failures:
MultiSource/Benchmarks/FreeBench/distray/distray
MultiSource/Benchmarks/McCat/08-main/main
MultiSource/Benchmarks/Olden/voronoi/voronoi
MultiSource/Benchmarks/mafft/pairlocalalign
MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
SingleSource/Benchmarks/CoyoteBench/almabench
SingleSource/Benchmarks/Misc/matmul_f64_4x4
- The lowering currently falls back to using Altivec instructions far more
than it should. Worse, there are some things that are scalarized through the
stack that shouldn't be.
- A lot of unnecessary copies make it past the optimizers, and this needs to
be fixed.
- Many more regression tests are needed.
Normally, I'd fix these things prior to committing, but there are some
students and other contributors who would like to work this, and so it makes
sense to move this development process upstream where it can be subject to the
regular code-review procedures.
llvm-svn: 203768
2014-03-13 15:58:58 +08:00
|
|
|
} // AddedComplexity
|
|
|
|
} // HasVSX
|
|
|
|
|
2016-10-04 14:59:23 +08:00
|
|
|
def ScalarLoads {
|
|
|
|
dag Li8 = (i32 (extloadi8 xoaddr:$src));
|
|
|
|
dag ZELi8 = (i32 (zextloadi8 xoaddr:$src));
|
|
|
|
dag ZELi8i64 = (i64 (zextloadi8 xoaddr:$src));
|
|
|
|
dag SELi8 = (i32 (sext_inreg (extloadi8 xoaddr:$src), i8));
|
|
|
|
dag SELi8i64 = (i64 (sext_inreg (extloadi8 xoaddr:$src), i8));
|
|
|
|
|
|
|
|
dag Li16 = (i32 (extloadi16 xoaddr:$src));
|
|
|
|
dag ZELi16 = (i32 (zextloadi16 xoaddr:$src));
|
|
|
|
dag ZELi16i64 = (i64 (zextloadi16 xoaddr:$src));
|
|
|
|
dag SELi16 = (i32 (sextloadi16 xoaddr:$src));
|
|
|
|
dag SELi16i64 = (i64 (sextloadi16 xoaddr:$src));
|
|
|
|
|
|
|
|
dag Li32 = (i32 (load xoaddr:$src));
|
|
|
|
}
|
|
|
|
|
2015-02-19 00:21:46 +08:00
|
|
|
// The following VSX instructions were introduced in Power ISA 2.07
|
|
|
|
/* FIXME: if the operands are v2i64, these patterns will not match.
|
|
|
|
we should define new patterns or otherwise match the same patterns
|
|
|
|
when the elements are larger than i32.
|
|
|
|
*/
|
|
|
|
def HasP8Vector : Predicate<"PPCSubTarget->hasP8Vector()">;
|
2015-04-11 18:40:42 +08:00
|
|
|
def HasDirectMove : Predicate<"PPCSubTarget->hasDirectMove()">;
|
2015-02-19 00:21:46 +08:00
|
|
|
let Predicates = [HasP8Vector] in {
|
|
|
|
let AddedComplexity = 400 in { // Prefer VSX patterns over non-VSX patterns.
|
2016-10-04 14:59:23 +08:00
|
|
|
let isCommutable = 1, UseVSXReg = 1 in {
|
2015-05-22 03:32:49 +08:00
|
|
|
def XXLEQV : XX3Form<60, 186,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xxleqv $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (vnot_ppc (xor v4i32:$XA, v4i32:$XB)))]>;
|
|
|
|
def XXLNAND : XX3Form<60, 178,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xxlnand $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (vnot_ppc (and v4i32:$XA,
|
2015-02-19 00:21:46 +08:00
|
|
|
v4i32:$XB)))]>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // isCommutable, UseVSXReg
|
2015-07-10 22:25:17 +08:00
|
|
|
|
2015-07-10 20:38:08 +08:00
|
|
|
def : Pat<(int_ppc_vsx_xxleqv v4i32:$A, v4i32:$B),
|
|
|
|
(XXLEQV $A, $B)>;
|
2015-05-22 03:32:49 +08:00
|
|
|
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
2015-05-22 03:32:49 +08:00
|
|
|
def XXLORC : XX3Form<60, 170,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xxlorc $XT, $XA, $XB", IIC_VecGeneral,
|
|
|
|
[(set v4i32:$XT, (or v4i32:$XA, (vnot_ppc v4i32:$XB)))]>;
|
|
|
|
|
2015-05-08 02:24:05 +08:00
|
|
|
// VSX scalar loads introduced in ISA 2.07
|
2017-01-27 02:59:15 +08:00
|
|
|
let mayLoad = 1, mayStore = 0 in {
|
2016-10-04 19:25:52 +08:00
|
|
|
let CodeSize = 3 in
|
2015-05-08 02:24:05 +08:00
|
|
|
def LXSSPX : XX1Form<31, 524, (outs vssrc:$XT), (ins memrr:$src),
|
2017-11-20 22:38:30 +08:00
|
|
|
"lxsspx $XT, $src", IIC_LdStLFD, []>;
|
2015-05-08 02:24:05 +08:00
|
|
|
def LXSIWAX : XX1Form<31, 76, (outs vsfrc:$XT), (ins memrr:$src),
|
2017-11-20 22:38:30 +08:00
|
|
|
"lxsiwax $XT, $src", IIC_LdStLFD, []>;
|
2015-05-08 02:24:05 +08:00
|
|
|
def LXSIWZX : XX1Form<31, 12, (outs vsfrc:$XT), (ins memrr:$src),
|
2017-11-20 22:38:30 +08:00
|
|
|
"lxsiwzx $XT, $src", IIC_LdStLFD, []>;
|
|
|
|
|
|
|
|
// Please note let isPseudo = 1 is not part of class Pseudo<>. Missing it
|
|
|
|
// would cause these Pseudos are not expanded in expandPostRAPseudos()
|
|
|
|
let isPseudo = 1 in {
|
|
|
|
// Pseudo instruction XFLOADf32 will be expanded to LXSSPX or LFSX later
|
|
|
|
let CodeSize = 3 in
|
|
|
|
def XFLOADf32 : Pseudo<(outs vssrc:$XT), (ins memrr:$src),
|
|
|
|
"#XFLOADf32",
|
|
|
|
[(set f32:$XT, (load xoaddr:$src))]>;
|
|
|
|
// Pseudo instruction LIWAX will be expanded to LXSIWAX or LFIWAX later
|
|
|
|
def LIWAX : Pseudo<(outs vsfrc:$XT), (ins memrr:$src),
|
|
|
|
"#LIWAX",
|
|
|
|
[(set f64:$XT, (PPClfiwax xoaddr:$src))]>;
|
|
|
|
// Pseudo instruction LIWZX will be expanded to LXSIWZX or LFIWZX later
|
|
|
|
def LIWZX : Pseudo<(outs vsfrc:$XT), (ins memrr:$src),
|
|
|
|
"#LIWZX",
|
|
|
|
[(set f64:$XT, (PPClfiwzx xoaddr:$src))]>;
|
|
|
|
}
|
2015-05-08 02:24:05 +08:00
|
|
|
} // mayLoad
|
|
|
|
|
|
|
|
// VSX scalar stores introduced in ISA 2.07
|
2017-01-27 02:59:15 +08:00
|
|
|
let mayStore = 1, mayLoad = 0 in {
|
2016-10-04 19:25:52 +08:00
|
|
|
let CodeSize = 3 in
|
2015-05-08 02:24:05 +08:00
|
|
|
def STXSSPX : XX1Form<31, 652, (outs), (ins vssrc:$XT, memrr:$dst),
|
2017-11-20 22:38:30 +08:00
|
|
|
"stxsspx $XT, $dst", IIC_LdStSTFD, []>;
|
2015-05-08 02:24:05 +08:00
|
|
|
def STXSIWX : XX1Form<31, 140, (outs), (ins vsfrc:$XT, memrr:$dst),
|
2017-11-20 22:38:30 +08:00
|
|
|
"stxsiwx $XT, $dst", IIC_LdStSTFD, []>;
|
|
|
|
|
|
|
|
// Please note let isPseudo = 1 is not part of class Pseudo<>. Missing it
|
|
|
|
// would cause these Pseudos are not expanded in expandPostRAPseudos()
|
|
|
|
let isPseudo = 1 in {
|
|
|
|
// Pseudo instruction XFSTOREf32 will be expanded to STXSSPX or STFSX later
|
|
|
|
let CodeSize = 3 in
|
|
|
|
def XFSTOREf32 : Pseudo<(outs), (ins vssrc:$XT, memrr:$dst),
|
|
|
|
"#XFSTOREf32",
|
|
|
|
[(store f32:$XT, xoaddr:$dst)]>;
|
|
|
|
// Pseudo instruction STIWX will be expanded to STXSIWX or STFIWX later
|
|
|
|
def STIWX : Pseudo<(outs), (ins vsfrc:$XT, memrr:$dst),
|
|
|
|
"#STIWX",
|
|
|
|
[(PPCstfiwx f64:$XT, xoaddr:$dst)]>;
|
|
|
|
}
|
2015-05-08 02:24:05 +08:00
|
|
|
} // mayStore
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
2015-05-22 03:32:49 +08:00
|
|
|
|
|
|
|
def : Pat<(f64 (extloadf32 xoaddr:$src)),
|
2017-11-20 22:38:30 +08:00
|
|
|
(COPY_TO_REGCLASS (XFLOADf32 xoaddr:$src), VSFRC)>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(f32 (fpround (extloadf32 xoaddr:$src))),
|
2017-11-20 22:38:30 +08:00
|
|
|
(f32 (XFLOADf32 xoaddr:$src))>;
|
2016-08-19 04:08:15 +08:00
|
|
|
def : Pat<(f64 (fpextend f32:$src)),
|
2015-05-22 03:32:49 +08:00
|
|
|
(COPY_TO_REGCLASS $src, VSFRC)>;
|
2015-08-31 06:12:50 +08:00
|
|
|
|
2015-05-22 03:32:49 +08:00
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETLT)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSSRC (CRANDC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETULT)),
|
2015-05-22 03:32:49 +08:00
|
|
|
(SELECT_VSSRC (CRANDC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETLE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSSRC (CRORC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETULE)),
|
2015-05-22 03:32:49 +08:00
|
|
|
(SELECT_VSSRC (CRORC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETEQ)),
|
|
|
|
(SELECT_VSSRC (CREQV $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETGE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSSRC (CRORC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETUGE)),
|
2015-05-22 03:32:49 +08:00
|
|
|
(SELECT_VSSRC (CRORC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETGT)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSSRC (CRANDC $rhs, $lhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETUGT)),
|
2015-05-22 03:32:49 +08:00
|
|
|
(SELECT_VSSRC (CRANDC $lhs, $rhs), $tval, $fval)>;
|
|
|
|
def : Pat<(f32 (selectcc i1:$lhs, i1:$rhs, f32:$tval, f32:$fval, SETNE)),
|
2015-08-31 06:12:50 +08:00
|
|
|
(SELECT_VSSRC (CRXOR $lhs, $rhs), $tval, $fval)>;
|
2015-05-22 03:32:49 +08:00
|
|
|
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
2015-05-22 03:32:49 +08:00
|
|
|
// VSX Elementary Scalar FP arithmetic (SP)
|
|
|
|
let isCommutable = 1 in {
|
|
|
|
def XSADDSP : XX3Form<60, 0,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsaddsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fadd f32:$XA, f32:$XB))]>;
|
|
|
|
def XSMULSP : XX3Form<60, 16,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsmulsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fmul f32:$XA, f32:$XB))]>;
|
|
|
|
} // isCommutable
|
|
|
|
|
|
|
|
def XSDIVSP : XX3Form<60, 24,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsdivsp $XT, $XA, $XB", IIC_FPDivS,
|
|
|
|
[(set f32:$XT, (fdiv f32:$XA, f32:$XB))]>;
|
|
|
|
def XSRESP : XX2Form<60, 26,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xsresp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfre f32:$XB))]>;
|
|
|
|
def XSSQRTSP : XX2Form<60, 11,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xssqrtsp $XT, $XB", IIC_FPSqrtS,
|
|
|
|
[(set f32:$XT, (fsqrt f32:$XB))]>;
|
|
|
|
def XSRSQRTESP : XX2Form<60, 10,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xsrsqrtesp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfrsqrte f32:$XB))]>;
|
|
|
|
def XSSUBSP : XX3Form<60, 8,
|
|
|
|
(outs vssrc:$XT), (ins vssrc:$XA, vssrc:$XB),
|
|
|
|
"xssubsp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fsub f32:$XA, f32:$XB))]>;
|
2015-05-30 01:13:25 +08:00
|
|
|
|
|
|
|
// FMA Instructions
|
|
|
|
let BaseName = "XSMADDASP" in {
|
|
|
|
let isCommutable = 1 in
|
|
|
|
def XSMADDASP : XX3Form<60, 1,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsmaddasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fma f32:$XA, f32:$XB, f32:$XTi))]>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
|
|
|
def XSMADDMSP : XX3Form<60, 9,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsmaddmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
|
|
|
|
|
|
|
let BaseName = "XSMSUBASP" in {
|
|
|
|
let isCommutable = 1 in
|
|
|
|
def XSMSUBASP : XX3Form<60, 17,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsmsubasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fma f32:$XA, f32:$XB,
|
|
|
|
(fneg f32:$XTi)))]>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
|
|
|
def XSMSUBMSP : XX3Form<60, 25,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsmsubmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
|
|
|
|
|
|
|
let BaseName = "XSNMADDASP" in {
|
|
|
|
let isCommutable = 1 in
|
|
|
|
def XSNMADDASP : XX3Form<60, 129,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsnmaddasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fneg (fma f32:$XA, f32:$XB,
|
|
|
|
f32:$XTi)))]>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
|
|
|
def XSNMADDMSP : XX3Form<60, 137,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsnmaddmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
|
|
|
|
|
|
|
let BaseName = "XSNMSUBASP" in {
|
|
|
|
let isCommutable = 1 in
|
|
|
|
def XSNMSUBASP : XX3Form<60, 145,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsnmsubasp $XT, $XA, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (fneg (fma f32:$XA, f32:$XB,
|
|
|
|
(fneg f32:$XTi))))]>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
let IsVSXFMAAlt = 1 in
|
|
|
|
def XSNMSUBMSP : XX3Form<60, 153,
|
|
|
|
(outs vssrc:$XT),
|
|
|
|
(ins vssrc:$XTi, vssrc:$XA, vssrc:$XB),
|
|
|
|
"xsnmsubmsp $XT, $XA, $XB", IIC_VecFP, []>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">,
|
|
|
|
AltVSXFMARel;
|
|
|
|
}
|
2015-08-14 01:40:44 +08:00
|
|
|
|
|
|
|
// Single Precision Conversions (FP <-> INT)
|
|
|
|
def XSCVSXDSP : XX2Form<60, 312,
|
|
|
|
(outs vssrc:$XT), (ins vsfrc:$XB),
|
|
|
|
"xscvsxdsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfcfids f64:$XB))]>;
|
|
|
|
def XSCVUXDSP : XX2Form<60, 296,
|
|
|
|
(outs vssrc:$XT), (ins vsfrc:$XB),
|
|
|
|
"xscvuxdsp $XT, $XB", IIC_VecFP,
|
|
|
|
[(set f32:$XT, (PPCfcfidus f64:$XB))]>;
|
|
|
|
|
|
|
|
// Conversions between vector and scalar single precision
|
|
|
|
def XSCVDPSPN : XX2Form<60, 267, (outs vsrc:$XT), (ins vssrc:$XB),
|
|
|
|
"xscvdpspn $XT, $XB", IIC_VecFP, []>;
|
|
|
|
def XSCVSPDPN : XX2Form<60, 331, (outs vssrc:$XT), (ins vsrc:$XB),
|
|
|
|
"xscvspdpn $XT, $XB", IIC_VecFP, []>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
2015-08-14 01:40:44 +08:00
|
|
|
|
2016-07-18 23:30:00 +08:00
|
|
|
let Predicates = [IsLittleEndian] in {
|
|
|
|
def : Pat<(f32 (PPCfcfids (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f32 (XSCVSXDSP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfids (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f32 (XSCVSXDSP (COPY_TO_REGCLASS (f64 (COPY_TO_REGCLASS $S, VSRC)), VSFRC)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f32 (XSCVUXDSP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f32 (XSCVUXDSP (COPY_TO_REGCLASS (f64 (COPY_TO_REGCLASS $S, VSRC)), VSFRC)))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsBigEndian] in {
|
|
|
|
def : Pat<(f32 (PPCfcfids (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f32 (XSCVSXDSP (COPY_TO_REGCLASS $S, VSFRC)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfids (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f32 (XSCVSXDSP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsra (i64 (vector_extract v2i64:$S, 0))))),
|
|
|
|
(f32 (XSCVUXDSP (COPY_TO_REGCLASS $S, VSFRC)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsra (i64 (vector_extract v2i64:$S, 1))))),
|
|
|
|
(f32 (XSCVUXDSP (COPY_TO_REGCLASS (XXPERMDI $S, $S, 2), VSFRC)))>;
|
|
|
|
}
|
2016-10-04 14:59:23 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector ScalarLoads.Li32)),
|
2017-11-20 22:38:30 +08:00
|
|
|
(v4i32 (XXSPLTWs (LIWAX xoaddr:$src), 1))>;
|
2015-05-08 02:24:05 +08:00
|
|
|
} // AddedComplexity = 400
|
2015-02-19 00:21:46 +08:00
|
|
|
} // HasP8Vector
|
2015-04-11 18:40:42 +08:00
|
|
|
|
2016-11-30 00:11:34 +08:00
|
|
|
let UseVSXReg = 1, AddedComplexity = 400 in {
|
2016-04-01 01:47:17 +08:00
|
|
|
let Predicates = [HasDirectMove] in {
|
2015-05-22 03:32:49 +08:00
|
|
|
// VSX direct move instructions
|
|
|
|
def MFVSRD : XX1_RS6_RD5_XO<31, 51, (outs g8rc:$rA), (ins vsfrc:$XT),
|
|
|
|
"mfvsrd $rA, $XT", IIC_VecGeneral,
|
|
|
|
[(set i64:$rA, (PPCmfvsr f64:$XT))]>,
|
|
|
|
Requires<[In64BitMode]>;
|
2017-03-16 00:04:53 +08:00
|
|
|
let isCodeGenOnly = 1 in
|
|
|
|
def MFVRD : XX1_RS6_RD5_XO<31, 51, (outs g8rc:$rA), (ins vrrc:$XT),
|
|
|
|
"mfvsrd $rA, $XT", IIC_VecGeneral,
|
|
|
|
[]>,
|
|
|
|
Requires<[In64BitMode]>;
|
2015-05-22 03:32:49 +08:00
|
|
|
def MFVSRWZ : XX1_RS6_RD5_XO<31, 115, (outs gprc:$rA), (ins vsfrc:$XT),
|
|
|
|
"mfvsrwz $rA, $XT", IIC_VecGeneral,
|
|
|
|
[(set i32:$rA, (PPCmfvsr f64:$XT))]>;
|
|
|
|
def MTVSRD : XX1_RS6_RD5_XO<31, 179, (outs vsfrc:$XT), (ins g8rc:$rA),
|
|
|
|
"mtvsrd $XT, $rA", IIC_VecGeneral,
|
|
|
|
[(set f64:$XT, (PPCmtvsra i64:$rA))]>,
|
|
|
|
Requires<[In64BitMode]>;
|
|
|
|
def MTVSRWA : XX1_RS6_RD5_XO<31, 211, (outs vsfrc:$XT), (ins gprc:$rA),
|
|
|
|
"mtvsrwa $XT, $rA", IIC_VecGeneral,
|
|
|
|
[(set f64:$XT, (PPCmtvsra i32:$rA))]>;
|
|
|
|
def MTVSRWZ : XX1_RS6_RD5_XO<31, 243, (outs vsfrc:$XT), (ins gprc:$rA),
|
|
|
|
"mtvsrwz $XT, $rA", IIC_VecGeneral,
|
|
|
|
[(set f64:$XT, (PPCmtvsrz i32:$rA))]>;
|
2016-04-01 01:47:17 +08:00
|
|
|
} // HasDirectMove
|
|
|
|
|
|
|
|
let Predicates = [IsISA3_0, HasDirectMove] in {
|
|
|
|
def MTVSRWS: XX1_RS6_RD5_XO<31, 403, (outs vsrc:$XT), (ins gprc:$rA),
|
2016-09-23 21:25:31 +08:00
|
|
|
"mtvsrws $XT, $rA", IIC_VecGeneral, []>;
|
2016-04-01 01:47:17 +08:00
|
|
|
|
2017-05-12 06:17:35 +08:00
|
|
|
def MTVSRDD: XX1Form<31, 435, (outs vsrc:$XT), (ins g8rc_nox0:$rA, g8rc:$rB),
|
2016-04-01 01:47:17 +08:00
|
|
|
"mtvsrdd $XT, $rA, $rB", IIC_VecGeneral,
|
|
|
|
[]>, Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
def MFVSRLD: XX1_RS6_RD5_XO<31, 307, (outs g8rc:$rA), (ins vsrc:$XT),
|
|
|
|
"mfvsrld $rA, $XT", IIC_VecGeneral,
|
|
|
|
[]>, Requires<[In64BitMode]>;
|
|
|
|
|
|
|
|
} // IsISA3_0, HasDirectMove
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
2015-08-14 01:40:44 +08:00
|
|
|
|
2017-03-16 00:04:53 +08:00
|
|
|
// We want to parse this from asm, but we don't want to emit this as it would
|
|
|
|
// be emitted with a VSX reg. So leave Emit = 0 here.
|
|
|
|
def : InstAlias<"mfvrd $rA, $XT",
|
|
|
|
(MFVRD g8rc:$rA, vrrc:$XT), 0>;
|
|
|
|
def : InstAlias<"mffprd $rA, $src",
|
|
|
|
(MFVSRD g8rc:$rA, f8rc:$src)>;
|
|
|
|
|
2015-10-09 19:12:18 +08:00
|
|
|
/* Direct moves of various widths from GPR's into VSR's. Each move lines
|
2015-08-14 01:40:44 +08:00
|
|
|
the value up into element 0 (both BE and LE). Namely, entities smaller than
|
|
|
|
a doubleword are shifted left and moved for BE. For LE, they're moved, then
|
|
|
|
swapped to go into the least significant element of the VSR.
|
|
|
|
*/
|
2015-10-09 19:12:18 +08:00
|
|
|
def MovesToVSR {
|
|
|
|
dag BE_BYTE_0 =
|
|
|
|
(MTVSRD
|
|
|
|
(RLDICR
|
|
|
|
(INSERT_SUBREG (i64 (IMPLICIT_DEF)), $A, sub_32), 56, 7));
|
|
|
|
dag BE_HALF_0 =
|
|
|
|
(MTVSRD
|
|
|
|
(RLDICR
|
|
|
|
(INSERT_SUBREG (i64 (IMPLICIT_DEF)), $A, sub_32), 48, 15));
|
|
|
|
dag BE_WORD_0 =
|
|
|
|
(MTVSRD
|
|
|
|
(RLDICR
|
|
|
|
(INSERT_SUBREG (i64 (IMPLICIT_DEF)), $A, sub_32), 32, 31));
|
2015-08-14 01:40:44 +08:00
|
|
|
dag BE_DWORD_0 = (MTVSRD $A);
|
|
|
|
|
|
|
|
dag LE_MTVSRW = (MTVSRD (INSERT_SUBREG (i64 (IMPLICIT_DEF)), $A, sub_32));
|
2015-10-09 19:12:18 +08:00
|
|
|
dag LE_WORD_1 = (v2i64 (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)),
|
|
|
|
LE_MTVSRW, sub_64));
|
2015-08-14 01:40:44 +08:00
|
|
|
dag LE_WORD_0 = (XXPERMDI LE_WORD_1, LE_WORD_1, 2);
|
2015-10-09 19:12:18 +08:00
|
|
|
dag LE_DWORD_1 = (v2i64 (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)),
|
|
|
|
BE_DWORD_0, sub_64));
|
2015-08-14 01:40:44 +08:00
|
|
|
dag LE_DWORD_0 = (XXPERMDI LE_DWORD_1, LE_DWORD_1, 2);
|
|
|
|
}
|
|
|
|
|
2015-12-10 21:35:28 +08:00
|
|
|
/* Patterns for extracting elements out of vectors. Integer elements are
|
|
|
|
extracted using direct move operations. Patterns for extracting elements
|
|
|
|
whose indices are not available at compile time are also provided with
|
|
|
|
various _VARIABLE_ patterns.
|
2015-10-09 19:12:18 +08:00
|
|
|
The numbering for the DAG's is for LE, but when used on BE, the correct
|
|
|
|
LE element can just be used (i.e. LE_BYTE_2 == BE_BYTE_13).
|
|
|
|
*/
|
2015-12-10 21:35:28 +08:00
|
|
|
def VectorExtractions {
|
2015-10-09 19:12:18 +08:00
|
|
|
// Doubleword extraction
|
|
|
|
dag LE_DWORD_0 =
|
|
|
|
(MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(XXPERMDI (COPY_TO_REGCLASS $S, VSRC),
|
|
|
|
(COPY_TO_REGCLASS $S, VSRC), 2), sub_64));
|
|
|
|
dag LE_DWORD_1 = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS $S, VSRC)), sub_64));
|
|
|
|
|
|
|
|
// Word extraction
|
2016-07-12 20:16:27 +08:00
|
|
|
dag LE_WORD_0 = (MFVSRWZ (EXTRACT_SUBREG (XXPERMDI $S, $S, 2), sub_64));
|
2015-10-09 19:12:18 +08:00
|
|
|
dag LE_WORD_1 = (MFVSRWZ (EXTRACT_SUBREG (XXSLDWI $S, $S, 1), sub_64));
|
|
|
|
dag LE_WORD_2 = (MFVSRWZ (EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS $S, VSRC)), sub_64));
|
|
|
|
dag LE_WORD_3 = (MFVSRWZ (EXTRACT_SUBREG (XXSLDWI $S, $S, 3), sub_64));
|
|
|
|
|
|
|
|
// Halfword extraction
|
|
|
|
dag LE_HALF_0 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 0, 48), sub_32));
|
|
|
|
dag LE_HALF_1 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 48, 48), sub_32));
|
|
|
|
dag LE_HALF_2 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 32, 48), sub_32));
|
|
|
|
dag LE_HALF_3 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 16, 48), sub_32));
|
|
|
|
dag LE_HALF_4 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 0, 48), sub_32));
|
|
|
|
dag LE_HALF_5 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 48, 48), sub_32));
|
|
|
|
dag LE_HALF_6 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 32, 48), sub_32));
|
|
|
|
dag LE_HALF_7 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 16, 48), sub_32));
|
|
|
|
|
|
|
|
// Byte extraction
|
|
|
|
dag LE_BYTE_0 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 0, 56), sub_32));
|
|
|
|
dag LE_BYTE_1 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 56, 56), sub_32));
|
|
|
|
dag LE_BYTE_2 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 48, 56), sub_32));
|
|
|
|
dag LE_BYTE_3 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 40, 56), sub_32));
|
|
|
|
dag LE_BYTE_4 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 32, 56), sub_32));
|
|
|
|
dag LE_BYTE_5 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 24, 56), sub_32));
|
|
|
|
dag LE_BYTE_6 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 16, 56), sub_32));
|
|
|
|
dag LE_BYTE_7 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_0, 8, 56), sub_32));
|
|
|
|
dag LE_BYTE_8 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 0, 56), sub_32));
|
|
|
|
dag LE_BYTE_9 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 56, 56), sub_32));
|
|
|
|
dag LE_BYTE_10 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 48, 56), sub_32));
|
|
|
|
dag LE_BYTE_11 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 40, 56), sub_32));
|
|
|
|
dag LE_BYTE_12 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 32, 56), sub_32));
|
|
|
|
dag LE_BYTE_13 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 24, 56), sub_32));
|
|
|
|
dag LE_BYTE_14 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 16, 56), sub_32));
|
|
|
|
dag LE_BYTE_15 = (i32 (EXTRACT_SUBREG (RLDICL LE_DWORD_1, 8, 56), sub_32));
|
|
|
|
|
|
|
|
/* Variable element number (BE and LE patterns must be specified separately)
|
|
|
|
This is a rather involved process.
|
|
|
|
|
|
|
|
Conceptually, this is how the move is accomplished:
|
|
|
|
1. Identify which doubleword contains the element
|
|
|
|
2. Shift in the VMX register so that the correct doubleword is correctly
|
|
|
|
lined up for the MFVSRD
|
|
|
|
3. Perform the move so that the element (along with some extra stuff)
|
|
|
|
is in the GPR
|
|
|
|
4. Right shift within the GPR so that the element is right-justified
|
|
|
|
|
|
|
|
Of course, the index is an element number which has a different meaning
|
|
|
|
on LE/BE so the patterns have to be specified separately.
|
|
|
|
|
|
|
|
Note: The final result will be the element right-justified with high
|
|
|
|
order bits being arbitrarily defined (namely, whatever was in the
|
|
|
|
vector register to the left of the value originally).
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* LE variable byte
|
|
|
|
Number 1. above:
|
|
|
|
- For elements 0-7, we shift left by 8 bytes since they're on the right
|
|
|
|
- For elements 8-15, we need not shift (shift left by zero bytes)
|
|
|
|
This is accomplished by inverting the bits of the index and AND-ing
|
|
|
|
with 0x8 (i.e. clearing all bits of the index and inverting bit 60).
|
|
|
|
*/
|
|
|
|
dag LE_VBYTE_PERM_VEC = (LVSL ZERO8, (ANDC8 (LI8 8), $Idx));
|
|
|
|
|
|
|
|
// Number 2. above:
|
|
|
|
// - Now that we set up the shift amount, we shift in the VMX register
|
|
|
|
dag LE_VBYTE_PERMUTE = (VPERM $S, $S, LE_VBYTE_PERM_VEC);
|
|
|
|
|
|
|
|
// Number 3. above:
|
|
|
|
// - The doubleword containing our element is moved to a GPR
|
|
|
|
dag LE_MV_VBYTE = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS LE_VBYTE_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
|
|
|
|
/* Number 4. above:
|
|
|
|
- Truncate the element number to the range 0-7 (8-15 are symmetrical
|
|
|
|
and out of range values are truncated accordingly)
|
|
|
|
- Multiply by 8 as we need to shift right by the number of bits, not bytes
|
|
|
|
- Shift right in the GPR by the calculated value
|
|
|
|
*/
|
|
|
|
dag LE_VBYTE_SHIFT = (EXTRACT_SUBREG (RLDICR (AND8 (LI8 7), $Idx), 3, 60),
|
|
|
|
sub_32);
|
|
|
|
dag LE_VARIABLE_BYTE = (EXTRACT_SUBREG (SRD LE_MV_VBYTE, LE_VBYTE_SHIFT),
|
|
|
|
sub_32);
|
|
|
|
|
|
|
|
/* LE variable halfword
|
|
|
|
Number 1. above:
|
|
|
|
- For elements 0-3, we shift left by 8 since they're on the right
|
|
|
|
- For elements 4-7, we need not shift (shift left by zero bytes)
|
|
|
|
Similarly to the byte pattern, we invert the bits of the index, but we
|
|
|
|
AND with 0x4 (i.e. clear all bits of the index and invert bit 61).
|
|
|
|
Of course, the shift is still by 8 bytes, so we must multiply by 2.
|
|
|
|
*/
|
|
|
|
dag LE_VHALF_PERM_VEC = (LVSL ZERO8, (RLDICR (ANDC8 (LI8 4), $Idx), 1, 62));
|
|
|
|
|
|
|
|
// Number 2. above:
|
|
|
|
// - Now that we set up the shift amount, we shift in the VMX register
|
|
|
|
dag LE_VHALF_PERMUTE = (VPERM $S, $S, LE_VHALF_PERM_VEC);
|
|
|
|
|
|
|
|
// Number 3. above:
|
|
|
|
// - The doubleword containing our element is moved to a GPR
|
|
|
|
dag LE_MV_VHALF = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS LE_VHALF_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
|
|
|
|
/* Number 4. above:
|
|
|
|
- Truncate the element number to the range 0-3 (4-7 are symmetrical
|
|
|
|
and out of range values are truncated accordingly)
|
|
|
|
- Multiply by 16 as we need to shift right by the number of bits
|
|
|
|
- Shift right in the GPR by the calculated value
|
|
|
|
*/
|
|
|
|
dag LE_VHALF_SHIFT = (EXTRACT_SUBREG (RLDICR (AND8 (LI8 3), $Idx), 4, 59),
|
|
|
|
sub_32);
|
|
|
|
dag LE_VARIABLE_HALF = (EXTRACT_SUBREG (SRD LE_MV_VHALF, LE_VHALF_SHIFT),
|
|
|
|
sub_32);
|
|
|
|
|
2015-12-10 21:35:28 +08:00
|
|
|
/* LE variable word
|
|
|
|
Number 1. above:
|
|
|
|
- For elements 0-1, we shift left by 8 since they're on the right
|
|
|
|
- For elements 2-3, we need not shift
|
|
|
|
*/
|
|
|
|
dag LE_VWORD_PERM_VEC = (LVSL ZERO8, (RLDICR (ANDC8 (LI8 2), $Idx), 2, 61));
|
|
|
|
|
|
|
|
// Number 2. above:
|
|
|
|
// - Now that we set up the shift amount, we shift in the VMX register
|
|
|
|
dag LE_VWORD_PERMUTE = (VPERM $S, $S, LE_VWORD_PERM_VEC);
|
|
|
|
|
|
|
|
// Number 3. above:
|
|
|
|
// - The doubleword containing our element is moved to a GPR
|
|
|
|
dag LE_MV_VWORD = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS LE_VWORD_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
|
|
|
|
/* Number 4. above:
|
|
|
|
- Truncate the element number to the range 0-1 (2-3 are symmetrical
|
|
|
|
and out of range values are truncated accordingly)
|
|
|
|
- Multiply by 32 as we need to shift right by the number of bits
|
|
|
|
- Shift right in the GPR by the calculated value
|
|
|
|
*/
|
|
|
|
dag LE_VWORD_SHIFT = (EXTRACT_SUBREG (RLDICR (AND8 (LI8 1), $Idx), 5, 58),
|
|
|
|
sub_32);
|
|
|
|
dag LE_VARIABLE_WORD = (EXTRACT_SUBREG (SRD LE_MV_VWORD, LE_VWORD_SHIFT),
|
|
|
|
sub_32);
|
|
|
|
|
|
|
|
/* LE variable doubleword
|
|
|
|
Number 1. above:
|
|
|
|
- For element 0, we shift left by 8 since it's on the right
|
|
|
|
- For element 1, we need not shift
|
|
|
|
*/
|
|
|
|
dag LE_VDWORD_PERM_VEC = (LVSL ZERO8, (RLDICR (ANDC8 (LI8 1), $Idx), 3, 60));
|
|
|
|
|
|
|
|
// Number 2. above:
|
|
|
|
// - Now that we set up the shift amount, we shift in the VMX register
|
|
|
|
dag LE_VDWORD_PERMUTE = (VPERM $S, $S, LE_VDWORD_PERM_VEC);
|
|
|
|
|
|
|
|
// Number 3. above:
|
|
|
|
// - The doubleword containing our element is moved to a GPR
|
|
|
|
// - Number 4. is not needed for the doubleword as the value is 64-bits
|
|
|
|
dag LE_VARIABLE_DWORD =
|
|
|
|
(MFVSRD (EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS LE_VDWORD_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
|
|
|
|
/* LE variable float
|
|
|
|
- Shift the vector to line up the desired element to BE Word 0
|
|
|
|
- Convert 32-bit float to a 64-bit single precision float
|
|
|
|
*/
|
|
|
|
dag LE_VFLOAT_PERM_VEC = (LVSL ZERO8, (RLDICR (XOR8 (LI8 3), $Idx), 2, 61));
|
|
|
|
dag LE_VFLOAT_PERMUTE = (VPERM $S, $S, LE_VFLOAT_PERM_VEC);
|
|
|
|
dag LE_VARIABLE_FLOAT = (XSCVSPDPN LE_VFLOAT_PERMUTE);
|
|
|
|
|
|
|
|
/* LE variable double
|
|
|
|
Same as the LE doubleword except there is no move.
|
|
|
|
*/
|
|
|
|
dag LE_VDOUBLE_PERMUTE = (VPERM (COPY_TO_REGCLASS $S, VRRC),
|
|
|
|
(COPY_TO_REGCLASS $S, VRRC),
|
|
|
|
LE_VDWORD_PERM_VEC);
|
|
|
|
dag LE_VARIABLE_DOUBLE = (COPY_TO_REGCLASS LE_VDOUBLE_PERMUTE, VSRC);
|
|
|
|
|
|
|
|
/* BE variable byte
|
|
|
|
The algorithm here is the same as the LE variable byte except:
|
|
|
|
- The shift in the VMX register is by 0/8 for opposite element numbers so
|
|
|
|
we simply AND the element number with 0x8
|
|
|
|
- The order of elements after the move to GPR is reversed, so we invert
|
|
|
|
the bits of the index prior to truncating to the range 0-7
|
|
|
|
*/
|
|
|
|
dag BE_VBYTE_PERM_VEC = (LVSL ZERO8, (ANDIo8 $Idx, 8));
|
|
|
|
dag BE_VBYTE_PERMUTE = (VPERM $S, $S, BE_VBYTE_PERM_VEC);
|
|
|
|
dag BE_MV_VBYTE = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS BE_VBYTE_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
dag BE_VBYTE_SHIFT = (EXTRACT_SUBREG (RLDICR (ANDC8 (LI8 7), $Idx), 3, 60),
|
|
|
|
sub_32);
|
|
|
|
dag BE_VARIABLE_BYTE = (EXTRACT_SUBREG (SRD BE_MV_VBYTE, BE_VBYTE_SHIFT),
|
|
|
|
sub_32);
|
|
|
|
|
2015-10-09 19:12:18 +08:00
|
|
|
/* BE variable halfword
|
|
|
|
The algorithm here is the same as the LE variable halfword except:
|
|
|
|
- The shift in the VMX register is by 0/8 for opposite element numbers so
|
|
|
|
we simply AND the element number with 0x4 and multiply by 2
|
|
|
|
- The order of elements after the move to GPR is reversed, so we invert
|
|
|
|
the bits of the index prior to truncating to the range 0-3
|
|
|
|
*/
|
|
|
|
dag BE_VHALF_PERM_VEC = (LVSL ZERO8, (RLDICR (ANDIo8 $Idx, 4), 1, 62));
|
|
|
|
dag BE_VHALF_PERMUTE = (VPERM $S, $S, BE_VHALF_PERM_VEC);
|
|
|
|
dag BE_MV_VHALF = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS BE_VHALF_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
2015-12-10 21:35:28 +08:00
|
|
|
dag BE_VHALF_SHIFT = (EXTRACT_SUBREG (RLDICR (ANDC8 (LI8 3), $Idx), 4, 59),
|
2015-10-09 19:12:18 +08:00
|
|
|
sub_32);
|
|
|
|
dag BE_VARIABLE_HALF = (EXTRACT_SUBREG (SRD BE_MV_VHALF, BE_VHALF_SHIFT),
|
|
|
|
sub_32);
|
2015-12-10 21:35:28 +08:00
|
|
|
|
|
|
|
/* BE variable word
|
|
|
|
The algorithm is the same as the LE variable word except:
|
|
|
|
- The shift in the VMX register happens for opposite element numbers
|
|
|
|
- The order of elements after the move to GPR is reversed, so we invert
|
|
|
|
the bits of the index prior to truncating to the range 0-1
|
|
|
|
*/
|
|
|
|
dag BE_VWORD_PERM_VEC = (LVSL ZERO8, (RLDICR (ANDIo8 $Idx, 2), 2, 61));
|
|
|
|
dag BE_VWORD_PERMUTE = (VPERM $S, $S, BE_VWORD_PERM_VEC);
|
|
|
|
dag BE_MV_VWORD = (MFVSRD
|
|
|
|
(EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS BE_VWORD_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
dag BE_VWORD_SHIFT = (EXTRACT_SUBREG (RLDICR (ANDC8 (LI8 1), $Idx), 5, 58),
|
|
|
|
sub_32);
|
|
|
|
dag BE_VARIABLE_WORD = (EXTRACT_SUBREG (SRD BE_MV_VWORD, BE_VWORD_SHIFT),
|
|
|
|
sub_32);
|
|
|
|
|
|
|
|
/* BE variable doubleword
|
|
|
|
Same as the LE doubleword except we shift in the VMX register for opposite
|
|
|
|
element indices.
|
|
|
|
*/
|
|
|
|
dag BE_VDWORD_PERM_VEC = (LVSL ZERO8, (RLDICR (ANDIo8 $Idx, 1), 3, 60));
|
|
|
|
dag BE_VDWORD_PERMUTE = (VPERM $S, $S, BE_VDWORD_PERM_VEC);
|
|
|
|
dag BE_VARIABLE_DWORD =
|
|
|
|
(MFVSRD (EXTRACT_SUBREG
|
|
|
|
(v2i64 (COPY_TO_REGCLASS BE_VDWORD_PERMUTE, VSRC)),
|
|
|
|
sub_64));
|
|
|
|
|
|
|
|
/* BE variable float
|
|
|
|
- Shift the vector to line up the desired element to BE Word 0
|
|
|
|
- Convert 32-bit float to a 64-bit single precision float
|
|
|
|
*/
|
|
|
|
dag BE_VFLOAT_PERM_VEC = (LVSL ZERO8, (RLDICR $Idx, 2, 61));
|
|
|
|
dag BE_VFLOAT_PERMUTE = (VPERM $S, $S, BE_VFLOAT_PERM_VEC);
|
|
|
|
dag BE_VARIABLE_FLOAT = (XSCVSPDPN BE_VFLOAT_PERMUTE);
|
|
|
|
|
|
|
|
/* BE variable double
|
|
|
|
Same as the BE doubleword except there is no move.
|
|
|
|
*/
|
|
|
|
dag BE_VDOUBLE_PERMUTE = (VPERM (COPY_TO_REGCLASS $S, VRRC),
|
|
|
|
(COPY_TO_REGCLASS $S, VRRC),
|
|
|
|
BE_VDWORD_PERM_VEC);
|
|
|
|
dag BE_VARIABLE_DOUBLE = (COPY_TO_REGCLASS BE_VDOUBLE_PERMUTE, VSRC);
|
2015-10-09 19:12:18 +08:00
|
|
|
}
|
|
|
|
|
2017-11-28 01:11:03 +08:00
|
|
|
def NoP9Altivec : Predicate<"!PPCSubTarget->hasP9Altivec()">;
|
2016-11-30 00:11:34 +08:00
|
|
|
let AddedComplexity = 400 in {
|
2015-10-09 19:12:18 +08:00
|
|
|
// v4f32 scalar <-> vector conversions (BE)
|
2015-08-14 01:40:44 +08:00
|
|
|
let Predicates = [IsBigEndian, HasP8Vector] in {
|
|
|
|
def : Pat<(v4f32 (scalar_to_vector f32:$A)),
|
|
|
|
(v4f32 (XSCVDPSPN $A))>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 0)),
|
|
|
|
(f32 (XSCVSPDPN $S))>;
|
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 1)),
|
|
|
|
(f32 (XSCVSPDPN (XXSLDWI $S, $S, 1)))>;
|
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 2)),
|
2016-07-12 20:16:27 +08:00
|
|
|
(f32 (XSCVSPDPN (XXPERMDI $S, $S, 2)))>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 3)),
|
|
|
|
(f32 (XSCVSPDPN (XXSLDWI $S, $S, 3)))>;
|
2015-12-10 21:35:28 +08:00
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, i64:$Idx)),
|
|
|
|
(f32 VectorExtractions.BE_VARIABLE_FLOAT)>;
|
2015-08-14 01:40:44 +08:00
|
|
|
} // IsBigEndian, HasP8Vector
|
|
|
|
|
2015-12-10 21:35:28 +08:00
|
|
|
// Variable index vector_extract for v2f64 does not require P8Vector
|
|
|
|
let Predicates = [IsBigEndian, HasVSX] in
|
|
|
|
def : Pat<(f64 (vector_extract v2f64:$S, i64:$Idx)),
|
|
|
|
(f64 VectorExtractions.BE_VARIABLE_DOUBLE)>;
|
|
|
|
|
2015-08-14 01:40:44 +08:00
|
|
|
let Predicates = [IsBigEndian, HasDirectMove] in {
|
2015-10-09 19:12:18 +08:00
|
|
|
// v16i8 scalar <-> vector conversions (BE)
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v16i8 (scalar_to_vector i32:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v16i8 (SUBREG_TO_REG (i64 1), MovesToVSR.BE_BYTE_0, sub_64))>;
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v8i16 (scalar_to_vector i32:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v8i16 (SUBREG_TO_REG (i64 1), MovesToVSR.BE_HALF_0, sub_64))>;
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector i32:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v4i32 (SUBREG_TO_REG (i64 1), MovesToVSR.BE_WORD_0, sub_64))>;
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector i64:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v2i64 (SUBREG_TO_REG (i64 1), MovesToVSR.BE_DWORD_0, sub_64))>;
|
2017-11-28 01:11:03 +08:00
|
|
|
|
|
|
|
// v2i64 scalar <-> vector conversions (BE)
|
|
|
|
def : Pat<(i64 (vector_extract v2i64:$S, 0)),
|
|
|
|
(i64 VectorExtractions.LE_DWORD_1)>;
|
|
|
|
def : Pat<(i64 (vector_extract v2i64:$S, 1)),
|
|
|
|
(i64 VectorExtractions.LE_DWORD_0)>;
|
|
|
|
def : Pat<(i64 (vector_extract v2i64:$S, i64:$Idx)),
|
|
|
|
(i64 VectorExtractions.BE_VARIABLE_DWORD)>;
|
|
|
|
} // IsBigEndian, HasDirectMove
|
|
|
|
|
|
|
|
let Predicates = [IsBigEndian, HasDirectMove, NoP9Altivec] in {
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 0)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_15)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 1)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_14)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 2)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_13)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 3)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_12)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 4)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_11)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 5)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_10)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 6)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_9)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 7)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_8)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 8)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_7)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 9)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_6)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 10)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_5)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 11)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_4)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 12)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_3)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 13)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_2)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 14)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_1)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 15)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_0)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, i64:$Idx)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.BE_VARIABLE_BYTE)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
|
|
|
|
// v8i16 scalar <-> vector conversions (BE)
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 0)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_7)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 1)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_6)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 2)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_5)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 3)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_4)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 4)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_3)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 5)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_2)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 6)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_1)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 7)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_0)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, i64:$Idx)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.BE_VARIABLE_HALF)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
|
|
|
|
// v4i32 scalar <-> vector conversions (BE)
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 0)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_3)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 1)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_2)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 2)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_1)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 3)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_0)>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, i64:$Idx)),
|
|
|
|
(i32 VectorExtractions.BE_VARIABLE_WORD)>;
|
2017-11-28 01:11:03 +08:00
|
|
|
} // IsBigEndian, HasDirectMove, NoP9Altivec
|
2015-08-14 01:40:44 +08:00
|
|
|
|
2015-10-09 19:12:18 +08:00
|
|
|
// v4f32 scalar <-> vector conversions (LE)
|
2015-08-14 01:40:44 +08:00
|
|
|
let Predicates = [IsLittleEndian, HasP8Vector] in {
|
|
|
|
def : Pat<(v4f32 (scalar_to_vector f32:$A)),
|
|
|
|
(v4f32 (XXSLDWI (XSCVDPSPN $A), (XSCVDPSPN $A), 1))>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 0)),
|
|
|
|
(f32 (XSCVSPDPN (XXSLDWI $S, $S, 3)))>;
|
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 1)),
|
2016-07-12 20:16:27 +08:00
|
|
|
(f32 (XSCVSPDPN (XXPERMDI $S, $S, 2)))>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 2)),
|
|
|
|
(f32 (XSCVSPDPN (XXSLDWI $S, $S, 1)))>;
|
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, 3)),
|
|
|
|
(f32 (XSCVSPDPN $S))>;
|
2015-12-10 21:35:28 +08:00
|
|
|
def : Pat<(f32 (vector_extract v4f32:$S, i64:$Idx)),
|
|
|
|
(f32 VectorExtractions.LE_VARIABLE_FLOAT)>;
|
2015-08-14 01:40:44 +08:00
|
|
|
} // IsLittleEndian, HasP8Vector
|
|
|
|
|
2015-12-10 21:35:28 +08:00
|
|
|
// Variable index vector_extract for v2f64 does not require P8Vector
|
|
|
|
let Predicates = [IsLittleEndian, HasVSX] in
|
|
|
|
def : Pat<(f64 (vector_extract v2f64:$S, i64:$Idx)),
|
|
|
|
(f64 VectorExtractions.LE_VARIABLE_DOUBLE)>;
|
|
|
|
|
2017-05-02 09:47:34 +08:00
|
|
|
def : Pat<(v4i32 (int_ppc_vsx_lxvw4x_be xoaddr:$src)), (LXVW4X xoaddr:$src)>;
|
|
|
|
def : Pat<(v2f64 (int_ppc_vsx_lxvd2x_be xoaddr:$src)), (LXVD2X xoaddr:$src)>;
|
2016-11-15 22:25:56 +08:00
|
|
|
|
2017-07-06 00:55:00 +08:00
|
|
|
// Variable index unsigned vector_extract on Power9
|
|
|
|
let Predicates = [HasP9Altivec, IsLittleEndian] in {
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v16i8:$S, i64:$Idx)))),
|
|
|
|
(VEXTUBRX $Idx, $S)>;
|
|
|
|
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, i64:$Idx)))),
|
|
|
|
(VEXTUHRX (RLWINM8 $Idx, 1, 28, 30), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 0)))),
|
|
|
|
(VEXTUHRX (LI8 0), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 1)))),
|
|
|
|
(VEXTUHRX (LI8 2), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 2)))),
|
|
|
|
(VEXTUHRX (LI8 4), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 3)))),
|
|
|
|
(VEXTUHRX (LI8 6), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 4)))),
|
|
|
|
(VEXTUHRX (LI8 8), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 5)))),
|
|
|
|
(VEXTUHRX (LI8 10), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 6)))),
|
|
|
|
(VEXTUHRX (LI8 12), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 7)))),
|
|
|
|
(VEXTUHRX (LI8 14), $S)>;
|
|
|
|
|
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, i64:$Idx)))),
|
|
|
|
(VEXTUWRX (RLWINM8 $Idx, 2, 28, 29), $S)>;
|
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 0)))),
|
|
|
|
(VEXTUWRX (LI8 0), $S)>;
|
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 1)))),
|
|
|
|
(VEXTUWRX (LI8 4), $S)>;
|
2017-11-28 01:11:03 +08:00
|
|
|
// For extracting LE word 2, MFVSRWZ is better than VEXTUWRX
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 2)))),
|
2017-11-28 01:11:03 +08:00
|
|
|
(INSERT_SUBREG (i64 (IMPLICIT_DEF)),
|
|
|
|
(i32 VectorExtractions.LE_WORD_2), sub_32)>;
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 3)))),
|
|
|
|
(VEXTUWRX (LI8 12), $S)>;
|
|
|
|
|
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, i64:$Idx)))),
|
|
|
|
(EXTSW (VEXTUWRX (RLWINM8 $Idx, 2, 28, 29), $S))>;
|
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 0)))),
|
|
|
|
(EXTSW (VEXTUWRX (LI8 0), $S))>;
|
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 1)))),
|
|
|
|
(EXTSW (VEXTUWRX (LI8 4), $S))>;
|
2017-11-28 01:11:03 +08:00
|
|
|
// For extracting LE word 2, MFVSRWZ is better than VEXTUWRX
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 2)))),
|
2017-11-28 01:11:03 +08:00
|
|
|
(EXTSW (INSERT_SUBREG (i64 (IMPLICIT_DEF)),
|
|
|
|
(i32 VectorExtractions.LE_WORD_2), sub_32))>;
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 3)))),
|
|
|
|
(EXTSW (VEXTUWRX (LI8 12), $S))>;
|
2017-11-28 01:11:03 +08:00
|
|
|
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, i64:$Idx)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX $Idx, $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 0)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 0), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 1)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 1), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 2)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 2), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 3)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 3), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 4)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 4), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 5)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 5), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 6)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 6), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 7)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 7), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 8)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 8), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 9)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 9), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 10)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 10), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 11)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 11), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 12)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 12), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 13)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 13), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 14)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 14), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 15)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBRX (LI8 15), $S), sub_32))>;
|
|
|
|
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, i64:$Idx)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX
|
|
|
|
(RLWINM8 $Idx, 1, 28, 30), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 0)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 0), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 1)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 2), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 2)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 4), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 3)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 6), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 4)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 8), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 5)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 10), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 6)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 12), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 6)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHRX (LI8 14), $S), sub_32))>;
|
|
|
|
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, i64:$Idx)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWRX
|
|
|
|
(RLWINM8 $Idx, 2, 28, 29), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 0)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWRX (LI8 0), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 1)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWRX (LI8 4), $S), sub_32))>;
|
|
|
|
// For extracting LE word 2, MFVSRWZ is better than VEXTUWRX
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 2)),
|
|
|
|
(i32 VectorExtractions.LE_WORD_2)>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 3)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWRX (LI8 12), $S), sub_32))>;
|
2017-07-06 00:55:00 +08:00
|
|
|
}
|
2017-11-28 01:11:03 +08:00
|
|
|
|
2017-07-06 00:55:00 +08:00
|
|
|
let Predicates = [HasP9Altivec, IsBigEndian] in {
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v16i8:$S, i64:$Idx)))),
|
|
|
|
(VEXTUBLX $Idx, $S)>;
|
|
|
|
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, i64:$Idx)))),
|
|
|
|
(VEXTUHLX (RLWINM8 $Idx, 1, 28, 30), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 0)))),
|
|
|
|
(VEXTUHLX (LI8 0), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 1)))),
|
|
|
|
(VEXTUHLX (LI8 2), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 2)))),
|
|
|
|
(VEXTUHLX (LI8 4), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 3)))),
|
|
|
|
(VEXTUHLX (LI8 6), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 4)))),
|
|
|
|
(VEXTUHLX (LI8 8), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 5)))),
|
|
|
|
(VEXTUHLX (LI8 10), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 6)))),
|
|
|
|
(VEXTUHLX (LI8 12), $S)>;
|
|
|
|
def : Pat<(i64 (anyext (i32 (vector_extract v8i16:$S, 7)))),
|
|
|
|
(VEXTUHLX (LI8 14), $S)>;
|
|
|
|
|
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, i64:$Idx)))),
|
|
|
|
(VEXTUWLX (RLWINM8 $Idx, 2, 28, 29), $S)>;
|
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 0)))),
|
|
|
|
(VEXTUWLX (LI8 0), $S)>;
|
2017-11-28 01:11:03 +08:00
|
|
|
|
|
|
|
// For extracting BE word 1, MFVSRWZ is better than VEXTUWLX
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 1)))),
|
2017-11-28 01:11:03 +08:00
|
|
|
(INSERT_SUBREG (i64 (IMPLICIT_DEF)),
|
|
|
|
(i32 VectorExtractions.LE_WORD_2), sub_32)>;
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 2)))),
|
|
|
|
(VEXTUWLX (LI8 8), $S)>;
|
|
|
|
def : Pat<(i64 (zext (i32 (vector_extract v4i32:$S, 3)))),
|
|
|
|
(VEXTUWLX (LI8 12), $S)>;
|
|
|
|
|
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, i64:$Idx)))),
|
|
|
|
(EXTSW (VEXTUWLX (RLWINM8 $Idx, 2, 28, 29), $S))>;
|
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 0)))),
|
|
|
|
(EXTSW (VEXTUWLX (LI8 0), $S))>;
|
2017-11-28 01:11:03 +08:00
|
|
|
// For extracting BE word 1, MFVSRWZ is better than VEXTUWLX
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 1)))),
|
2017-11-28 01:11:03 +08:00
|
|
|
(EXTSW (INSERT_SUBREG (i64 (IMPLICIT_DEF)),
|
|
|
|
(i32 VectorExtractions.LE_WORD_2), sub_32))>;
|
2017-07-06 00:55:00 +08:00
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 2)))),
|
|
|
|
(EXTSW (VEXTUWLX (LI8 8), $S))>;
|
|
|
|
def : Pat<(i64 (sext (i32 (vector_extract v4i32:$S, 3)))),
|
|
|
|
(EXTSW (VEXTUWLX (LI8 12), $S))>;
|
2017-11-28 01:11:03 +08:00
|
|
|
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, i64:$Idx)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX $Idx, $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 0)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 0), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 1)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 1), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 2)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 2), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 3)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 3), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 4)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 4), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 5)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 5), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 6)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 6), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 7)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 7), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 8)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 8), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 9)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 9), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 10)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 10), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 11)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 11), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 12)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 12), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 13)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 13), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 14)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 14), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 15)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUBLX (LI8 15), $S), sub_32))>;
|
|
|
|
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, i64:$Idx)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX
|
|
|
|
(RLWINM8 $Idx, 1, 28, 30), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 0)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 0), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 1)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 2), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 2)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 4), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 3)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 6), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 4)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 8), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 5)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 10), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 6)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 12), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 6)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUHLX (LI8 14), $S), sub_32))>;
|
|
|
|
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, i64:$Idx)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWLX
|
|
|
|
(RLWINM8 $Idx, 2, 28, 29), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 0)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWLX (LI8 0), $S), sub_32))>;
|
|
|
|
// For extracting BE word 1, MFVSRWZ is better than VEXTUWLX
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 1)),
|
|
|
|
(i32 VectorExtractions.LE_WORD_2)>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 2)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWLX (LI8 8), $S), sub_32))>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 3)),
|
|
|
|
(i32 (EXTRACT_SUBREG (VEXTUWLX (LI8 12), $S), sub_32))>;
|
2017-07-06 00:55:00 +08:00
|
|
|
}
|
|
|
|
|
2015-08-14 01:40:44 +08:00
|
|
|
let Predicates = [IsLittleEndian, HasDirectMove] in {
|
2015-10-09 19:12:18 +08:00
|
|
|
// v16i8 scalar <-> vector conversions (LE)
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v16i8 (scalar_to_vector i32:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v16i8 (COPY_TO_REGCLASS MovesToVSR.LE_WORD_0, VSRC))>;
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v8i16 (scalar_to_vector i32:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v8i16 (COPY_TO_REGCLASS MovesToVSR.LE_WORD_0, VSRC))>;
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector i32:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v4i32 MovesToVSR.LE_WORD_0)>;
|
2015-08-14 01:40:44 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector i64:$A)),
|
2015-10-09 19:12:18 +08:00
|
|
|
(v2i64 MovesToVSR.LE_DWORD_0)>;
|
2017-11-28 01:11:03 +08:00
|
|
|
// v2i64 scalar <-> vector conversions (LE)
|
|
|
|
def : Pat<(i64 (vector_extract v2i64:$S, 0)),
|
|
|
|
(i64 VectorExtractions.LE_DWORD_0)>;
|
|
|
|
def : Pat<(i64 (vector_extract v2i64:$S, 1)),
|
|
|
|
(i64 VectorExtractions.LE_DWORD_1)>;
|
|
|
|
def : Pat<(i64 (vector_extract v2i64:$S, i64:$Idx)),
|
|
|
|
(i64 VectorExtractions.LE_VARIABLE_DWORD)>;
|
|
|
|
} // IsLittleEndian, HasDirectMove
|
|
|
|
|
|
|
|
let Predicates = [IsLittleEndian, HasDirectMove, NoP9Altivec] in {
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 0)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_0)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 1)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_1)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 2)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_2)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 3)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_3)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 4)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_4)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 5)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_5)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 6)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_6)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 7)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_7)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 8)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_8)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 9)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_9)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 10)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_10)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 11)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_11)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 12)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_12)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 13)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_13)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 14)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_14)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, 15)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_BYTE_15)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v16i8:$S, i64:$Idx)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_VARIABLE_BYTE)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
|
|
|
|
// v8i16 scalar <-> vector conversions (LE)
|
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 0)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_0)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 1)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_1)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 2)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_2)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 3)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_3)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 4)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_4)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 5)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_5)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 6)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_6)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, 7)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_HALF_7)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v8i16:$S, i64:$Idx)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_VARIABLE_HALF)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
|
|
|
|
// v4i32 scalar <-> vector conversions (LE)
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 0)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_0)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 1)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_1)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 2)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_2)>;
|
2015-10-09 19:12:18 +08:00
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, 3)),
|
2015-12-10 21:35:28 +08:00
|
|
|
(i32 VectorExtractions.LE_WORD_3)>;
|
|
|
|
def : Pat<(i32 (vector_extract v4i32:$S, i64:$Idx)),
|
|
|
|
(i32 VectorExtractions.LE_VARIABLE_WORD)>;
|
2017-11-28 01:11:03 +08:00
|
|
|
} // IsLittleEndian, HasDirectMove, NoP9Altivec
|
2015-12-15 22:50:34 +08:00
|
|
|
|
|
|
|
let Predicates = [HasDirectMove, HasVSX] in {
|
|
|
|
// bitconvert f32 -> i32
|
|
|
|
// (convert to 32-bit fp single, shift right 1 word, move to GPR)
|
|
|
|
def : Pat<(i32 (bitconvert f32:$S)),
|
|
|
|
(i32 (MFVSRWZ (EXTRACT_SUBREG
|
|
|
|
(XXSLDWI (XSCVDPSPN $S),(XSCVDPSPN $S), 3),
|
|
|
|
sub_64)))>;
|
|
|
|
// bitconvert i32 -> f32
|
|
|
|
// (move to FPR, shift left 1 word, convert to 64-bit fp single)
|
|
|
|
def : Pat<(f32 (bitconvert i32:$A)),
|
|
|
|
(f32 (XSCVSPDPN
|
|
|
|
(XXSLDWI MovesToVSR.LE_WORD_1, MovesToVSR.LE_WORD_1, 1)))>;
|
|
|
|
|
|
|
|
// bitconvert f64 -> i64
|
|
|
|
// (move to GPR, nothing else needed)
|
|
|
|
def : Pat<(i64 (bitconvert f64:$S)),
|
|
|
|
(i64 (MFVSRD $S))>;
|
|
|
|
|
|
|
|
// bitconvert i64 -> f64
|
|
|
|
// (move to FPR, nothing else needed)
|
|
|
|
def : Pat<(f64 (bitconvert i64:$S)),
|
|
|
|
(f64 (MTVSRD $S))>;
|
|
|
|
}
|
2016-02-27 05:11:55 +08:00
|
|
|
|
2016-11-30 00:11:34 +08:00
|
|
|
// Materialize a zero-vector of long long
|
|
|
|
def : Pat<(v2i64 immAllZerosV),
|
|
|
|
(v2i64 (XXLXORz))>;
|
|
|
|
}
|
|
|
|
|
2016-07-13 05:00:10 +08:00
|
|
|
def AlignValues {
|
|
|
|
dag F32_TO_BE_WORD1 = (v4f32 (XXSLDWI (XSCVDPSPN $B), (XSCVDPSPN $B), 3));
|
|
|
|
dag I32_TO_BE_WORD1 = (COPY_TO_REGCLASS (MTVSRWZ $B), VSRC);
|
|
|
|
}
|
|
|
|
|
2016-02-27 05:11:55 +08:00
|
|
|
// The following VSX instructions were introduced in Power ISA 3.0
|
|
|
|
def HasP9Vector : Predicate<"PPCSubTarget->hasP9Vector()">;
|
2016-07-13 05:00:10 +08:00
|
|
|
let AddedComplexity = 400, Predicates = [HasP9Vector] in {
|
2016-02-27 05:11:55 +08:00
|
|
|
|
|
|
|
// [PO VRT XO VRB XO /]
|
|
|
|
class X_VT5_XO5_VB5<bits<6> opcode, bits<5> xo2, bits<10> xo, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: X_RD5_XO5_RS5<opcode, xo2, xo, (outs vrrc:$vT), (ins vrrc:$vB),
|
|
|
|
!strconcat(opc, " $vT, $vB"), IIC_VecFP, pattern>;
|
|
|
|
|
|
|
|
// [PO VRT XO VRB XO RO], Round to Odd version of [PO VRT XO VRB XO /]
|
|
|
|
class X_VT5_XO5_VB5_Ro<bits<6> opcode, bits<5> xo2, bits<10> xo, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: X_VT5_XO5_VB5<opcode, xo2, xo, opc, pattern>, isDOT;
|
|
|
|
|
|
|
|
// [PO VRT XO VRB XO /], but the VRB is only used the left 64 bits (or less),
|
|
|
|
// So we use different operand class for VRB
|
|
|
|
class X_VT5_XO5_VB5_TyVB<bits<6> opcode, bits<5> xo2, bits<10> xo, string opc,
|
|
|
|
RegisterOperand vbtype, list<dag> pattern>
|
|
|
|
: X_RD5_XO5_RS5<opcode, xo2, xo, (outs vrrc:$vT), (ins vbtype:$vB),
|
|
|
|
!strconcat(opc, " $vT, $vB"), IIC_VecFP, pattern>;
|
|
|
|
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
// [PO T XO B XO BX /]
|
|
|
|
class XX2_RT5_XO5_XB6<bits<6> opcode, bits<5> xo2, bits<9> xo, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: XX2_RD5_XO5_RS6<opcode, xo2, xo, (outs g8rc:$rT), (ins vsfrc:$XB),
|
|
|
|
!strconcat(opc, " $rT, $XB"), IIC_VecFP, pattern>;
|
|
|
|
|
2016-02-27 05:11:55 +08:00
|
|
|
// [PO T XO B XO BX TX]
|
|
|
|
class XX2_XT6_XO5_XB6<bits<6> opcode, bits<5> xo2, bits<9> xo, string opc,
|
|
|
|
RegisterOperand vtype, list<dag> pattern>
|
|
|
|
: XX2_RD6_XO5_RS6<opcode, xo2, xo, (outs vtype:$XT), (ins vtype:$XB),
|
|
|
|
!strconcat(opc, " $XT, $XB"), IIC_VecFP, pattern>;
|
|
|
|
|
|
|
|
// [PO T A B XO AX BX TX], src and dest register use different operand class
|
|
|
|
class XX3_XT5_XA5_XB5<bits<6> opcode, bits<8> xo, string opc,
|
|
|
|
RegisterOperand xty, RegisterOperand aty, RegisterOperand bty,
|
|
|
|
InstrItinClass itin, list<dag> pattern>
|
|
|
|
: XX3Form<opcode, xo, (outs xty:$XT), (ins aty:$XA, bty:$XB),
|
|
|
|
!strconcat(opc, " $XT, $XA, $XB"), itin, pattern>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
2016-02-27 05:11:55 +08:00
|
|
|
|
2016-03-28 15:38:01 +08:00
|
|
|
// [PO VRT VRA VRB XO /]
|
|
|
|
class X_VT5_VA5_VB5<bits<6> opcode, bits<10> xo, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: XForm_1<opcode, xo, (outs vrrc:$vT), (ins vrrc:$vA, vrrc:$vB),
|
|
|
|
!strconcat(opc, " $vT, $vA, $vB"), IIC_VecFP, pattern>;
|
|
|
|
|
|
|
|
// [PO VRT VRA VRB XO RO], Round to Odd version of [PO VRT VRA VRB XO /]
|
|
|
|
class X_VT5_VA5_VB5_Ro<bits<6> opcode, bits<10> xo, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: X_VT5_VA5_VB5<opcode, xo, opc, pattern>, isDOT;
|
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Quad-Precision Scalar Move Instructions:
|
|
|
|
|
|
|
|
// Copy Sign
|
|
|
|
def XSCPSGNQP : X_VT5_VA5_VB5<63, 100, "xscpsgnqp", []>;
|
|
|
|
|
|
|
|
// Absolute/Negative-Absolute/Negate
|
|
|
|
def XSABSQP : X_VT5_XO5_VB5<63, 0, 804, "xsabsqp" , []>;
|
|
|
|
def XSNABSQP : X_VT5_XO5_VB5<63, 8, 804, "xsnabsqp", []>;
|
|
|
|
def XSNEGQP : X_VT5_XO5_VB5<63, 16, 804, "xsnegqp" , []>;
|
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Quad-Precision Scalar Floating-Point Arithmetic Instructions:
|
|
|
|
|
|
|
|
// Add/Divide/Multiply/Subtract
|
|
|
|
def XSADDQP : X_VT5_VA5_VB5 <63, 4, "xsaddqp" , []>;
|
|
|
|
def XSADDQPO : X_VT5_VA5_VB5_Ro<63, 4, "xsaddqpo", []>;
|
|
|
|
def XSDIVQP : X_VT5_VA5_VB5 <63, 548, "xsdivqp" , []>;
|
|
|
|
def XSDIVQPO : X_VT5_VA5_VB5_Ro<63, 548, "xsdivqpo", []>;
|
|
|
|
def XSMULQP : X_VT5_VA5_VB5 <63, 36, "xsmulqp" , []>;
|
|
|
|
def XSMULQPO : X_VT5_VA5_VB5_Ro<63, 36, "xsmulqpo", []>;
|
|
|
|
def XSSUBQP : X_VT5_VA5_VB5 <63, 516, "xssubqp" , []>;
|
|
|
|
def XSSUBQPO : X_VT5_VA5_VB5_Ro<63, 516, "xssubqpo", []>;
|
|
|
|
|
|
|
|
// Square-Root
|
|
|
|
def XSSQRTQP : X_VT5_XO5_VB5 <63, 27, 804, "xssqrtqp" , []>;
|
|
|
|
def XSSQRTQPO : X_VT5_XO5_VB5_Ro<63, 27, 804, "xssqrtqpo", []>;
|
|
|
|
|
|
|
|
// (Negative) Multiply-{Add/Subtract}
|
|
|
|
def XSMADDQP : X_VT5_VA5_VB5 <63, 388, "xsmaddqp" , []>;
|
|
|
|
def XSMADDQPO : X_VT5_VA5_VB5_Ro<63, 388, "xsmaddqpo" , []>;
|
|
|
|
def XSMSUBQP : X_VT5_VA5_VB5 <63, 420, "xsmsubqp" , []>;
|
|
|
|
def XSMSUBQPO : X_VT5_VA5_VB5_Ro<63, 420, "xsmsubqpo" , []>;
|
|
|
|
def XSNMADDQP : X_VT5_VA5_VB5 <63, 452, "xsnmaddqp" , []>;
|
|
|
|
def XSNMADDQPO: X_VT5_VA5_VB5_Ro<63, 452, "xsnmaddqpo", []>;
|
|
|
|
def XSNMSUBQP : X_VT5_VA5_VB5 <63, 484, "xsnmsubqp" , []>;
|
|
|
|
def XSNMSUBQPO: X_VT5_VA5_VB5_Ro<63, 484, "xsnmsubqpo", []>;
|
|
|
|
|
2016-02-27 05:11:55 +08:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Quad/Double-Precision Compare Instructions:
|
|
|
|
|
|
|
|
// [PO BF // VRA VRB XO /]
|
|
|
|
class X_BF3_VA5_VB5<bits<6> opcode, bits<10> xo, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: XForm_17<opcode, xo, (outs crrc:$crD), (ins vrrc:$VA, vrrc:$VB),
|
|
|
|
!strconcat(opc, " $crD, $VA, $VB"), IIC_FPCompare> {
|
|
|
|
let Pattern = pattern;
|
|
|
|
}
|
|
|
|
|
|
|
|
// QP Compare Ordered/Unordered
|
|
|
|
def XSCMPOQP : X_BF3_VA5_VB5<63, 132, "xscmpoqp", []>;
|
|
|
|
def XSCMPUQP : X_BF3_VA5_VB5<63, 644, "xscmpuqp", []>;
|
|
|
|
|
|
|
|
// DP/QP Compare Exponents
|
|
|
|
def XSCMPEXPDP : XX3Form_1<60, 59,
|
|
|
|
(outs crrc:$crD), (ins vsfrc:$XA, vsfrc:$XB),
|
2016-10-04 14:59:23 +08:00
|
|
|
"xscmpexpdp $crD, $XA, $XB", IIC_FPCompare, []>,
|
|
|
|
UseVSXReg;
|
2016-02-27 05:11:55 +08:00
|
|
|
def XSCMPEXPQP : X_BF3_VA5_VB5<63, 164, "xscmpexpqp", []>;
|
|
|
|
|
|
|
|
// DP Compare ==, >=, >, !=
|
|
|
|
// Use vsrc for XT, because the entire register of XT is set.
|
|
|
|
// XT.dword[1] = 0x0000_0000_0000_0000
|
|
|
|
def XSCMPEQDP : XX3_XT5_XA5_XB5<60, 3, "xscmpeqdp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_FPCompare, []>;
|
|
|
|
def XSCMPGEDP : XX3_XT5_XA5_XB5<60, 19, "xscmpgedp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_FPCompare, []>;
|
|
|
|
def XSCMPGTDP : XX3_XT5_XA5_XB5<60, 11, "xscmpgtdp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_FPCompare, []>;
|
|
|
|
def XSCMPNEDP : XX3_XT5_XA5_XB5<60, 27, "xscmpnedp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_FPCompare, []>;
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
2016-02-27 05:11:55 +08:00
|
|
|
// Vector Compare Not Equal
|
|
|
|
def XVCMPNEDP : XX3Form_Rc<60, 123,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvcmpnedp $XT, $XA, $XB", IIC_VecFPCompare, []>;
|
|
|
|
let Defs = [CR6] in
|
|
|
|
def XVCMPNEDPo : XX3Form_Rc<60, 123,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvcmpnedp. $XT, $XA, $XB", IIC_VecFPCompare, []>,
|
|
|
|
isDOT;
|
|
|
|
def XVCMPNESP : XX3Form_Rc<60, 91,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvcmpnesp $XT, $XA, $XB", IIC_VecFPCompare, []>;
|
|
|
|
let Defs = [CR6] in
|
|
|
|
def XVCMPNESPo : XX3Form_Rc<60, 91,
|
|
|
|
(outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
|
|
|
|
"xvcmpnesp. $XT, $XA, $XB", IIC_VecFPCompare, []>,
|
|
|
|
isDOT;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
2016-02-27 05:11:55 +08:00
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Quad-Precision Floating-Point Conversion Instructions:
|
|
|
|
|
|
|
|
// Convert DP -> QP
|
2016-10-04 14:59:23 +08:00
|
|
|
def XSCVDPQP : X_VT5_XO5_VB5_TyVB<63, 22, 836, "xscvdpqp", vfrc, []>;
|
2016-02-27 05:11:55 +08:00
|
|
|
|
|
|
|
// Round & Convert QP -> DP (dword[1] is set to zero)
|
|
|
|
def XSCVQPDP : X_VT5_XO5_VB5 <63, 20, 836, "xscvqpdp" , []>;
|
|
|
|
def XSCVQPDPO : X_VT5_XO5_VB5_Ro<63, 20, 836, "xscvqpdpo", []>;
|
|
|
|
|
|
|
|
// Truncate & Convert QP -> (Un)Signed (D)Word (dword[1] is set to zero)
|
|
|
|
def XSCVQPSDZ : X_VT5_XO5_VB5<63, 25, 836, "xscvqpsdz", []>;
|
|
|
|
def XSCVQPSWZ : X_VT5_XO5_VB5<63, 9, 836, "xscvqpswz", []>;
|
|
|
|
def XSCVQPUDZ : X_VT5_XO5_VB5<63, 17, 836, "xscvqpudz", []>;
|
|
|
|
def XSCVQPUWZ : X_VT5_XO5_VB5<63, 1, 836, "xscvqpuwz", []>;
|
|
|
|
|
|
|
|
// Convert (Un)Signed DWord -> QP
|
2016-10-04 14:59:23 +08:00
|
|
|
def XSCVSDQP : X_VT5_XO5_VB5_TyVB<63, 10, 836, "xscvsdqp", vfrc, []>;
|
|
|
|
def XSCVUDQP : X_VT5_XO5_VB5_TyVB<63, 2, 836, "xscvudqp", vfrc, []>;
|
2016-02-27 05:11:55 +08:00
|
|
|
|
2016-11-15 02:43:59 +08:00
|
|
|
let UseVSXReg = 1 in {
|
2016-02-27 05:11:55 +08:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Round to Floating-Point Integer Instructions
|
|
|
|
|
|
|
|
// (Round &) Convert DP <-> HP
|
|
|
|
// Note! xscvdphp's src and dest register both use the left 64 bits, so we use
|
|
|
|
// vsfrc for src and dest register. xscvhpdp's src only use the left 16 bits,
|
|
|
|
// but we still use vsfrc for it.
|
|
|
|
def XSCVDPHP : XX2_XT6_XO5_XB6<60, 17, 347, "xscvdphp", vsfrc, []>;
|
|
|
|
def XSCVHPDP : XX2_XT6_XO5_XB6<60, 16, 347, "xscvhpdp", vsfrc, []>;
|
|
|
|
|
|
|
|
// Vector HP -> SP
|
|
|
|
def XVCVHPSP : XX2_XT6_XO5_XB6<60, 24, 475, "xvcvhpsp", vsrc, []>;
|
2016-11-12 05:42:01 +08:00
|
|
|
def XVCVSPHP : XX2_XT6_XO5_XB6<60, 25, 475, "xvcvsphp", vsrc,
|
|
|
|
[(set v4f32:$XT,
|
|
|
|
(int_ppc_vsx_xvcvsphp v4f32:$XB))]>;
|
2016-02-27 05:11:55 +08:00
|
|
|
|
2016-11-15 02:43:59 +08:00
|
|
|
} // UseVSXReg = 1
|
|
|
|
|
|
|
|
// Pattern for matching Vector HP -> Vector SP intrinsic. Defined as a
|
2017-03-30 20:59:53 +08:00
|
|
|
// separate pattern so that it can convert the input register class from
|
2016-11-15 02:43:59 +08:00
|
|
|
// VRRC(v8i16) to VSRC.
|
|
|
|
def : Pat<(v4f32 (int_ppc_vsx_xvcvhpsp v8i16:$A)),
|
|
|
|
(v4f32 (XVCVHPSP (COPY_TO_REGCLASS $A, VSRC)))>;
|
|
|
|
|
2016-02-27 05:11:55 +08:00
|
|
|
class Z23_VT5_R1_VB5_RMC2_EX1<bits<6> opcode, bits<8> xo, bit ex, string opc,
|
|
|
|
list<dag> pattern>
|
|
|
|
: Z23Form_1<opcode, xo,
|
|
|
|
(outs vrrc:$vT), (ins u1imm:$r, vrrc:$vB, u2imm:$rmc),
|
|
|
|
!strconcat(opc, " $r, $vT, $vB, $rmc"), IIC_VecFP, pattern> {
|
|
|
|
let RC = ex;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Round to Quad-Precision Integer [with Inexact]
|
|
|
|
def XSRQPI : Z23_VT5_R1_VB5_RMC2_EX1<63, 5, 0, "xsrqpi" , []>;
|
|
|
|
def XSRQPIX : Z23_VT5_R1_VB5_RMC2_EX1<63, 5, 1, "xsrqpix", []>;
|
|
|
|
|
|
|
|
// Round Quad-Precision to Double-Extended Precision (fp80)
|
|
|
|
def XSRQPXP : Z23_VT5_R1_VB5_RMC2_EX1<63, 37, 0, "xsrqpxp", []>;
|
2016-03-08 11:49:13 +08:00
|
|
|
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Insert/Extract Instructions
|
|
|
|
|
|
|
|
// Insert Exponent DP/QP
|
|
|
|
// XT NOTE: XT.dword[1] = 0xUUUU_UUUU_UUUU_UUUU
|
|
|
|
def XSIEXPDP : XX1Form <60, 918, (outs vsrc:$XT), (ins g8rc:$rA, g8rc:$rB),
|
2016-10-04 14:59:23 +08:00
|
|
|
"xsiexpdp $XT, $rA, $rB", IIC_VecFP, []>, UseVSXReg;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
// vB NOTE: only vB.dword[0] is used, that's why we don't use
|
|
|
|
// X_VT5_VA5_VB5 form
|
|
|
|
def XSIEXPQP : XForm_18<63, 868, (outs vrrc:$vT), (ins vrrc:$vA, vsfrc:$vB),
|
|
|
|
"xsiexpqp $vT, $vA, $vB", IIC_VecFP, []>;
|
|
|
|
|
|
|
|
// Extract Exponent/Significand DP/QP
|
|
|
|
def XSXEXPDP : XX2_RT5_XO5_XB6<60, 0, 347, "xsxexpdp", []>;
|
|
|
|
def XSXSIGDP : XX2_RT5_XO5_XB6<60, 1, 347, "xsxsigdp", []>;
|
2016-10-04 14:59:23 +08:00
|
|
|
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
def XSXEXPQP : X_VT5_XO5_VB5 <63, 2, 804, "xsxexpqp", []>;
|
|
|
|
def XSXSIGQP : X_VT5_XO5_VB5 <63, 18, 804, "xsxsigqp", []>;
|
|
|
|
|
|
|
|
// Vector Insert Word
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
// XB NOTE: Only XB.dword[1] is used, but we use vsrc on XB.
|
2016-07-13 05:00:10 +08:00
|
|
|
def XXINSERTW :
|
|
|
|
XX2_RD6_UIM5_RS6<60, 181, (outs vsrc:$XT),
|
|
|
|
(ins vsrc:$XTi, vsrc:$XB, u4imm:$UIM),
|
|
|
|
"xxinsertw $XT, $XB, $UIM", IIC_VecFP,
|
2017-09-06 02:08:02 +08:00
|
|
|
[(set v4i32:$XT, (PPCvecinsert v4i32:$XTi, v4i32:$XB,
|
2016-07-13 05:00:10 +08:00
|
|
|
imm32SExt16:$UIM))]>,
|
|
|
|
RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
|
|
|
|
// Vector Extract Unsigned Word
|
|
|
|
def XXEXTRACTUW : XX2_RD6_UIM5_RS6<60, 165,
|
2016-07-13 05:00:10 +08:00
|
|
|
(outs vsfrc:$XT), (ins vsrc:$XB, u4imm:$UIMM),
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
"xxextractuw $XT, $XB, $UIMM", IIC_VecFP, []>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
|
|
|
|
// Vector Insert Exponent DP/SP
|
|
|
|
def XVIEXPDP : XX3_XT5_XA5_XB5<60, 248, "xviexpdp", vsrc, vsrc, vsrc,
|
2016-10-27 03:03:40 +08:00
|
|
|
IIC_VecFP, [(set v2f64: $XT,(int_ppc_vsx_xviexpdp v2i64:$XA, v2i64:$XB))]>;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
def XVIEXPSP : XX3_XT5_XA5_XB5<60, 216, "xviexpsp", vsrc, vsrc, vsrc,
|
2016-10-27 03:03:40 +08:00
|
|
|
IIC_VecFP, [(set v4f32: $XT,(int_ppc_vsx_xviexpsp v4i32:$XA, v4i32:$XB))]>;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
|
|
|
|
// Vector Extract Exponent/Significand DP/SP
|
2016-11-14 22:42:37 +08:00
|
|
|
def XVXEXPDP : XX2_XT6_XO5_XB6<60, 0, 475, "xvxexpdp", vsrc,
|
|
|
|
[(set v2i64: $XT,
|
|
|
|
(int_ppc_vsx_xvxexpdp v2f64:$XB))]>;
|
|
|
|
def XVXEXPSP : XX2_XT6_XO5_XB6<60, 8, 475, "xvxexpsp", vsrc,
|
|
|
|
[(set v4i32: $XT,
|
|
|
|
(int_ppc_vsx_xvxexpsp v4f32:$XB))]>;
|
|
|
|
def XVXSIGDP : XX2_XT6_XO5_XB6<60, 1, 475, "xvxsigdp", vsrc,
|
|
|
|
[(set v2i64: $XT,
|
|
|
|
(int_ppc_vsx_xvxsigdp v2f64:$XB))]>;
|
|
|
|
def XVXSIGSP : XX2_XT6_XO5_XB6<60, 9, 475, "xvxsigsp", vsrc,
|
|
|
|
[(set v4i32: $XT,
|
|
|
|
(int_ppc_vsx_xvxsigsp v4f32:$XB))]>;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
|
2016-12-10 01:21:42 +08:00
|
|
|
let AddedComplexity = 400, Predicates = [HasP9Vector] in {
|
|
|
|
// Extra patterns expanding to vector Extract Word/Insert Word
|
|
|
|
def : Pat<(v4i32 (int_ppc_vsx_xxinsertw v4i32:$A, v2i64:$B, imm:$IMM)),
|
|
|
|
(v4i32 (XXINSERTW $A, $B, imm:$IMM))>;
|
|
|
|
def : Pat<(v2i64 (int_ppc_vsx_xxextractuw v2i64:$A, imm:$IMM)),
|
|
|
|
(v2i64 (COPY_TO_REGCLASS (XXEXTRACTUW $A, imm:$IMM), VSRC))>;
|
|
|
|
} // AddedComplexity = 400, HasP9Vector
|
|
|
|
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Test Data Class SP/DP/QP
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
def XSTSTDCSP : XX2_BF3_DCMX7_RS6<60, 298,
|
|
|
|
(outs crrc:$BF), (ins u7imm:$DCMX, vsfrc:$XB),
|
|
|
|
"xststdcsp $BF, $XB, $DCMX", IIC_VecFP, []>;
|
|
|
|
def XSTSTDCDP : XX2_BF3_DCMX7_RS6<60, 362,
|
|
|
|
(outs crrc:$BF), (ins u7imm:$DCMX, vsfrc:$XB),
|
|
|
|
"xststdcdp $BF, $XB, $DCMX", IIC_VecFP, []>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
def XSTSTDCQP : X_BF3_DCMX7_RS5 <63, 708,
|
|
|
|
(outs crrc:$BF), (ins u7imm:$DCMX, vrrc:$vB),
|
|
|
|
"xststdcqp $BF, $vB, $DCMX", IIC_VecFP, []>;
|
|
|
|
|
|
|
|
// Vector Test Data Class SP/DP
|
2016-10-04 14:59:23 +08:00
|
|
|
let UseVSXReg = 1 in {
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
def XVTSTDCSP : XX2_RD6_DCMX7_RS6<60, 13, 5,
|
|
|
|
(outs vsrc:$XT), (ins u7imm:$DCMX, vsrc:$XB),
|
2016-11-14 22:42:37 +08:00
|
|
|
"xvtstdcsp $XT, $XB, $DCMX", IIC_VecFP,
|
|
|
|
[(set v4i32: $XT,
|
|
|
|
(int_ppc_vsx_xvtstdcsp v4f32:$XB, imm:$DCMX))]>;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
def XVTSTDCDP : XX2_RD6_DCMX7_RS6<60, 15, 5,
|
|
|
|
(outs vsrc:$XT), (ins u7imm:$DCMX, vsrc:$XB),
|
2016-11-14 22:42:37 +08:00
|
|
|
"xvtstdcdp $XT, $XB, $DCMX", IIC_VecFP,
|
|
|
|
[(set v2i64: $XT,
|
|
|
|
(int_ppc_vsx_xvtstdcdp v2f64:$XB, imm:$DCMX))]>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // UseVSXReg = 1
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Maximum/Minimum Type-C/Type-J DP
|
|
|
|
// XT.dword[1] = 0xUUUU_UUUU_UUUU_UUUU, so we use vsrc for XT
|
|
|
|
def XSMAXCDP : XX3_XT5_XA5_XB5<60, 128, "xsmaxcdp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_VecFP, []>;
|
|
|
|
def XSMAXJDP : XX3_XT5_XA5_XB5<60, 144, "xsmaxjdp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_VecFP, []>;
|
|
|
|
def XSMINCDP : XX3_XT5_XA5_XB5<60, 136, "xsmincdp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_VecFP, []>;
|
|
|
|
def XSMINJDP : XX3_XT5_XA5_XB5<60, 152, "xsminjdp", vsrc, vsfrc, vsfrc,
|
|
|
|
IIC_VecFP, []>;
|
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Vector Byte-Reverse H/W/D/Q Word
|
|
|
|
def XXBRH : XX2_XT6_XO5_XB6<60, 7, 475, "xxbrh", vsrc, []>;
|
|
|
|
def XXBRW : XX2_XT6_XO5_XB6<60, 15, 475, "xxbrw", vsrc, []>;
|
|
|
|
def XXBRD : XX2_XT6_XO5_XB6<60, 23, 475, "xxbrd", vsrc, []>;
|
|
|
|
def XXBRQ : XX2_XT6_XO5_XB6<60, 31, 475, "xxbrq", vsrc, []>;
|
|
|
|
|
2017-06-13 02:24:36 +08:00
|
|
|
// Vector Reverse
|
|
|
|
def : Pat<(v8i16 (PPCxxreverse v8i16 :$A)),
|
|
|
|
(v8i16 (COPY_TO_REGCLASS (XXBRH (COPY_TO_REGCLASS $A, VSRC)), VRRC))>;
|
|
|
|
def : Pat<(v4i32 (PPCxxreverse v4i32 :$A)),
|
|
|
|
(v4i32 (XXBRW $A))>;
|
|
|
|
def : Pat<(v2i64 (PPCxxreverse v2i64 :$A)),
|
|
|
|
(v2i64 (XXBRD $A))>;
|
|
|
|
def : Pat<(v1i128 (PPCxxreverse v1i128 :$A)),
|
|
|
|
(v1i128 (COPY_TO_REGCLASS (XXBRQ (COPY_TO_REGCLASS $A, VSRC)), VRRC))>;
|
|
|
|
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
// Vector Permute
|
|
|
|
def XXPERM : XX3_XT5_XA5_XB5<60, 26, "xxperm" , vsrc, vsrc, vsrc,
|
|
|
|
IIC_VecPerm, []>;
|
|
|
|
def XXPERMR : XX3_XT5_XA5_XB5<60, 58, "xxpermr", vsrc, vsrc, vsrc,
|
|
|
|
IIC_VecPerm, []>;
|
|
|
|
|
|
|
|
// Vector Splat Immediate Byte
|
|
|
|
def XXSPLTIB : X_RD6_IMM8<60, 360, (outs vsrc:$XT), (ins u8imm:$IMM8),
|
2016-10-04 14:59:23 +08:00
|
|
|
"xxspltib $XT, $IMM8", IIC_VecPerm, []>, UseVSXReg;
|
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
2016-03-28 16:34:28 +08:00
|
|
|
|
2016-03-08 11:49:13 +08:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Vector/Scalar Load/Store Instructions
|
|
|
|
|
2016-10-04 19:25:52 +08:00
|
|
|
// When adding new D-Form loads/stores, be sure to update the ImmToIdxMap in
|
|
|
|
// PPCRegisterInfo::PPCRegisterInfo and maybe save yourself some debugging.
|
2017-01-27 02:59:15 +08:00
|
|
|
let mayLoad = 1, mayStore = 0 in {
|
2016-03-08 11:49:13 +08:00
|
|
|
// Load Vector
|
|
|
|
def LXV : DQ_RD6_RS5_DQ12<61, 1, (outs vsrc:$XT), (ins memrix16:$src),
|
2016-10-04 14:59:23 +08:00
|
|
|
"lxv $XT, $src", IIC_LdStLFD, []>, UseVSXReg;
|
2016-03-08 11:49:13 +08:00
|
|
|
// Load DWord
|
2016-10-04 14:59:23 +08:00
|
|
|
def LXSD : DSForm_1<57, 2, (outs vfrc:$vD), (ins memrix:$src),
|
2016-03-08 11:49:13 +08:00
|
|
|
"lxsd $vD, $src", IIC_LdStLFD, []>;
|
|
|
|
// Load SP from src, convert it to DP, and place in dword[0]
|
2016-10-04 14:59:23 +08:00
|
|
|
def LXSSP : DSForm_1<57, 3, (outs vfrc:$vD), (ins memrix:$src),
|
2016-03-08 11:49:13 +08:00
|
|
|
"lxssp $vD, $src", IIC_LdStLFD, []>;
|
|
|
|
|
|
|
|
// [PO T RA RB XO TX] almost equal to [PO S RA RB XO SX], but has different
|
|
|
|
// "out" and "in" dag
|
|
|
|
class X_XT6_RA5_RB5<bits<6> opcode, bits<10> xo, string opc,
|
|
|
|
RegisterOperand vtype, list<dag> pattern>
|
|
|
|
: XX1Form<opcode, xo, (outs vtype:$XT), (ins memrr:$src),
|
2016-10-04 14:59:23 +08:00
|
|
|
!strconcat(opc, " $XT, $src"), IIC_LdStLFD, pattern>, UseVSXReg;
|
2016-03-08 11:49:13 +08:00
|
|
|
|
|
|
|
// Load as Integer Byte/Halfword & Zero Indexed
|
2016-10-04 14:59:23 +08:00
|
|
|
def LXSIBZX : X_XT6_RA5_RB5<31, 781, "lxsibzx", vsfrc,
|
|
|
|
[(set f64:$XT, (PPClxsizx xoaddr:$src, 1))]>;
|
|
|
|
def LXSIHZX : X_XT6_RA5_RB5<31, 813, "lxsihzx", vsfrc,
|
|
|
|
[(set f64:$XT, (PPClxsizx xoaddr:$src, 2))]>;
|
2016-03-08 11:49:13 +08:00
|
|
|
|
|
|
|
// Load Vector Halfword*8/Byte*16 Indexed
|
|
|
|
def LXVH8X : X_XT6_RA5_RB5<31, 812, "lxvh8x" , vsrc, []>;
|
|
|
|
def LXVB16X : X_XT6_RA5_RB5<31, 876, "lxvb16x", vsrc, []>;
|
|
|
|
|
|
|
|
// Load Vector Indexed
|
2016-09-22 17:52:19 +08:00
|
|
|
def LXVX : X_XT6_RA5_RB5<31, 268, "lxvx" , vsrc,
|
2017-05-25 01:50:37 +08:00
|
|
|
[(set v2f64:$XT, (load xaddr:$src))]>;
|
2016-03-08 11:49:13 +08:00
|
|
|
// Load Vector (Left-justified) with Length
|
2016-11-16 01:54:19 +08:00
|
|
|
def LXVL : XX1Form<31, 269, (outs vsrc:$XT), (ins memr:$src, g8rc:$rB),
|
|
|
|
"lxvl $XT, $src, $rB", IIC_LdStLoad,
|
|
|
|
[(set v4i32:$XT, (int_ppc_vsx_lxvl addr:$src, i64:$rB))]>,
|
|
|
|
UseVSXReg;
|
|
|
|
def LXVLL : XX1Form<31,301, (outs vsrc:$XT), (ins memr:$src, g8rc:$rB),
|
|
|
|
"lxvll $XT, $src, $rB", IIC_LdStLoad,
|
|
|
|
[(set v4i32:$XT, (int_ppc_vsx_lxvll addr:$src, i64:$rB))]>,
|
|
|
|
UseVSXReg;
|
2016-03-08 11:49:13 +08:00
|
|
|
|
|
|
|
// Load Vector Word & Splat Indexed
|
|
|
|
def LXVWSX : X_XT6_RA5_RB5<31, 364, "lxvwsx" , vsrc, []>;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // mayLoad
|
2016-03-08 11:49:13 +08:00
|
|
|
|
2016-10-04 19:25:52 +08:00
|
|
|
// When adding new D-Form loads/stores, be sure to update the ImmToIdxMap in
|
|
|
|
// PPCRegisterInfo::PPCRegisterInfo and maybe save yourself some debugging.
|
2017-01-27 02:59:15 +08:00
|
|
|
let mayStore = 1, mayLoad = 0 in {
|
2016-03-08 11:49:13 +08:00
|
|
|
// Store Vector
|
|
|
|
def STXV : DQ_RD6_RS5_DQ12<61, 5, (outs), (ins vsrc:$XT, memrix16:$dst),
|
2016-10-04 14:59:23 +08:00
|
|
|
"stxv $XT, $dst", IIC_LdStSTFD, []>, UseVSXReg;
|
2016-03-08 11:49:13 +08:00
|
|
|
// Store DWord
|
2016-10-04 14:59:23 +08:00
|
|
|
def STXSD : DSForm_1<61, 2, (outs), (ins vfrc:$vS, memrix:$dst),
|
2016-03-08 11:49:13 +08:00
|
|
|
"stxsd $vS, $dst", IIC_LdStSTFD, []>;
|
|
|
|
// Convert DP of dword[0] to SP, and Store to dst
|
2016-10-04 14:59:23 +08:00
|
|
|
def STXSSP : DSForm_1<61, 3, (outs), (ins vfrc:$vS, memrix:$dst),
|
2016-03-08 11:49:13 +08:00
|
|
|
"stxssp $vS, $dst", IIC_LdStSTFD, []>;
|
|
|
|
|
|
|
|
// [PO S RA RB XO SX]
|
|
|
|
class X_XS6_RA5_RB5<bits<6> opcode, bits<10> xo, string opc,
|
|
|
|
RegisterOperand vtype, list<dag> pattern>
|
|
|
|
: XX1Form<opcode, xo, (outs), (ins vtype:$XT, memrr:$dst),
|
2016-10-04 14:59:23 +08:00
|
|
|
!strconcat(opc, " $XT, $dst"), IIC_LdStSTFD, pattern>, UseVSXReg;
|
2016-03-08 11:49:13 +08:00
|
|
|
|
|
|
|
// Store as Integer Byte/Halfword Indexed
|
2016-10-04 14:59:23 +08:00
|
|
|
def STXSIBX : X_XS6_RA5_RB5<31, 909, "stxsibx" , vsfrc,
|
|
|
|
[(PPCstxsix f64:$XT, xoaddr:$dst, 1)]>;
|
|
|
|
def STXSIHX : X_XS6_RA5_RB5<31, 941, "stxsihx" , vsfrc,
|
|
|
|
[(PPCstxsix f64:$XT, xoaddr:$dst, 2)]>;
|
|
|
|
let isCodeGenOnly = 1 in {
|
|
|
|
def STXSIBXv : X_XS6_RA5_RB5<31, 909, "stxsibx" , vrrc, []>;
|
|
|
|
def STXSIHXv : X_XS6_RA5_RB5<31, 941, "stxsihx" , vrrc, []>;
|
|
|
|
}
|
2016-03-08 11:49:13 +08:00
|
|
|
|
|
|
|
// Store Vector Halfword*8/Byte*16 Indexed
|
|
|
|
def STXVH8X : X_XS6_RA5_RB5<31, 940, "stxvh8x" , vsrc, []>;
|
|
|
|
def STXVB16X : X_XS6_RA5_RB5<31, 1004, "stxvb16x", vsrc, []>;
|
|
|
|
|
|
|
|
// Store Vector Indexed
|
2016-09-22 17:52:19 +08:00
|
|
|
def STXVX : X_XS6_RA5_RB5<31, 396, "stxvx" , vsrc,
|
2017-05-25 01:50:37 +08:00
|
|
|
[(store v2f64:$XT, xaddr:$dst)]>;
|
2016-03-08 11:49:13 +08:00
|
|
|
|
|
|
|
// Store Vector (Left-justified) with Length
|
2016-11-16 01:54:19 +08:00
|
|
|
def STXVL : XX1Form<31, 397, (outs), (ins vsrc:$XT, memr:$dst, g8rc:$rB),
|
|
|
|
"stxvl $XT, $dst, $rB", IIC_LdStLoad,
|
|
|
|
[(int_ppc_vsx_stxvl v4i32:$XT, addr:$dst, i64:$rB)]>,
|
|
|
|
UseVSXReg;
|
|
|
|
def STXVLL : XX1Form<31, 429, (outs), (ins vsrc:$XT, memr:$dst, g8rc:$rB),
|
|
|
|
"stxvll $XT, $dst, $rB", IIC_LdStLoad,
|
|
|
|
[(int_ppc_vsx_stxvll v4i32:$XT, addr:$dst, i64:$rB)]>,
|
|
|
|
UseVSXReg;
|
2016-10-04 14:59:23 +08:00
|
|
|
} // mayStore
|
2016-07-13 05:00:10 +08:00
|
|
|
|
2017-08-15 02:09:29 +08:00
|
|
|
let Predicates = [IsLittleEndian] in {
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 3))))>;
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 2))))>;
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 1))))>;
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 0))))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 3)), VSFRC))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 2)), VSFRC))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 1)), VSFRC))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 0)), VSFRC))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsBigEndian] in {
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 0))))>;
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 1))))>;
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 2))))>;
|
|
|
|
def: Pat<(f32 (PPCfcfids (PPCmtvsra (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f32 (XSCVSPDPN (XVCVSXWSP (XXSPLTW $A, 3))))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 0)), VSFRC))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 1)), VSFRC))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 2)), VSFRC))>;
|
|
|
|
def: Pat<(f64 (PPCfcfid (PPCmtvsra (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f64 (COPY_TO_REGCLASS (XVCVSXWDP (XXSPLTW $A, 3)), VSFRC))>;
|
|
|
|
}
|
|
|
|
|
2017-11-08 04:55:43 +08:00
|
|
|
// Alternate patterns for PPCmtvsrz where the output is v8i16 or v16i8 instead
|
|
|
|
// of f64
|
|
|
|
def : Pat<(v8i16 (PPCmtvsrz i32:$A)),
|
|
|
|
(v8i16 (SUBREG_TO_REG (i64 1), (MTVSRWZ $A), sub_64))>;
|
|
|
|
def : Pat<(v16i8 (PPCmtvsrz i32:$A)),
|
|
|
|
(v16i8 (SUBREG_TO_REG (i64 1), (MTVSRWZ $A), sub_64))>;
|
|
|
|
|
2016-07-13 05:00:10 +08:00
|
|
|
// Patterns for which instructions from ISA 3.0 are a better match
|
|
|
|
let Predicates = [IsLittleEndian, HasP9Vector] in {
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 12)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 8)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 4)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 0)))>;
|
2017-08-15 02:09:29 +08:00
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 12)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 8)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 4)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 0)))>;
|
2016-07-13 05:00:10 +08:00
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 0)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 12))>;
|
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 1)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 8))>;
|
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 2)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 4))>;
|
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 3)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 0))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 0)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 12))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 1)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 8))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 2)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 4))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 3)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 0))>;
|
|
|
|
} // IsLittleEndian, HasP9Vector
|
|
|
|
|
|
|
|
let Predicates = [IsBigEndian, HasP9Vector] in {
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 0)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 4)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 8)))>;
|
|
|
|
def : Pat<(f32 (PPCfcfidus (PPCmtvsrz (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f32 (XSCVUXDSP (XXEXTRACTUW $A, 12)))>;
|
2017-08-15 02:09:29 +08:00
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 0))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 0)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 1))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 4)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 2))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 8)))>;
|
|
|
|
def : Pat<(f64 (PPCfcfidu (PPCmtvsrz (i32 (extractelt v4i32:$A, 3))))),
|
|
|
|
(f64 (XSCVUXDDP (XXEXTRACTUW $A, 12)))>;
|
2016-07-13 05:00:10 +08:00
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 0)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 0))>;
|
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 1)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 4))>;
|
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 2)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 8))>;
|
|
|
|
def : Pat<(v4i32 (insertelt v4i32:$A, i32:$B, 3)),
|
|
|
|
(v4i32 (XXINSERTW v4i32:$A, AlignValues.I32_TO_BE_WORD1, 12))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 0)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 0))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 1)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 4))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 2)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 8))>;
|
|
|
|
def : Pat<(v4f32 (insertelt v4f32:$A, f32:$B, 3)),
|
|
|
|
(v4f32 (XXINSERTW v4f32:$A, AlignValues.F32_TO_BE_WORD1, 12))>;
|
|
|
|
} // IsLittleEndian, HasP9Vector
|
2016-09-22 17:52:19 +08:00
|
|
|
|
2017-05-25 01:50:37 +08:00
|
|
|
// D-Form Load/Store
|
2017-07-14 02:17:10 +08:00
|
|
|
def : Pat<(v4i32 (quadwOffsetLoad iqaddr:$src)), (LXV memrix16:$src)>;
|
|
|
|
def : Pat<(v4f32 (quadwOffsetLoad iqaddr:$src)), (LXV memrix16:$src)>;
|
|
|
|
def : Pat<(v2i64 (quadwOffsetLoad iqaddr:$src)), (LXV memrix16:$src)>;
|
|
|
|
def : Pat<(v2f64 (quadwOffsetLoad iqaddr:$src)), (LXV memrix16:$src)>;
|
|
|
|
def : Pat<(v4i32 (int_ppc_vsx_lxvw4x iqaddr:$src)), (LXV memrix16:$src)>;
|
|
|
|
def : Pat<(v2f64 (int_ppc_vsx_lxvd2x iqaddr:$src)), (LXV memrix16:$src)>;
|
|
|
|
|
|
|
|
def : Pat<(quadwOffsetStore v4f32:$rS, iqaddr:$dst), (STXV $rS, memrix16:$dst)>;
|
|
|
|
def : Pat<(quadwOffsetStore v4i32:$rS, iqaddr:$dst), (STXV $rS, memrix16:$dst)>;
|
|
|
|
def : Pat<(quadwOffsetStore v2f64:$rS, iqaddr:$dst), (STXV $rS, memrix16:$dst)>;
|
|
|
|
def : Pat<(quadwOffsetStore v2i64:$rS, iqaddr:$dst), (STXV $rS, memrix16:$dst)>;
|
|
|
|
def : Pat<(int_ppc_vsx_stxvw4x v4i32:$rS, iqaddr:$dst),
|
2017-05-25 01:50:37 +08:00
|
|
|
(STXV $rS, memrix16:$dst)>;
|
2017-07-14 02:17:10 +08:00
|
|
|
def : Pat<(int_ppc_vsx_stxvd2x v2f64:$rS, iqaddr:$dst),
|
2017-05-25 01:50:37 +08:00
|
|
|
(STXV $rS, memrix16:$dst)>;
|
|
|
|
|
|
|
|
|
2017-07-14 02:17:10 +08:00
|
|
|
def : Pat<(v2f64 (nonQuadwOffsetLoad xoaddr:$src)), (LXVX xoaddr:$src)>;
|
|
|
|
def : Pat<(v2i64 (nonQuadwOffsetLoad xoaddr:$src)), (LXVX xoaddr:$src)>;
|
|
|
|
def : Pat<(v4f32 (nonQuadwOffsetLoad xoaddr:$src)), (LXVX xoaddr:$src)>;
|
|
|
|
def : Pat<(v4i32 (nonQuadwOffsetLoad xoaddr:$src)), (LXVX xoaddr:$src)>;
|
|
|
|
def : Pat<(v4i32 (int_ppc_vsx_lxvw4x xoaddr:$src)), (LXVX xoaddr:$src)>;
|
|
|
|
def : Pat<(v2f64 (int_ppc_vsx_lxvd2x xoaddr:$src)), (LXVX xoaddr:$src)>;
|
|
|
|
def : Pat<(nonQuadwOffsetStore v2f64:$rS, xoaddr:$dst),
|
|
|
|
(STXVX $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(nonQuadwOffsetStore v2i64:$rS, xoaddr:$dst),
|
|
|
|
(STXVX $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(nonQuadwOffsetStore v4f32:$rS, xoaddr:$dst),
|
|
|
|
(STXVX $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(nonQuadwOffsetStore v4i32:$rS, xoaddr:$dst),
|
|
|
|
(STXVX $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(int_ppc_vsx_stxvw4x v4i32:$rS, xoaddr:$dst),
|
|
|
|
(STXVX $rS, xoaddr:$dst)>;
|
|
|
|
def : Pat<(int_ppc_vsx_stxvd2x v2f64:$rS, xoaddr:$dst),
|
|
|
|
(STXVX $rS, xoaddr:$dst)>;
|
2016-09-23 21:25:31 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector (i32 (load xoaddr:$src)))),
|
|
|
|
(v4i32 (LXVWSX xoaddr:$src))>;
|
|
|
|
def : Pat<(v4f32 (scalar_to_vector (f32 (load xoaddr:$src)))),
|
|
|
|
(v4f32 (LXVWSX xoaddr:$src))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v4f32 (scalar_to_vector (f32 (fpround (extloadf32 xoaddr:$src))))),
|
|
|
|
(v4f32 (LXVWSX xoaddr:$src))>;
|
2016-10-04 14:59:23 +08:00
|
|
|
|
|
|
|
// Build vectors from i8 loads
|
|
|
|
def : Pat<(v16i8 (scalar_to_vector ScalarLoads.Li8)),
|
|
|
|
(v16i8 (VSPLTBs 7, (LXSIBZX xoaddr:$src)))>;
|
|
|
|
def : Pat<(v8i16 (scalar_to_vector ScalarLoads.ZELi8)),
|
|
|
|
(v8i16 (VSPLTHs 3, (LXSIBZX xoaddr:$src)))>;
|
|
|
|
def : Pat<(v4i32 (scalar_to_vector ScalarLoads.ZELi8)),
|
|
|
|
(v4i32 (XXSPLTWs (LXSIBZX xoaddr:$src), 1))>;
|
|
|
|
def : Pat<(v2i64 (scalar_to_vector ScalarLoads.ZELi8i64)),
|
2016-12-06 19:47:14 +08:00
|
|
|
(v2i64 (XXPERMDIs (LXSIBZX xoaddr:$src), 0))>;
|
2016-10-04 14:59:23 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector ScalarLoads.SELi8)),
|
|
|
|
(v4i32 (XXSPLTWs (VEXTSB2Ws (LXSIBZX xoaddr:$src)), 1))>;
|
|
|
|
def : Pat<(v2i64 (scalar_to_vector ScalarLoads.SELi8i64)),
|
2016-12-06 19:47:14 +08:00
|
|
|
(v2i64 (XXPERMDIs (VEXTSB2Ds (LXSIBZX xoaddr:$src)), 0))>;
|
2016-10-04 14:59:23 +08:00
|
|
|
|
|
|
|
// Build vectors from i16 loads
|
|
|
|
def : Pat<(v8i16 (scalar_to_vector ScalarLoads.Li16)),
|
|
|
|
(v8i16 (VSPLTHs 3, (LXSIHZX xoaddr:$src)))>;
|
|
|
|
def : Pat<(v4i32 (scalar_to_vector ScalarLoads.ZELi16)),
|
|
|
|
(v4i32 (XXSPLTWs (LXSIHZX xoaddr:$src), 1))>;
|
|
|
|
def : Pat<(v2i64 (scalar_to_vector ScalarLoads.ZELi16i64)),
|
2016-12-06 19:47:14 +08:00
|
|
|
(v2i64 (XXPERMDIs (LXSIHZX xoaddr:$src), 0))>;
|
2016-10-04 14:59:23 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector ScalarLoads.SELi16)),
|
|
|
|
(v4i32 (XXSPLTWs (VEXTSH2Ws (LXSIHZX xoaddr:$src)), 1))>;
|
|
|
|
def : Pat<(v2i64 (scalar_to_vector ScalarLoads.SELi16i64)),
|
2016-12-06 19:47:14 +08:00
|
|
|
(v2i64 (XXPERMDIs (VEXTSH2Ds (LXSIHZX xoaddr:$src)), 0))>;
|
2016-10-04 14:59:23 +08:00
|
|
|
|
|
|
|
let Predicates = [IsBigEndian, HasP9Vector] in {
|
|
|
|
// Scalar stores of i8
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 0)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 9), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 1)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 10), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 2)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 11), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 3)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 12), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 4)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 13), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 5)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 14), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 6)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 15), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 7)), xoaddr:$dst),
|
|
|
|
(STXSIBXv $S, xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 8)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 1), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 9)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 2), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 10)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 3), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 11)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 4), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 12)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 5), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 13)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 6), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 14)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 7), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 15)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 8), xoaddr:$dst)>;
|
|
|
|
|
|
|
|
// Scalar stores of i16
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 0)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 10), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 1)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 12), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 2)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 14), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 3)), xoaddr:$dst),
|
|
|
|
(STXSIHXv $S, xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 4)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 2), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 5)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 4), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 6)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 6), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 7)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 8), xoaddr:$dst)>;
|
|
|
|
} // IsBigEndian, HasP9Vector
|
|
|
|
|
|
|
|
let Predicates = [IsLittleEndian, HasP9Vector] in {
|
|
|
|
// Scalar stores of i8
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 0)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 8), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 1)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 7), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 2)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 6), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 3)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 5), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 4)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 4), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 5)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 3), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 6)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 2), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 7)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 1), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 8)), xoaddr:$dst),
|
|
|
|
(STXSIBXv $S, xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 9)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 15), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 10)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 14), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 11)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 13), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 12)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 12), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 13)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 11), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 14)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 10), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei8 (i32 (vector_extract v16i8:$S, 15)), xoaddr:$dst),
|
|
|
|
(STXSIBXv (VSLDOI $S, $S, 9), xoaddr:$dst)>;
|
|
|
|
|
|
|
|
// Scalar stores of i16
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 0)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 8), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 1)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 6), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 2)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 4), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 3)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 2), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 4)), xoaddr:$dst),
|
|
|
|
(STXSIHXv $S, xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 5)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 14), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 6)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 12), xoaddr:$dst)>;
|
|
|
|
def : Pat<(truncstorei16 (i32 (vector_extract v8i16:$S, 7)), xoaddr:$dst),
|
|
|
|
(STXSIHXv (VSLDOI $S, $S, 10), xoaddr:$dst)>;
|
|
|
|
} // IsLittleEndian, HasP9Vector
|
|
|
|
|
2016-12-10 01:21:42 +08:00
|
|
|
|
2016-10-04 14:59:23 +08:00
|
|
|
// Vector sign extensions
|
|
|
|
def : Pat<(f64 (PPCVexts f64:$A, 1)),
|
|
|
|
(f64 (COPY_TO_REGCLASS (VEXTSB2Ds $A), VSFRC))>;
|
|
|
|
def : Pat<(f64 (PPCVexts f64:$A, 2)),
|
|
|
|
(f64 (COPY_TO_REGCLASS (VEXTSH2Ds $A), VSFRC))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
|
2016-10-04 19:25:52 +08:00
|
|
|
let isPseudo = 1 in {
|
|
|
|
def DFLOADf32 : Pseudo<(outs vssrc:$XT), (ins memrix:$src),
|
|
|
|
"#DFLOADf32",
|
2017-07-14 02:17:10 +08:00
|
|
|
[(set f32:$XT, (load ixaddr:$src))]>;
|
2016-10-04 19:25:52 +08:00
|
|
|
def DFLOADf64 : Pseudo<(outs vsfrc:$XT), (ins memrix:$src),
|
|
|
|
"#DFLOADf64",
|
2017-07-14 02:17:10 +08:00
|
|
|
[(set f64:$XT, (load ixaddr:$src))]>;
|
2016-10-04 19:25:52 +08:00
|
|
|
def DFSTOREf32 : Pseudo<(outs), (ins vssrc:$XT, memrix:$dst),
|
|
|
|
"#DFSTOREf32",
|
2017-07-14 02:17:10 +08:00
|
|
|
[(store f32:$XT, ixaddr:$dst)]>;
|
2016-10-04 19:25:52 +08:00
|
|
|
def DFSTOREf64 : Pseudo<(outs), (ins vsfrc:$XT, memrix:$dst),
|
|
|
|
"#DFSTOREf64",
|
2017-07-14 02:17:10 +08:00
|
|
|
[(store f64:$XT, ixaddr:$dst)]>;
|
2016-10-04 19:25:52 +08:00
|
|
|
}
|
2017-07-14 02:17:10 +08:00
|
|
|
def : Pat<(f64 (extloadf32 ixaddr:$src)),
|
|
|
|
(COPY_TO_REGCLASS (DFLOADf32 ixaddr:$src), VSFRC)>;
|
|
|
|
def : Pat<(f32 (fpround (extloadf32 ixaddr:$src))),
|
|
|
|
(f32 (DFLOADf32 ixaddr:$src))>;
|
2016-07-13 05:00:10 +08:00
|
|
|
} // end HasP9Vector, AddedComplexity
|
2016-09-23 21:25:31 +08:00
|
|
|
|
2017-09-22 00:12:33 +08:00
|
|
|
let Predicates = [HasP9Vector] in {
|
|
|
|
let isPseudo = 1 in {
|
|
|
|
let mayStore = 1 in {
|
|
|
|
def SPILLTOVSR_STX : Pseudo<(outs), (ins spilltovsrrc:$XT, memrr:$dst),
|
|
|
|
"#SPILLTOVSR_STX", []>;
|
|
|
|
def SPILLTOVSR_ST : Pseudo<(outs), (ins spilltovsrrc:$XT, memrix:$dst),
|
|
|
|
"#SPILLTOVSR_ST", []>;
|
|
|
|
}
|
|
|
|
let mayLoad = 1 in {
|
|
|
|
def SPILLTOVSR_LDX : Pseudo<(outs spilltovsrrc:$XT), (ins memrr:$src),
|
|
|
|
"#SPILLTOVSR_LDX", []>;
|
|
|
|
def SPILLTOVSR_LD : Pseudo<(outs spilltovsrrc:$XT), (ins memrix:$src),
|
|
|
|
"#SPILLTOVSR_LD", []>;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-11-30 00:11:34 +08:00
|
|
|
// Integer extend helper dags 32 -> 64
|
|
|
|
def AnyExts {
|
|
|
|
dag A = (INSERT_SUBREG (i64 (IMPLICIT_DEF)), $A, sub_32);
|
|
|
|
dag B = (INSERT_SUBREG (i64 (IMPLICIT_DEF)), $B, sub_32);
|
|
|
|
dag C = (INSERT_SUBREG (i64 (IMPLICIT_DEF)), $C, sub_32);
|
|
|
|
dag D = (INSERT_SUBREG (i64 (IMPLICIT_DEF)), $D, sub_32);
|
2016-09-23 21:25:31 +08:00
|
|
|
}
|
|
|
|
|
2016-11-30 00:11:34 +08:00
|
|
|
def DblToFlt {
|
|
|
|
dag A0 = (f32 (fpround (f64 (extractelt v2f64:$A, 0))));
|
|
|
|
dag A1 = (f32 (fpround (f64 (extractelt v2f64:$A, 1))));
|
|
|
|
dag B0 = (f32 (fpround (f64 (extractelt v2f64:$B, 0))));
|
|
|
|
dag B1 = (f32 (fpround (f64 (extractelt v2f64:$B, 1))));
|
|
|
|
}
|
2017-06-09 01:14:36 +08:00
|
|
|
|
|
|
|
def ByteToWord {
|
2017-07-06 00:00:38 +08:00
|
|
|
dag LE_A0 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 0)), i8));
|
|
|
|
dag LE_A1 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 4)), i8));
|
|
|
|
dag LE_A2 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 8)), i8));
|
|
|
|
dag LE_A3 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 12)), i8));
|
|
|
|
dag BE_A0 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 3)), i8));
|
|
|
|
dag BE_A1 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 7)), i8));
|
|
|
|
dag BE_A2 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 11)), i8));
|
|
|
|
dag BE_A3 = (i32 (sext_inreg (i32 (vector_extract v16i8:$A, 15)), i8));
|
2017-06-09 01:14:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def ByteToDWord {
|
2017-07-06 00:00:38 +08:00
|
|
|
dag LE_A0 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v16i8:$A, 0)))), i8));
|
|
|
|
dag LE_A1 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v16i8:$A, 8)))), i8));
|
|
|
|
dag BE_A0 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v16i8:$A, 7)))), i8));
|
|
|
|
dag BE_A1 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v16i8:$A, 15)))), i8));
|
2017-06-09 01:14:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def HWordToWord {
|
2017-07-06 00:00:38 +08:00
|
|
|
dag LE_A0 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 0)), i16));
|
|
|
|
dag LE_A1 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 2)), i16));
|
|
|
|
dag LE_A2 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 4)), i16));
|
|
|
|
dag LE_A3 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 6)), i16));
|
|
|
|
dag BE_A0 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 1)), i16));
|
|
|
|
dag BE_A1 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 3)), i16));
|
|
|
|
dag BE_A2 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 5)), i16));
|
|
|
|
dag BE_A3 = (i32 (sext_inreg (i32 (vector_extract v8i16:$A, 7)), i16));
|
2017-06-09 01:14:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def HWordToDWord {
|
2017-07-06 00:00:38 +08:00
|
|
|
dag LE_A0 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v8i16:$A, 0)))), i16));
|
|
|
|
dag LE_A1 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v8i16:$A, 4)))), i16));
|
|
|
|
dag BE_A0 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v8i16:$A, 3)))), i16));
|
|
|
|
dag BE_A1 = (i64 (sext_inreg
|
|
|
|
(i64 (anyext (i32 (vector_extract v8i16:$A, 7)))), i16));
|
2017-06-09 01:14:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def WordToDWord {
|
2017-07-06 00:00:38 +08:00
|
|
|
dag LE_A0 = (i64 (sext (i32 (vector_extract v4i32:$A, 0))));
|
|
|
|
dag LE_A1 = (i64 (sext (i32 (vector_extract v4i32:$A, 2))));
|
|
|
|
dag BE_A0 = (i64 (sext (i32 (vector_extract v4i32:$A, 1))));
|
|
|
|
dag BE_A1 = (i64 (sext (i32 (vector_extract v4i32:$A, 3))));
|
2017-06-09 01:14:36 +08:00
|
|
|
}
|
|
|
|
|
2016-11-30 00:11:34 +08:00
|
|
|
def FltToIntLoad {
|
|
|
|
dag A = (i32 (PPCmfvsr (PPCfctiwz (f64 (extloadf32 xoaddr:$A)))));
|
|
|
|
}
|
|
|
|
def FltToUIntLoad {
|
|
|
|
dag A = (i32 (PPCmfvsr (PPCfctiwuz (f64 (extloadf32 xoaddr:$A)))));
|
|
|
|
}
|
|
|
|
def FltToLongLoad {
|
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctidz (f64 (extloadf32 xoaddr:$A)))));
|
|
|
|
}
|
2017-05-29 15:12:39 +08:00
|
|
|
def FltToLongLoadP9 {
|
2017-07-14 02:17:10 +08:00
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctidz (f64 (extloadf32 ixaddr:$A)))));
|
2017-05-29 15:12:39 +08:00
|
|
|
}
|
2016-11-30 00:11:34 +08:00
|
|
|
def FltToULongLoad {
|
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctiduz (f64 (extloadf32 xoaddr:$A)))));
|
|
|
|
}
|
2017-05-29 15:12:39 +08:00
|
|
|
def FltToULongLoadP9 {
|
2017-07-14 02:17:10 +08:00
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctiduz (f64 (extloadf32 ixaddr:$A)))));
|
2017-05-29 15:12:39 +08:00
|
|
|
}
|
2016-11-30 00:11:34 +08:00
|
|
|
def FltToLong {
|
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctidz (fpextend f32:$A))));
|
|
|
|
}
|
|
|
|
def FltToULong {
|
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctiduz (fpextend f32:$A))));
|
|
|
|
}
|
|
|
|
def DblToInt {
|
|
|
|
dag A = (i32 (PPCmfvsr (f64 (PPCfctiwz f64:$A))));
|
|
|
|
}
|
|
|
|
def DblToUInt {
|
|
|
|
dag A = (i32 (PPCmfvsr (f64 (PPCfctiwuz f64:$A))));
|
|
|
|
}
|
|
|
|
def DblToLong {
|
|
|
|
dag A = (i64 (PPCmfvsr (f64 (PPCfctidz f64:$A))));
|
|
|
|
}
|
|
|
|
def DblToULong {
|
|
|
|
dag A = (i64 (PPCmfvsr (f64 (PPCfctiduz f64:$A))));
|
|
|
|
}
|
|
|
|
def DblToIntLoad {
|
|
|
|
dag A = (i32 (PPCmfvsr (PPCfctiwz (f64 (load xoaddr:$A)))));
|
|
|
|
}
|
2017-05-29 15:12:39 +08:00
|
|
|
def DblToIntLoadP9 {
|
2017-07-14 02:17:10 +08:00
|
|
|
dag A = (i32 (PPCmfvsr (PPCfctiwz (f64 (load ixaddr:$A)))));
|
2017-05-29 15:12:39 +08:00
|
|
|
}
|
2016-11-30 00:11:34 +08:00
|
|
|
def DblToUIntLoad {
|
|
|
|
dag A = (i32 (PPCmfvsr (PPCfctiwuz (f64 (load xoaddr:$A)))));
|
|
|
|
}
|
2017-05-29 15:12:39 +08:00
|
|
|
def DblToUIntLoadP9 {
|
2017-07-14 02:17:10 +08:00
|
|
|
dag A = (i32 (PPCmfvsr (PPCfctiwuz (f64 (load ixaddr:$A)))));
|
2017-05-29 15:12:39 +08:00
|
|
|
}
|
2016-11-30 00:11:34 +08:00
|
|
|
def DblToLongLoad {
|
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctidz (f64 (load xoaddr:$A)))));
|
|
|
|
}
|
|
|
|
def DblToULongLoad {
|
|
|
|
dag A = (i64 (PPCmfvsr (PPCfctiduz (f64 (load xoaddr:$A)))));
|
|
|
|
}
|
|
|
|
|
|
|
|
// FP merge dags (for f32 -> v4f32)
|
|
|
|
def MrgFP {
|
|
|
|
dag AC = (XVCVDPSP (XXPERMDI (COPY_TO_REGCLASS $A, VSRC),
|
|
|
|
(COPY_TO_REGCLASS $C, VSRC), 0));
|
|
|
|
dag BD = (XVCVDPSP (XXPERMDI (COPY_TO_REGCLASS $B, VSRC),
|
|
|
|
(COPY_TO_REGCLASS $D, VSRC), 0));
|
|
|
|
dag ABhToFlt = (XVCVDPSP (XXPERMDI $A, $B, 0));
|
|
|
|
dag ABlToFlt = (XVCVDPSP (XXPERMDI $A, $B, 3));
|
|
|
|
dag BAhToFlt = (XVCVDPSP (XXPERMDI $B, $A, 0));
|
|
|
|
dag BAlToFlt = (XVCVDPSP (XXPERMDI $B, $A, 3));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Patterns for BUILD_VECTOR nodes.
|
|
|
|
def NoP9Vector : Predicate<"!PPCSubTarget->hasP9Vector()">;
|
|
|
|
let AddedComplexity = 400 in {
|
|
|
|
|
|
|
|
let Predicates = [HasVSX] in {
|
|
|
|
// Build vectors of floating point converted to i32.
|
|
|
|
def : Pat<(v4i32 (build_vector DblToInt.A, DblToInt.A,
|
|
|
|
DblToInt.A, DblToInt.A)),
|
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS (XSCVDPSXWS $A), VSRC), 1))>;
|
|
|
|
def : Pat<(v4i32 (build_vector DblToUInt.A, DblToUInt.A,
|
|
|
|
DblToUInt.A, DblToUInt.A)),
|
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS (XSCVDPUXWS $A), VSRC), 1))>;
|
|
|
|
def : Pat<(v2i64 (build_vector DblToLong.A, DblToLong.A)),
|
|
|
|
(v2i64 (XXPERMDI (COPY_TO_REGCLASS (XSCVDPSXDS $A), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (XSCVDPSXDS $A), VSRC), 0))>;
|
|
|
|
def : Pat<(v2i64 (build_vector DblToULong.A, DblToULong.A)),
|
|
|
|
(v2i64 (XXPERMDI (COPY_TO_REGCLASS (XSCVDPUXDS $A), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (XSCVDPUXDS $A), VSRC), 0))>;
|
|
|
|
def : Pat<(v4i32 (scalar_to_vector FltToIntLoad.A)),
|
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS
|
2017-11-20 22:38:30 +08:00
|
|
|
(XSCVDPSXWSs (XFLOADf32 xoaddr:$A)), VSRC), 1))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector FltToUIntLoad.A)),
|
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS
|
2017-11-20 22:38:30 +08:00
|
|
|
(XSCVDPUXWSs (XFLOADf32 xoaddr:$A)), VSRC), 1))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v4f32 (build_vector f32:$A, f32:$A, f32:$A, f32:$A)),
|
|
|
|
(v4f32 (XXSPLTW (v4f32 (XSCVDPSPN $A)), 0))>;
|
|
|
|
|
|
|
|
// Build vectors of floating point converted to i64.
|
|
|
|
def : Pat<(v2i64 (build_vector FltToLong.A, FltToLong.A)),
|
2016-12-06 19:47:14 +08:00
|
|
|
(v2i64 (XXPERMDIs
|
|
|
|
(COPY_TO_REGCLASS (XSCVDPSXDSs $A), VSFRC), 0))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v2i64 (build_vector FltToULong.A, FltToULong.A)),
|
2016-12-06 19:47:14 +08:00
|
|
|
(v2i64 (XXPERMDIs
|
|
|
|
(COPY_TO_REGCLASS (XSCVDPUXDSs $A), VSFRC), 0))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector DblToLongLoad.A)),
|
|
|
|
(v2i64 (XVCVDPSXDS (LXVDSX xoaddr:$A)))>;
|
|
|
|
def : Pat<(v2i64 (scalar_to_vector DblToULongLoad.A)),
|
|
|
|
(v2i64 (XVCVDPUXDS (LXVDSX xoaddr:$A)))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [HasVSX, NoP9Vector] in {
|
2017-11-20 22:38:30 +08:00
|
|
|
// Load-and-splat with fp-to-int conversion (using X-Form VSX/FP loads).
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector DblToIntLoad.A)),
|
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS
|
2017-11-20 22:38:30 +08:00
|
|
|
(XSCVDPSXWS (XFLOADf64 xoaddr:$A)), VSRC), 1))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector DblToUIntLoad.A)),
|
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS
|
2017-11-20 22:38:30 +08:00
|
|
|
(XSCVDPUXWS (XFLOADf64 xoaddr:$A)), VSRC), 1))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector FltToLongLoad.A)),
|
|
|
|
(v2i64 (XXPERMDIs (XSCVDPSXDS (COPY_TO_REGCLASS
|
2017-11-20 22:38:30 +08:00
|
|
|
(XFLOADf32 xoaddr:$A), VSFRC)), 0))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector FltToULongLoad.A)),
|
|
|
|
(v2i64 (XXPERMDIs (XSCVDPUXDS (COPY_TO_REGCLASS
|
2017-11-20 22:38:30 +08:00
|
|
|
(XFLOADf32 xoaddr:$A), VSFRC)), 0))>;
|
2016-11-30 00:11:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Big endian, available on all targets with VSX
|
|
|
|
let Predicates = [IsBigEndian, HasVSX] in {
|
|
|
|
def : Pat<(v2f64 (build_vector f64:$A, f64:$B)),
|
|
|
|
(v2f64 (XXPERMDI
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC),
|
|
|
|
(COPY_TO_REGCLASS $B, VSRC), 0))>;
|
|
|
|
|
|
|
|
def : Pat<(v4f32 (build_vector f32:$A, f32:$B, f32:$C, f32:$D)),
|
|
|
|
(VMRGEW MrgFP.AC, MrgFP.BD)>;
|
|
|
|
def : Pat<(v4f32 (build_vector DblToFlt.A0, DblToFlt.A1,
|
|
|
|
DblToFlt.B0, DblToFlt.B1)),
|
|
|
|
(v4f32 (VMRGEW MrgFP.ABhToFlt, MrgFP.ABlToFlt))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsLittleEndian, HasVSX] in {
|
|
|
|
// Little endian, available on all targets with VSX
|
|
|
|
def : Pat<(v2f64 (build_vector f64:$A, f64:$B)),
|
|
|
|
(v2f64 (XXPERMDI
|
|
|
|
(COPY_TO_REGCLASS $B, VSRC),
|
|
|
|
(COPY_TO_REGCLASS $A, VSRC), 0))>;
|
|
|
|
|
|
|
|
def : Pat<(v4f32 (build_vector f32:$D, f32:$C, f32:$B, f32:$A)),
|
|
|
|
(VMRGEW MrgFP.AC, MrgFP.BD)>;
|
|
|
|
def : Pat<(v4f32 (build_vector DblToFlt.A0, DblToFlt.A1,
|
|
|
|
DblToFlt.B0, DblToFlt.B1)),
|
|
|
|
(v4f32 (VMRGEW MrgFP.BAhToFlt, MrgFP.BAlToFlt))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [HasDirectMove] in {
|
|
|
|
// Endianness-neutral constant splat on P8 and newer targets. The reason
|
|
|
|
// for this pattern is that on targets with direct moves, we don't expand
|
|
|
|
// BUILD_VECTOR nodes for v4i32.
|
|
|
|
def : Pat<(v4i32 (build_vector immSExt5NonZero:$A, immSExt5NonZero:$A,
|
|
|
|
immSExt5NonZero:$A, immSExt5NonZero:$A)),
|
|
|
|
(v4i32 (VSPLTISW imm:$A))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsBigEndian, HasDirectMove, NoP9Vector] in {
|
|
|
|
// Big endian integer vectors using direct moves.
|
|
|
|
def : Pat<(v2i64 (build_vector i64:$A, i64:$B)),
|
|
|
|
(v2i64 (XXPERMDI
|
|
|
|
(COPY_TO_REGCLASS (MTVSRD $A), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRD $B), VSRC), 0))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$B, i32:$C, i32:$D)),
|
|
|
|
(VMRGOW (XXPERMDI (COPY_TO_REGCLASS (MTVSRWZ $A), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRWZ $C), VSRC), 0),
|
|
|
|
(XXPERMDI (COPY_TO_REGCLASS (MTVSRWZ $B), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRWZ $D), VSRC), 0))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$A, i32:$A, i32:$A)),
|
|
|
|
(XXSPLTW (COPY_TO_REGCLASS (MTVSRWZ $A), VSRC), 1)>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsLittleEndian, HasDirectMove, NoP9Vector] in {
|
|
|
|
// Little endian integer vectors using direct moves.
|
|
|
|
def : Pat<(v2i64 (build_vector i64:$A, i64:$B)),
|
|
|
|
(v2i64 (XXPERMDI
|
|
|
|
(COPY_TO_REGCLASS (MTVSRD $B), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRD $A), VSRC), 0))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$B, i32:$C, i32:$D)),
|
|
|
|
(VMRGOW (XXPERMDI (COPY_TO_REGCLASS (MTVSRWZ $D), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRWZ $B), VSRC), 0),
|
|
|
|
(XXPERMDI (COPY_TO_REGCLASS (MTVSRWZ $C), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRWZ $A), VSRC), 0))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$A, i32:$A, i32:$A)),
|
|
|
|
(XXSPLTW (COPY_TO_REGCLASS (MTVSRWZ $A), VSRC), 1)>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [HasP9Vector] in {
|
|
|
|
// Endianness-neutral patterns for const splats with ISA 3.0 instructions.
|
|
|
|
def : Pat<(v4i32 (scalar_to_vector i32:$A)),
|
|
|
|
(v4i32 (MTVSRWS $A))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$A, i32:$A, i32:$A)),
|
|
|
|
(v4i32 (MTVSRWS $A))>;
|
2016-12-15 19:16:20 +08:00
|
|
|
def : Pat<(v16i8 (build_vector immAnyExt8:$A, immAnyExt8:$A, immAnyExt8:$A,
|
|
|
|
immAnyExt8:$A, immAnyExt8:$A, immAnyExt8:$A,
|
|
|
|
immAnyExt8:$A, immAnyExt8:$A, immAnyExt8:$A,
|
|
|
|
immAnyExt8:$A, immAnyExt8:$A, immAnyExt8:$A,
|
|
|
|
immAnyExt8:$A, immAnyExt8:$A, immAnyExt8:$A,
|
|
|
|
immAnyExt8:$A)),
|
2016-11-30 00:11:34 +08:00
|
|
|
(v16i8 (COPY_TO_REGCLASS (XXSPLTIB imm:$A), VSRC))>;
|
|
|
|
def : Pat<(v16i8 immAllOnesV),
|
|
|
|
(v16i8 (COPY_TO_REGCLASS (XXSPLTIB 255), VSRC))>;
|
|
|
|
def : Pat<(v8i16 immAllOnesV),
|
|
|
|
(v8i16 (COPY_TO_REGCLASS (XXSPLTIB 255), VSRC))>;
|
|
|
|
def : Pat<(v4i32 immAllOnesV),
|
|
|
|
(v4i32 (XXSPLTIB 255))>;
|
|
|
|
def : Pat<(v2i64 immAllOnesV),
|
|
|
|
(v2i64 (XXSPLTIB 255))>;
|
|
|
|
def : Pat<(v4i32 (scalar_to_vector FltToIntLoad.A)),
|
|
|
|
(v4i32 (XVCVSPSXWS (LXVWSX xoaddr:$A)))>;
|
|
|
|
def : Pat<(v4i32 (scalar_to_vector FltToUIntLoad.A)),
|
|
|
|
(v4i32 (XVCVSPUXWS (LXVWSX xoaddr:$A)))>;
|
2017-05-29 15:12:39 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector DblToIntLoadP9.A)),
|
2016-11-30 00:11:34 +08:00
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS
|
2017-07-14 02:17:10 +08:00
|
|
|
(XSCVDPSXWS (DFLOADf64 ixaddr:$A)), VSRC), 1))>;
|
2017-05-29 15:12:39 +08:00
|
|
|
def : Pat<(v4i32 (scalar_to_vector DblToUIntLoadP9.A)),
|
2016-11-30 00:11:34 +08:00
|
|
|
(v4i32 (XXSPLTW (COPY_TO_REGCLASS
|
2017-07-14 02:17:10 +08:00
|
|
|
(XSCVDPUXWS (DFLOADf64 ixaddr:$A)), VSRC), 1))>;
|
2017-05-29 15:12:39 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector FltToLongLoadP9.A)),
|
2016-11-30 00:11:34 +08:00
|
|
|
(v2i64 (XXPERMDIs (XSCVDPSXDS (COPY_TO_REGCLASS
|
2017-07-14 02:17:10 +08:00
|
|
|
(DFLOADf32 ixaddr:$A),
|
2016-11-30 00:11:34 +08:00
|
|
|
VSFRC)), 0))>;
|
2017-05-29 15:12:39 +08:00
|
|
|
def : Pat<(v2i64 (scalar_to_vector FltToULongLoadP9.A)),
|
2016-11-30 00:11:34 +08:00
|
|
|
(v2i64 (XXPERMDIs (XSCVDPUXDS (COPY_TO_REGCLASS
|
2017-07-14 02:17:10 +08:00
|
|
|
(DFLOADf32 ixaddr:$A),
|
2016-11-30 00:11:34 +08:00
|
|
|
VSFRC)), 0))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsISA3_0, HasDirectMove, IsBigEndian] in {
|
|
|
|
def : Pat<(i64 (extractelt v2i64:$A, 1)),
|
|
|
|
(i64 (MFVSRLD $A))>;
|
|
|
|
// Better way to build integer vectors if we have MTVSRDD. Big endian.
|
|
|
|
def : Pat<(v2i64 (build_vector i64:$rB, i64:$rA)),
|
|
|
|
(v2i64 (MTVSRDD $rB, $rA))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$B, i32:$C, i32:$D)),
|
|
|
|
(VMRGOW (COPY_TO_REGCLASS (MTVSRDD AnyExts.A, AnyExts.C), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRDD AnyExts.B, AnyExts.D), VSRC))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [IsISA3_0, HasDirectMove, IsLittleEndian] in {
|
|
|
|
def : Pat<(i64 (extractelt v2i64:$A, 0)),
|
|
|
|
(i64 (MFVSRLD $A))>;
|
|
|
|
// Better way to build integer vectors if we have MTVSRDD. Little endian.
|
|
|
|
def : Pat<(v2i64 (build_vector i64:$rA, i64:$rB)),
|
|
|
|
(v2i64 (MTVSRDD $rB, $rA))>;
|
|
|
|
def : Pat<(v4i32 (build_vector i32:$A, i32:$B, i32:$C, i32:$D)),
|
|
|
|
(VMRGOW (COPY_TO_REGCLASS (MTVSRDD AnyExts.D, AnyExts.B), VSRC),
|
|
|
|
(COPY_TO_REGCLASS (MTVSRDD AnyExts.C, AnyExts.A), VSRC))>;
|
|
|
|
}
|
2017-06-09 01:14:36 +08:00
|
|
|
// P9 Altivec instructions that can be used to build vectors.
|
|
|
|
// Adding them to PPCInstrVSX.td rather than PPCAltivecVSX.td to compete
|
|
|
|
// with complexities of existing build vector patterns in this file.
|
2017-07-06 00:00:38 +08:00
|
|
|
let Predicates = [HasP9Altivec, IsLittleEndian] in {
|
|
|
|
def : Pat<(v2i64 (build_vector WordToDWord.LE_A0, WordToDWord.LE_A1)),
|
|
|
|
(v2i64 (VEXTSW2D $A))>;
|
|
|
|
def : Pat<(v2i64 (build_vector HWordToDWord.LE_A0, HWordToDWord.LE_A1)),
|
|
|
|
(v2i64 (VEXTSH2D $A))>;
|
|
|
|
def : Pat<(v4i32 (build_vector HWordToWord.LE_A0, HWordToWord.LE_A1,
|
|
|
|
HWordToWord.LE_A2, HWordToWord.LE_A3)),
|
|
|
|
(v4i32 (VEXTSH2W $A))>;
|
|
|
|
def : Pat<(v4i32 (build_vector ByteToWord.LE_A0, ByteToWord.LE_A1,
|
|
|
|
ByteToWord.LE_A2, ByteToWord.LE_A3)),
|
|
|
|
(v4i32 (VEXTSB2W $A))>;
|
|
|
|
def : Pat<(v2i64 (build_vector ByteToDWord.LE_A0, ByteToDWord.LE_A1)),
|
|
|
|
(v2i64 (VEXTSB2D $A))>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let Predicates = [HasP9Altivec, IsBigEndian] in {
|
|
|
|
def : Pat<(v2i64 (build_vector WordToDWord.BE_A0, WordToDWord.BE_A1)),
|
2017-06-09 01:14:36 +08:00
|
|
|
(v2i64 (VEXTSW2D $A))>;
|
2017-07-06 00:00:38 +08:00
|
|
|
def : Pat<(v2i64 (build_vector HWordToDWord.BE_A0, HWordToDWord.BE_A1)),
|
2017-06-09 01:14:36 +08:00
|
|
|
(v2i64 (VEXTSH2D $A))>;
|
2017-07-06 00:00:38 +08:00
|
|
|
def : Pat<(v4i32 (build_vector HWordToWord.BE_A0, HWordToWord.BE_A1,
|
|
|
|
HWordToWord.BE_A2, HWordToWord.BE_A3)),
|
2017-06-09 01:14:36 +08:00
|
|
|
(v4i32 (VEXTSH2W $A))>;
|
2017-07-06 00:00:38 +08:00
|
|
|
def : Pat<(v4i32 (build_vector ByteToWord.BE_A0, ByteToWord.BE_A1,
|
|
|
|
ByteToWord.BE_A2, ByteToWord.BE_A3)),
|
2017-06-09 01:14:36 +08:00
|
|
|
(v4i32 (VEXTSB2W $A))>;
|
2017-07-06 00:00:38 +08:00
|
|
|
def : Pat<(v2i64 (build_vector ByteToDWord.BE_A0, ByteToDWord.BE_A1)),
|
2017-06-09 01:14:36 +08:00
|
|
|
(v2i64 (VEXTSB2D $A))>;
|
|
|
|
}
|
2017-07-06 00:00:38 +08:00
|
|
|
|
|
|
|
let Predicates = [HasP9Altivec] in {
|
|
|
|
def: Pat<(v2i64 (PPCSExtVElems v16i8:$A)),
|
|
|
|
(v2i64 (VEXTSB2D $A))>;
|
|
|
|
def: Pat<(v2i64 (PPCSExtVElems v8i16:$A)),
|
|
|
|
(v2i64 (VEXTSH2D $A))>;
|
|
|
|
def: Pat<(v2i64 (PPCSExtVElems v4i32:$A)),
|
|
|
|
(v2i64 (VEXTSW2D $A))>;
|
|
|
|
def: Pat<(v4i32 (PPCSExtVElems v16i8:$A)),
|
|
|
|
(v4i32 (VEXTSB2W $A))>;
|
|
|
|
def: Pat<(v4i32 (PPCSExtVElems v8i16:$A)),
|
|
|
|
(v4i32 (VEXTSH2W $A))>;
|
|
|
|
}
|
2016-09-23 21:25:31 +08:00
|
|
|
}
|