[PATCH] Fix v*i1 store size

Hal Finkel hfinkel at anl.gov
Tue Jan 29 15:18:01 PST 2013


----- Original Message -----
> From: "Nadav Rotem" <nrotem at apple.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "CVS Commit Messages for LLVM repository" <llvm-commits at cs.uiuc.edu>
> Sent: Tuesday, January 29, 2013 4:56:09 PM
> Subject: Re: [PATCH]  Fix v*i1 store size
> 
> Hi Hal,
> 
> I am not sure that this is the right approach. The type '<Y x i1>'
> may be legal (it is legal on Intel's MIC, and possibly other
> targets) and in these targets the mask can be saved into memory in
> the packed form.
> 
> As you know at the moment we can't save <Y x i1> to memory. I think
> that the right way to handle this is to always pack and unpack the
> bits when reading/writing memory.  So, v4i1 would take 1 byte (mask
> in the lowest 4 bits).

I don't at all disagree with you; but this change is simply to reflect the current state of affairs. Currently, if you run:
@X = global <4 x i1> <i1 0, i1 1, i1 2, i1 3>

through llc (for x86_64 or anything else), you'll get something which looks like:
X:
	.byte	0                       # 0x0
	.byte	1                       # 0x1
	.byte	0                       # 0x0
	.byte	1                       # 0x1
	.size	X, 4

if we want to change the way this is done (so that these are stored in packed form), then we'd need to change the behavior of currently-existing infrastructure logic. Unless you'd like to do that now, I think that we might as well make the existing setup self consistent.

Thanks again,
Hal

> 
> Thanks,
> Nadav
> 
> 
> 
> On Jan 29, 2013, at 2:06 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> 
> > Hello,
> > 
> > Please review the attached patch which fixes the storage size (in
> > bytes) reported by DataLayout and MVT/EVT for v*i1 vectors. The
> > current (incorrect) behavior is to round the total size in bits up
> > and divide by 8. Instead, each element is stored in a separate
> > byte, and so the result should be equal to the number of elements
> > in the vector.
> > 
> > Thanks again,
> > Hal
> > 
> > --
> > Hal Finkel
> > Postdoctoral Appointee
> > Leadership Computing Facility
> > Argonne National Laboratory
> > <i1vstoresize.patch>_______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 



More information about the llvm-commits mailing list