mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 17:25:21 +00:00
R600: Consolidate expansion of v2i32/v4i32 ops for EG/SI
By default, we expand these operations for both EG and SI. Move the duplicated code into a common space for now. If the targets ever actually implement these operations as instructions, we can override that in the relevant target. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -70,6 +70,28 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
|
||||
setOperationAction(ISD::UDIV, MVT::i32, Expand);
|
||||
setOperationAction(ISD::UDIVREM, MVT::i32, Custom);
|
||||
setOperationAction(ISD::UREM, MVT::i32, Expand);
|
||||
|
||||
int types[] = {
|
||||
(int)MVT::v2i32,
|
||||
(int)MVT::v4i32
|
||||
};
|
||||
size_t NumTypes = sizeof(types) / sizeof(*types);
|
||||
|
||||
for (unsigned int x = 0; x < NumTypes; ++x) {
|
||||
MVT::SimpleValueType VT = (MVT::SimpleValueType)types[x];
|
||||
//Expand the following operations for the current type by default
|
||||
setOperationAction(ISD::ADD, VT, Expand);
|
||||
setOperationAction(ISD::AND, VT, Expand);
|
||||
setOperationAction(ISD::MUL, VT, Expand);
|
||||
setOperationAction(ISD::OR, VT, Expand);
|
||||
setOperationAction(ISD::SHL, VT, Expand);
|
||||
setOperationAction(ISD::SRL, VT, Expand);
|
||||
setOperationAction(ISD::SRA, VT, Expand);
|
||||
setOperationAction(ISD::SUB, VT, Expand);
|
||||
setOperationAction(ISD::UDIV, VT, Expand);
|
||||
setOperationAction(ISD::UREM, VT, Expand);
|
||||
setOperationAction(ISD::XOR, VT, Expand);
|
||||
}
|
||||
}
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user