Revision 5fafdf24 target-arm/nwfpe/fpa11_cpdo.c

b/target-arm/nwfpe/fpa11_cpdo.c
30 30
{
31 31
   FPA11 *fpa11 = GET_FPA11();
32 32
   unsigned int Fd, nType, nDest, nRc = 1;
33
   
33
  
34 34
   //printk("EmulateCPDO(0x%08x)\n",opcode);
35 35

  
36 36
   /* Get the destination size.  If not valid let Linux perform
37 37
      an invalid instruction trap. */
38 38
   nDest = getDestinationSize(opcode);
39 39
   if (typeNone == nDest) return 0;
40
   
40
  
41 41
   SetRoundingMode(opcode);
42
     
42
    
43 43
   /* Compare the size of the operands in Fn and Fm.
44 44
      Choose the largest size and perform operations in that size,
45
      in order to make use of all the precision of the operands. 
46
      If Fm is a constant, we just grab a constant of a size 
45
      in order to make use of all the precision of the operands.
46
      If Fm is a constant, we just grab a constant of a size
47 47
      matching the size of the operand in Fn. */
48 48
   if (MONADIC_INSTRUCTION(opcode))
49 49
     nType = nDest;
50 50
   else
51 51
     nType = fpa11->fType[getFn(opcode)];
52
   
52
  
53 53
   if (!CONSTANT_FM(opcode))
54 54
   {
55 55
     register unsigned int Fm = getFm(opcode);
......
79 79
       case typeSingle:
80 80
       {
81 81
         if (typeDouble == nType)
82
           fpa11->fpreg[Fd].fSingle = 
82
           fpa11->fpreg[Fd].fSingle =
83 83
              float64_to_float32(fpa11->fpreg[Fd].fDouble, &fpa11->fp_status);
84 84
         else
85
           fpa11->fpreg[Fd].fSingle = 
85
           fpa11->fpreg[Fd].fSingle =
86 86
              floatx80_to_float32(fpa11->fpreg[Fd].fExtended, &fpa11->fp_status);
87 87
       }
88 88
       break;
89
          
89
         
90 90
       case typeDouble:
91 91
       {
92 92
         if (typeSingle == nType)
93
           fpa11->fpreg[Fd].fDouble = 
93
           fpa11->fpreg[Fd].fDouble =
94 94
              float32_to_float64(fpa11->fpreg[Fd].fSingle, &fpa11->fp_status);
95 95
         else
96
           fpa11->fpreg[Fd].fDouble = 
96
           fpa11->fpreg[Fd].fDouble =
97 97
              floatx80_to_float64(fpa11->fpreg[Fd].fExtended, &fpa11->fp_status);
98 98
       }
99 99
       break;
100
          
100
         
101 101
       case typeExtended:
102 102
       {
103 103
         if (typeSingle == nType)
104
           fpa11->fpreg[Fd].fExtended = 
104
           fpa11->fpreg[Fd].fExtended =
105 105
              float32_to_floatx80(fpa11->fpreg[Fd].fSingle, &fpa11->fp_status);
106 106
         else
107
           fpa11->fpreg[Fd].fExtended = 
107
           fpa11->fpreg[Fd].fExtended =
108 108
              float64_to_floatx80(fpa11->fpreg[Fd].fDouble, &fpa11->fp_status);
109 109
       }
110 110
       break;
111 111
     }
112
     
112
    
113 113
     fpa11->fType[Fd] = nDest;
114 114
   }
115
   
115
  
116 116
   return nRc;
117 117
}

Also available in: Unified diff