OSDN Git Service

Remove as sg.exe is not a open source product.
[nxt-jsp/etrobo-atk.git] / lejos_osek / lejos_nxj / src / nxtvm / javavm / op_conversions.hc
1 /**
2  * This is included inside a switch statement.
3  */
4
5 case OP_I2B:
6   just_set_top_word ((JBYTE) word2jint(get_top_word()));
7   goto LABEL_ENGINELOOP;
8 case OP_I2S:
9 case OP_I2C:
10   just_set_top_word ((JSHORT) word2jint(get_top_word()));
11   goto LABEL_ENGINELOOP;   
12 case OP_F2D:
13   // Arguments: 0
14   // Stack: -1 +2
15   // Temporary is necessary because these are macros
16   tempStackWord = get_top_word();
17   push_word (tempStackWord);
18   goto LABEL_ENGINELOOP;
19 case OP_D2F:
20 case OP_L2I:
21   // Arguments: 0
22   // Stack: -2 +1
23   // Temporary is necessary because mixing macros is bad!
24   tempStackWord = pop_word();
25   just_set_top_word (tempStackWord);
26   goto LABEL_ENGINELOOP;
27 case OP_I2L:
28   tempStackWord = get_top_word();
29   just_set_top_word (0);
30   push_word (tempStackWord);
31   goto LABEL_ENGINELOOP;
32
33 #if FP_ARITHMETIC
34
35 case OP_I2F:
36   // Arguments: 0
37   // Stack: -1 +1
38   just_set_top_word (jfloat2word ((JFLOAT) word2jint(get_top_word())));
39   goto LABEL_ENGINELOOP;
40 case OP_I2D:
41   // Arguments: 0
42   // Stack: -1 +2
43   push_word (jfloat2word ((JFLOAT) word2jint(get_top_word())));
44   goto LABEL_ENGINELOOP;
45 case OP_F2I:
46   // Arguments: 0
47   // Stack: -1 +1
48   just_set_top_word ((JINT) word2jfloat(get_top_word()));
49   goto LABEL_ENGINELOOP;
50 case OP_D2I:
51   // Arguments: 0
52   // Stack: -2 +1  
53   // Temporary is necessary because mixing macros is bad!
54   tempStackWord = (JINT) word2jfloat (pop_word());
55   just_set_top_word (tempStackWord);
56   goto LABEL_ENGINELOOP;
57 case OP_L2F:
58   tempStackWord = pop_word();
59   just_set_top_word (jfloat2word ((JFLOAT) tempStackWord));
60   goto LABEL_ENGINELOOP;
61 case OP_L2D:
62   just_set_top_word (jfloat2word ((JFLOAT) get_top_word()));
63   goto LABEL_ENGINELOOP;
64 case OP_F2L:
65   tempStackWord = get_top_word();
66   just_set_top_word (0);
67   push_word ((JINT) word2jfloat(tempStackWord));
68   goto LABEL_ENGINELOOP;
69 case OP_D2L:
70   tempStackWord = pop_word();
71   just_set_top_word (0);
72   push_word ((JINT) word2jfloat(tempStackWord));
73   goto LABEL_ENGINELOOP;
74
75 #endif
76
77 /*end*/
78
79