From 4fea05acfae1a95cc755588210d41b49950d505d Mon Sep 17 00:00:00 2001 From: Justin Holewinski Date: Thu, 28 Apr 2011 00:19:52 +0000 Subject: [PATCH] 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 --- lib/Target/PTX/PTXISelLowering.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Target/PTX/PTXISelLowering.cpp b/lib/Target/PTX/PTXISelLowering.cpp index 7187518c52e..c3ba249d631 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);