aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PTX/PTXAsmPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-241-1/+1
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add initial support for device function callsJustin Holewinski2011-08-091-1/+42
| | | | | | - Calls are supported on SM 2.0+ for function with no return values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137125 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Reverting implementation of i8.Dan Bailey2011-06-251-2/+0
| | | | | | | | | | The .b8 operations in PTX are far more limiting than I first thought. The mov operation isn't even supported, so there's no way of converting a .pred value into a .b8 without going via .b16, which is not sensible. An improved implementation needs to use the fact that loads and stores automatically extend and truncate to implement support for EXTLOAD and TRUNCSTORE in order to correctly support boolean values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133873 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add support for i8 type and introduce associated .b8 registersDan Bailey2011-06-241-0/+2
| | | | | | | | The i8 type is required for boolean values, but can only use ld, st and mov instructions. The i1 type continues to be used for predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133814 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add preliminary support for outputting debug information in the form ofJustin Holewinski2011-06-241-0/+97
| | | | | | | | | | .file and .loc directives. Ideally, we would utilize the existing support in AsmPrinter for this, but I cannot find a way to get .file and .loc directives to print without the rest of the associated DWARF sections, which ptxas cannot handle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133812 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Re-work target sm/compute selection and add some basic GPUJustin Holewinski2011-06-241-1/+1
| | | | | | targets: g80, gt200, gf100(fermi) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133799 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Always use registers for return values, but use .param space for deviceJustin Holewinski2011-06-231-13/+4
| | | | | | | | | | | parameters if SM >= 2.0 - Update test cases to be more robust against register allocation changes - Bump up the number of registers to 128 per type - Include Python script to re-generate register file with any number of registers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133736 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Whitespace fixes and remove commented out codeJustin Holewinski2011-06-231-35/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133734 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Prevent DCE from eliminating st.param calls, and unify the handling ofJustin Holewinski2011-06-231-5/+23
| | | | | | | | st.param and ld.param FIXME: Test cases still need to be updated git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133733 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Use .param space for parameters in device functions for SM >= 2.0Justin Holewinski2011-06-231-1/+2
| | | | | | FIXME: DCE is eliminating the final st.param.x calls, figure out why git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133732 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix FrameIndex mapping bugJustin Holewinski2011-06-221-7/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133619 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add .address_size directive if PTX version >= 2.3Justin Holewinski2011-06-221-0/+7
| | | | | | Patch by Wei-Ren Chen git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133589 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add basic register spilling codeJustin Holewinski2011-06-201-0/+13
| | | | | | | | | | | | The current implementation generates stack loads/stores, which are really just mov instructions from/to "special" registers. This may not be the most efficient implementation, compared to an approach where the stack registers are directly folded into instructions, but this is easier to implement and I have yet to see a case where ptxas is unable to see through this kind of register usage and know what is really going on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133443 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FIXME by making GlobalVariable::getInitializer() return aJay Foad2011-06-191-1/+1
| | | | | | const Constant *. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133400 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Finish new calling convention implementationJustin Holewinski2011-06-161-43/+75
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133172 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Rename register classes for readability and combine int and fp registersJustin Holewinski2011-06-161-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133171 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix whitespace errorsJustin Holewinski2011-06-161-9/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133158 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: patch to AsmPrinterJustin Holewinski2011-04-281-22/+47
| | | | | | | | | - immediate value cast as long not int - handles initializer for constant array Patch by Dan Bailey git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130352 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Add intrinsics to list of built-in intrinsics, which allows them to beJustin Holewinski2011-04-201-1/+2
| | | | | | | | | | used by Clang. To help Clang integration, the PTX target has been split into two targets: ptx32 and ptx64, depending on the desired pointer size. - Add GCCBuiltin class to all intrinsics - Split PTX target into ptx32 and ptx64 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129851 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix various codegen issuesJustin Holewinski2011-03-181-1/+11
| | | | | | | | - Emit mad instead of mad.rn for shader model 1.0 - Emit explicit mov.u32 instructions for reading global variables - (most PTX instructions cannot take global variable immediates) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127895 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: fix parameter order that is reversedChe-Liang Chiou2011-03-181-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127874 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add unconditional and conditional branchChe-Liang Chiou2011-03-181-16/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127873 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Emit global arrays with proper sizesJustin Holewinski2011-03-141-5/+34
| | | | | | | - Emit all arrays as type .b8 and proper sizes in bytes to conform to the output of nvcc git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127584 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add set.p instruction and related changes to predicate executionChe-Liang Chiou2011-03-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127577 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add basic support of predicate executionChe-Liang Chiou2011-03-131-1/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127569 91177308-0d34-0410-b5e6-96231b3b80d8
* PTX: Fix a couple of lint violationsJustin Holewinski2011-03-031-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126936 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: fix lint and compiler warningsChe-Liang Chiou2011-03-021-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126838 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 64-bit addressing to PTX backendChe-Liang Chiou2011-03-021-5/+6
| | | | | | | | | | | | - Add '64bit' sub-target option. - Select 32-bit/64-bit loads/stores based on '64bit' option. - Fix function parameter order. Patch by Justin Holewinski git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126837 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend initial support for primitive types in PTX backendChe-Liang Chiou2011-03-021-19/+45
| | | | | | | | | | | | | | | | - Allow i16, i32, i64, float, and double types, using the native .u16, .u32, .u64, .f32, and .f64 PTX types. - Allow loading/storing of all primitive types. - Allow primitive types to be passed as parameters. - Allow selection of PTX Version and Shader Model as sub-target attributes. - Merge integer/floating-point test cases for load/store. - Use .u32 instead of .s32 to conform to output from NVidia nvcc compiler. Patch by Justin Holewinski git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126824 91177308-0d34-0410-b5e6-96231b3b80d8
* Add preliminary support for .f32 in the PTX backend.Che-Liang Chiou2011-02-281-2/+27
| | | | | | | | | | | | | | - Add appropriate TableGen patterns for fadd, fsub, fmul. - Add .f32 as the PTX type for the LLVM float type. - Allow parameters, return values, and global variable declarations to accept the float type. - Add appropriate test cases. Patch by Justin Holewinski git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126636 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add passing parameter to kernel functionsChe-Liang Chiou2011-02-101-3/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125279 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add state spacesChe-Liang Chiou2010-12-301-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122638 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add ld instruction and testChe-Liang Chiou2010-12-221-4/+99
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122398 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: bug fix: use after freeChe-Liang Chiou2010-12-011-7/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120571 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add command-line options for gpu target and ptx versionChe-Liang Chiou2010-11-301-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120423 91177308-0d34-0410-b5e6-96231b3b80d8
* ptx: add ld instructionChe-Liang Chiou2010-11-301-9/+21
| | | | | | | | | | support register and register-immediate addressing mode todo: immediate and register-register addressing mode git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120407 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simple arithmetics and %type directive for PTXChe-Liang Chiou2010-11-171-8/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119485 91177308-0d34-0410-b5e6-96231b3b80d8
* move all the target's asmprinters into the main target. The piece Chris Lattner2010-11-141-0/+190
that should be split out is the InstPrinter (if a target is mc'ized). This change makes all the targets be consistent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119056 91177308-0d34-0410-b5e6-96231b3b80d8