Re: sparse-llvm op_fpcast implementation missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 12, 2017 at 12:04:43PM +0000, Dibyendu Majumdar wrote:
> On 12 March 2017 at 00:01, Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
> > On Sat, Mar 11, 2017 at 11:53:53PM +0000, Dibyendu Majumdar wrote:
> >> Following test fails:
> >>
> >> int main(void)
> >> {
> >>  float f = 'a';
> >>  float g = 97;
> >>  printf("%f %f\n", f, g);
> >>  return 0;
> >> }
> >
> > Just for info, there is a lot of things missing or incorrect with
> > floating-points and I'm not speaking of the llvm part but of
> > sparse itself.
> >
> > I have some test cases somewhere in one of my topic branches
> > but this is very very low priority to me.
> >
> 
> Ok no problem. I have tried to add partial support for FPCAST and
> SETVAL in my project. Here is the commit:
> 
> https://github.com/dibyendumajumdar/dmr_c/commit/b95d54c9555ccf9e230edea5c1a3701172b7b1e2
> 
> Please let me know if this looks reasonable.

The idea is there, yes.
I just saw two minor things for OP_FPCAST:
- you consider all intergers as signed / there is no support for 
  unsigned integer to float (LLVMUIToFP I suppose).
- you're making the assumption sizeof(float) == 32, sizeof(double) == 64
  while these things are defined by the data layout

-- Luc Van Oostenryck
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux