Gregory Junker wrote:>>> -----Original Message----- >>> From: Rotem, Nadav [mailto:nadav.rotem at intel.com] >>> Sent: Saturday, July 30, 2011 6:51 AM >>> To: Gregory Junker >>> Subject: RE: [LLVMdev] "Cannot select" error in 2.9 >>> >>> Can you reduce the test with bug-point ? Does it work on ToT ? >> >> Hi Nadav >> >> I'm not sure what those are -- can you clarify? >> > > OK bugpoint was simple enough to figure out -- it tells me > > > bugpoint: test.ll:2:12: error: invalid operand type for instruction > > %1 = add double %f0, %f1 > > > That doesn't make a lot of sense to me -- LLVM can't add doubles?No, LLVM can't, but it can fadd them. ;) "add" only accepts integers and vectors of integers, "fadd" accepts floats and vectors of floats. See their entries in the language reference: add: http://llvm.org/docs/LangRef.html#i_add fadd: http://llvm.org/docs/LangRef.html#i_fadd The split is intended to let us add additional properties to integer adds (like the nuw/nsw bits documented) that don't apply to floats, and properties to floats (rounding modes) that don't apply to ints. Nick For> completeness, the original assembly dump: > > define double @0(double %f0, double %f1, double %f2, double %f3, double %f4, > double %f5, double %f6, double %f7, double %f8, double %f9) { > %1 = add double %f0, %f1 > %2 = add double %1, %f2 > %3 = add double %2, %f3 > %4 = add double %3, %f4 > %5 = add double %4, %f5 > %6 = add double %5, %f6 > %7 = add double %6, %f7 > %8 = add double %7, %f8 > %9 = add double %8, %f9 > ret double %9 > } > > > Thanks > Greg > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
> -----Original Message----- > From: Nick Lewycky [mailto:nicholas at mxc.ca] > Sent: Saturday, July 30, 2011 2:36 PM > To: Gregory Junker > Cc: 'Rotem, Nadav'; llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] "Cannot select" error in 2.9 > > Gregory Junker wrote: > >>> -----Original Message----- > >>> From: Rotem, Nadav [mailto:nadav.rotem at intel.com] > >>> Sent: Saturday, July 30, 2011 6:51 AM > >>> To: Gregory Junker > >>> Subject: RE: [LLVMdev] "Cannot select" error in 2.9 > >>> > >>> Can you reduce the test with bug-point ? Does it work on ToT ? > >> > >> Hi Nadav > >> > >> I'm not sure what those are -- can you clarify? > >> > > > > OK bugpoint was simple enough to figure out -- it tells me > > > > > > bugpoint: test.ll:2:12: error: invalid operand type for instruction > > > > %1 = add double %f0, %f1 > > > > > > That doesn't make a lot of sense to me -- LLVM can't add doubles? > > No, LLVM can't, but it can fadd them. ;) "add" only accepts integers > and > vectors of integers, "fadd" accepts floats and vectors of floats. See > their entries in the language reference: > > add: http://llvm.org/docs/LangRef.html#i_add > fadd: http://llvm.org/docs/LangRef.html#i_fadd > > The split is intended to let us add additional properties to integer > adds (like the nuw/nsw bits documented) that don't apply to floats, and > properties to floats (rounding modes) that don't apply to ints.Ah interesting -- this was introduced in 2.9 then? Easy enough for me to fix this in my code. Out of curiosity, was this documented anywhere? I ask because I looked through release notes and either missed this or didn't see it, and I'd like to find out what else changed so I can make the necessary adjustments in my code. Thanks! Greg
> -----Original Message----- > From: Nick Lewycky [mailto:nicholas at mxc.ca] > Sent: Saturday, July 30, 2011 2:36 PM > To: Gregory Junker > Cc: 'Rotem, Nadav'; llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] "Cannot select" error in 2.9 > > Gregory Junker wrote: > >>> -----Original Message----- > >>> From: Rotem, Nadav [mailto:nadav.rotem at intel.com] > >>> Sent: Saturday, July 30, 2011 6:51 AM > >>> To: Gregory Junker > >>> Subject: RE: [LLVMdev] "Cannot select" error in 2.9 > >>> > >>> Can you reduce the test with bug-point ? Does it work on ToT ? > >> > >> Hi Nadav > >> > >> I'm not sure what those are -- can you clarify? > >> > > > > OK bugpoint was simple enough to figure out -- it tells me > > > > > > bugpoint: test.ll:2:12: error: invalid operand type for instruction > > > > %1 = add double %f0, %f1 > > > > > > That doesn't make a lot of sense to me -- LLVM can't add doubles? > > No, LLVM can't, but it can fadd them. ;) "add" only accepts integers > and > vectors of integers, "fadd" accepts floats and vectors of floats. See > their entries in the language reference: > > add: http://llvm.org/docs/LangRef.html#i_add > fadd: http://llvm.org/docs/LangRef.html#i_fadd > > The split is intended to let us add additional properties to integer > adds (like the nuw/nsw bits documented) that don't apply to floats, and > properties to floats (rounding modes) that don't apply to ints. > > NickYup, that sorted it for me -- thanks Nick and Nadav for pointing me in the right direction! Greg
On 30 July 2011 23:39, Gregory Junker <gjunker at dayark.com> wrote:>> From: Nick Lewycky [mailto:nicholas at mxc.ca][snip]>> Gregory Junker wrote: >> > That doesn't make a lot of sense to me -- LLVM can't add doubles? >> >> No, LLVM can't, but it can fadd them. ;) "add" only accepts integers >> and >> vectors of integers, "fadd" accepts floats and vectors of floats. See >> their entries in the language reference:[snip]> > Ah interesting -- this was introduced in 2.9 then? Easy enough for me to fix > this in my code. > > Out of curiosity, was this documented anywhere? I ask because I looked > through release notes and either missed this or didn't see it, and I'd like > to find out what else changed so I can make the necessary adjustments in my > code.Actually, it was new in *2.6*, which was released almost two years ago. It's documented here: <http://llvm.org/releases/2.6/docs/ReleaseNotes.html#coreimprovements>.