mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-24 08:33:39 +00:00
On x86, f32 / f64 nodes share the same registers as 128-bit vector values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e0e925efb3
commit
dee81010eb
@ -1190,6 +1190,32 @@ unsigned X86TargetLowering::getFunctionAlignment(const Function *F) const {
|
|||||||
return F->hasFnAttr(Attribute::OptimizeForSize) ? 0 : 4;
|
return F->hasFnAttr(Attribute::OptimizeForSize) ? 0 : 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::pair<const TargetRegisterClass*, uint8_t>
|
||||||
|
X86TargetLowering::findRepresentativeClass(EVT VT) const{
|
||||||
|
const TargetRegisterClass *RRC = 0;
|
||||||
|
uint8_t Cost = 1;
|
||||||
|
switch (VT.getSimpleVT().SimpleTy) {
|
||||||
|
default:
|
||||||
|
return TargetLowering::findRepresentativeClass(VT);
|
||||||
|
case MVT::i8: case MVT::i16: case MVT::i32: case MVT::i64:
|
||||||
|
RRC = (Subtarget->is64Bit()
|
||||||
|
? X86::GR64RegisterClass : X86::GR32RegisterClass);
|
||||||
|
break;
|
||||||
|
case MVT::v8i8: case MVT::v4i16:
|
||||||
|
case MVT::v2i32: case MVT::v1i64:
|
||||||
|
RRC = X86::VR64RegisterClass;
|
||||||
|
break;
|
||||||
|
case MVT::f32: case MVT::f64:
|
||||||
|
case MVT::v16i8: case MVT::v8i16: case MVT::v4i32: case MVT::v2i64:
|
||||||
|
case MVT::v4f32: case MVT::v2f64:
|
||||||
|
case MVT::v32i8: case MVT::v8i32: case MVT::v4i64: case MVT::v8f32:
|
||||||
|
case MVT::v4f64:
|
||||||
|
RRC = X86::VR128RegisterClass;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return std::make_pair(RRC, Cost);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
X86TargetLowering::getRegPressureLimit(const TargetRegisterClass *RC,
|
X86TargetLowering::getRegPressureLimit(const TargetRegisterClass *RC,
|
||||||
MachineFunction &MF) const {
|
MachineFunction &MF) const {
|
||||||
|
@ -599,6 +599,10 @@ namespace llvm {
|
|||||||
/// appropriate.
|
/// appropriate.
|
||||||
virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const;
|
virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::pair<const TargetRegisterClass*, uint8_t>
|
||||||
|
findRepresentativeClass(EVT VT) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Subtarget - Keep a pointer to the X86Subtarget around so that we can
|
/// Subtarget - Keep a pointer to the X86Subtarget around so that we can
|
||||||
/// make the right decision when generating code for different targets.
|
/// make the right decision when generating code for different targets.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user