Question about Floating-point operations base SH4 JIT

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Floating-point operations base SH4 JIT

felixs

Hi,

I have test with follow case, and cann't get correct reslut. I find that Floating-point operations  is error, and I don't know where shold start to fixed this question. so if anybody can give some information for which function i should to check. 

Any help explaining this would be much appreciated!

My Compiler: MSVS

ARCH: SH4

Feature: JIT


Javascript code of test case

function jitTestCode() {

  var tmp = -1*0;

  debug("tmp:" + tmp); 

  var result = tmp + 1;

  debug("The result should be 1,result:" + result);   //print

  var item1 =  result - 1;

  debug("The item1 should be 0,item1:" + item1); //print

  var item2 =  result - 2;

  debug("The item2 should be -1,item2:" + item2); //print

}

 

And the log information are:

[CONSOLE-DEBUG]Message is :'tmp:0'

[CONSOLE-DEBUG]Message is :'The result should be 1,result:0.0078125'

[CONSOLE-DEBUG]Message is :'The item1 should be 0,item1:0'

[CONSOLE-DEBUG]Message is :'The item2 should be -1,item2:-0.0078125'


--
BGs/Felix Shi





_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about Floating-point operations base SH4 JIT

Filip Pizlo
What is the endianness of your platform?  I think that the big endian code in JavaScriptCore may have rotted.

This smells to me like the tag and payload getting flipped around, which might happen if there are parts of the code that are assuming little endian and your hardware is big endian.

-F



On Aug 1, 2012, at 11:47 PM, [hidden email] wrote:

Hi,

I have test with follow case, and cann't get correct reslut. I find that Floating-point operations  is error, and I don't know where shold start to fixed this question. so if anybody can give some information for which function i should to check. 


Any help explaining this would be much appreciated!


My Compiler: MSVS

ARCH: SH4

Feature: JIT



Javascript code of test case

function jitTestCode() {

  var tmp = -1*0;

  debug("tmp:" + tmp); 

  var result = tmp + 1;

  debug("The result should be 1,result:" + result);   //print

  var item1 =  result - 1;

  debug("The item1 should be 0,item1:" + item1); //print

  var item2 =  result - 2;

  debug("The item2 should be -1,item2:" + item2); //print

}

 

And the log information are:

[CONSOLE-DEBUG]Message is :'tmp:0'

[CONSOLE-DEBUG]Message is :'The result should be 1,result:0.0078125'

[CONSOLE-DEBUG]Message is :'The item1 should be 0,item1:0'

[CONSOLE-DEBUG]Message is :'The item2 should be -1,item2:-0.0078125'


--
BGs/Felix Shi




_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev


_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about Floating-point operations base SH4 JIT

felixs
My platform use the  little-endian.   

--
BGs/Felix Shi

At 2012-08-02 14:51:48,"Filip Pizlo" <[hidden email]> wrote:
What is the endianness of your platform?  I think that the big endian code in JavaScriptCore may have rotted.

This smells to me like the tag and payload getting flipped around, which might happen if there are parts of the code that are assuming little endian and your hardware is big endian.

-F



On Aug 1, 2012, at 11:47 PM, [hidden email] wrote:

Hi,

I have test with follow case, and cann't get correct reslut. I find that Floating-point operations  is error, and I don't know where shold start to fixed this question. so if anybody can give some information for which function i should to check. 


Any help explaining this would be much appreciated!


My Compiler: MSVS

ARCH: SH4

Feature: JIT



Javascript code of test case

function jitTestCode() {

  var tmp = -1*0;

  debug("tmp:" + tmp); 

  var result = tmp + 1;

  debug("The result should be 1,result:" + result);   //print

  var item1 =  result - 1;

  debug("The item1 should be 0,item1:" + item1); //print

  var item2 =  result - 2;

  debug("The item2 should be -1,item2:" + item2); //print

}

 

And the log information are:

[CONSOLE-DEBUG]Message is :'tmp:0'

[CONSOLE-DEBUG]Message is :'The result should be 1,result:0.0078125'

[CONSOLE-DEBUG]Message is :'The item1 should be 0,item1:0'

[CONSOLE-DEBUG]Message is :'The item2 should be -1,item2:-0.0078125'


--
BGs/Felix Shi




_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev




_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about Floating-point operations base SH4 JIT

