linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sparse-llvm op_fpcast implementation missing
@ 2017-03-11 23:53 Dibyendu Majumdar
  2017-03-12  0:01 ` Luc Van Oostenryck
  0 siblings, 1 reply; 4+ messages in thread
From: Dibyendu Majumdar @ 2017-03-11 23:53 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

Following test fails:

int main(void)
{
 float f = 'a';
 float g = 97;
 printf("%f %f\n", f, g);
 return 0;
}


Regards
Dibyendu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sparse-llvm op_fpcast implementation missing
  2017-03-11 23:53 sparse-llvm op_fpcast implementation missing Dibyendu Majumdar
@ 2017-03-12  0:01 ` Luc Van Oostenryck
  2017-03-12 12:04   ` Dibyendu Majumdar
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Van Oostenryck @ 2017-03-12  0:01 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

On Sat, Mar 11, 2017 at 11:53:53PM +0000, Dibyendu Majumdar wrote:
> Hi,
> 
> 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.

-- Luc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sparse-llvm op_fpcast implementation missing
  2017-03-12  0:01 ` Luc Van Oostenryck
@ 2017-03-12 12:04   ` Dibyendu Majumdar
  2017-03-12 19:49     ` Luc Van Oostenryck
  0 siblings, 1 reply; 4+ messages in thread
From: Dibyendu Majumdar @ 2017-03-12 12:04 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Linux-Sparse

On 12 March 2017 at 00:01, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> 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.

Unfortunately due to my amended codebase I am not able to submit patches here.

Thanks and Regards
Dibyendu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sparse-llvm op_fpcast implementation missing
  2017-03-12 12:04   ` Dibyendu Majumdar
@ 2017-03-12 19:49     ` Luc Van Oostenryck
  0 siblings, 0 replies; 4+ messages in thread
From: Luc Van Oostenryck @ 2017-03-12 19:49 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

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@gmail.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-12 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-11 23:53 sparse-llvm op_fpcast implementation missing Dibyendu Majumdar
2017-03-12  0:01 ` Luc Van Oostenryck
2017-03-12 12:04   ` Dibyendu Majumdar
2017-03-12 19:49     ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).