[LLVMdev] a possible alternative for pre-legalize extended ValueTypes

Christopher Lamb christopher.lamb at gmail.com
Fri Jun 22 11:57:27 PDT 2007


On Jun 22, 2007, at 11:06 AM, Dan Gohman wrote:

> After doing a bunch of work for moving pre-legalize extended  
> ValueTypes
> into a table in SelectionDAG, I may have just found a simpler  
> approach.
>
> There are under 32 simple ValueType values, so we only really need  
> 5 bits
> to represent those. ValueType is already a 32-bit type on most  
> hosts; what
> if we make use of the remaining 27 bits instead of using an external
> table?
>
> If we can assume that vector lengths will always be a fixed  
> multiple of 2,
> we can encode vector lengths for extended vector types as the log2  
> of the
> length, biased by one. Using only 6 bits gets us vector lengths up to
> (2**64)-2, which Ought To Be Enough For Anyone.

Yerk! This would throw a serious wrench in supporting non power of  
two vector lengths, which is needed by us. We needed to add v3f32 and  
v3i32 ValueTypes just to define our register file in the .td.

--
Christopher Lamb



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070622/f3ce0d40/attachment.html>


More information about the llvm-dev mailing list