Filip Pizlo
In reply to this post by Filip Pizlo
I would still suggest you look at the tag/payload ordering.  If it's flipped, you'll see this error.

Try using the describe() function in jsc in addition to using print().  That will do a dump of the internal structure of the JSValue.  If it's flipped, then you'll know where to look.

-F


On Aug 2, 2012, at 12:00 AM, 石梦军 <[hidden email]> wrote:

My platform use the  little-endian.  
 
--
BGs/Felix Shi

At 2012-08-02 14:51:48,"Filip Pizlo" <[hidden email]> wrote:
What is the endianness of your platform?  I think that the big endian code in JavaScriptCore may have rotted.

This smells to me like the tag and payload getting flipped around, which might happen if there are parts of the code that are assuming little endian and your hardware is big endian.

-F



On Aug 1, 2012, at 11:47 PM, [hidden email] wrote:

Hi,

I have test with follow case, and cann't get correct reslut. I find that Floating-point operations  is error, and I don't know where shold start to fixed this question. so if anybody can give some information for which function i should to check. 


Any help explaining this would be much appreciated!


My Compiler: MSVS

ARCH: SH4

Feature: JIT



Javascript code of test case

function jitTestCode() {

  var tmp = -1*0;

  debug("tmp:" + tmp); 

  var result = tmp + 1;

  debug("The result should be 1,result:" + result);   //print

  var item1 =  result - 1;

  debug("The item1 should be 0,item1:" + item1); //print

  var item2 =  result - 2;

  debug("The item2 should be -1,item2:" + item2); //print

}

 

And the log information are:

[CONSOLE-DEBUG]Message is :'tmp:0'

[CONSOLE-DEBUG]Message is :'The result should be 1,result:0.0078125'

[CONSOLE-DEBUG]Message is :'The item1 should be 0,item1:0'

[CONSOLE-DEBUG]Message is :'The item2 should be -1,item2:-0.0078125'


--
BGs/Felix Shi




_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev





_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about Floating-point operations base SH4 JIT

felixs
Firstly, Thanks for your help.
I find that  describe() function  was call only in the Interpreter::dumpRegisters function, and dumpCallFrame will call the  dumpRegisters , but i cann't find the place that call the  dumpCallFrame .

--
BGs/Felix Shi

At 2012-08-02 15:06:38,"Filip Pizlo" <[hidden email]> wrote:
I would still suggest you look at the tag/payload ordering.  If it's flipped, you'll see this error.

Try using the describe() function in jsc in addition to using print().  That will do a dump of the internal structure of the JSValue.  If it's flipped, then you'll know where to look.

-F


On Aug 2, 2012, at 12:00 AM, 石梦军 <[hidden email]> wrote:

My platform use the  little-endian.  
 
--
BGs/Felix Shi

At 2012-08-02 14:51:48,"Filip Pizlo" <[hidden email]> wrote:
What is the endianness of your platform?  I think that the big endian code in JavaScriptCore may have rotted.

This smells to me like the tag and payload getting flipped around, which might happen if there are parts of the code that are assuming little endian and your hardware is big endian.

-F



On Aug 1, 2012, at 11:47 PM, [hidden email] wrote:

Hi,

I have test with follow case, and cann't get correct reslut. I find that Floating-point operations  is error, and I don't know where shold start to fixed this question. so if anybody can give some information for which function i should to check. 


Any help explaining this would be much appreciated!


My Compiler: MSVS

ARCH: SH4

Feature: JIT



Javascript code of test case

function jitTestCode() {

  var tmp = -1*0;

  debug("tmp:" + tmp); 

  var result = tmp + 1;

  debug("The result should be 1,result:" + result);   //print

  var item1 =  result - 1;

  debug("The item1 should be 0,item1:" + item1); //print

  var item2 =  result - 2;

  debug("The item2 should be -1,item2:" + item2); //print

}

 

And the log information are:

[CONSOLE-DEBUG]Message is :'tmp:0'

[CONSOLE-DEBUG]Message is :'The result should be 1,result:0.0078125'

[CONSOLE-DEBUG]Message is :'The item1 should be 0,item1:0'

[CONSOLE-DEBUG]Message is :'The item2 should be -1,item2:-0.0078125'


--
BGs/Felix Shi




_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev







_______________________________________________
webkit-dev mailing list
[hidden email]
http://lists.webkit.org/mailman/listinfo/webkit-dev