[LLVMbugs] [Bug 1297] NEW: Support Overloaded Intrinsic Functions

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Mar 30 19:40:00 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1297

           Summary: Support Overloaded Intrinsic Functions
           Product: tools
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: TableGen
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rspencer at x10sys.com


With there now being up to 8 million integer types, we need the ability to
overload intrinsic functions by the type of their arguments. To this end, this
PR tracks work that I'm doing to:

1. Create a new MVT::ValueType, iAny which is a place holder for an integer type
   of any bit width
2. Use iAny in the definition of "llvm_int_ty" in Intrinsics.td
3. Use llvm_int_ty in the definition of overloaded intrinsics that work on a 
   variety of integer bit widths. For example llvm.ctpop will now work on any
   integer bit width.
4. Convert existing intrinsics that should be overloaded to use the overloading
   mechanisms (bswap, ctpop, cttz, ctlz).
5. Enhance TableGen to deal with all of the above, especially the generation of
   the recognizers where only the prefix should be matched for overloaded
   intrinsics.
6. Implement new intrinsics to support bit manipulation of integer types:
     bit_select (select one bit from many) 
     bit_set (set a bit in an integer of arbitrary width)
     bit_part_set (set a range of bits in an arbitrary integer)
     bit_part_select (select a set of bits from an integer type)
     bit_concat (concat two integer values of arbitrary width)
     bit_and_reduce (reduce an iAny to i1 by applying AND bitwise)
     bit_or_reduce (reduce an iAny to i1 by applying OR bitwise)
     bit_xor_reduce (reduce an iAny to i1 by applying XOR bitwise)
     bit_nand_reduce (reduce an iAny to i1 by applying NAND bitwise)
     bit_nor_reduce (reduce an iAny to i1 by applying NOR bitwise)
     bit_nxor_reduce (reduce an iAny to i1 by applying NXOR bitwise)
7. Make the Verifier check the names of overloaded intrinsics to ensure that
   the suffix is of the correct form (. followed by the actual type for each
   iAny type).
8. Implement lowering of the overloaded intrinsics so that they can be executed
   regardless of whether a target supports lowering them itself (to an
   instruction).  Targets (and CBE and LLI) can decide which of these intrinsics
   they wish to support directly. The others will be lowered to internal 
   functions of a similar name (. -> _) with bodies defined in LLVM IR. These
   function bodies would then need to be code generated. Only those overloadings
   actually used (called) will be generated.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list