This function converts a type according to result type of binary operation between types 'first' and 'second' For example, int * double = double, so first operand will be transformed to double double * int = double, no transformations
| 23 | //For example, int * double = double, so first operand will be transformed to double |
| 24 | // double * int = double, no transformations |
| 25 | asmStackType ConvertFirstForSecond(asmStackType first, asmStackType second) |
| 26 | { |
| 27 | if(first == STYPE_INT && second == STYPE_DOUBLE) |
| 28 | { |
| 29 | cmdList.push_back(VMCmd(cmdItoD)); |
| 30 | return second; |
| 31 | } |
| 32 | if(first == STYPE_LONG && second == STYPE_DOUBLE) |
| 33 | { |
| 34 | cmdList.push_back(VMCmd(cmdLtoD)); |
| 35 | return second; |
| 36 | } |
| 37 | if(first == STYPE_INT && second == STYPE_LONG) |
| 38 | { |
| 39 | cmdList.push_back(VMCmd(cmdItoL)); |
| 40 | return second; |
| 41 | } |
| 42 | return first; |
| 43 | } |
| 44 | |
| 45 | //This functions transforms first type to second one |
| 46 | void ConvertFirstToSecond(asmStackType first, asmStackType second) |