diff options
author | Justin Holewinski <justin.holewinski@gmail.com> | 2011-04-28 00:19:52 +0000 |
---|---|---|
committer | Justin Holewinski <justin.holewinski@gmail.com> | 2011-04-28 00:19:52 +0000 |
commit | 4fea05acfae1a95cc755588210d41b49950d505d (patch) | |
tree | 6f44c546a191e1b7fbeaf13f597aeb2881e6bc31 /lib | |
parent | 5a3cb924c6b9685429042e189d743f70a775548c (diff) | |
download | external_llvm-4fea05acfae1a95cc755588210d41b49950d505d.zip external_llvm-4fea05acfae1a95cc755588210d41b49950d505d.tar.gz external_llvm-4fea05acfae1a95cc755588210d41b49950d505d.tar.bz2 |
PTX: support for zext loads and trunc stores
- expansion of EXTLOAD and TRUNCSTORE instructions
Patch by Dan Bailey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PTX/PTXISelLowering.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Target/PTX/PTXISelLowering.cpp b/lib/Target/PTX/PTXISelLowering.cpp index 7187518..c3ba249 100644 --- a/lib/Target/PTX/PTXISelLowering.cpp +++ b/lib/Target/PTX/PTXISelLowering.cpp @@ -34,11 +34,23 @@ PTXTargetLowering::PTXTargetLowering(TargetMachine &TM) addRegisterClass(MVT::f32, PTX::RRegf32RegisterClass); addRegisterClass(MVT::f64, PTX::RRegf64RegisterClass); + setBooleanContents(ZeroOrOneBooleanContent); + setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand); setOperationAction(ISD::ConstantFP, MVT::f32, Legal); setOperationAction(ISD::ConstantFP, MVT::f64, Legal); - + + // Turn i16 (z)extload into load + (z)extend + setLoadExtAction(ISD::EXTLOAD, MVT::i16, Expand); + setLoadExtAction(ISD::ZEXTLOAD, MVT::i16, Expand); + + // Turn f32 extload into load + fextend + setLoadExtAction(ISD::EXTLOAD, MVT::f32, Expand); + + // Turn f64 truncstore into trunc + store. + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // Customize translation of memory addresses setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); setOperationAction(ISD::GlobalAddress, MVT::i64, Custom); |