mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
An INSERT_VECTOR_ELT can insert a larger value
than the vector element type. Don't forget to handle this when the insertion index is not a constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53556 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8cc364c5cc
commit
262e04b307
@ -360,13 +360,14 @@ void DAGTypeLegalizer::SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDOperand &Lo,
|
||||
|
||||
// Spill the vector to the stack.
|
||||
MVT VecVT = Vec.getValueType();
|
||||
MVT EltVT = VecVT.getVectorElementType();
|
||||
SDOperand StackPtr = DAG.CreateStackTemporary(VecVT);
|
||||
SDOperand Store = DAG.getStore(DAG.getEntryNode(), Vec, StackPtr, NULL, 0);
|
||||
|
||||
// Store the new element.
|
||||
SDOperand EltPtr = GetVectorElementPointer(StackPtr,
|
||||
VecVT.getVectorElementType(), Idx);
|
||||
Store = DAG.getStore(Store, Elt, EltPtr, NULL, 0);
|
||||
// Store the new element. This may be larger than the vector element type,
|
||||
// so use a truncating store.
|
||||
SDOperand EltPtr = GetVectorElementPointer(StackPtr, EltVT, Idx);
|
||||
Store = DAG.getTruncStore(Store, Elt, EltPtr, NULL, 0, EltVT);
|
||||
|
||||
// Reload the vector from the stack.
|
||||
SDOperand Load = DAG.getLoad(VecVT, Store, StackPtr, NULL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user