X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FTarget%2FTargetLowering.h;h=25456d7c6dc4c20186a5c65b3091f12528b54e15;hb=ddf89566a93081cb230bb9406a72ab2d3eada4a7;hp=06c160b1b5e897ba8d4aa702d09a68268eb5b82f;hpb=41c5a3918f62a46671c972b1069072f9d9173605;p=oota-llvm.git diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 06c160b1b5e..25456d7c6dc 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -301,19 +301,22 @@ public: getLoadXAction(LType, VT) == Custom; } - /// getStoreXAction - Return how this store with truncation should be treated: - /// either it is legal, needs to be promoted to a larger size, needs to be - /// expanded to some other code sequence, or the target has a custom expander - /// for it. - LegalizeAction getStoreXAction(MVT::ValueType VT) const { - if (MVT::isExtendedVT(VT)) return getTypeAction(VT); - return (LegalizeAction)((StoreXActions >> (2*VT)) & 3); + /// getTruncStoreAction - Return how this store with truncation should be + /// treated: either it is legal, needs to be promoted to a larger size, needs + /// to be expanded to some other code sequence, or the target has a custom + /// expander for it. + LegalizeAction getTruncStoreAction(MVT::ValueType ValVT, + MVT::ValueType MemVT) const { + assert(ValVT < MVT::LAST_VALUETYPE && MemVT < 32 && + "Table isn't big enough!"); + return (LegalizeAction)((TruncStoreActions[ValVT] >> (2*MemVT)) & 3); } - /// isStoreXLegal - Return true if the specified store with truncation is + /// isTruncStoreLegal - Return true if the specified store with truncation is /// legal on this target. - bool isStoreXLegal(MVT::ValueType VT) const { - return getStoreXAction(VT) == Legal || getStoreXAction(VT) == Custom; + bool isTruncStoreLegal(MVT::ValueType ValVT, MVT::ValueType MemVT) const { + return getTruncStoreAction(ValVT, MemVT) == Legal || + getTruncStoreAction(ValVT, MemVT) == Custom; } /// getIndexedLoadAction - Return how the indexed load should be treated: @@ -760,12 +763,14 @@ protected: LoadXActions[ExtType] |= (uint64_t)Action << VT*2; } - /// setStoreXAction - Indicate that the specified store with truncation does + /// setTruncStoreAction - Indicate that the specified truncating store does /// not work with the with specified type and indicate what to do about it. - void setStoreXAction(MVT::ValueType VT, LegalizeAction Action) { - assert(VT < 32 && "Table isn't big enough!"); - StoreXActions &= ~(uint64_t(3UL) << VT*2); - StoreXActions |= (uint64_t)Action << VT*2; + void setTruncStoreAction(MVT::ValueType ValVT, MVT::ValueType MemVT, + LegalizeAction Action) { + assert(ValVT < MVT::LAST_VALUETYPE && MemVT < 32 && + "Table isn't big enough!"); + TruncStoreActions[ValVT] &= ~(uint64_t(3UL) << MemVT*2); + TruncStoreActions[ValVT] |= (uint64_t)Action << MemVT*2; } /// setIndexedLoadAction - Indicate that the specified indexed load does or @@ -1183,10 +1188,9 @@ private: /// with the load. uint64_t LoadXActions[ISD::LAST_LOADX_TYPE]; - /// StoreXActions - For each store with truncation of each value type, keep a - /// LegalizeAction that indicates how instruction selection should deal with - /// the store. - uint64_t StoreXActions; + /// TruncStoreActions - For each truncating store, keep a LegalizeAction that + /// indicates how instruction selection should deal with the store. + uint64_t TruncStoreActions[MVT::LAST_VALUETYPE]; /// IndexedModeActions - For each indexed mode and each value type, keep a /// pair of LegalizeAction that indicates how instruction selection should