122d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch   /* Copyright (C) 2008 The Android Open Source Project
222d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
322d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * Licensed under the Apache License, Version 2.0 (the "License");
422d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * you may not use this file except in compliance with the License.
522d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * You may obtain a copy of the License at
622d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
722d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * http://www.apache.org/licenses/LICENSE-2.0
822d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
922d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * Unless required by applicable law or agreed to in writing, software
1022d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * distributed under the License is distributed on an "AS IS" BASIS,
1122d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1222d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * See the License for the specific language governing permissions and
1322d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * limitations under the License.
1422d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    */
1522d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch
1622d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch   /*
1722d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * File: OP_INT_TO_FLOAT.S
1822d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
1922d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * Code: Convert an int to a float. Uses no substitutions.
2022d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
2122d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * For: int-to-float
2222d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
2322d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * Description: Convert an int in the source register, to a float, and
2422d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *              stores the result in the destintation register. vA<- (float) vB
2522d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
2622d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * Format: B|A|op (12x)
2722d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    *
2822d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    * Syntax: op vA, vB
2922d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    */
3022d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch
3122d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    movl        rINST, %eax             # %eax<- BA+
3222d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    shr         $$4, %eax               # %eax<- B
3322d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    andl        $$15,  rINST            # rINST<- A
3422d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    cvtsi2ss    (rFP,%eax,4), %xmm0     # %xmm0<- vB
3522d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    movss       %xmm0, (rFP, rINST, 4)  # vA<- %xmm0
3622d404a75a00cda0b0ebed1034c2808ba060b05fJohnnie Birch    FINISH      1                       # jump to next instruction
37