Home | History | Annotate | Download | only in out
      1 /*
      2  * This file was generated automatically by gen-mterp.py for 'x86-atom'.
      3  *
      4  * --> DO NOT EDIT <--
      5  */
      6 
      7 /* File: x86-atom/header.S */
      8    /* Copyright (C) 2008 The Android Open Source Project
      9     *
     10     * Licensed under the Apache License, Version 2.0 (the "License");
     11     * you may not use this file except in compliance with the License.
     12     * You may obtain a copy of the License at
     13     *
     14     * http://www.apache.org/licenses/LICENSE-2.0
     15     *
     16     * Unless required by applicable law or agreed to in writing, software
     17     * distributed under the License is distributed on an "AS IS" BASIS,
     18     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     19     * See the License for the specific language governing permissions and
     20     * limitations under the License.
     21     */
     22 
     23    /*
     24     * File: header.S
     25     */
     26 
     27    /*
     28     * IA32 calling convention and general notes:
     29     *
     30     * EAX, ECX, EDX - general purpose scratch registers (caller-saved);
     31     *
     32     * The stack (%esp) - used to pass arguments to functions
     33     *
     34     * EAX - holds the first 4 bytes of a return
     35     * EDX - holds the second 4 bytes of a return
     36     *
     37     * EBX, ESI, EDI, EBP - are callee saved
     38     *
     39     * CS, DS, SS - are segment registers
     40     * ES, FS, GS - are segment registers. We will try to avoid using these registers
     41     *
     42     * The stack is "full descending". Only the arguments that do not fit    * in the first two arg registers are placed on the stack.
     43     * "%esp" points to the first stacked argument (i.e. the 3rd arg).
     44     */
     45 
     46    /*
     47     * Mterp and IA32 notes
     48     *
     49     * mem          nick      purpose
     50     * (%ebp)       rGLUE     InterpState base pointer (A.K.A. MterpGlue Pointer)
     51     * %esi         rPC       interpreted program counter, used for fetching
     52     *                        instructions
     53     * %ebx         rINST     first 16-bit code unit of current instruction
     54     * %edi         rFP       interpreted frame pointer, used for accessing
     55     *                        locals and args
     56     */
     57 
     58    /*
     59     * Includes
     60     */
     61 
     62 #include "../common/asm-constants.h"
     63 
     64    /*
     65     * Reserved registers
     66     */
     67 
     68 #define rGLUE  (%ebp)
     69 #define rINST   %ebx
     70 #define rINSTbl  %bl
     71 #define rINSTbh  %bh
     72 #define rINSTw  %bx
     73 #define rPC     %esi
     74 #define rFP     %edi
     75 
     76    /*
     77     * Temporary register used when finishing an opcode
     78     */
     79 
     80 #define rFinish %edx
     81 
     82    /*
     83     * Stack locations used for temporary data. For convenience.
     84     */
     85 
     86 #define sReg0    4(%ebp)
     87 #define sReg1    8(%ebp)
     88 #define sReg2   12(%ebp)
     89 #define sReg3   16(%ebp)
     90 
     91    /*
     92     * Save the PC and FP to the glue struct
     93     */
     94 
     95     .macro      SAVE_PC_FP_TO_GLUE _reg
     96     movl        rGLUE, \_reg
     97     movl        rPC, offGlue_pc(\_reg)
     98     movl        rFP, offGlue_fp(\_reg)
     99     .endm
    100 
    101    /*
    102     * Restore the PC and FP from the glue struct
    103     */
    104 
    105     .macro      LOAD_PC_FP_FROM_GLUE
    106     movl        rGLUE, rFP
    107     movl        offGlue_pc(rFP), rPC
    108     movl        offGlue_fp(rFP), rFP
    109     .endm
    110 
    111    /*
    112     * "Export" the PC to the stack frame, f/b/o future exception objects. This must
    113     * be done *before* something calls dvmThrowException.
    114     *
    115     * In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
    116     * fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
    117     *
    118     * It's okay to do this more than once.
    119     */
    120 
    121     .macro      EXPORT_PC
    122     movl        rPC, (-sizeofStackSaveArea + offStackSaveArea_currentPc)(rFP)
    123     .endm
    124 
    125    /*
    126     * Given a frame pointer, find the stack save area.
    127     * In C this is "((StackSaveArea*)(_fp) -1)".
    128     */
    129 
    130     .macro      SAVEAREA_FROM_FP  _reg
    131     lea         -sizeofStackSaveArea(rFP), \_reg
    132     .endm
    133 
    134    /*
    135     * Get the 32-bit value from a dalvik register.
    136     */
    137 
    138     .macro      GET_VREG _vreg
    139     movl        (rFP,\_vreg, 4), \_vreg
    140     .endm
    141 
    142    /*
    143     * Set the 32-bit value from a dalvik register.
    144     */
    145 
    146     .macro      SET_VREG _reg _vreg
    147     movl        \_reg, (rFP,\_vreg, 4)
    148     .endm
    149 
    150    /*
    151     * Fetch the next instruction from rPC into rINST. Does not advance rPC.
    152     */
    153 
    154     .macro      FETCH_INST
    155     movzwl      (rPC), rINST
    156     .endm
    157 
    158    /*
    159     * Fetch the next instruction from the specified offset. Advances rPC
    160     * to point to the next instruction. "_count" is in 16-bit code units.
    161     *
    162     * This must come AFTER anything that can throw an exception, or the
    163     * exception catch may miss. (This also implies that it must come after
    164     * EXPORT_PC())
    165     */
    166 
    167     .macro      FETCH_ADVANCE_INST _count
    168     add         $(\_count*2), rPC
    169     movzwl      (rPC), rINST
    170     .endm
    171 
    172    /*
    173     * Fetch the next instruction from an offset specified by _reg. Updates
    174     * rPC to point to the next instruction. "_reg" must specify the distance
    175     * in bytes, *not* 16-bit code units, and may be a signed value.
    176     */
    177 
    178     .macro      FETCH_ADVANCE_INST_RB _reg
    179     addl        \_reg, rPC
    180     movzwl      (rPC), rINST
    181     .endm
    182 
    183    /*
    184     * Fetch a half-word code unit from an offset past the current PC. The
    185     * "_count" value is in 16-bit code units. Does not advance rPC.
    186     * For example, given instruction of format: AA|op BBBB, it
    187     * fetches BBBB.
    188     */
    189 
    190     .macro      FETCH _count _reg
    191     movzwl      (\_count*2)(rPC), \_reg
    192     .endm
    193 
    194    /*
    195     * Fetch a half-word code unit from an offset past the current PC. The
    196     * "_count" value is in 16-bit code units. Does not advance rPC.
    197     * This variant treats the value as signed.
    198     */
    199 
    200     .macro      FETCHs _count _reg
    201     movswl      (\_count*2)(rPC), \_reg
    202     .endm
    203 
    204    /*
    205     * Fetch the first byte from an offset past the current PC. The
    206     * "_count" value is in 16-bit code units. Does not advance rPC.
    207     * For example, given instruction of format: AA|op CC|BB, it
    208     * fetches BB.
    209     */
    210 
    211     .macro      FETCH_BB _count _reg
    212     movzbl      (\_count*2)(rPC), \_reg
    213     .endm
    214 
    215     /*
    216     * Fetch the second byte from an offset past the current PC. The
    217     * "_count" value is in 16-bit code units. Does not advance rPC.
    218     * For example, given instruction of format: AA|op CC|BB, it
    219     * fetches CC.
    220     */
    221 
    222     .macro      FETCH_CC _count _reg
    223     movzbl      (\_count*2 + 1)(rPC), \_reg
    224     .endm
    225 
    226    /*
    227     * Fetch the second byte from an offset past the current PC. The
    228     * "_count" value is in 16-bit code units. Does not advance rPC.
    229     * This variant treats the value as signed.
    230     */
    231 
    232     .macro      FETCH_CCs _count _reg
    233     movsbl      (\_count*2 + 1)(rPC), \_reg
    234     .endm
    235 
    236 
    237    /*
    238     * Fetch one byte from an offset past the current PC.  Pass in the same
    239     * "_count" as you would for FETCH, and an additional 0/1 indicating which
    240     * byte of the halfword you want (lo/hi).
    241     */
    242 
    243     .macro      FETCH_B _reg  _count  _byte
    244     movzbl      (\_count*2+\_byte)(rPC), \_reg
    245     .endm
    246 
    247    /*
    248     * Put the instruction's opcode field into the specified register.
    249     */
    250 
    251     .macro      GET_INST_OPCODE _reg
    252     movzbl      rINSTbl, \_reg
    253     .endm
    254 
    255    /*
    256     * Begin executing the opcode in _reg.
    257     */
    258 
    259     .macro      GOTO_OPCODE _reg
    260     shl         $6, \_reg
    261     addl        $dvmAsmInstructionStart,\_reg
    262     jmp         *\_reg
    263     .endm
    264 
    265 
    266 
    267    /*
    268     * Macros pair attempts to speed up FETCH_INST, GET_INST_OPCODE and GOTO_OPCODE
    269     * by using a jump table. _rFinish should must be the same register for
    270     * both macros.
    271     */
    272 
    273     .macro      FFETCH _rFinish
    274     movzbl      (rPC), \_rFinish
    275     .endm
    276 
    277     .macro      FGETOP_JMPa _rFinish
    278     movzbl      1(rPC), rINST
    279     jmp         *dvmAsmInstructionJmpTable(,\_rFinish, 4)
    280     .endm
    281 
    282    /*
    283     * Macro pair attempts to speed up FETCH_INST, GET_INST_OPCODE and GOTO_OPCODE
    284     * by using a jump table. _rFinish and _count should must be the same register for
    285     * both macros.
    286     */
    287 
    288     .macro      FFETCH_ADV _count _rFinish
    289     movzbl      (\_count*2)(rPC), \_rFinish
    290     .endm
    291 
    292     .macro      FGETOP_JMP _count _rFinish
    293     movzbl      (\_count*2 + 1)(rPC), rINST
    294     addl        $(\_count*2), rPC
    295     jmp         *dvmAsmInstructionJmpTable(,\_rFinish, 4)
    296     .endm
    297 
    298    /*
    299     * Macro pair attempts to speed up FETCH_INST, GET_INST_OPCODE and GOTO_OPCODE
    300     * by using a jump table. _rFinish and _reg should must be the same register for
    301     * both macros.
    302     */
    303 
    304     .macro      FFETCH_ADV_RB _reg _rFinish
    305     movzbl      (\_reg, rPC), \_rFinish
    306     .endm
    307 
    308     .macro      FGETOP_RB_JMP _reg _rFinish
    309     movzbl      1(\_reg, rPC), rINST
    310     addl        \_reg, rPC
    311     jmp         *dvmAsmInstructionJmpTable(,\_rFinish, 4)
    312     .endm
    313 
    314    /*
    315     * Attempts to speed up FETCH_INST, GET_INST_OPCODE using
    316     * a jump table. This macro should be called before FINISH_JMP where
    317     * rFinish should be the same register containing the opcode value.
    318     * This is an attempt to split up FINISH in order to reduce or remove
    319     * potential stalls due to the wait for rFINISH.
    320     */
    321 
    322     .macro      FINISH_FETCH _rFinish
    323     movzbl      (rPC), \_rFinish
    324     movzbl      1(rPC), rINST
    325     .endm
    326 
    327 
    328    /*
    329     * Attempts to speed up FETCH_ADVANCE_INST, GET_INST_OPCODE using
    330     * a jump table. This macro should be called before FINISH_JMP where
    331     * rFinish should be the same register containing the opcode value.
    332     * This is an attempt to split up FINISH in order to reduce or remove
    333     * potential stalls due to the wait for rFINISH.
    334     */
    335 
    336     .macro      FINISH_FETCH_ADVANCE _count _rFinish
    337     movzbl      (\_count*2)(rPC), \_rFinish
    338     movzbl      (\_count*2 + 1)(rPC), rINST
    339     addl        $(\_count*2), rPC
    340     .endm
    341 
    342    /*
    343     * Attempts to speed up FETCH_ADVANCE_INST_RB, GET_INST_OPCODE using
    344     * a jump table. This macro should be called before FINISH_JMP where
    345     * rFinish should be the same register containing the opcode value.
    346     * This is an attempt to split up FINISH in order to reduce or remove
    347     * potential stalls due to the wait for rFINISH.
    348     */
    349 
    350     .macro      FINISH_FETCH_ADVANCE_RB _reg _rFinish
    351     movzbl      (\_reg, rPC), \_rFinish
    352     movzbl      1(\_reg, rPC), rINST
    353     addl        \_reg, rPC
    354     .endm
    355 
    356    /*
    357     * Attempts to speed up GOTO_OPCODE using a jump table. This macro should
    358     * be called after a FINISH_FETCH* instruction where rFinish should be the
    359     * same register containing the opcode value. This is an attempt to split up
    360     * FINISH in order to reduce or remove potential stalls due to the wait for rFINISH.
    361     */
    362 
    363     .macro      FINISH_JMP _rFinish
    364     jmp         *dvmAsmInstructionJmpTable(,\_rFinish, 4)
    365     .endm
    366 
    367    /*
    368     * Attempts to speed up FETCH_INST, GET_INST_OPCODE, GOTO_OPCODE by using
    369     * a jump table. Uses a single macro - but it should be faster if we
    370     * split up the fetch for rFinish and the jump using rFinish.
    371     */
    372 
    373     .macro      FINISH_A
    374     movzbl      (rPC), rFinish
    375     movzbl      1(rPC), rINST
    376     jmp         *dvmAsmInstructionJmpTable(,rFinish, 4)
    377     .endm
    378 
    379    /*
    380     * Attempts to speed up FETCH_ADVANCE_INST, GET_INST_OPCODE,
    381     * GOTO_OPCODE by using a jump table. Uses a single macro -
    382     * but it should be faster if we split up the fetch for rFinish
    383     * and the jump using rFinish.
    384     */
    385 
    386     .macro      FINISH _count
    387     movzbl      (\_count*2)(rPC), rFinish
    388     movzbl      (\_count*2 + 1)(rPC), rINST
    389     addl        $(\_count*2), rPC
    390     jmp         *dvmAsmInstructionJmpTable(,rFinish, 4)
    391     .endm
    392 
    393    /*
    394     * Attempts to speed up FETCH_ADVANCE_INST_RB, GET_INST_OPCODE,
    395     * GOTO_OPCODE by using a jump table. Uses a single macro -
    396     * but it should be faster if we split up the fetch for rFinish
    397     * and the jump using rFinish.
    398     */
    399 
    400     .macro      FINISH_RB _reg _rFinish
    401     movzbl      (\_reg, rPC), \_rFinish
    402     movzbl      1(\_reg, rPC), rINST
    403     addl        \_reg, rPC
    404     jmp         *dvmAsmInstructionJmpTable(,\_rFinish, 4)
    405     .endm
    406 
    407    /*
    408     * Hard coded helper values.
    409     */
    410 
    411 .balign 16
    412 
    413 .LdoubNeg:
    414     .quad       0x8000000000000000
    415 
    416 .L64bits:
    417     .quad       0xFFFFFFFFFFFFFFFF
    418 
    419 .LshiftMask2:
    420     .quad       0x0000000000000000
    421 .LshiftMask:
    422     .quad       0x000000000000003F
    423 
    424 .Lvalue64:
    425     .quad       0x0000000000000040
    426 
    427 .LvaluePosInfLong:
    428     .quad       0x7FFFFFFFFFFFFFFF
    429 
    430 .LvalueNegInfLong:
    431     .quad       0x8000000000000000
    432 
    433 .LvalueNanLong:
    434     .quad       0x0000000000000000
    435 
    436 .LintMin:
    437 .long   0x80000000
    438 
    439 .LintMax:
    440 .long   0x7FFFFFFF
    441 
    442 
    443     .global dvmAsmInstructionStart
    444     .type   dvmAsmInstructionStart, %function
    445 dvmAsmInstructionStart = .L_OP_NOP
    446     .text
    447 
    448 /* ------------------------------ */
    449     .balign 64
    450 .L_OP_NOP: /* 0x00 */
    451 /* File: x86-atom/OP_NOP.S */
    452    /* Copyright (C) 2008 The Android Open Source Project
    453     *
    454     * Licensed under the Apache License, Version 2.0 (the "License");
    455     * you may not use this file except in compliance with the License.
    456     * You may obtain a copy of the License at
    457     *
    458     * http://www.apache.org/licenses/LICENSE-2.0
    459     *
    460     * Unless required by applicable law or agreed to in writing, software
    461     * distributed under the License is distributed on an "AS IS" BASIS,
    462     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    463     * See the License for the specific language governing permissions and
    464     * limitations under the License.
    465     */
    466 
    467    /*
    468     * File: OP_NOP.S
    469     *
    470     * Code: Use a cycle. Uses no substitutions.
    471     *
    472     * For: nop
    473     *
    474     * Description: No operation. Use a cycle
    475     *
    476     * Format: |op (10x)
    477     *
    478     * Syntax: op
    479     */
    480 
    481     FINISH      1                       # jump to next instruction
    482 
    483 #ifdef ASSIST_DEBUGGER
    484 
    485    /*
    486     * insert fake function header to help gdb find the stack frame
    487     */
    488 
    489     .type       dalvik_inst, %function
    490 dalvik_inst:
    491     MTERP_ENTRY
    492 #endif
    493 
    494 /* ------------------------------ */
    495     .balign 64
    496 .L_OP_MOVE: /* 0x01 */
    497 /* File: x86-atom/OP_MOVE.S */
    498    /* Copyright (C) 2008 The Android Open Source Project
    499     *
    500     * Licensed under the Apache License, Version 2.0 (the "License");
    501     * you may not use this file except in compliance with the License.
    502     * You may obtain a copy of the License at
    503     *
    504     * http://www.apache.org/licenses/LICENSE-2.0
    505     *
    506     * Unless required by applicable law or agreed to in writing, software
    507     * distributed under the License is distributed on an "AS IS" BASIS,
    508     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    509     * See the License for the specific language governing permissions and
    510     * limitations under the License.
    511     */
    512 
    513    /*
    514     * File: OP_MOVE.S
    515     *
    516     * Code: Copies contents from one register to another. Uses no
    517     *       substitutions.
    518     *
    519     * For: move, move-object, long-to-int
    520     *
    521     * Description: Copies contents from one non-object register to another.
    522     *              vA<- vB; fp[A]<- fp[B]
    523     *
    524     * Format: B|A|op (12x)
    525     *
    526     * Syntax: op vA, vB
    527     */
    528 
    529     movl        rINST, %ecx             # %ecx<- BA
    530     shr         $4, rINST              # rINST<- B
    531     and         $15, %ecx              # %ecx<- A
    532     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
    533     GET_VREG    rINST                   # rINST<- vB
    534     SET_VREG    rINST, %ecx             # vA<- vB; %edx
    535     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
    536 
    537 /* ------------------------------ */
    538     .balign 64
    539 .L_OP_MOVE_FROM16: /* 0x02 */
    540 /* File: x86-atom/OP_MOVE_FROM16.S */
    541    /* Copyright (C) 2008 The Android Open Source Project
    542     *
    543     * Licensed under the Apache License, Version 2.0 (the "License");
    544     * you may not use this file except in compliance with the License.
    545     * You may obtain a copy of the License at
    546     *
    547     * http://www.apache.org/licenses/LICENSE-2.0
    548     *
    549     * Unless required by applicable law or agreed to in writing, software
    550     * distributed under the License is distributed on an "AS IS" BASIS,
    551     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    552     * See the License for the specific language governing permissions and
    553     * limitations under the License.
    554     */
    555 
    556    /*
    557     * File: OP_MOVE_FROM16.S
    558     *
    559     * Code: Copies contents from one register to another
    560     *
    561     * For: move/from16, move-object/from16
    562     *
    563     * Description: Copies contents from one non-object register to another.
    564     *              vA<- vB; fp[A]<- fp[B]
    565     *
    566     * Format: AA|op BBBB (22x)
    567     *
    568     * Syntax: op vAA, vBBBB
    569     */
    570 
    571     FETCH       1, %edx                 # %edx<- BBBB
    572     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
    573     GET_VREG    %edx                    # %edx<- vB
    574     SET_VREG    %edx, rINST             # vA<- vB; %edx
    575     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
    576 
    577 /* ------------------------------ */
    578     .balign 64
    579 .L_OP_MOVE_16: /* 0x03 */
    580 /* File: x86-atom/OP_MOVE_16.S */
    581    /* Copyright (C) 2008 The Android Open Source Project
    582     *
    583     * Licensed under the Apache License, Version 2.0 (the "License");
    584     * you may not use this file except in compliance with the License.
    585     * You may obtain a copy of the License at
    586     *
    587     * http://www.apache.org/licenses/LICENSE-2.0
    588     *
    589     * Unless required by applicable law or agreed to in writing, software
    590     * distributed under the License is distributed on an "AS IS" BASIS,
    591     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    592     * See the License for the specific language governing permissions and
    593     * limitations under the License.
    594     */
    595 
    596    /*
    597     * File: OP_MOVE_16.S
    598     *
    599     * Code: Copies contents from one register to another
    600     *
    601     * For: move/16, move-object/16
    602     *
    603     * Description: Copies contents from one non-object register to another.
    604     *              fp[A]<- fp[B]
    605     *
    606     * Format: |op AAAA BBBB (32x)
    607     *
    608     * Syntax: op vAAAA, vBBBB
    609     */
    610 
    611     FETCH       2, %edx                 # %edx<- BBBB
    612     FETCH       1, %ecx                 # %ecx<- AAAA
    613     FFETCH_ADV  3, %eax                 # %eax<- next instruction hi; fetch, advance
    614     GET_VREG    %edx                    # %edx<- vB
    615     SET_VREG    %edx, %ecx              # vA<- vB; %edx
    616     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
    617 
    618 /* ------------------------------ */
    619     .balign 64
    620 .L_OP_MOVE_WIDE: /* 0x04 */
    621 /* File: x86-atom/OP_MOVE_WIDE.S */
    622    /* Copyright (C) 2008 The Android Open Source Project
    623     *
    624     * Licensed under the Apache License, Version 2.0 (the "License");
    625     * you may not use this file except in compliance with the License.
    626     * You may obtain a copy of the License at
    627     *
    628     * http://www.apache.org/licenses/LICENSE-2.0
    629     *
    630     * Unless required by applicable law or agreed to in writing, software
    631     * distributed under the License is distributed on an "AS IS" BASIS,
    632     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    633     * See the License for the specific language governing permissions and
    634     * limitations under the License.
    635     */
    636 
    637    /*
    638     * File: OP_MOVE_WIDE.S
    639     *
    640     * Code: Copies contents from one register to another. Uses no
    641     *       substitutions.
    642     *
    643     * For: move-wide
    644     *
    645     * Description: Copies contents from one non-object register to another.
    646     *
    647     * Format: B|A|op (12x)
    648     *
    649     * Syntax: op vA, vB
    650     */
    651 
    652     movl        rINST, %edx             # %edx<- BA+
    653     shr         $4, %edx               # %edx<- B
    654     and         $15, rINST             # rINST<- A
    655     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
    656     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vB
    657     movq        %xmm0, (rFP, rINST, 4)  # vA<- vB
    658     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
    659 
    660 /* ------------------------------ */
    661     .balign 64
    662 .L_OP_MOVE_WIDE_FROM16: /* 0x05 */
    663 /* File: x86-atom/OP_MOVE_WIDE_FROM16.S */
    664    /* Copyright (C) 2008 The Android Open Source Project
    665     *
    666     * Licensed under the Apache License, Version 2.0 (the "License");
    667     * you may not use this file except in compliance with the License.
    668     * You may obtain a copy of the License at
    669     *
    670     * http://www.apache.org/licenses/LICENSE-2.0
    671     *
    672     * Unless required by applicable law or agreed to in writing, software
    673     * distributed under the License is distributed on an "AS IS" BASIS,
    674     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    675     * See the License for the specific language governing permissions and
    676     * limitations under the License.
    677     */
    678 
    679    /*
    680     * File: OP_MOVE_WIDE_FROM16.S
    681     *
    682     * Code: Copies contents from one register to another
    683     *
    684     * For: move-wide/from16
    685     *
    686     * Description: Copies contents from one non-object register to another.
    687     *
    688     * Format: AA|op BBBB (22x)
    689     *
    690     * Syntax: op vAA, vBBBB
    691     */
    692 
    693     FETCH       1, %edx                 # %edx<- BBBB
    694     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
    695     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vB
    696     movq        %xmm0, (rFP, rINST, 4)  # vA<- vB
    697     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
    698 
    699 /* ------------------------------ */
    700     .balign 64
    701 .L_OP_MOVE_WIDE_16: /* 0x06 */
    702 /* File: x86-atom/OP_MOVE_WIDE_16.S */
    703    /* Copyright (C) 2008 The Android Open Source Project
    704     *
    705     * Licensed under the Apache License, Version 2.0 (the "License");
    706     * you may not use this file except in compliance with the License.
    707     * You may obtain a copy of the License at
    708     *
    709     * http://www.apache.org/licenses/LICENSE-2.0
    710     *
    711     * Unless required by applicable law or agreed to in writing, software
    712     * distributed under the License is distributed on an "AS IS" BASIS,
    713     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    714     * See the License for the specific language governing permissions and
    715     * limitations under the License.
    716     */
    717 
    718    /*
    719     * File: OP_MOVE_WIDE_16.S
    720     *
    721     * Code: Copies contents from one register to another. Uses no
    722     *       substitutions.
    723     *
    724     * For: move-wide/16
    725     *
    726     * Description: Copies contents from one non-object register to another.
    727     *
    728     * Format: |op AAAA BBBB (32x)
    729     *
    730     * Syntax: op vAAAA, vBBBB
    731     */
    732 
    733     FETCH       2, %edx                 # %edx<- BBBB
    734     FETCH       1, %ecx                 # %ecx<- AAAA
    735     FFETCH_ADV  3, %eax                 # %eax<- next instruction hi; fetch, advance
    736     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vB
    737     movq        %xmm0, (rFP, %ecx, 4)   # vA<- vB; %xmm0
    738     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
    739 
    740 /* ------------------------------ */
    741     .balign 64
    742 .L_OP_MOVE_OBJECT: /* 0x07 */
    743 /* File: x86-atom/OP_MOVE_OBJECT.S */
    744    /* Copyright (C) 2008 The Android Open Source Project
    745     *
    746     * Licensed under the Apache License, Version 2.0 (the "License");
    747     * you may not use this file except in compliance with the License.
    748     * You may obtain a copy of the License at
    749     *
    750     * http://www.apache.org/licenses/LICENSE-2.0
    751     *
    752     * Unless required by applicable law or agreed to in writing, software
    753     * distributed under the License is distributed on an "AS IS" BASIS,
    754     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    755     * See the License for the specific language governing permissions and
    756     * limitations under the License.
    757     */
    758 
    759    /*
    760     * File: OP_MOVE_OBJECT.S
    761     */
    762 
    763 /* File: x86-atom/OP_MOVE.S */
    764    /* Copyright (C) 2008 The Android Open Source Project
    765     *
    766     * Licensed under the Apache License, Version 2.0 (the "License");
    767     * you may not use this file except in compliance with the License.
    768     * You may obtain a copy of the License at
    769     *
    770     * http://www.apache.org/licenses/LICENSE-2.0
    771     *
    772     * Unless required by applicable law or agreed to in writing, software
    773     * distributed under the License is distributed on an "AS IS" BASIS,
    774     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    775     * See the License for the specific language governing permissions and
    776     * limitations under the License.
    777     */
    778 
    779    /*
    780     * File: OP_MOVE.S
    781     *
    782     * Code: Copies contents from one register to another. Uses no
    783     *       substitutions.
    784     *
    785     * For: move, move-object, long-to-int
    786     *
    787     * Description: Copies contents from one non-object register to another.
    788     *              vA<- vB; fp[A]<- fp[B]
    789     *
    790     * Format: B|A|op (12x)
    791     *
    792     * Syntax: op vA, vB
    793     */
    794 
    795     movl        rINST, %ecx             # %ecx<- BA
    796     shr         $4, rINST              # rINST<- B
    797     and         $15, %ecx              # %ecx<- A
    798     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
    799     GET_VREG    rINST                   # rINST<- vB
    800     SET_VREG    rINST, %ecx             # vA<- vB; %edx
    801     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
    802 
    803 
    804 /* ------------------------------ */
    805     .balign 64
    806 .L_OP_MOVE_OBJECT_FROM16: /* 0x08 */
    807 /* File: x86-atom/OP_MOVE_OBJECT_FROM16.S */
    808    /* Copyright (C) 2008 The Android Open Source Project
    809     *
    810     * Licensed under the Apache License, Version 2.0 (the "License");
    811     * you may not use this file except in compliance with the License.
    812     * You may obtain a copy of the License at
    813     *
    814     * http://www.apache.org/licenses/LICENSE-2.0
    815     *
    816     * Unless required by applicable law or agreed to in writing, software
    817     * distributed under the License is distributed on an "AS IS" BASIS,
    818     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    819     * See the License for the specific language governing permissions and
    820     * limitations under the License.
    821     */
    822 
    823    /*
    824     * File: OP_MOVE_OBJECT_FROM16.S
    825     */
    826 
    827 /* File: x86-atom/OP_MOVE_FROM16.S */
    828    /* Copyright (C) 2008 The Android Open Source Project
    829     *
    830     * Licensed under the Apache License, Version 2.0 (the "License");
    831     * you may not use this file except in compliance with the License.
    832     * You may obtain a copy of the License at
    833     *
    834     * http://www.apache.org/licenses/LICENSE-2.0
    835     *
    836     * Unless required by applicable law or agreed to in writing, software
    837     * distributed under the License is distributed on an "AS IS" BASIS,
    838     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    839     * See the License for the specific language governing permissions and
    840     * limitations under the License.
    841     */
    842 
    843    /*
    844     * File: OP_MOVE_FROM16.S
    845     *
    846     * Code: Copies contents from one register to another
    847     *
    848     * For: move/from16, move-object/from16
    849     *
    850     * Description: Copies contents from one non-object register to another.
    851     *              vA<- vB; fp[A]<- fp[B]
    852     *
    853     * Format: AA|op BBBB (22x)
    854     *
    855     * Syntax: op vAA, vBBBB
    856     */
    857 
    858     FETCH       1, %edx                 # %edx<- BBBB
    859     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
    860     GET_VREG    %edx                    # %edx<- vB
    861     SET_VREG    %edx, rINST             # vA<- vB; %edx
    862     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
    863 
    864 
    865 /* ------------------------------ */
    866     .balign 64
    867 .L_OP_MOVE_OBJECT_16: /* 0x09 */
    868 /* File: x86-atom/OP_MOVE_OBJECT_16.S */
    869    /* Copyright (C) 2008 The Android Open Source Project
    870     *
    871     * Licensed under the Apache License, Version 2.0 (the "License");
    872     * you may not use this file except in compliance with the License.
    873     * You may obtain a copy of the License at
    874     *
    875     * http://www.apache.org/licenses/LICENSE-2.0
    876     *
    877     * Unless required by applicable law or agreed to in writing, software
    878     * distributed under the License is distributed on an "AS IS" BASIS,
    879     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    880     * See the License for the specific language governing permissions and
    881     * limitations under the License.
    882     */
    883 
    884    /*
    885     * File: OP_MOVE_OBJECT_16.S
    886     */
    887 
    888 /* File: x86-atom/OP_MOVE_16.S */
    889    /* Copyright (C) 2008 The Android Open Source Project
    890     *
    891     * Licensed under the Apache License, Version 2.0 (the "License");
    892     * you may not use this file except in compliance with the License.
    893     * You may obtain a copy of the License at
    894     *
    895     * http://www.apache.org/licenses/LICENSE-2.0
    896     *
    897     * Unless required by applicable law or agreed to in writing, software
    898     * distributed under the License is distributed on an "AS IS" BASIS,
    899     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    900     * See the License for the specific language governing permissions and
    901     * limitations under the License.
    902     */
    903 
    904    /*
    905     * File: OP_MOVE_16.S
    906     *
    907     * Code: Copies contents from one register to another
    908     *
    909     * For: move/16, move-object/16
    910     *
    911     * Description: Copies contents from one non-object register to another.
    912     *              fp[A]<- fp[B]
    913     *
    914     * Format: |op AAAA BBBB (32x)
    915     *
    916     * Syntax: op vAAAA, vBBBB
    917     */
    918 
    919     FETCH       2, %edx                 # %edx<- BBBB
    920     FETCH       1, %ecx                 # %ecx<- AAAA
    921     FFETCH_ADV  3, %eax                 # %eax<- next instruction hi; fetch, advance
    922     GET_VREG    %edx                    # %edx<- vB
    923     SET_VREG    %edx, %ecx              # vA<- vB; %edx
    924     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
    925 
    926 
    927 /* ------------------------------ */
    928     .balign 64
    929 .L_OP_MOVE_RESULT: /* 0x0a */
    930 /* File: x86-atom/OP_MOVE_RESULT.S */
    931    /* Copyright (C) 2008 The Android Open Source Project
    932     *
    933     * Licensed under the Apache License, Version 2.0 (the "License");
    934     * you may not use this file except in compliance with the License.
    935     * You may obtain a copy of the License at
    936     *
    937     * http://www.apache.org/licenses/LICENSE-2.0
    938     *
    939     * Unless required by applicable law or agreed to in writing, software
    940     * distributed under the License is distributed on an "AS IS" BASIS,
    941     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    942     * See the License for the specific language governing permissions and
    943     * limitations under the License.
    944     */
    945 
    946    /*
    947     * File: OP_MOVE_RESULT.S
    948     *
    949     * Code: Copies a return value to a register
    950     *
    951     * For: move-result, move-result-object
    952     *
    953     * Description: Move the single-word non-object result of the most
    954     *              recent method invocation into the indicated register. This
    955     *              must be done as the instruction immediately after a
    956     *              method invocation whose (single-word, non-object) result
    957     *              is not to be ignored; anywhere else is invalid.
    958     *
    959     * Format: AA|op (11x)
    960     *
    961     * Syntax: op vAA
    962     */
    963 
    964     movl        rGLUE, %eax             # %eax<- pMterpGlue
    965     FFETCH_ADV  1, %ecx                 # %ecx<- next instruction hi; fetch, advance
    966     movl        offGlue_retval(%eax), %edx # %edx<- glue->retval
    967     SET_VREG    %edx, rINST             # vA<- glue->retval
    968     FGETOP_JMP  1, %ecx                 # jump to next instruction; getop, jmp
    969 
    970 /* ------------------------------ */
    971     .balign 64
    972 .L_OP_MOVE_RESULT_WIDE: /* 0x0b */
    973 /* File: x86-atom/OP_MOVE_RESULT_WIDE.S */
    974    /* Copyright (C) 2008 The Android Open Source Project
    975     *
    976     * Licensed under the Apache License, Version 2.0 (the "License");
    977     * you may not use this file except in compliance with the License.
    978     * You may obtain a copy of the License at
    979     *
    980     * http://www.apache.org/licenses/LICENSE-2.0
    981     *
    982     * Unless required by applicable law or agreed to in writing, software
    983     * distributed under the License is distributed on an "AS IS" BASIS,
    984     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    985     * See the License for the specific language governing permissions and
    986     * limitations under the License.
    987     */
    988 
    989    /*
    990     * File: OP_MOVE_RESULT_WIDE.S
    991     *
    992     * Code: Copies a return value to a register
    993     *
    994     * For: move-result-wide
    995     *
    996     * Description: Move the double-word non-object result of the most
    997     *              recent method invocation into the indicated register. This
    998     *              must be done as the instruction immediately after a
    999     *              method invocation whose (single-word, non-object) result
   1000     *              is not to be ignored; anywhere else is invalid.
   1001     *
   1002     * Format: AA|op (11x)
   1003     *
   1004     * Syntax: op vAA
   1005     */
   1006 
   1007     movl        rGLUE, %eax             # %eax<- pMterpGlue
   1008     movq        offGlue_retval(%eax), %xmm0 # %xmm0<- glue->retval
   1009     movq        %xmm0, (rFP, rINST, 4)  # vA<- glue->retval
   1010     FFETCH_ADV  1, %edx                 # %edx<- next instruction hi; fetch, advance
   1011     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   1012 
   1013 /* ------------------------------ */
   1014     .balign 64
   1015 .L_OP_MOVE_RESULT_OBJECT: /* 0x0c */
   1016 /* File: x86-atom/OP_MOVE_RESULT_OBJECT.S */
   1017    /* Copyright (C) 2008 The Android Open Source Project
   1018     *
   1019     * Licensed under the Apache License, Version 2.0 (the "License");
   1020     * you may not use this file except in compliance with the License.
   1021     * You may obtain a copy of the License at
   1022     *
   1023     * http://www.apache.org/licenses/LICENSE-2.0
   1024     *
   1025     * Unless required by applicable law or agreed to in writing, software
   1026     * distributed under the License is distributed on an "AS IS" BASIS,
   1027     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1028     * See the License for the specific language governing permissions and
   1029     * limitations under the License.
   1030     */
   1031 
   1032    /*
   1033     * File: OP_MOVE_RESULT_OBJECT.S
   1034     */
   1035 
   1036 /* File: x86-atom/OP_MOVE_RESULT.S */
   1037    /* Copyright (C) 2008 The Android Open Source Project
   1038     *
   1039     * Licensed under the Apache License, Version 2.0 (the "License");
   1040     * you may not use this file except in compliance with the License.
   1041     * You may obtain a copy of the License at
   1042     *
   1043     * http://www.apache.org/licenses/LICENSE-2.0
   1044     *
   1045     * Unless required by applicable law or agreed to in writing, software
   1046     * distributed under the License is distributed on an "AS IS" BASIS,
   1047     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1048     * See the License for the specific language governing permissions and
   1049     * limitations under the License.
   1050     */
   1051 
   1052    /*
   1053     * File: OP_MOVE_RESULT.S
   1054     *
   1055     * Code: Copies a return value to a register
   1056     *
   1057     * For: move-result, move-result-object
   1058     *
   1059     * Description: Move the single-word non-object result of the most
   1060     *              recent method invocation into the indicated register. This
   1061     *              must be done as the instruction immediately after a
   1062     *              method invocation whose (single-word, non-object) result
   1063     *              is not to be ignored; anywhere else is invalid.
   1064     *
   1065     * Format: AA|op (11x)
   1066     *
   1067     * Syntax: op vAA
   1068     */
   1069 
   1070     movl        rGLUE, %eax             # %eax<- pMterpGlue
   1071     FFETCH_ADV  1, %ecx                 # %ecx<- next instruction hi; fetch, advance
   1072     movl        offGlue_retval(%eax), %edx # %edx<- glue->retval
   1073     SET_VREG    %edx, rINST             # vA<- glue->retval
   1074     FGETOP_JMP  1, %ecx                 # jump to next instruction; getop, jmp
   1075 
   1076 
   1077 /* ------------------------------ */
   1078     .balign 64
   1079 .L_OP_MOVE_EXCEPTION: /* 0x0d */
   1080 /* File: x86-atom/OP_MOVE_EXCEPTION.S */
   1081    /* Copyright (C) 2008 The Android Open Source Project
   1082     *
   1083     * Licensed under the Apache License, Version 2.0 (the "License");
   1084     * you may not use this file except in compliance with the License.
   1085     * You may obtain a copy of the License at
   1086     *
   1087     * http://www.apache.org/licenses/LICENSE-2.0
   1088     *
   1089     * Unless required by applicable law or agreed to in writing, software
   1090     * distributed under the License is distributed on an "AS IS" BASIS,
   1091     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1092     * See the License for the specific language governing permissions and
   1093     * limitations under the License.
   1094     */
   1095 
   1096    /*
   1097     * File: OP_MOVE_EXCEPTION.S
   1098     *
   1099     * Code: Moves an exception to a register
   1100     *
   1101     * For: move-exception
   1102     *
   1103     * Description: Save a just-caught exception into the given register. This
   1104     *              instruction is only valid as the first instruction of an
   1105     *              exception handler.
   1106     *
   1107     * Format: AA|op (11x)
   1108     *
   1109     * Syntax: op vAA
   1110     */
   1111 
   1112     movl        rGLUE, %eax             # %eax<- pMterpGlue
   1113     movl        offGlue_self(%eax), %ecx # %ecx<- glue->self
   1114     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   1115     movl        offThread_exception(%ecx), %edx # %edx<- glue->self->exception
   1116     movl        $0, offThread_exception(%ecx) # clear exception
   1117     SET_VREG    %edx, rINST             # vAA<- glue->self->exception
   1118     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   1119 
   1120 /* ------------------------------ */
   1121     .balign 64
   1122 .L_OP_RETURN_VOID: /* 0x0e */
   1123 /* File: x86-atom/OP_RETURN_VOID.S */
   1124    /* Copyright (C) 2008 The Android Open Source Project
   1125     *
   1126     * Licensed under the Apache License, Version 2.0 (the "License");
   1127     * you may not use this file except in compliance with the License.
   1128     * You may obtain a copy of the License at
   1129     *
   1130     * http://www.apache.org/licenses/LICENSE-2.0
   1131     *
   1132     * Unless required by applicable law or agreed to in writing, software
   1133     * distributed under the License is distributed on an "AS IS" BASIS,
   1134     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1135     * See the License for the specific language governing permissions and
   1136     * limitations under the License.
   1137     */
   1138 
   1139    /*
   1140     * File: OP_RETURN_VOID.S
   1141     */
   1142 
   1143     jmp         common_returnFromMethod
   1144 
   1145 /* ------------------------------ */
   1146     .balign 64
   1147 .L_OP_RETURN: /* 0x0f */
   1148 /* File: x86-atom/OP_RETURN.S */
   1149    /* Copyright (C) 2008 The Android Open Source Project
   1150     *
   1151     * Licensed under the Apache License, Version 2.0 (the "License");
   1152     * you may not use this file except in compliance with the License.
   1153     * You may obtain a copy of the License at
   1154     *
   1155     * http://www.apache.org/licenses/LICENSE-2.0
   1156     *
   1157     * Unless required by applicable law or agreed to in writing, software
   1158     * distributed under the License is distributed on an "AS IS" BASIS,
   1159     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1160     * See the License for the specific language governing permissions and
   1161     * limitations under the License.
   1162     */
   1163 
   1164    /*
   1165     * File: OP_RETURN.S
   1166     */
   1167 
   1168 /* File: x86-atom/OP_RETURN_COMMON.S */
   1169    /* Copyright (C) 2008 The Android Open Source Project
   1170     *
   1171     * Licensed under the Apache License, Version 2.0 (the "License");
   1172     * you may not use this file except in compliance with the License.
   1173     * You may obtain a copy of the License at
   1174     *
   1175     * http://www.apache.org/licenses/LICENSE-2.0
   1176     *
   1177     * Unless required by applicable law or agreed to in writing, software
   1178     * distributed under the License is distributed on an "AS IS" BASIS,
   1179     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1180     * See the License for the specific language governing permissions and
   1181     * limitations under the License.
   1182     */
   1183 
   1184    /*
   1185     * File: OP_RETURN_COMMON.S
   1186     *
   1187     * Code: Return a 32-bit value. Uses no substitutions.
   1188     *
   1189     * For: return, return-object
   1190     *
   1191     * Description: Copies the return value into the "glue"
   1192     *              structure, then jumps to the return handler.
   1193     *
   1194     * Format: AA|op (11x)
   1195     *
   1196     * Syntax: op vAA
   1197     */
   1198 
   1199     movl        rGLUE, %edx             # %edx<- pMterpGlue
   1200     GET_VREG    rINST                   # rINST<- vAA
   1201     movl        rINST, offGlue_retval(%edx) # glue->retval<- vAA
   1202     jmp         common_returnFromMethod # jump to common return code
   1203 
   1204 
   1205 /* ------------------------------ */
   1206     .balign 64
   1207 .L_OP_RETURN_WIDE: /* 0x10 */
   1208 /* File: x86-atom/OP_RETURN_WIDE.S */
   1209    /* Copyright (C) 2008 The Android Open Source Project
   1210     *
   1211     * Licensed under the Apache License, Version 2.0 (the "License");
   1212     * you may not use this file except in compliance with the License.
   1213     * You may obtain a copy of the License at
   1214     *
   1215     * http://www.apache.org/licenses/LICENSE-2.0
   1216     *
   1217     * Unless required by applicable law or agreed to in writing, software
   1218     * distributed under the License is distributed on an "AS IS" BASIS,
   1219     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1220     * See the License for the specific language governing permissions and
   1221     * limitations under the License.
   1222     */
   1223 
   1224    /*
   1225     * File: OP_RETURN_WIDE.S
   1226     *
   1227     * Code: Return a 64-bit value. Uses no substitutions.
   1228     *
   1229     * For: return-wide
   1230     *
   1231     * Description: Copies the return value into the "glue"
   1232     *              structure, then jumps to the return handler.
   1233     *
   1234     * Format: AA|op (11x)
   1235     *
   1236     * Syntax: op vAA
   1237     */
   1238 
   1239     movl        rGLUE, %edx             # %edx<- pMterpGlue
   1240     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vAA
   1241     movq        %xmm0, offGlue_retval(%edx)# glue->retval<- vAA
   1242     jmp         common_returnFromMethod # jump to common return code
   1243 
   1244 /* ------------------------------ */
   1245     .balign 64
   1246 .L_OP_RETURN_OBJECT: /* 0x11 */
   1247 /* File: x86-atom/OP_RETURN_OBJECT.S */
   1248    /* Copyright (C) 2008 The Android Open Source Project
   1249     *
   1250     * Licensed under the Apache License, Version 2.0 (the "License");
   1251     * you may not use this file except in compliance with the License.
   1252     * You may obtain a copy of the License at
   1253     *
   1254     * http://www.apache.org/licenses/LICENSE-2.0
   1255     *
   1256     * Unless required by applicable law or agreed to in writing, software
   1257     * distributed under the License is distributed on an "AS IS" BASIS,
   1258     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1259     * See the License for the specific language governing permissions and
   1260     * limitations under the License.
   1261     */
   1262 
   1263    /*
   1264     * File: OP_RETURN_OBJECT.S
   1265     */
   1266 
   1267 /* File: x86-atom/OP_RETURN_COMMON.S */
   1268    /* Copyright (C) 2008 The Android Open Source Project
   1269     *
   1270     * Licensed under the Apache License, Version 2.0 (the "License");
   1271     * you may not use this file except in compliance with the License.
   1272     * You may obtain a copy of the License at
   1273     *
   1274     * http://www.apache.org/licenses/LICENSE-2.0
   1275     *
   1276     * Unless required by applicable law or agreed to in writing, software
   1277     * distributed under the License is distributed on an "AS IS" BASIS,
   1278     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1279     * See the License for the specific language governing permissions and
   1280     * limitations under the License.
   1281     */
   1282 
   1283    /*
   1284     * File: OP_RETURN_COMMON.S
   1285     *
   1286     * Code: Return a 32-bit value. Uses no substitutions.
   1287     *
   1288     * For: return, return-object
   1289     *
   1290     * Description: Copies the return value into the "glue"
   1291     *              structure, then jumps to the return handler.
   1292     *
   1293     * Format: AA|op (11x)
   1294     *
   1295     * Syntax: op vAA
   1296     */
   1297 
   1298     movl        rGLUE, %edx             # %edx<- pMterpGlue
   1299     GET_VREG    rINST                   # rINST<- vAA
   1300     movl        rINST, offGlue_retval(%edx) # glue->retval<- vAA
   1301     jmp         common_returnFromMethod # jump to common return code
   1302 
   1303 
   1304 /* ------------------------------ */
   1305     .balign 64
   1306 .L_OP_CONST_4: /* 0x12 */
   1307 /* File: x86-atom/OP_CONST_4.S */
   1308    /* Copyright (C) 2008 The Android Open Source Project
   1309     *
   1310     * Licensed under the Apache License, Version 2.0 (the "License");
   1311     * you may not use this file except in compliance with the License.
   1312     * You may obtain a copy of the License at
   1313     *
   1314     * http://www.apache.org/licenses/LICENSE-2.0
   1315     *
   1316     * Unless required by applicable law or agreed to in writing, software
   1317     * distributed under the License is distributed on an "AS IS" BASIS,
   1318     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1319     * See the License for the specific language governing permissions and
   1320     * limitations under the License.
   1321     */
   1322 
   1323    /*
   1324     * File: OP_CONST_4.S
   1325     *
   1326     * Code: Moves a literal to a register. Uses no substitutions.
   1327     *
   1328     * For: const/4
   1329     *
   1330     * Description: Move the given literal value (right-zero-extended to 32
   1331     *              bits) into the specified register.
   1332     *
   1333     * Format: B|A|op (11n)
   1334     *
   1335     * Syntax: op vA, #+B
   1336     */
   1337 
   1338     movl        rINST, %edx             # %edx<- BA
   1339     andl        $15, rINST             # rINST<- A
   1340     shl         $24, %edx              # %edx<- B000
   1341     sar         $28, %edx              # %edx<- right-zero-extended B
   1342     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   1343     SET_VREG    %edx, rINST             # vA<- %edx; literal
   1344     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   1345 
   1346 /* ------------------------------ */
   1347     .balign 64
   1348 .L_OP_CONST_16: /* 0x13 */
   1349 /* File: x86-atom/OP_CONST_16.S */
   1350    /* Copyright (C) 2008 The Android Open Source Project
   1351     *
   1352     * Licensed under the Apache License, Version 2.0 (the "License");
   1353     * you may not use this file except in compliance with the License.
   1354     * You may obtain a copy of the License at
   1355     *
   1356     * http://www.apache.org/licenses/LICENSE-2.0
   1357     *
   1358     * Unless required by applicable law or agreed to in writing, software
   1359     * distributed under the License is distributed on an "AS IS" BASIS,
   1360     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1361     * See the License for the specific language governing permissions and
   1362     * limitations under the License.
   1363     */
   1364 
   1365    /*
   1366     * File: OP_CONST_16.S
   1367     *
   1368     * Code: Moves a literal to a register. Uses no substitutions.
   1369     *
   1370     * For: const/16
   1371     *
   1372     * Description: Move the given literal value (right-zero-extended to 32
   1373     *              bits) into the specified register
   1374     *
   1375     * Format: AA|op BBBB (21s)
   1376     *
   1377     * Syntax: op vAA, #+BBBB
   1378     */
   1379 
   1380     FETCHs      1, %edx                 # %edx<- BBBB
   1381     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   1382     SET_VREG    %edx rINST              # vAA<- BBBB; literal
   1383     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   1384 
   1385 /* ------------------------------ */
   1386     .balign 64
   1387 .L_OP_CONST: /* 0x14 */
   1388 /* File: x86-atom/OP_CONST.S */
   1389    /* Copyright (C) 2008 The Android Open Source Project
   1390     *
   1391     * Licensed under the Apache License, Version 2.0 (the "License");
   1392     * you may not use this file except in compliance with the License.
   1393     * You may obtain a copy of the License at
   1394     *
   1395     * http://www.apache.org/licenses/LICENSE-2.0
   1396     *
   1397     * Unless required by applicable law or agreed to in writing, software
   1398     * distributed under the License is distributed on an "AS IS" BASIS,
   1399     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1400     * See the License for the specific language governing permissions and
   1401     * limitations under the License.
   1402     */
   1403 
   1404    /*
   1405     * File: OP_CONST.S
   1406     *
   1407     * Code: Move a literal to a register. Uses no substitutions.
   1408     *
   1409     * For: const
   1410     *
   1411     * Description: Move the given literal value into the specified register
   1412     *
   1413     * Format: AA|op BBBBlo BBBBhi (31i)
   1414     *
   1415     * Syntax: op vAA, #+BBBBBBBB
   1416     */
   1417 
   1418     FETCH       2, %edx                 # %edx<- BBBBhi
   1419     FETCH       1, %ecx                 # %ecx<- BBBBlo
   1420     shl         $16, %edx              # move BBBB to high bits
   1421     or          %edx, %ecx              # %ecx<- #+BBBBBBBB
   1422     FFETCH_ADV  3, %eax                 # %eax<- next instruction hi; fetch, advance
   1423     SET_VREG    %ecx, rINST             # vAA<- %ecx; literal
   1424     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
   1425 
   1426 /* ------------------------------ */
   1427     .balign 64
   1428 .L_OP_CONST_HIGH16: /* 0x15 */
   1429 /* File: x86-atom/OP_CONST_HIGH16.S */
   1430    /* Copyright (C) 2008 The Android Open Source Project
   1431     *
   1432     * Licensed under the Apache License, Version 2.0 (the "License");
   1433     * you may not use this file except in compliance with the License.
   1434     * You may obtain a copy of the License at
   1435     *
   1436     * http://www.apache.org/licenses/LICENSE-2.0
   1437     *
   1438     * Unless required by applicable law or agreed to in writing, software
   1439     * distributed under the License is distributed on an "AS IS" BASIS,
   1440     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1441     * See the License for the specific language governing permissions and
   1442     * limitations under the License.
   1443     */
   1444 
   1445    /*
   1446     * File: OP_CONST_HIGH16.S
   1447     *
   1448     * Code: Move a literal to a register. Uses no substitutions.
   1449     *
   1450     * For: const/high16
   1451     *
   1452     * Description: Move the given literal value (right-zero-extended to 32
   1453     *              bits) into the specified register
   1454     *
   1455     * Format: AA|op BBBB (21h)
   1456     *
   1457     * Syntax: op vAA, #+BBBB0000
   1458     */
   1459 
   1460     FETCH       1, %ecx                 # %ecx<- 0000BBBB (zero-extended)
   1461     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   1462     shl         $16, %ecx              # %ecx<- BBBB0000
   1463     SET_VREG    %ecx, rINST             # vAA<- %ecx; BBBB0000
   1464     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   1465 
   1466 /* ------------------------------ */
   1467     .balign 64
   1468 .L_OP_CONST_WIDE_16: /* 0x16 */
   1469 /* File: x86-atom/OP_CONST_WIDE_16.S */
   1470    /* Copyright (C) 2008 The Android Open Source Project
   1471     *
   1472     * Licensed under the Apache License, Version 2.0 (the "License");
   1473     * you may not use this file except in compliance with the License.
   1474     * You may obtain a copy of the License at
   1475     *
   1476     * http://www.apache.org/licenses/LICENSE-2.0
   1477     *
   1478     * Unless required by applicable law or agreed to in writing, software
   1479     * distributed under the License is distributed on an "AS IS" BASIS,
   1480     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1481     * See the License for the specific language governing permissions and
   1482     * limitations under the License.
   1483     */
   1484 
   1485    /*
   1486     * File: OP_CONST_WIDE_16.S
   1487     *
   1488     * Code: Move a literal to a register. Uses no substitutions.
   1489     *
   1490     * For: const-wide/16
   1491     *
   1492     * Description: Move the given literal value (sign-extended to 64 bits)
   1493     *              into the specified register-pair
   1494     *
   1495     * Format: AA|op BBBB (21s)
   1496     *
   1497     * Syntax: op vAA, #+BBBB
   1498     */
   1499 
   1500     FETCHs      1, %ecx                 # %ecx<- ssssBBBB (sign-extended)
   1501     movl        %ecx, %edx              # %edx<- ssssBBBB (sign-extended)
   1502     sar         $31, %ecx              # %ecx<- sign bit
   1503     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   1504     movl        %edx, (rFP, rINST, 4)   # vAA<- ssssBBBB
   1505     movl        %ecx, 4(rFP, rINST, 4)  # vAA+1<- ssssssss
   1506     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   1507 
   1508 /* ------------------------------ */
   1509     .balign 64
   1510 .L_OP_CONST_WIDE_32: /* 0x17 */
   1511 /* File: x86-atom/OP_CONST_WIDE_32.S */
   1512    /* Copyright (C) 2008 The Android Open Source Project
   1513     *
   1514     * Licensed under the Apache License, Version 2.0 (the "License");
   1515     * you may not use this file except in compliance with the License.
   1516     * You may obtain a copy of the License at
   1517     *
   1518     * http://www.apache.org/licenses/LICENSE-2.0
   1519     *
   1520     * Unless required by applicable law or agreed to in writing, software
   1521     * distributed under the License is distributed on an "AS IS" BASIS,
   1522     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1523     * See the License for the specific language governing permissions and
   1524     * limitations under the License.
   1525     */
   1526 
   1527    /*
   1528     * File: OP_CONST_WIDE_32.S
   1529     *
   1530     * Code: Move a literal to a register. Uses no substitutions.
   1531     *
   1532     * For: const-wide/32
   1533     *
   1534     * Description: Move the given literal value (sign-extended to 64 bits)
   1535     *              into the specified register-pair
   1536     *
   1537     * Format: AA|op BBBBlo BBBBhi (31i)
   1538     *
   1539     * Syntax: op vAA, #+BBBBBBBB
   1540     */
   1541 
   1542     FETCH       1,  %edx                # %edx<- BBBBlo
   1543     FETCHs      2, %ecx                 # %ecx<- BBBBhi
   1544     shl         $16, %ecx              # prepare to create #+BBBBBBBB
   1545     or          %ecx, %edx              # %edx<- %edx<- #+BBBBBBBB
   1546     sar         $31, %ecx              # %ecx<- sign bit
   1547     FFETCH_ADV  3, %eax                 # %eax<- next instruction hi; fetch, advance
   1548     movl        %edx, (rFP, rINST, 4)   # vAA<-  BBBBBBBB
   1549     movl        %ecx, 4(rFP, rINST, 4)  # vAA+1<- ssssssss
   1550     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
   1551 
   1552 /* ------------------------------ */
   1553     .balign 64
   1554 .L_OP_CONST_WIDE: /* 0x18 */
   1555 /* File: x86-atom/OP_CONST_WIDE.S */
   1556    /* Copyright (C) 2008 The Android Open Source Project
   1557     *
   1558     * Licensed under the Apache License, Version 2.0 (the "License");
   1559     * you may not use this file except in compliance with the License.
   1560     * You may obtain a copy of the License at
   1561     *
   1562     * http://www.apache.org/licenses/LICENSE-2.0
   1563     *
   1564     * Unless required by applicable law or agreed to in writing, software
   1565     * distributed under the License is distributed on an "AS IS" BASIS,
   1566     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1567     * See the License for the specific language governing permissions and
   1568     * limitations under the License.
   1569     */
   1570 
   1571    /*
   1572     * File: OP_CONST_WIDE.S
   1573     *
   1574     * Code: Move a literal to a register. Uses no substitutions.
   1575     *
   1576     * For: const-wide
   1577     *
   1578     * Description: Move the given literal value into the specified
   1579     *              register pair
   1580     *
   1581     * Format: AA|op BBBBlolo BBBBlohi BBBBhilo BBBBhihi (51l)
   1582     *
   1583     * Syntax: op vAA, #+BBBBBBBBBBBBBBBB
   1584     */
   1585 
   1586     FETCH       1, %ecx                 # %ecx<- BBBBlolo
   1587     FETCH       2, %edx                 # %edx<- BBBBlohi
   1588     shl         $16, %edx              # %edx<- prepare to create #+BBBBBBBBlo
   1589     or          %edx, %ecx              # %ecx<- #+BBBBBBBBlo
   1590     movl        %ecx, (rFP, rINST, 4)   # vAA <- #+BBBBBBBBlo
   1591     FETCH       3, %ecx                 # %ecx<- BBBBhilo
   1592     FETCH       4, %edx                 # %edx<- BBBBhihi
   1593     FFETCH_ADV  5, %eax                 # %eax<- next instruction hi; fetch, advance
   1594     shl         $16, %edx              # %edx<- prepare to create #+BBBBBBBBhi
   1595     or          %edx, %ecx              # %ecx<- #+BBBBBBBBhi
   1596     movl        %ecx, 4(rFP, rINST, 4)  # vAA+1 <- #+BBBBBBBBlo
   1597     FGETOP_JMP  5, %eax                 # jump to next instruction; getop, jmp
   1598 
   1599 /* ------------------------------ */
   1600     .balign 64
   1601 .L_OP_CONST_WIDE_HIGH16: /* 0x19 */
   1602 /* File: x86-atom/OP_CONST_WIDE_HIGH16.S */
   1603    /* Copyright (C) 2008 The Android Open Source Project
   1604     *
   1605     * Licensed under the Apache License, Version 2.0 (the "License");
   1606     * you may not use this file except in compliance with the License.
   1607     * You may obtain a copy of the License at
   1608     *
   1609     * http://www.apache.org/licenses/LICENSE-2.0
   1610     *
   1611     * Unless required by applicable law or agreed to in writing, software
   1612     * distributed under the License is distributed on an "AS IS" BASIS,
   1613     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1614     * See the License for the specific language governing permissions and
   1615     * limitations under the License.
   1616     */
   1617 
   1618    /*
   1619     * File: OP_CONST_WIDE_HIGH16.S
   1620     *
   1621     * Code: Move a literal value to a register. Uses no substitutions.
   1622     *
   1623     * For: const-wide/high16
   1624     *
   1625     * Description: Move the given literal value (right-zero-extended to 64
   1626     *              bits) into the specified register
   1627     *
   1628     * Format: AA|op BBBB (21h)
   1629     *
   1630     * Syntax: op vAA, #+BBBB000000000000
   1631     */
   1632 
   1633     FETCH       1, %ecx                 # %ecx<- 0000BBBB (zero-extended)
   1634     shl         $16, %ecx              # rINST<- AA
   1635     movl        $0, (rFP, rINST, 4)    # vAAlow<- 00000000
   1636     movl        %ecx, 4(rFP, rINST, 4)  # vAAhigh<- %ecx; BBBB0000
   1637     FINISH      2                       # jump to next instruction
   1638 
   1639 /* ------------------------------ */
   1640     .balign 64
   1641 .L_OP_CONST_STRING: /* 0x1a */
   1642 /* File: x86-atom/OP_CONST_STRING.S */
   1643    /* Copyright (C) 2008 The Android Open Source Project
   1644     *
   1645     * Licensed under the Apache License, Version 2.0 (the "License");
   1646     * you may not use this file except in compliance with the License.
   1647     * You may obtain a copy of the License at
   1648     *
   1649     * http://www.apache.org/licenses/LICENSE-2.0
   1650     *
   1651     * Unless required by applicable law or agreed to in writing, software
   1652     * distributed under the License is distributed on an "AS IS" BASIS,
   1653     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1654     * See the License for the specific language governing permissions and
   1655     * limitations under the License.
   1656     */
   1657 
   1658    /*
   1659     * File: OP_CONST_STRING.S
   1660     *
   1661     * Code: Move a string reference to a register. Uses no substitutions.
   1662     *
   1663     * For: const/string
   1664     *
   1665     * Description: Move a referece to the string specified by the given
   1666     *              index into the specified register. vAA <- pResString[BBBB]
   1667     *
   1668     * Format: AA|op BBBB (21c)
   1669     *
   1670     * Syntax: op vAA, string@BBBB
   1671     */
   1672 
   1673     FETCH       1, %ecx                 # %ecx<- BBBB
   1674     movl        rGLUE, %edx             # get MterpGlue pointer
   1675     movl        offGlue_methodClassDex(%edx), %eax # %eax<- glue->methodClassDex
   1676     movl        offDvmDex_pResStrings(%eax), %eax # %eax<- glue->methodClassDex->pResStrings
   1677     movl        (%eax, %ecx, 4), %eax   # %eax<- pResStrings[BBBB]
   1678     cmp         $0, %eax               # check if string is resolved
   1679     je          .LOP_CONST_STRING_resolve     # resolve string reference
   1680     SET_VREG    %eax, rINST             # vAA<- %eax; pResString[BBBB]
   1681     FINISH      2                       # jump to next instruction
   1682 
   1683 
   1684 /* ------------------------------ */
   1685     .balign 64
   1686 .L_OP_CONST_STRING_JUMBO: /* 0x1b */
   1687 /* File: x86-atom/OP_CONST_STRING_JUMBO.S */
   1688    /* Copyright (C) 2008 The Android Open Source Project
   1689     *
   1690     * Licensed under the Apache License, Version 2.0 (the "License");
   1691     * you may not use this file except in compliance with the License.
   1692     * You may obtain a copy of the License at
   1693     *
   1694     * http://www.apache.org/licenses/LICENSE-2.0
   1695     *
   1696     * Unless required by applicable law or agreed to in writing, software
   1697     * distributed under the License is distributed on an "AS IS" BASIS,
   1698     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1699     * See the License for the specific language governing permissions and
   1700     * limitations under the License.
   1701     */
   1702 
   1703    /*
   1704     * File: OP_CONST_STRING_JUMBO.S
   1705     *
   1706     * Code: Move a string reference to a register. Uses no substitutions.
   1707     *
   1708     * For: const/string-jumbo
   1709     *
   1710     * Description: Move a reference to the string specified by the given
   1711     *              index into the specified register. vAA <- pResString[BBBB]
   1712     *
   1713     * Format: AA|op BBBBlo BBBBhi (31c)
   1714     *
   1715     * Syntax: op vAA, string@BBBBBBBB
   1716     */
   1717 
   1718     movl        rGLUE, %edx             # get MterpGlue pointer
   1719     movl        offGlue_methodClassDex(%edx), %eax # %eax<- glue->methodClassDex
   1720     movl        offDvmDex_pResStrings(%eax), %eax # %eax<- glue->methodClassDex->pResStrings
   1721     FETCH       1, %ecx                 # %ecx<- BBBBlo
   1722     FETCH       2, %edx                 # %edx<- BBBBhi
   1723     shl         $16, %edx              # %edx<- prepare to create &BBBBBBBB
   1724     or          %edx, %ecx              # %ecx<- &BBBBBBBB
   1725     movl        (%eax, %ecx, 4), %eax   # %eax<- pResStrings[BBBB]
   1726     cmp         $0, %eax               # check if string is resolved
   1727     je          .LOP_CONST_STRING_JUMBO_resolve     # resolve string reference
   1728     SET_VREG    %eax, rINST             # vAA<- %eax; pResString[BBBB]
   1729     FINISH      3                       # jump to next instruction
   1730 
   1731 /* ------------------------------ */
   1732     .balign 64
   1733 .L_OP_CONST_CLASS: /* 0x1c */
   1734 /* File: x86-atom/OP_CONST_CLASS.S */
   1735    /* Copyright (C) 2008 The Android Open Source Project
   1736     *
   1737     * Licensed under the Apache License, Version 2.0 (the "License");
   1738     * you may not use this file except in compliance with the License.
   1739     * You may obtain a copy of the License at
   1740     *
   1741     * http://www.apache.org/licenses/LICENSE-2.0
   1742     *
   1743     * Unless required by applicable law or agreed to in writing, software
   1744     * distributed under the License is distributed on an "AS IS" BASIS,
   1745     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1746     * See the License for the specific language governing permissions and
   1747     * limitations under the License.
   1748     */
   1749 
   1750    /*
   1751     * File: OP_CONST_CLASS.S
   1752     *
   1753     * Code: Move a class reference to a register. Uses no substitutions.
   1754     *
   1755     * For: const/class
   1756     *
   1757     * Description: Move a reference to the class specified
   1758     *              by the given index into the specified register.
   1759     *              In the case where the indicated type is primitive,
   1760     *              this will store a reference to the primitive type's
   1761     *              degenerate class.
   1762     *
   1763     * Format: AA|op BBBBlo BBBBhi (21c)
   1764     *
   1765     * Syntax: op vAA, field@BBBB
   1766     */
   1767 
   1768     movl        rGLUE, %edx             # get MterpGlue pointer
   1769     FETCH       1, %ecx                 # %ecx<- BBBB
   1770     movl        offGlue_methodClassDex(%edx), %eax # %eax<- pDvmDex
   1771     movl        offDvmDex_pResClasses(%eax), %eax # %eax<- pDvmDex->pResClasses
   1772     movl        (%eax, %ecx, 4), %eax   # %eax<- resolved class
   1773     cmp         $0, %eax               # check if classes is resolved before?
   1774     je          .LOP_CONST_CLASS_resolve     # resolve class
   1775     SET_VREG    %eax, rINST             # vAA<- resolved class
   1776     FINISH      2                       # jump to next instruction
   1777 
   1778 /* ------------------------------ */
   1779     .balign 64
   1780 .L_OP_MONITOR_ENTER: /* 0x1d */
   1781 /* File: x86-atom/OP_MONITOR_ENTER.S */
   1782    /* Copyright (C) 2008 The Android Open Source Project
   1783     *
   1784     * Licensed under the Apache License, Version 2.0 (the "License");
   1785     * you may not use this file except in compliance with the License.
   1786     * You may obtain a copy of the License at
   1787     *
   1788     * http://www.apache.org/licenses/LICENSE-2.0
   1789     *
   1790     * Unless required by applicable law or agreed to in writing, software
   1791     * distributed under the License is distributed on an "AS IS" BASIS,
   1792     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1793     * See the License for the specific language governing permissions and
   1794     * limitations under the License.
   1795     */
   1796 
   1797    /*
   1798     * File: OP_MONITOR_ENTER.S
   1799     *
   1800     * Code: Aquire a monitor
   1801     *
   1802     * For: monitor-enter
   1803     *
   1804     * Description: Aquire a monitor for the indicated object.
   1805     *
   1806     *
   1807     *
   1808     * Format: AA|op (11x)
   1809     *
   1810     * Syntax: op vAA
   1811     */
   1812 
   1813     movl        rGLUE, %eax             # %eax<- pMterpGlue
   1814     GET_VREG    rINST                   # rINST<- vAA
   1815     cmp         $0, rINST              # check for null object
   1816     movl        offGlue_self(%eax), %eax # %eax<- glue->self
   1817     EXPORT_PC   # need for precise GC
   1818     je          common_errNullObject    # handle null object
   1819 #    jmp         .LOP_MONITOR_ENTER_finish
   1820 #%break
   1821 #.LOP_MONITOR_ENTER_finish:
   1822     movl        rINST, -4(%esp)         # push parameter reference
   1823     movl        %eax, -8(%esp)          # push parameter
   1824     lea         -8(%esp), %esp
   1825     call        dvmLockObject           # call: (struct Thread* self,
   1826                                         #       struct Object* obj)
   1827                                         # return: void
   1828     FFETCH_ADV  1, %edx                 # %edx<- next instruction hi; fetch, advance
   1829     lea         8(%esp), %esp
   1830     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   1831 
   1832 /* ------------------------------ */
   1833     .balign 64
   1834 .L_OP_MONITOR_EXIT: /* 0x1e */
   1835 /* File: x86-atom/OP_MONITOR_EXIT.S */
   1836    /* Copyright (C) 2008 The Android Open Source Project
   1837     *
   1838     * Licensed under the Apache License, Version 2.0 (the "License");
   1839     * you may not use this file except in compliance with the License.
   1840     * You may obtain a copy of the License at
   1841     *
   1842     * http://www.apache.org/licenses/LICENSE-2.0
   1843     *
   1844     * Unless required by applicable law or agreed to in writing, software
   1845     * distributed under the License is distributed on an "AS IS" BASIS,
   1846     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1847     * See the License for the specific language governing permissions and
   1848     * limitations under the License.
   1849     */
   1850 
   1851    /*
   1852     * File: OP_MONITOR_EXIT.S
   1853     *
   1854     * Code: Release a monitor
   1855     *
   1856     * For: monitor-exit
   1857     *
   1858     * Description: Release a monitor for the indicated object. If this instruction needs
   1859     *              to throw an execption, it must do so as if the pc has already
   1860     *              advanced pased the instruction.
   1861     *
   1862     * Format: AA|op (11x)
   1863     *
   1864     * Syntax: op vAA
   1865     */
   1866 
   1867     movl        rGLUE, %eax             # %eax<- pMterpGlue
   1868     EXPORT_PC                           # export the pc
   1869     GET_VREG    rINST                   # rINST<- vAA
   1870     cmp         $0, rINST              # rINST<- check for null object
   1871     je          common_errNullObject    # handle null object
   1872     push        rINST                   # push parameter object
   1873     push        offGlue_self(%eax)      # push parameter self
   1874     call        dvmUnlockObject         # call: (struct Thread* self,
   1875                                         #       struct Object* obj)
   1876                                         # return: bool
   1877     FINISH_FETCH_ADVANCE 1, %edx        # advance pc before exception
   1878     cmp         $0, %eax               # check for success
   1879     lea         8(%esp), %esp
   1880     je          common_exceptionThrown  # handle exception
   1881     FINISH_JMP  %edx                    # jump to next instruction
   1882 
   1883 /* ------------------------------ */
   1884     .balign 64
   1885 .L_OP_CHECK_CAST: /* 0x1f */
   1886 /* File: x86-atom/OP_CHECK_CAST.S */
   1887    /* Copyright (C) 2008 The Android Open Source Project
   1888     *
   1889     * Licensed under the Apache License, Version 2.0 (the "License");
   1890     * you may not use this file except in compliance with the License.
   1891     * You may obtain a copy of the License at
   1892     *
   1893     * http://www.apache.org/licenses/LICENSE-2.0
   1894     *
   1895     * Unless required by applicable law or agreed to in writing, software
   1896     * distributed under the License is distributed on an "AS IS" BASIS,
   1897     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1898     * See the License for the specific language governing permissions and
   1899     * limitations under the License.
   1900     */
   1901 
   1902    /*
   1903     * File: OP_CHECK_CAST.S
   1904     *
   1905     * Code: Checks to see if a cast is allowed. Uses no substitutions.
   1906     *
   1907     * For: check-cast
   1908     *
   1909     * Description: Throw if the reference in the given register cannot be
   1910     *              cast to the indicated type. The type must be a reference
   1911     *              type (not a primitive type).
   1912     *
   1913     * Format: AA|op BBBB (21c)
   1914     *
   1915     * Syntax: op vAA, type@BBBB
   1916     */
   1917 
   1918     movl        rGLUE, %edx             # get MterpGlue pointer
   1919     movl        offGlue_methodClassDex(%edx), %eax # %eax<- pDvmDex
   1920     GET_VREG    rINST                   # rINST<- vAA
   1921     movl        offDvmDex_pResClasses(%eax), %eax # %eax<- pDvmDex->pResClasses
   1922     cmp         $0, rINST              # check for null reference object
   1923     je          .LOP_CHECK_CAST_okay        # can always cast null object
   1924     FETCH       1, %ecx                 # %ecx<- BBBB
   1925     movl        (%eax, %ecx, 4), %ecx   # %ecx<- resolved class
   1926     cmp         $0, %ecx               # check if classes is resolved before?
   1927     je          .LOP_CHECK_CAST_resolve     # resolve class
   1928     jmp         .LOP_CHECK_CAST_resolved    # continue
   1929 
   1930 /* ------------------------------ */
   1931     .balign 64
   1932 .L_OP_INSTANCE_OF: /* 0x20 */
   1933 /* File: x86-atom/OP_INSTANCE_OF.S */
   1934    /* Copyright (C) 2008 The Android Open Source Project
   1935     *
   1936     * Licensed under the Apache License, Version 2.0 (the "License");
   1937     * you may not use this file except in compliance with the License.
   1938     * You may obtain a copy of the License at
   1939     *
   1940     * http://www.apache.org/licenses/LICENSE-2.0
   1941     *
   1942     * Unless required by applicable law or agreed to in writing, software
   1943     * distributed under the License is distributed on an "AS IS" BASIS,
   1944     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1945     * See the License for the specific language governing permissions and
   1946     * limitations under the License.
   1947     */
   1948 
   1949    /*
   1950     * File: OP_INSTANCE_OF.S
   1951     *
   1952     * Code: Checks if object is instance of a class. Uses no substitutions.
   1953     *
   1954     * For: instance-of
   1955     *
   1956     * Description: Store in the given destination register 1 if the indicated
   1957     *              reference is an instance of the given type, or 0 if not.
   1958     *              The type must be a reference type (not a primitive type).
   1959     *
   1960     * Format: B|A|op CCCC (22c)
   1961     *
   1962     * Syntax: op vA, vB, type@CCCC
   1963     *         op vA, vB, field@CCCC
   1964     */
   1965 
   1966     movl        rINST, %edx             # %edx<- BA
   1967     shr         $4, %edx               # %edx<- B
   1968     GET_VREG    %edx                    # %edx<- vB
   1969     cmp         $0, %edx               # check for null object
   1970     je          .LOP_INSTANCE_OF_store       # null object
   1971     jmp         .LOP_INSTANCE_OF_break
   1972 
   1973 /* ------------------------------ */
   1974     .balign 64
   1975 .L_OP_ARRAY_LENGTH: /* 0x21 */
   1976 /* File: x86-atom/OP_ARRAY_LENGTH.S */
   1977    /* Copyright (C) 2008 The Android Open Source Project
   1978     *
   1979     * Licensed under the Apache License, Version 2.0 (the "License");
   1980     * you may not use this file except in compliance with the License.
   1981     * You may obtain a copy of the License at
   1982     *
   1983     * http://www.apache.org/licenses/LICENSE-2.0
   1984     *
   1985     * Unless required by applicable law or agreed to in writing, software
   1986     * distributed under the License is distributed on an "AS IS" BASIS,
   1987     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   1988     * See the License for the specific language governing permissions and
   1989     * limitations under the License.
   1990     */
   1991 
   1992    /*
   1993     * File: OP_ARRAY_LENGTH.S
   1994     *
   1995     * Code: 32-bit array length operation.
   1996     *
   1997     * For: array-length
   1998     *
   1999     * Description: Store the length of the indicated array in the given
   2000     *              destination register. vB <- offArrayObject_length(vA)
   2001     *
   2002     * Format: B|A|op (12x)
   2003     *
   2004     * Syntax: op vA, vB
   2005     */
   2006 
   2007     movl        rINST, %eax             # %eax<- BA
   2008     shr         $4, %eax               # %eax<- B
   2009     andl        $15, rINST             # rINST<- A
   2010     GET_VREG    %eax                    # %eax<- vB
   2011     cmp         $0, %eax               # check for null array object
   2012     je          common_errNullObject    # handle null array object
   2013     FFETCH_ADV  1, %edx                 # %edx<- next instruction hi; fetch, advance
   2014     movl        offArrayObject_length(%eax), %eax # %eax<- array length
   2015     movl        %eax, (rFP, rINST, 4)   # vA<- %eax; array length
   2016     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   2017 
   2018 /* ------------------------------ */
   2019     .balign 64
   2020 .L_OP_NEW_INSTANCE: /* 0x22 */
   2021 /* File: x86-atom/OP_NEW_INSTANCE.S */
   2022    /* Copyright (C) 2008 The Android Open Source Project
   2023     *
   2024     * Licensed under the Apache License, Version 2.0 (the "License");
   2025     * you may not use this file except in compliance with the License.
   2026     * You may obtain a copy of the License at
   2027     *
   2028     * http://www.apache.org/licenses/LICENSE-2.0
   2029     *
   2030     * Unless required by applicable law or agreed to in writing, software
   2031     * distributed under the License is distributed on an "AS IS" BASIS,
   2032     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2033     * See the License for the specific language governing permissions and
   2034     * limitations under the License.
   2035     */
   2036 
   2037    /*
   2038     * File: OP_NEW_INSTANCE.S
   2039     *
   2040     * Code: Create a new instance of a given type. Uses no substitutions.
   2041     *
   2042     * For: new-instance
   2043     *
   2044     * Description: Construct a new instance of the indicated type,
   2045     *              storing a reference to it in the destination.
   2046     *              The type must refer to a non-array class.
   2047     *
   2048     *
   2049     *
   2050     * Format: AA|op BBBB (21c)
   2051     *
   2052     * Syntax: op vAA, type@BBBB
   2053     *         op vAA, field@BBBB
   2054     *         op vAA, string@BBBB
   2055     */
   2056 
   2057     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   2058     movl        offGlue_methodClassDex(%ecx), %ecx # %ecx<- glue->pDvmDex
   2059     FETCH       1, %edx                 # %edx<- BBBB
   2060     movl        offDvmDex_pResClasses(%ecx), %ecx # %ecx<- glue->pDvmDex->pResClasses
   2061     movl        (%ecx, %edx, 4), %edx   # %edx<- vB
   2062     EXPORT_PC                           # required for resolve
   2063     cmp         $0, %edx               # check for null
   2064     je          .LOP_NEW_INSTANCE_resolve     # need to resolve
   2065 
   2066    /*
   2067     *  %edx holds class object
   2068     */
   2069 
   2070 .LOP_NEW_INSTANCE_resolved:
   2071     movzbl      offClassObject_status(%edx), %eax # %eax<- class status
   2072     cmp         $CLASS_INITIALIZED, %eax # check if class is initialized
   2073     jne         .LOP_NEW_INSTANCE_needinit    # initialize class
   2074 
   2075    /*
   2076     *  %edx holds class object
   2077     */
   2078 
   2079 .LOP_NEW_INSTANCE_initialized:
   2080     testl       $(ACC_INTERFACE|ACC_ABSTRACT), offClassObject_accessFlags(%edx)
   2081     mov         $ALLOC_DONT_TRACK, %eax # %eax<- flag for alloc call
   2082     je          .LOP_NEW_INSTANCE_finish      # continue
   2083     jmp         .LOP_NEW_INSTANCE_abstract    # handle abstract or interface
   2084 
   2085    /*
   2086     *  %edx holds class object
   2087     *  %eax holds flags for alloc call
   2088     */
   2089 
   2090 
   2091 /* ------------------------------ */
   2092     .balign 64
   2093 .L_OP_NEW_ARRAY: /* 0x23 */
   2094 /* File: x86-atom/OP_NEW_ARRAY.S */
   2095    /* Copyright (C) 2008 The Android Open Source Project
   2096     *
   2097     * Licensed under the Apache License, Version 2.0 (the "License");
   2098     * you may not use this file except in compliance with the License.
   2099     * You may obtain a copy of the License at
   2100     *
   2101     * http://www.apache.org/licenses/LICENSE-2.0
   2102     *
   2103     * Unless required by applicable law or agreed to in writing, software
   2104     * distributed under the License is distributed on an "AS IS" BASIS,
   2105     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2106     * See the License for the specific language governing permissions and
   2107     * limitations under the License.
   2108     */
   2109 
   2110    /*
   2111     * File: OP_NEW_ARRAY.S
   2112     *
   2113     * Code: Create a new array. Uses no substitutions.
   2114     *
   2115     * For: new-array
   2116     *
   2117     * Description: Construct a new array of the indicated type and size.
   2118     *              The type must be an array type.
   2119     *
   2120     * Format: B|A|op CCCC (22c)
   2121     *
   2122     * Syntax: op vA, vB, type@CCCC
   2123     *         op vA, vB, field@CCCC
   2124     */
   2125 
   2126     movl        rGLUE, %eax             # %eax<- pMterpGlue
   2127     movl        rINST, %edx             # %edx<- BA
   2128     shr         $4, %edx               # %edx<- B
   2129     movl        offGlue_methodClassDex(%eax), %eax # %eax<- glue->pDvmDex
   2130     FETCH       1, %ecx                 # %ecx<- CCCC
   2131     GET_VREG    %edx                    # %edx<- vB
   2132     movl        offDvmDex_pResClasses(%eax), %eax # %eax<- glue->pDvmDex->pResClasses
   2133     cmp         $0, %edx               # check for negative length
   2134     movl        (%eax, %ecx, 4), %eax   # %eax<- resolved class
   2135     js          common_errNegativeArraySize # handle negative array length
   2136     cmp         $0, %eax               # check for null
   2137     EXPORT_PC                           # required for resolve
   2138     jne         .LOP_NEW_ARRAY_finish      # already resovled so continue
   2139     jmp         .LOP_NEW_ARRAY_resolve     # need to resolve
   2140 
   2141 /* ------------------------------ */
   2142     .balign 64
   2143 .L_OP_FILLED_NEW_ARRAY: /* 0x24 */
   2144 /* File: x86-atom/OP_FILLED_NEW_ARRAY.S */
   2145    /* Copyright (C) 2008 The Android Open Source Project
   2146     *
   2147     * Licensed under the Apache License, Version 2.0 (the "License");
   2148     * you may not use this file except in compliance with the License.
   2149     * You may obtain a copy of the License at
   2150     *
   2151     * http://www.apache.org/licenses/LICENSE-2.0
   2152     *
   2153     * Unless required by applicable law or agreed to in writing, software
   2154     * distributed under the License is distributed on an "AS IS" BASIS,
   2155     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2156     * See the License for the specific language governing permissions and
   2157     * limitations under the License.
   2158     */
   2159 
   2160    /*
   2161     * File: OP_FILLED_NEW_ARRAY.S
   2162     *
   2163     * Code: Constructs and fills an array with the given data. Provides
   2164     *
   2165     * For: float-to-int
   2166     *
   2167     * Description: Construct an array of the given type and size,
   2168     *              filling it with the supplied contents. The type
   2169     *              must be an array type. The array's contents
   2170     *              must be single-word. The constructed instance
   2171     *              is stored as a result in the same way that the
   2172     *              method invocation instructions store their results,
   2173     *              so the constructed instance must be moved to a
   2174     *              register with a subsequent move-result-object
   2175     *              instruction.
   2176     *
   2177     * Format: B|A|op CCCC G|F|E|D (35c)
   2178     *         AA|op BBBB CCCC (3rc) (range)
   2179     *
   2180     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, vtaboff@CCCC
   2181     *         [B=4] op {vD, vE, vF, vG}, vtaboff@CCCC
   2182     *         [B=3] op {vD, vE, vF}, vtaboff@CCCC
   2183     *         [B=2] op {vD, vE}, vtaboff@CCCC
   2184     *         [B=1] op {vD}, vtaboff@CCCC
   2185     *
   2186     *         op {vCCCC .. vNNNN}, meth@BBBB
   2187     *         op {vCCCC .. vNNNN}, type@BBBB
   2188     */
   2189 
   2190 
   2191     movl        rGLUE, %edx             # %edx<- MterpGlue pointer
   2192     movl        offGlue_methodClassDex(%edx), %edx # %edx<- glue->methodClassDex
   2193     movl        offDvmDex_pResClasses(%edx), %edx # %edx<- glue->methodClassDex->pResClasses
   2194     FETCH       1, %ecx                 # %ecx<- BBBB
   2195     EXPORT_PC
   2196     movl (%edx, %ecx, 4), %eax # %eax<- possibly resolved class
   2197     cmp         $0, %eax               # %eax<- check if already resolved
   2198     jne         .LOP_FILLED_NEW_ARRAY_continue
   2199     jmp         .LOP_FILLED_NEW_ARRAY_break
   2200 
   2201 /* ------------------------------ */
   2202     .balign 64
   2203 .L_OP_FILLED_NEW_ARRAY_RANGE: /* 0x25 */
   2204 /* File: x86-atom/OP_FILLED_NEW_ARRAY_RANGE.S */
   2205    /* Copyright (C) 2008 The Android Open Source Project
   2206     *
   2207     * Licensed under the Apache License, Version 2.0 (the "License");
   2208     * you may not use this file except in compliance with the License.
   2209     * You may obtain a copy of the License at
   2210     *
   2211     * http://www.apache.org/licenses/LICENSE-2.0
   2212     *
   2213     * Unless required by applicable law or agreed to in writing, software
   2214     * distributed under the License is distributed on an "AS IS" BASIS,
   2215     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2216     * See the License for the specific language governing permissions and
   2217     * limitations under the License.
   2218     */
   2219 
   2220    /*
   2221     * File: OP_FILLED_NEW_ARRAY_RANGE.S
   2222     */
   2223 
   2224 /* File: x86-atom/OP_FILLED_NEW_ARRAY.S */
   2225    /* Copyright (C) 2008 The Android Open Source Project
   2226     *
   2227     * Licensed under the Apache License, Version 2.0 (the "License");
   2228     * you may not use this file except in compliance with the License.
   2229     * You may obtain a copy of the License at
   2230     *
   2231     * http://www.apache.org/licenses/LICENSE-2.0
   2232     *
   2233     * Unless required by applicable law or agreed to in writing, software
   2234     * distributed under the License is distributed on an "AS IS" BASIS,
   2235     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2236     * See the License for the specific language governing permissions and
   2237     * limitations under the License.
   2238     */
   2239 
   2240    /*
   2241     * File: OP_FILLED_NEW_ARRAY.S
   2242     *
   2243     * Code: Constructs and fills an array with the given data. Provides
   2244     *
   2245     * For: float-to-int
   2246     *
   2247     * Description: Construct an array of the given type and size,
   2248     *              filling it with the supplied contents. The type
   2249     *              must be an array type. The array's contents
   2250     *              must be single-word. The constructed instance
   2251     *              is stored as a result in the same way that the
   2252     *              method invocation instructions store their results,
   2253     *              so the constructed instance must be moved to a
   2254     *              register with a subsequent move-result-object
   2255     *              instruction.
   2256     *
   2257     * Format: B|A|op CCCC G|F|E|D (35c)
   2258     *         AA|op BBBB CCCC (3rc) (range)
   2259     *
   2260     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, vtaboff@CCCC
   2261     *         [B=4] op {vD, vE, vF, vG}, vtaboff@CCCC
   2262     *         [B=3] op {vD, vE, vF}, vtaboff@CCCC
   2263     *         [B=2] op {vD, vE}, vtaboff@CCCC
   2264     *         [B=1] op {vD}, vtaboff@CCCC
   2265     *
   2266     *         op {vCCCC .. vNNNN}, meth@BBBB
   2267     *         op {vCCCC .. vNNNN}, type@BBBB
   2268     */
   2269 
   2270 
   2271     movl        rGLUE, %edx             # %edx<- MterpGlue pointer
   2272     movl        offGlue_methodClassDex(%edx), %edx # %edx<- glue->methodClassDex
   2273     movl        offDvmDex_pResClasses(%edx), %edx # %edx<- glue->methodClassDex->pResClasses
   2274     FETCH       1, %ecx                 # %ecx<- BBBB
   2275     EXPORT_PC
   2276     movl (%edx, %ecx, 4), %eax # %eax<- possibly resolved class
   2277     cmp         $0, %eax               # %eax<- check if already resolved
   2278     jne         .LOP_FILLED_NEW_ARRAY_RANGE_continue
   2279     jmp         .LOP_FILLED_NEW_ARRAY_RANGE_break
   2280 
   2281 
   2282 /* ------------------------------ */
   2283     .balign 64
   2284 .L_OP_FILL_ARRAY_DATA: /* 0x26 */
   2285 /* File: x86-atom/OP_FILL_ARRAY_DATA.S */
   2286    /* Copyright (C) 2008 The Android Open Source Project
   2287     *
   2288     * Licensed under the Apache License, Version 2.0 (the "License");
   2289     * you may not use this file except in compliance with the License.
   2290     * You may obtain a copy of the License at
   2291     *
   2292     * http://www.apache.org/licenses/LICENSE-2.0
   2293     *
   2294     * Unless required by applicable law or agreed to in writing, software
   2295     * distributed under the License is distributed on an "AS IS" BASIS,
   2296     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2297     * See the License for the specific language governing permissions and
   2298     * limitations under the License.
   2299     */
   2300 
   2301    /*
   2302     * File: OP_FILL_ARRAY_DATA.S
   2303     *
   2304     * Code: Fills an array with given data. Uses no substitutions.
   2305     *
   2306     * For: fill-array-data
   2307     *
   2308     * Description: Fill the given array with the idicated data. The reference
   2309     *              must be an array of primitives, and the data table must
   2310     *              match it in type and size
   2311     *
   2312     * Format: AA|op BBBBlo BBBBhi (31t)
   2313     *
   2314     * Syntax: op vAA, +BBBBBBBB
   2315     */
   2316 
   2317     FETCH       1, %ecx                 # %ecx<- BBBBlo
   2318     FETCH       2, %edx                 # %edx<- BBBBhi
   2319     shl         $16, %edx              # prepare to create +BBBBBBBB
   2320     or          %ecx, %edx              # %edx<- +BBBBBBBB
   2321     lea         (rPC, %edx, 2), %edx    # %edx<- PC + +BBBBBBBB; array data location
   2322     EXPORT_PC
   2323     push        %edx
   2324     push        (rFP, rINST, 4)
   2325     call        dvmInterpHandleFillArrayData # call: (ArrayObject* arrayObject, const u2* arrayData)
   2326                                              # return: bool
   2327     FFETCH_ADV  3, %edx                 # %edx<- next instruction hi; fetch, advance
   2328     cmp         $0, %eax
   2329     lea         8(%esp), %esp
   2330     je          common_exceptionThrown
   2331     FGETOP_JMP  3, %edx                 # jump to next instruction; getop, jmp
   2332 
   2333 /* ------------------------------ */
   2334     .balign 64
   2335 .L_OP_THROW: /* 0x27 */
   2336 /* File: x86-atom/OP_THROW.S */
   2337    /* Copyright (C) 2008 The Android Open Source Project
   2338     *
   2339     * Licensed under the Apache License, Version 2.0 (the "License");
   2340     * you may not use this file except in compliance with the License.
   2341     * You may obtain a copy of the License at
   2342     *
   2343     * http://www.apache.org/licenses/LICENSE-2.0
   2344     *
   2345     * Unless required by applicable law or agreed to in writing, software
   2346     * distributed under the License is distributed on an "AS IS" BASIS,
   2347     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2348     * See the License for the specific language governing permissions and
   2349     * limitations under the License.
   2350     */
   2351 
   2352    /*
   2353     * File: OP_THROW.S
   2354     *
   2355     * Code: Throw an exception
   2356     *
   2357     * For: throw
   2358     *
   2359     * Description: Throw an exception object in the current thread.
   2360     *
   2361     * Format: AA|op (11x)
   2362     *
   2363     * Syntax: op vAA
   2364     */
   2365 
   2366     movl        rGLUE, %eax             # %eax<- pMterpGlue
   2367     EXPORT_PC                           # export the pc
   2368     GET_VREG    rINST                   # rINST<- vAA
   2369     cmp         $0, rINST              # check for null
   2370     movl        offGlue_self(%eax), %ecx # %ecx<- glue->self
   2371     je          common_errNullObject    # handle null object
   2372     movl        rINST, offThread_exception(%ecx) # thread->exception<- object
   2373     jmp         common_exceptionThrown  # handle exception
   2374 
   2375 /* ------------------------------ */
   2376     .balign 64
   2377 .L_OP_GOTO: /* 0x28 */
   2378 /* File: x86-atom/OP_GOTO.S */
   2379    /* Copyright (C) 2008 The Android Open Source Project
   2380     *
   2381     * Licensed under the Apache License, Version 2.0 (the "License");
   2382     * you may not use this file except in compliance with the License.
   2383     * You may obtain a copy of the License at
   2384     *
   2385     * http://www.apache.org/licenses/LICENSE-2.0
   2386     *
   2387     * Unless required by applicable law or agreed to in writing, software
   2388     * distributed under the License is distributed on an "AS IS" BASIS,
   2389     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2390     * See the License for the specific language governing permissions and
   2391     * limitations under the License.
   2392     */
   2393 
   2394    /*
   2395     * File: OP_GOTO.S
   2396     *
   2397     * Code: Do an unconditional branch. Uses no substitutions.
   2398     *
   2399     * For: goto
   2400     *
   2401     * Description: Performs an unconditionally jump to the indicated instruction.
   2402     *              The branch uses an 8-bit offset that cannot be zero.
   2403     *
   2404     * Format: AA|op (10t)
   2405     *
   2406     * Syntax: op +AA
   2407     */
   2408 
   2409 LOP_GOTO.S:
   2410 
   2411     movsbl      rINSTbl, %edx           # %edx<- +AA
   2412     shl         $1, %edx               # %edx is shifted for byte offset
   2413     js          common_periodicChecks_backwardBranch  # do check on backwards branch
   2414     FINISH_RB   %edx, %ecx              # jump to next instruction
   2415 
   2416 /* ------------------------------ */
   2417     .balign 64
   2418 .L_OP_GOTO_16: /* 0x29 */
   2419 /* File: x86-atom/OP_GOTO_16.S */
   2420    /* Copyright (C) 2008 The Android Open Source Project
   2421     *
   2422     * Licensed under the Apache License, Version 2.0 (the "License");
   2423     * you may not use this file except in compliance with the License.
   2424     * You may obtain a copy of the License at
   2425     *
   2426     * http://www.apache.org/licenses/LICENSE-2.0
   2427     *
   2428     * Unless required by applicable law or agreed to in writing, software
   2429     * distributed under the License is distributed on an "AS IS" BASIS,
   2430     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2431     * See the License for the specific language governing permissions and
   2432     * limitations under the License.
   2433     */
   2434 
   2435    /*
   2436     * File: OP_GOTO_16.S
   2437     *
   2438     * Code: Do an unconditional branch. Uses no substitutions.
   2439     *
   2440     * For: goto/16
   2441     *
   2442     * Description: Performs an unconditionally jump to the indicated instruction.
   2443     *              The branch uses a 16-bit offset that cannot be zero.
   2444     *
   2445     * Format: |op AAAA (20t)
   2446     *
   2447     * Syntax: op +AAAA
   2448     */
   2449 
   2450     FETCHs      1, %edx                 # %edx<- ssssAAAA (sign-extended)
   2451     shl         $1, %edx               # %edx is doubled to get the byte offset
   2452     js          common_periodicChecks_backwardBranch  # do check on backwards branch
   2453     FINISH_RB   %edx, %ecx              # jump to next instruction
   2454 
   2455 /* ------------------------------ */
   2456     .balign 64
   2457 .L_OP_GOTO_32: /* 0x2a */
   2458 /* File: x86-atom/OP_GOTO_32.S */
   2459    /* Copyright (C) 2008 The Android Open Source Project
   2460     *
   2461     * Licensed under the Apache License, Version 2.0 (the "License");
   2462     * you may not use this file except in compliance with the License.
   2463     * You may obtain a copy of the License at
   2464     *
   2465     * http://www.apache.org/licenses/LICENSE-2.0
   2466     *
   2467     * Unless required by applicable law or agreed to in writing, software
   2468     * distributed under the License is distributed on an "AS IS" BASIS,
   2469     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2470     * See the License for the specific language governing permissions and
   2471     * limitations under the License.
   2472     */
   2473 
   2474    /*
   2475     * File: OP_GOTO_32.S
   2476     *
   2477     * Code: Do an unconditional branch. Uses no substitutions.
   2478     *
   2479     * For: goto/32
   2480     *
   2481     * Description:  Performs an unconditionally jump to the indicated instruction.
   2482     *               The branch uses a 32-bit offset that can be zero.
   2483     *
   2484     * Format: |op AAAAlo AAAAhi (30t)
   2485     *
   2486     * Syntax: op +AAAAAAAA
   2487     */
   2488 
   2489     FETCH       1, %edx                 # %edx<- AAAAlo
   2490     FETCH       2, %ecx                 # %ecx<- AAAAhi
   2491     shl         $16, %ecx              # prepare to create +AAAAAAAA
   2492     or          %ecx, %edx              # %edx<- +AAAAAAAA
   2493     shl         $1, %edx               # %edx is doubled to get the byte offset
   2494     jle          common_periodicChecks_backwardBranch  # do check on backwards branch
   2495     FINISH_RB   %edx, %ecx              # jump to next instruction
   2496 
   2497 /* ------------------------------ */
   2498     .balign 64
   2499 .L_OP_PACKED_SWITCH: /* 0x2b */
   2500 /* File: x86-atom/OP_PACKED_SWITCH.S */
   2501    /* Copyright (C) 2008 The Android Open Source Project
   2502     *
   2503     * Licensed under the Apache License, Version 2.0 (the "License");
   2504     * you may not use this file except in compliance with the License.
   2505     * You may obtain a copy of the License at
   2506     *
   2507     * http://www.apache.org/licenses/LICENSE-2.0
   2508     *
   2509     * Unless required by applicable law or agreed to in writing, software
   2510     * distributed under the License is distributed on an "AS IS" BASIS,
   2511     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2512     * See the License for the specific language governing permissions and
   2513     * limitations under the License.
   2514     */
   2515 
   2516    /*
   2517     * File: OP_PACKED_SWITCH.S
   2518     *
   2519     * Code: Jump to a new instruction using a jump table
   2520     *
   2521     * For: packed-switch, sparse-switch
   2522     *
   2523     * Description: Jump to a new instruction based on the value in the given
   2524     *              register, using a table of offsets corresponding to each
   2525     *              value in a particular integral range, or fall through to
   2526     *              the next instruction if there is no match.
   2527     *
   2528     * Format: AA|op BBBBlo BBBBhi (31t)
   2529     *
   2530     * Syntax: op vAA, +BBBBBBBB
   2531     */
   2532 
   2533 
   2534     FETCH       1, %ecx                 # %ecx<- BBBBlo
   2535     FETCH       2, %edx                 # %edx<- BBBBhi
   2536     shl         $16, %edx              # prepare to create +BBBBBBBB
   2537     or          %edx, %ecx              # %ecx<- +BBBBBBBB
   2538     GET_VREG    rINST                   # rINST<- vAA
   2539     movl        rINST, -4(%esp)         # push parameter vAA
   2540     lea         (rPC, %ecx, 2), %ecx    # %ecx<- PC + +BBBBBBBB*2
   2541     movl        %ecx, -8(%esp)          # push parameter PC + +BBBBBBBB*2
   2542     lea         -8(%esp), %esp
   2543     call        dvmInterpHandlePackedSwitch                   # call code-unit branch offset
   2544     shl         $1, %eax               # shift for byte offset
   2545     movl        %eax, %edx              # %edx<- offset
   2546     lea         8(%esp), %esp
   2547     jle         common_periodicChecks_backwardBranch  # do backward branch
   2548     jmp         .LOP_PACKED_SWITCH_finish
   2549 
   2550 /* ------------------------------ */
   2551     .balign 64
   2552 .L_OP_SPARSE_SWITCH: /* 0x2c */
   2553 /* File: x86-atom/OP_SPARSE_SWITCH.S */
   2554    /* Copyright (C) 2008 The Android Open Source Project
   2555     *
   2556     * Licensed under the Apache License, Version 2.0 (the "License");
   2557     * you may not use this file except in compliance with the License.
   2558     * You may obtain a copy of the License at
   2559     *
   2560     * http://www.apache.org/licenses/LICENSE-2.0
   2561     *
   2562     * Unless required by applicable law or agreed to in writing, software
   2563     * distributed under the License is distributed on an "AS IS" BASIS,
   2564     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2565     * See the License for the specific language governing permissions and
   2566     * limitations under the License.
   2567     */
   2568 
   2569    /*
   2570     * File: OP_SPARSE_SWITCH.S
   2571     */
   2572 
   2573 /* File: x86-atom/OP_PACKED_SWITCH.S */
   2574    /* Copyright (C) 2008 The Android Open Source Project
   2575     *
   2576     * Licensed under the Apache License, Version 2.0 (the "License");
   2577     * you may not use this file except in compliance with the License.
   2578     * You may obtain a copy of the License at
   2579     *
   2580     * http://www.apache.org/licenses/LICENSE-2.0
   2581     *
   2582     * Unless required by applicable law or agreed to in writing, software
   2583     * distributed under the License is distributed on an "AS IS" BASIS,
   2584     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2585     * See the License for the specific language governing permissions and
   2586     * limitations under the License.
   2587     */
   2588 
   2589    /*
   2590     * File: OP_PACKED_SWITCH.S
   2591     *
   2592     * Code: Jump to a new instruction using a jump table
   2593     *
   2594     * For: packed-switch, sparse-switch
   2595     *
   2596     * Description: Jump to a new instruction based on the value in the given
   2597     *              register, using a table of offsets corresponding to each
   2598     *              value in a particular integral range, or fall through to
   2599     *              the next instruction if there is no match.
   2600     *
   2601     * Format: AA|op BBBBlo BBBBhi (31t)
   2602     *
   2603     * Syntax: op vAA, +BBBBBBBB
   2604     */
   2605 
   2606 
   2607     FETCH       1, %ecx                 # %ecx<- BBBBlo
   2608     FETCH       2, %edx                 # %edx<- BBBBhi
   2609     shl         $16, %edx              # prepare to create +BBBBBBBB
   2610     or          %edx, %ecx              # %ecx<- +BBBBBBBB
   2611     GET_VREG    rINST                   # rINST<- vAA
   2612     movl        rINST, -4(%esp)         # push parameter vAA
   2613     lea         (rPC, %ecx, 2), %ecx    # %ecx<- PC + +BBBBBBBB*2
   2614     movl        %ecx, -8(%esp)          # push parameter PC + +BBBBBBBB*2
   2615     lea         -8(%esp), %esp
   2616     call        dvmInterpHandleSparseSwitch                   # call code-unit branch offset
   2617     shl         $1, %eax               # shift for byte offset
   2618     movl        %eax, %edx              # %edx<- offset
   2619     lea         8(%esp), %esp
   2620     jle         common_periodicChecks_backwardBranch  # do backward branch
   2621     jmp         .LOP_SPARSE_SWITCH_finish
   2622 
   2623 
   2624 /* ------------------------------ */
   2625     .balign 64
   2626 .L_OP_CMPL_FLOAT: /* 0x2d */
   2627 /* File: x86-atom/OP_CMPL_FLOAT.S */
   2628    /* Copyright (C) 2008 The Android Open Source Project
   2629     *
   2630     * Licensed under the Apache License, Version 2.0 (the "License");
   2631     * you may not use this file except in compliance with the License.
   2632     * You may obtain a copy of the License at
   2633     *
   2634     * http://www.apache.org/licenses/LICENSE-2.0
   2635     *
   2636     * Unless required by applicable law or agreed to in writing, software
   2637     * distributed under the License is distributed on an "AS IS" BASIS,
   2638     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2639     * See the License for the specific language governing permissions and
   2640     * limitations under the License.
   2641     */
   2642 
   2643    /*
   2644     * File: OP_CMPL_FLOAT.S
   2645     *
   2646     * Code: Provides a "nan" variable to specify the return value for
   2647     *       NaN. Provides a variable "sod" which appends a "s" or a "d"
   2648     *       to the move and comparison instructions, depending on if we
   2649     *       are working with a float or a double. For instructions
   2650     *       cmpx-float and cmpx-double, the x will be eiher a g or a l
   2651     *       to specify positive or negative bias for NaN.
   2652     *
   2653     * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
   2654     *
   2655     * Description: Perform the indicated floating point or long comparison,
   2656     *              storing 0 if the two arguments are equal, 1 if the second
   2657     *              argument is larger, or -1 if the first argument is larger.
   2658     *
   2659     * Format: AA|op CC|BB (23x)
   2660     *
   2661     * Syntax: op vAA, vBB, vCC
   2662     */
   2663 
   2664 
   2665     FETCH_BB    1, %ecx                 # %ecx<- BB
   2666     FETCH_CC    1, %edx                 # %edx<- CC
   2667     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   2668     movss    (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   2669     comiss   (rFP, %edx, 4), %xmm0   # do comparison
   2670     ja          .LOP_CMPL_FLOAT_greater
   2671     jp          .LOP_CMPL_FLOAT_finalNan
   2672     jz          .LOP_CMPL_FLOAT_final
   2673 
   2674 .LOP_CMPL_FLOAT_less:
   2675     movl        $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
   2676     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   2677 
   2678 
   2679 /* ------------------------------ */
   2680     .balign 64
   2681 .L_OP_CMPG_FLOAT: /* 0x2e */
   2682 /* File: x86-atom/OP_CMPG_FLOAT.S */
   2683    /* Copyright (C) 2008 The Android Open Source Project
   2684     *
   2685     * Licensed under the Apache License, Version 2.0 (the "License");
   2686     * you may not use this file except in compliance with the License.
   2687     * You may obtain a copy of the License at
   2688     *
   2689     * http://www.apache.org/licenses/LICENSE-2.0
   2690     *
   2691     * Unless required by applicable law or agreed to in writing, software
   2692     * distributed under the License is distributed on an "AS IS" BASIS,
   2693     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2694     * See the License for the specific language governing permissions and
   2695     * limitations under the License.
   2696     */
   2697 
   2698    /*
   2699     * File: OP_CMPG_FLOAT.S
   2700     */
   2701 
   2702 /* File: x86-atom/OP_CMPL_FLOAT.S */
   2703    /* Copyright (C) 2008 The Android Open Source Project
   2704     *
   2705     * Licensed under the Apache License, Version 2.0 (the "License");
   2706     * you may not use this file except in compliance with the License.
   2707     * You may obtain a copy of the License at
   2708     *
   2709     * http://www.apache.org/licenses/LICENSE-2.0
   2710     *
   2711     * Unless required by applicable law or agreed to in writing, software
   2712     * distributed under the License is distributed on an "AS IS" BASIS,
   2713     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2714     * See the License for the specific language governing permissions and
   2715     * limitations under the License.
   2716     */
   2717 
   2718    /*
   2719     * File: OP_CMPL_FLOAT.S
   2720     *
   2721     * Code: Provides a "nan" variable to specify the return value for
   2722     *       NaN. Provides a variable "sod" which appends a "s" or a "d"
   2723     *       to the move and comparison instructions, depending on if we
   2724     *       are working with a float or a double. For instructions
   2725     *       cmpx-float and cmpx-double, the x will be eiher a g or a l
   2726     *       to specify positive or negative bias for NaN.
   2727     *
   2728     * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
   2729     *
   2730     * Description: Perform the indicated floating point or long comparison,
   2731     *              storing 0 if the two arguments are equal, 1 if the second
   2732     *              argument is larger, or -1 if the first argument is larger.
   2733     *
   2734     * Format: AA|op CC|BB (23x)
   2735     *
   2736     * Syntax: op vAA, vBB, vCC
   2737     */
   2738 
   2739 
   2740     FETCH_BB    1, %ecx                 # %ecx<- BB
   2741     FETCH_CC    1, %edx                 # %edx<- CC
   2742     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   2743     movss    (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   2744     comiss   (rFP, %edx, 4), %xmm0   # do comparison
   2745     ja          .LOP_CMPG_FLOAT_greater
   2746     jp          .LOP_CMPG_FLOAT_finalNan
   2747     jz          .LOP_CMPG_FLOAT_final
   2748 
   2749 .LOP_CMPG_FLOAT_less:
   2750     movl        $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
   2751     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   2752 
   2753 
   2754 
   2755 /* ------------------------------ */
   2756     .balign 64
   2757 .L_OP_CMPL_DOUBLE: /* 0x2f */
   2758 /* File: x86-atom/OP_CMPL_DOUBLE.S */
   2759    /* Copyright (C) 2008 The Android Open Source Project
   2760     *
   2761     * Licensed under the Apache License, Version 2.0 (the "License");
   2762     * you may not use this file except in compliance with the License.
   2763     * You may obtain a copy of the License at
   2764     *
   2765     * http://www.apache.org/licenses/LICENSE-2.0
   2766     *
   2767     * Unless required by applicable law or agreed to in writing, software
   2768     * distributed under the License is distributed on an "AS IS" BASIS,
   2769     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2770     * See the License for the specific language governing permissions and
   2771     * limitations under the License.
   2772     */
   2773 
   2774    /*
   2775     * File: OP_CMPL_DOUBLE.S
   2776     */
   2777 
   2778 /* File: x86-atom/OP_CMPL_FLOAT.S */
   2779    /* Copyright (C) 2008 The Android Open Source Project
   2780     *
   2781     * Licensed under the Apache License, Version 2.0 (the "License");
   2782     * you may not use this file except in compliance with the License.
   2783     * You may obtain a copy of the License at
   2784     *
   2785     * http://www.apache.org/licenses/LICENSE-2.0
   2786     *
   2787     * Unless required by applicable law or agreed to in writing, software
   2788     * distributed under the License is distributed on an "AS IS" BASIS,
   2789     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2790     * See the License for the specific language governing permissions and
   2791     * limitations under the License.
   2792     */
   2793 
   2794    /*
   2795     * File: OP_CMPL_FLOAT.S
   2796     *
   2797     * Code: Provides a "nan" variable to specify the return value for
   2798     *       NaN. Provides a variable "sod" which appends a "s" or a "d"
   2799     *       to the move and comparison instructions, depending on if we
   2800     *       are working with a float or a double. For instructions
   2801     *       cmpx-float and cmpx-double, the x will be eiher a g or a l
   2802     *       to specify positive or negative bias for NaN.
   2803     *
   2804     * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
   2805     *
   2806     * Description: Perform the indicated floating point or long comparison,
   2807     *              storing 0 if the two arguments are equal, 1 if the second
   2808     *              argument is larger, or -1 if the first argument is larger.
   2809     *
   2810     * Format: AA|op CC|BB (23x)
   2811     *
   2812     * Syntax: op vAA, vBB, vCC
   2813     */
   2814 
   2815 
   2816     FETCH_BB    1, %ecx                 # %ecx<- BB
   2817     FETCH_CC    1, %edx                 # %edx<- CC
   2818     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   2819     movsd    (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   2820     comisd   (rFP, %edx, 4), %xmm0   # do comparison
   2821     ja          .LOP_CMPL_DOUBLE_greater
   2822     jp          .LOP_CMPL_DOUBLE_finalNan
   2823     jz          .LOP_CMPL_DOUBLE_final
   2824 
   2825 .LOP_CMPL_DOUBLE_less:
   2826     movl        $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
   2827     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   2828 
   2829 
   2830 
   2831 /* ------------------------------ */
   2832     .balign 64
   2833 .L_OP_CMPG_DOUBLE: /* 0x30 */
   2834 /* File: x86-atom/OP_CMPG_DOUBLE.S */
   2835    /* Copyright (C) 2008 The Android Open Source Project
   2836     *
   2837     * Licensed under the Apache License, Version 2.0 (the "License");
   2838     * you may not use this file except in compliance with the License.
   2839     * You may obtain a copy of the License at
   2840     *
   2841     * http://www.apache.org/licenses/LICENSE-2.0
   2842     *
   2843     * Unless required by applicable law or agreed to in writing, software
   2844     * distributed under the License is distributed on an "AS IS" BASIS,
   2845     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2846     * See the License for the specific language governing permissions and
   2847     * limitations under the License.
   2848     */
   2849 
   2850    /*
   2851     * File: OP_CMPG_DOUBLE.S
   2852     */
   2853 
   2854 /* File: x86-atom/OP_CMPL_FLOAT.S */
   2855    /* Copyright (C) 2008 The Android Open Source Project
   2856     *
   2857     * Licensed under the Apache License, Version 2.0 (the "License");
   2858     * you may not use this file except in compliance with the License.
   2859     * You may obtain a copy of the License at
   2860     *
   2861     * http://www.apache.org/licenses/LICENSE-2.0
   2862     *
   2863     * Unless required by applicable law or agreed to in writing, software
   2864     * distributed under the License is distributed on an "AS IS" BASIS,
   2865     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2866     * See the License for the specific language governing permissions and
   2867     * limitations under the License.
   2868     */
   2869 
   2870    /*
   2871     * File: OP_CMPL_FLOAT.S
   2872     *
   2873     * Code: Provides a "nan" variable to specify the return value for
   2874     *       NaN. Provides a variable "sod" which appends a "s" or a "d"
   2875     *       to the move and comparison instructions, depending on if we
   2876     *       are working with a float or a double. For instructions
   2877     *       cmpx-float and cmpx-double, the x will be eiher a g or a l
   2878     *       to specify positive or negative bias for NaN.
   2879     *
   2880     * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
   2881     *
   2882     * Description: Perform the indicated floating point or long comparison,
   2883     *              storing 0 if the two arguments are equal, 1 if the second
   2884     *              argument is larger, or -1 if the first argument is larger.
   2885     *
   2886     * Format: AA|op CC|BB (23x)
   2887     *
   2888     * Syntax: op vAA, vBB, vCC
   2889     */
   2890 
   2891 
   2892     FETCH_BB    1, %ecx                 # %ecx<- BB
   2893     FETCH_CC    1, %edx                 # %edx<- CC
   2894     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   2895     movsd    (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   2896     comisd   (rFP, %edx, 4), %xmm0   # do comparison
   2897     ja          .LOP_CMPG_DOUBLE_greater
   2898     jp          .LOP_CMPG_DOUBLE_finalNan
   2899     jz          .LOP_CMPG_DOUBLE_final
   2900 
   2901 .LOP_CMPG_DOUBLE_less:
   2902     movl        $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
   2903     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   2904 
   2905 
   2906 
   2907 /* ------------------------------ */
   2908     .balign 64
   2909 .L_OP_CMP_LONG: /* 0x31 */
   2910 /* File: x86-atom/OP_CMP_LONG.S */
   2911    /* Copyright (C) 2008 The Android Open Source Project
   2912     *
   2913     * Licensed under the Apache License, Version 2.0 (the "License");
   2914     * you may not use this file except in compliance with the License.
   2915     * You may obtain a copy of the License at
   2916     *
   2917     * http://www.apache.org/licenses/LICENSE-2.0
   2918     *
   2919     * Unless required by applicable law or agreed to in writing, software
   2920     * distributed under the License is distributed on an "AS IS" BASIS,
   2921     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2922     * See the License for the specific language governing permissions and
   2923     * limitations under the License.
   2924     */
   2925 
   2926    /*
   2927     * File: OP_CMP_LONG.S
   2928     *
   2929     * Code: Compare floating point values. Uses no substitutions.
   2930     *
   2931     * For: cmp-long
   2932     *
   2933     * Description: Perform a long comparison, storing 0 if the two
   2934     *              arguments are equal, 1 if the second argument is larger
   2935     *              or -1 if the first argument is larger.
   2936     *
   2937     * Format: AA|op CC|BB (23x)
   2938     *
   2939     * Syntax: op vAA, vBB, vCC
   2940     */
   2941 
   2942     FETCH_BB    1, %ecx                 # %ecx<- BB
   2943     FETCH_CC    1, %edx                 # %edx<- CC
   2944     movl        4(rFP, %ecx, 4), %eax   # %eax<- vBBhi
   2945     cmp         4(rFP, %edx, 4), %eax   # compare vCChi and vBBhi
   2946     jl          .LOP_CMP_LONG_less
   2947     jg          .LOP_CMP_LONG_greater
   2948     movl        (rFP, %ecx, 4), %eax    # %eax<- vBBlo
   2949     cmp         (rFP, %edx, 4), %eax    # compare vCClo and vBBlo
   2950     ja          .LOP_CMP_LONG_greater
   2951     jne         .LOP_CMP_LONG_less
   2952     jmp         .LOP_CMP_LONG_final
   2953 
   2954 /* ------------------------------ */
   2955     .balign 64
   2956 .L_OP_IF_EQ: /* 0x32 */
   2957 /* File: x86-atom/OP_IF_EQ.S */
   2958    /* Copyright (C) 2008 The Android Open Source Project
   2959     *
   2960     * Licensed under the Apache License, Version 2.0 (the "License");
   2961     * you may not use this file except in compliance with the License.
   2962     * You may obtain a copy of the License at
   2963     *
   2964     * http://www.apache.org/licenses/LICENSE-2.0
   2965     *
   2966     * Unless required by applicable law or agreed to in writing, software
   2967     * distributed under the License is distributed on an "AS IS" BASIS,
   2968     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2969     * See the License for the specific language governing permissions and
   2970     * limitations under the License.
   2971     */
   2972 
   2973    /*
   2974     * File: OP_IF_EQ.S
   2975     */
   2976 
   2977 /* File: x86-atom/bincmp.S */
   2978    /* Copyright (C) 2008 The Android Open Source Project
   2979     *
   2980     * Licensed under the Apache License, Version 2.0 (the "License");
   2981     * you may not use this file except in compliance with the License.
   2982     * You may obtain a copy of the License at
   2983     *
   2984     * http://www.apache.org/licenses/LICENSE-2.0
   2985     *
   2986     * Unless required by applicable law or agreed to in writing, software
   2987     * distributed under the License is distributed on an "AS IS" BASIS,
   2988     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   2989     * See the License for the specific language governing permissions and
   2990     * limitations under the License.
   2991     */
   2992 
   2993    /*
   2994     * File: bincmp.S
   2995     *
   2996     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   2997     *       variable to specify the reverse comparison to perform.
   2998     *
   2999     * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
   3000     *
   3001     * Description: Branch to the given destination if the comparison
   3002     *              test between the given registers values is true.
   3003     *
   3004     * Format: B|A|op CCCC (22t)
   3005     *
   3006     * Syntax: op vA, vB, +CCCC
   3007     */
   3008 
   3009     movl        rINST,  %eax            # %eax<- BA
   3010     andl        $15, rINST             # rINST<- A
   3011     shr         $4, %eax               # %eax<- B
   3012     GET_VREG    rINST                   # rINST<- vA
   3013     movl        $4, %edx               # %edx<- 4
   3014     cmp         (rFP, %eax, 4), rINST   # compare vA and vB
   3015     jne  1f                      # goto next instruction if reverse
   3016                                         # comparison is true
   3017     FETCHs      1, %edx                 # %edx<- +CCCC, Branch offset
   3018     sal         $1, %edx
   3019     js          common_periodicChecks_backwardBranch
   3020 1:
   3021     FINISH_RB   %edx, %ecx              # jump to next instruction
   3022 
   3023 
   3024 /* ------------------------------ */
   3025     .balign 64
   3026 .L_OP_IF_NE: /* 0x33 */
   3027 /* File: x86-atom/OP_IF_NE.S */
   3028    /* Copyright (C) 2008 The Android Open Source Project
   3029     *
   3030     * Licensed under the Apache License, Version 2.0 (the "License");
   3031     * you may not use this file except in compliance with the License.
   3032     * You may obtain a copy of the License at
   3033     *
   3034     * http://www.apache.org/licenses/LICENSE-2.0
   3035     *
   3036     * Unless required by applicable law or agreed to in writing, software
   3037     * distributed under the License is distributed on an "AS IS" BASIS,
   3038     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3039     * See the License for the specific language governing permissions and
   3040     * limitations under the License.
   3041     */
   3042 
   3043    /*
   3044     * File: OP_IF_NE.S
   3045     */
   3046 
   3047 /* File: x86-atom/bincmp.S */
   3048    /* Copyright (C) 2008 The Android Open Source Project
   3049     *
   3050     * Licensed under the Apache License, Version 2.0 (the "License");
   3051     * you may not use this file except in compliance with the License.
   3052     * You may obtain a copy of the License at
   3053     *
   3054     * http://www.apache.org/licenses/LICENSE-2.0
   3055     *
   3056     * Unless required by applicable law or agreed to in writing, software
   3057     * distributed under the License is distributed on an "AS IS" BASIS,
   3058     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3059     * See the License for the specific language governing permissions and
   3060     * limitations under the License.
   3061     */
   3062 
   3063    /*
   3064     * File: bincmp.S
   3065     *
   3066     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3067     *       variable to specify the reverse comparison to perform.
   3068     *
   3069     * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
   3070     *
   3071     * Description: Branch to the given destination if the comparison
   3072     *              test between the given registers values is true.
   3073     *
   3074     * Format: B|A|op CCCC (22t)
   3075     *
   3076     * Syntax: op vA, vB, +CCCC
   3077     */
   3078 
   3079     movl        rINST,  %eax            # %eax<- BA
   3080     andl        $15, rINST             # rINST<- A
   3081     shr         $4, %eax               # %eax<- B
   3082     GET_VREG    rINST                   # rINST<- vA
   3083     movl        $4, %edx               # %edx<- 4
   3084     cmp         (rFP, %eax, 4), rINST   # compare vA and vB
   3085     je  1f                      # goto next instruction if reverse
   3086                                         # comparison is true
   3087     FETCHs      1, %edx                 # %edx<- +CCCC, Branch offset
   3088     sal         $1, %edx
   3089     js          common_periodicChecks_backwardBranch
   3090 1:
   3091     FINISH_RB   %edx, %ecx              # jump to next instruction
   3092 
   3093 
   3094 /* ------------------------------ */
   3095     .balign 64
   3096 .L_OP_IF_LT: /* 0x34 */
   3097 /* File: x86-atom/OP_IF_LT.S */
   3098    /* Copyright (C) 2008 The Android Open Source Project
   3099     *
   3100     * Licensed under the Apache License, Version 2.0 (the "License");
   3101     * you may not use this file except in compliance with the License.
   3102     * You may obtain a copy of the License at
   3103     *
   3104     * http://www.apache.org/licenses/LICENSE-2.0
   3105     *
   3106     * Unless required by applicable law or agreed to in writing, software
   3107     * distributed under the License is distributed on an "AS IS" BASIS,
   3108     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3109     * See the License for the specific language governing permissions and
   3110     * limitations under the License.
   3111     */
   3112 
   3113    /*
   3114     * File: OP_IF_LT.S
   3115     */
   3116 
   3117 /* File: x86-atom/bincmp.S */
   3118    /* Copyright (C) 2008 The Android Open Source Project
   3119     *
   3120     * Licensed under the Apache License, Version 2.0 (the "License");
   3121     * you may not use this file except in compliance with the License.
   3122     * You may obtain a copy of the License at
   3123     *
   3124     * http://www.apache.org/licenses/LICENSE-2.0
   3125     *
   3126     * Unless required by applicable law or agreed to in writing, software
   3127     * distributed under the License is distributed on an "AS IS" BASIS,
   3128     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3129     * See the License for the specific language governing permissions and
   3130     * limitations under the License.
   3131     */
   3132 
   3133    /*
   3134     * File: bincmp.S
   3135     *
   3136     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3137     *       variable to specify the reverse comparison to perform.
   3138     *
   3139     * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
   3140     *
   3141     * Description: Branch to the given destination if the comparison
   3142     *              test between the given registers values is true.
   3143     *
   3144     * Format: B|A|op CCCC (22t)
   3145     *
   3146     * Syntax: op vA, vB, +CCCC
   3147     */
   3148 
   3149     movl        rINST,  %eax            # %eax<- BA
   3150     andl        $15, rINST             # rINST<- A
   3151     shr         $4, %eax               # %eax<- B
   3152     GET_VREG    rINST                   # rINST<- vA
   3153     movl        $4, %edx               # %edx<- 4
   3154     cmp         (rFP, %eax, 4), rINST   # compare vA and vB
   3155     jge  1f                      # goto next instruction if reverse
   3156                                         # comparison is true
   3157     FETCHs      1, %edx                 # %edx<- +CCCC, Branch offset
   3158     sal         $1, %edx
   3159     js          common_periodicChecks_backwardBranch
   3160 1:
   3161     FINISH_RB   %edx, %ecx              # jump to next instruction
   3162 
   3163 
   3164 /* ------------------------------ */
   3165     .balign 64
   3166 .L_OP_IF_GE: /* 0x35 */
   3167 /* File: x86-atom/OP_IF_GE.S */
   3168    /* Copyright (C) 2008 The Android Open Source Project
   3169     *
   3170     * Licensed under the Apache License, Version 2.0 (the "License");
   3171     * you may not use this file except in compliance with the License.
   3172     * You may obtain a copy of the License at
   3173     *
   3174     * http://www.apache.org/licenses/LICENSE-2.0
   3175     *
   3176     * Unless required by applicable law or agreed to in writing, software
   3177     * distributed under the License is distributed on an "AS IS" BASIS,
   3178     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3179     * See the License for the specific language governing permissions and
   3180     * limitations under the License.
   3181     */
   3182 
   3183    /*
   3184     * File: OP_IF_GE.S
   3185     */
   3186 
   3187 /* File: x86-atom/bincmp.S */
   3188    /* Copyright (C) 2008 The Android Open Source Project
   3189     *
   3190     * Licensed under the Apache License, Version 2.0 (the "License");
   3191     * you may not use this file except in compliance with the License.
   3192     * You may obtain a copy of the License at
   3193     *
   3194     * http://www.apache.org/licenses/LICENSE-2.0
   3195     *
   3196     * Unless required by applicable law or agreed to in writing, software
   3197     * distributed under the License is distributed on an "AS IS" BASIS,
   3198     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3199     * See the License for the specific language governing permissions and
   3200     * limitations under the License.
   3201     */
   3202 
   3203    /*
   3204     * File: bincmp.S
   3205     *
   3206     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3207     *       variable to specify the reverse comparison to perform.
   3208     *
   3209     * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
   3210     *
   3211     * Description: Branch to the given destination if the comparison
   3212     *              test between the given registers values is true.
   3213     *
   3214     * Format: B|A|op CCCC (22t)
   3215     *
   3216     * Syntax: op vA, vB, +CCCC
   3217     */
   3218 
   3219     movl        rINST,  %eax            # %eax<- BA
   3220     andl        $15, rINST             # rINST<- A
   3221     shr         $4, %eax               # %eax<- B
   3222     GET_VREG    rINST                   # rINST<- vA
   3223     movl        $4, %edx               # %edx<- 4
   3224     cmp         (rFP, %eax, 4), rINST   # compare vA and vB
   3225     jl  1f                      # goto next instruction if reverse
   3226                                         # comparison is true
   3227     FETCHs      1, %edx                 # %edx<- +CCCC, Branch offset
   3228     sal         $1, %edx
   3229     js          common_periodicChecks_backwardBranch
   3230 1:
   3231     FINISH_RB   %edx, %ecx              # jump to next instruction
   3232 
   3233 
   3234 /* ------------------------------ */
   3235     .balign 64
   3236 .L_OP_IF_GT: /* 0x36 */
   3237 /* File: x86-atom/OP_IF_GT.S */
   3238    /* Copyright (C) 2008 The Android Open Source Project
   3239     *
   3240     * Licensed under the Apache License, Version 2.0 (the "License");
   3241     * you may not use this file except in compliance with the License.
   3242     * You may obtain a copy of the License at
   3243     *
   3244     * http://www.apache.org/licenses/LICENSE-2.0
   3245     *
   3246     * Unless required by applicable law or agreed to in writing, software
   3247     * distributed under the License is distributed on an "AS IS" BASIS,
   3248     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3249     * See the License for the specific language governing permissions and
   3250     * limitations under the License.
   3251     */
   3252 
   3253    /*
   3254     * File: OP_IF_GT.S
   3255     */
   3256 
   3257 /* File: x86-atom/bincmp.S */
   3258    /* Copyright (C) 2008 The Android Open Source Project
   3259     *
   3260     * Licensed under the Apache License, Version 2.0 (the "License");
   3261     * you may not use this file except in compliance with the License.
   3262     * You may obtain a copy of the License at
   3263     *
   3264     * http://www.apache.org/licenses/LICENSE-2.0
   3265     *
   3266     * Unless required by applicable law or agreed to in writing, software
   3267     * distributed under the License is distributed on an "AS IS" BASIS,
   3268     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3269     * See the License for the specific language governing permissions and
   3270     * limitations under the License.
   3271     */
   3272 
   3273    /*
   3274     * File: bincmp.S
   3275     *
   3276     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3277     *       variable to specify the reverse comparison to perform.
   3278     *
   3279     * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
   3280     *
   3281     * Description: Branch to the given destination if the comparison
   3282     *              test between the given registers values is true.
   3283     *
   3284     * Format: B|A|op CCCC (22t)
   3285     *
   3286     * Syntax: op vA, vB, +CCCC
   3287     */
   3288 
   3289     movl        rINST,  %eax            # %eax<- BA
   3290     andl        $15, rINST             # rINST<- A
   3291     shr         $4, %eax               # %eax<- B
   3292     GET_VREG    rINST                   # rINST<- vA
   3293     movl        $4, %edx               # %edx<- 4
   3294     cmp         (rFP, %eax, 4), rINST   # compare vA and vB
   3295     jle  1f                      # goto next instruction if reverse
   3296                                         # comparison is true
   3297     FETCHs      1, %edx                 # %edx<- +CCCC, Branch offset
   3298     sal         $1, %edx
   3299     js          common_periodicChecks_backwardBranch
   3300 1:
   3301     FINISH_RB   %edx, %ecx              # jump to next instruction
   3302 
   3303 
   3304 /* ------------------------------ */
   3305     .balign 64
   3306 .L_OP_IF_LE: /* 0x37 */
   3307 /* File: x86-atom/OP_IF_LE.S */
   3308    /* Copyright (C) 2008 The Android Open Source Project
   3309     *
   3310     * Licensed under the Apache License, Version 2.0 (the "License");
   3311     * you may not use this file except in compliance with the License.
   3312     * You may obtain a copy of the License at
   3313     *
   3314     * http://www.apache.org/licenses/LICENSE-2.0
   3315     *
   3316     * Unless required by applicable law or agreed to in writing, software
   3317     * distributed under the License is distributed on an "AS IS" BASIS,
   3318     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3319     * See the License for the specific language governing permissions and
   3320     * limitations under the License.
   3321     */
   3322 
   3323    /*
   3324     * File: OP_IF_LE.S
   3325     */
   3326 
   3327 /* File: x86-atom/bincmp.S */
   3328    /* Copyright (C) 2008 The Android Open Source Project
   3329     *
   3330     * Licensed under the Apache License, Version 2.0 (the "License");
   3331     * you may not use this file except in compliance with the License.
   3332     * You may obtain a copy of the License at
   3333     *
   3334     * http://www.apache.org/licenses/LICENSE-2.0
   3335     *
   3336     * Unless required by applicable law or agreed to in writing, software
   3337     * distributed under the License is distributed on an "AS IS" BASIS,
   3338     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3339     * See the License for the specific language governing permissions and
   3340     * limitations under the License.
   3341     */
   3342 
   3343    /*
   3344     * File: bincmp.S
   3345     *
   3346     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3347     *       variable to specify the reverse comparison to perform.
   3348     *
   3349     * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
   3350     *
   3351     * Description: Branch to the given destination if the comparison
   3352     *              test between the given registers values is true.
   3353     *
   3354     * Format: B|A|op CCCC (22t)
   3355     *
   3356     * Syntax: op vA, vB, +CCCC
   3357     */
   3358 
   3359     movl        rINST,  %eax            # %eax<- BA
   3360     andl        $15, rINST             # rINST<- A
   3361     shr         $4, %eax               # %eax<- B
   3362     GET_VREG    rINST                   # rINST<- vA
   3363     movl        $4, %edx               # %edx<- 4
   3364     cmp         (rFP, %eax, 4), rINST   # compare vA and vB
   3365     jg  1f                      # goto next instruction if reverse
   3366                                         # comparison is true
   3367     FETCHs      1, %edx                 # %edx<- +CCCC, Branch offset
   3368     sal         $1, %edx
   3369     js          common_periodicChecks_backwardBranch
   3370 1:
   3371     FINISH_RB   %edx, %ecx              # jump to next instruction
   3372 
   3373 
   3374 /* ------------------------------ */
   3375     .balign 64
   3376 .L_OP_IF_EQZ: /* 0x38 */
   3377 /* File: x86-atom/OP_IF_EQZ.S */
   3378    /* Copyright (C) 2008 The Android Open Source Project
   3379     *
   3380     * Licensed under the Apache License, Version 2.0 (the "License");
   3381     * you may not use this file except in compliance with the License.
   3382     * You may obtain a copy of the License at
   3383     *
   3384     * http://www.apache.org/licenses/LICENSE-2.0
   3385     *
   3386     * Unless required by applicable law or agreed to in writing, software
   3387     * distributed under the License is distributed on an "AS IS" BASIS,
   3388     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3389     * See the License for the specific language governing permissions and
   3390     * limitations under the License.
   3391     */
   3392 
   3393    /*
   3394     * File: OP_IF_EQZ.S
   3395     */
   3396 
   3397 /* File: x86-atom/zcmp.S */
   3398    /* Copyright (C) 2008 The Android Open Source Project
   3399     *
   3400     * Licensed under the Apache License, Version 2.0 (the "License");
   3401     * you may not use this file except in compliance with the License.
   3402     * You may obtain a copy of the License at
   3403     *
   3404     * http://www.apache.org/licenses/LICENSE-2.0
   3405     *
   3406     * Unless required by applicable law or agreed to in writing, software
   3407     * distributed under the License is distributed on an "AS IS" BASIS,
   3408     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3409     * See the License for the specific language governing permissions and
   3410     * limitations under the License.
   3411     */
   3412 
   3413    /*
   3414     * File: zcmp.S
   3415     *
   3416     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3417     *       variable to specify the reverse comparison to perform
   3418     *
   3419     * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
   3420     *
   3421     * Description: Branch to the given destination if the given register's
   3422     *              value compares with 0 as specified.
   3423     *
   3424     * Format: AA|op BBBB (21t)
   3425     *
   3426     * Syntax: op vAA, +BBBB
   3427     */
   3428 
   3429     cmp         $0, (rFP, rINST, 4)    # compare vAA with zero
   3430     jne  OP_IF_EQZ_2f                    # goto next instruction or branch
   3431     FETCHs      1, %edx                 # %edx<- BBBB; branch offset
   3432     sal         $1, %edx               # %edx<- adjust byte offset
   3433 
   3434    /*
   3435     * Inline common_backwardBranch
   3436     */
   3437 
   3438     js          common_periodicChecks_backwardBranch  # jump on backwards branch
   3439 1:
   3440     FINISH_RB   %edx, %ecx              # jump to next instruction
   3441 
   3442    /*
   3443     * FINISH code
   3444     */
   3445 
   3446 OP_IF_EQZ_2f:
   3447     movzbl      4(rPC), %edx            # grab the next opcode
   3448     movzbl      5(rPC), rINST           # update the instruction
   3449     addl        $4, rPC                # update the program counter
   3450     jmp         *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
   3451 
   3452 
   3453 /* ------------------------------ */
   3454     .balign 64
   3455 .L_OP_IF_NEZ: /* 0x39 */
   3456 /* File: x86-atom/OP_IF_NEZ.S */
   3457    /* Copyright (C) 2008 The Android Open Source Project
   3458     *
   3459     * Licensed under the Apache License, Version 2.0 (the "License");
   3460     * you may not use this file except in compliance with the License.
   3461     * You may obtain a copy of the License at
   3462     *
   3463     * http://www.apache.org/licenses/LICENSE-2.0
   3464     *
   3465     * Unless required by applicable law or agreed to in writing, software
   3466     * distributed under the License is distributed on an "AS IS" BASIS,
   3467     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3468     * See the License for the specific language governing permissions and
   3469     * limitations under the License.
   3470     */
   3471 
   3472    /*
   3473     * File: OP_IF_NEZ.S
   3474     */
   3475 
   3476 /* File: x86-atom/zcmp.S */
   3477    /* Copyright (C) 2008 The Android Open Source Project
   3478     *
   3479     * Licensed under the Apache License, Version 2.0 (the "License");
   3480     * you may not use this file except in compliance with the License.
   3481     * You may obtain a copy of the License at
   3482     *
   3483     * http://www.apache.org/licenses/LICENSE-2.0
   3484     *
   3485     * Unless required by applicable law or agreed to in writing, software
   3486     * distributed under the License is distributed on an "AS IS" BASIS,
   3487     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3488     * See the License for the specific language governing permissions and
   3489     * limitations under the License.
   3490     */
   3491 
   3492    /*
   3493     * File: zcmp.S
   3494     *
   3495     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3496     *       variable to specify the reverse comparison to perform
   3497     *
   3498     * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
   3499     *
   3500     * Description: Branch to the given destination if the given register's
   3501     *              value compares with 0 as specified.
   3502     *
   3503     * Format: AA|op BBBB (21t)
   3504     *
   3505     * Syntax: op vAA, +BBBB
   3506     */
   3507 
   3508     cmp         $0, (rFP, rINST, 4)    # compare vAA with zero
   3509     je  OP_IF_NEZ_2f                    # goto next instruction or branch
   3510     FETCHs      1, %edx                 # %edx<- BBBB; branch offset
   3511     sal         $1, %edx               # %edx<- adjust byte offset
   3512 
   3513    /*
   3514     * Inline common_backwardBranch
   3515     */
   3516 
   3517     js          common_periodicChecks_backwardBranch  # jump on backwards branch
   3518 1:
   3519     FINISH_RB   %edx, %ecx              # jump to next instruction
   3520 
   3521    /*
   3522     * FINISH code
   3523     */
   3524 
   3525 OP_IF_NEZ_2f:
   3526     movzbl      4(rPC), %edx            # grab the next opcode
   3527     movzbl      5(rPC), rINST           # update the instruction
   3528     addl        $4, rPC                # update the program counter
   3529     jmp         *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
   3530 
   3531 
   3532 /* ------------------------------ */
   3533     .balign 64
   3534 .L_OP_IF_LTZ: /* 0x3a */
   3535 /* File: x86-atom/OP_IF_LTZ.S */
   3536    /* Copyright (C) 2008 The Android Open Source Project
   3537     *
   3538     * Licensed under the Apache License, Version 2.0 (the "License");
   3539     * you may not use this file except in compliance with the License.
   3540     * You may obtain a copy of the License at
   3541     *
   3542     * http://www.apache.org/licenses/LICENSE-2.0
   3543     *
   3544     * Unless required by applicable law or agreed to in writing, software
   3545     * distributed under the License is distributed on an "AS IS" BASIS,
   3546     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3547     * See the License for the specific language governing permissions and
   3548     * limitations under the License.
   3549     */
   3550 
   3551    /*
   3552     * File: OP_IF_LTZ.S
   3553     */
   3554 
   3555 /* File: x86-atom/zcmp.S */
   3556    /* Copyright (C) 2008 The Android Open Source Project
   3557     *
   3558     * Licensed under the Apache License, Version 2.0 (the "License");
   3559     * you may not use this file except in compliance with the License.
   3560     * You may obtain a copy of the License at
   3561     *
   3562     * http://www.apache.org/licenses/LICENSE-2.0
   3563     *
   3564     * Unless required by applicable law or agreed to in writing, software
   3565     * distributed under the License is distributed on an "AS IS" BASIS,
   3566     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3567     * See the License for the specific language governing permissions and
   3568     * limitations under the License.
   3569     */
   3570 
   3571    /*
   3572     * File: zcmp.S
   3573     *
   3574     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3575     *       variable to specify the reverse comparison to perform
   3576     *
   3577     * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
   3578     *
   3579     * Description: Branch to the given destination if the given register's
   3580     *              value compares with 0 as specified.
   3581     *
   3582     * Format: AA|op BBBB (21t)
   3583     *
   3584     * Syntax: op vAA, +BBBB
   3585     */
   3586 
   3587     cmp         $0, (rFP, rINST, 4)    # compare vAA with zero
   3588     jge  OP_IF_LTZ_2f                    # goto next instruction or branch
   3589     FETCHs      1, %edx                 # %edx<- BBBB; branch offset
   3590     sal         $1, %edx               # %edx<- adjust byte offset
   3591 
   3592    /*
   3593     * Inline common_backwardBranch
   3594     */
   3595 
   3596     js          common_periodicChecks_backwardBranch  # jump on backwards branch
   3597 1:
   3598     FINISH_RB   %edx, %ecx              # jump to next instruction
   3599 
   3600    /*
   3601     * FINISH code
   3602     */
   3603 
   3604 OP_IF_LTZ_2f:
   3605     movzbl      4(rPC), %edx            # grab the next opcode
   3606     movzbl      5(rPC), rINST           # update the instruction
   3607     addl        $4, rPC                # update the program counter
   3608     jmp         *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
   3609 
   3610 
   3611 /* ------------------------------ */
   3612     .balign 64
   3613 .L_OP_IF_GEZ: /* 0x3b */
   3614 /* File: x86-atom/OP_IF_GEZ.S */
   3615    /* Copyright (C) 2008 The Android Open Source Project
   3616     *
   3617     * Licensed under the Apache License, Version 2.0 (the "License");
   3618     * you may not use this file except in compliance with the License.
   3619     * You may obtain a copy of the License at
   3620     *
   3621     * http://www.apache.org/licenses/LICENSE-2.0
   3622     *
   3623     * Unless required by applicable law or agreed to in writing, software
   3624     * distributed under the License is distributed on an "AS IS" BASIS,
   3625     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3626     * See the License for the specific language governing permissions and
   3627     * limitations under the License.
   3628     */
   3629 
   3630    /*
   3631     * File: OP_IF_GEZ.S
   3632     */
   3633 
   3634 /* File: x86-atom/zcmp.S */
   3635    /* Copyright (C) 2008 The Android Open Source Project
   3636     *
   3637     * Licensed under the Apache License, Version 2.0 (the "License");
   3638     * you may not use this file except in compliance with the License.
   3639     * You may obtain a copy of the License at
   3640     *
   3641     * http://www.apache.org/licenses/LICENSE-2.0
   3642     *
   3643     * Unless required by applicable law or agreed to in writing, software
   3644     * distributed under the License is distributed on an "AS IS" BASIS,
   3645     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3646     * See the License for the specific language governing permissions and
   3647     * limitations under the License.
   3648     */
   3649 
   3650    /*
   3651     * File: zcmp.S
   3652     *
   3653     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3654     *       variable to specify the reverse comparison to perform
   3655     *
   3656     * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
   3657     *
   3658     * Description: Branch to the given destination if the given register's
   3659     *              value compares with 0 as specified.
   3660     *
   3661     * Format: AA|op BBBB (21t)
   3662     *
   3663     * Syntax: op vAA, +BBBB
   3664     */
   3665 
   3666     cmp         $0, (rFP, rINST, 4)    # compare vAA with zero
   3667     jl  OP_IF_GEZ_2f                    # goto next instruction or branch
   3668     FETCHs      1, %edx                 # %edx<- BBBB; branch offset
   3669     sal         $1, %edx               # %edx<- adjust byte offset
   3670 
   3671    /*
   3672     * Inline common_backwardBranch
   3673     */
   3674 
   3675     js          common_periodicChecks_backwardBranch  # jump on backwards branch
   3676 1:
   3677     FINISH_RB   %edx, %ecx              # jump to next instruction
   3678 
   3679    /*
   3680     * FINISH code
   3681     */
   3682 
   3683 OP_IF_GEZ_2f:
   3684     movzbl      4(rPC), %edx            # grab the next opcode
   3685     movzbl      5(rPC), rINST           # update the instruction
   3686     addl        $4, rPC                # update the program counter
   3687     jmp         *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
   3688 
   3689 
   3690 /* ------------------------------ */
   3691     .balign 64
   3692 .L_OP_IF_GTZ: /* 0x3c */
   3693 /* File: x86-atom/OP_IF_GTZ.S */
   3694    /* Copyright (C) 2008 The Android Open Source Project
   3695     *
   3696     * Licensed under the Apache License, Version 2.0 (the "License");
   3697     * you may not use this file except in compliance with the License.
   3698     * You may obtain a copy of the License at
   3699     *
   3700     * http://www.apache.org/licenses/LICENSE-2.0
   3701     *
   3702     * Unless required by applicable law or agreed to in writing, software
   3703     * distributed under the License is distributed on an "AS IS" BASIS,
   3704     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3705     * See the License for the specific language governing permissions and
   3706     * limitations under the License.
   3707     */
   3708 
   3709    /*
   3710     * File: OP_IF_GTZ.S
   3711     */
   3712 
   3713 /* File: x86-atom/zcmp.S */
   3714    /* Copyright (C) 2008 The Android Open Source Project
   3715     *
   3716     * Licensed under the Apache License, Version 2.0 (the "License");
   3717     * you may not use this file except in compliance with the License.
   3718     * You may obtain a copy of the License at
   3719     *
   3720     * http://www.apache.org/licenses/LICENSE-2.0
   3721     *
   3722     * Unless required by applicable law or agreed to in writing, software
   3723     * distributed under the License is distributed on an "AS IS" BASIS,
   3724     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3725     * See the License for the specific language governing permissions and
   3726     * limitations under the License.
   3727     */
   3728 
   3729    /*
   3730     * File: zcmp.S
   3731     *
   3732     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3733     *       variable to specify the reverse comparison to perform
   3734     *
   3735     * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
   3736     *
   3737     * Description: Branch to the given destination if the given register's
   3738     *              value compares with 0 as specified.
   3739     *
   3740     * Format: AA|op BBBB (21t)
   3741     *
   3742     * Syntax: op vAA, +BBBB
   3743     */
   3744 
   3745     cmp         $0, (rFP, rINST, 4)    # compare vAA with zero
   3746     jle  OP_IF_GTZ_2f                    # goto next instruction or branch
   3747     FETCHs      1, %edx                 # %edx<- BBBB; branch offset
   3748     sal         $1, %edx               # %edx<- adjust byte offset
   3749 
   3750    /*
   3751     * Inline common_backwardBranch
   3752     */
   3753 
   3754     js          common_periodicChecks_backwardBranch  # jump on backwards branch
   3755 1:
   3756     FINISH_RB   %edx, %ecx              # jump to next instruction
   3757 
   3758    /*
   3759     * FINISH code
   3760     */
   3761 
   3762 OP_IF_GTZ_2f:
   3763     movzbl      4(rPC), %edx            # grab the next opcode
   3764     movzbl      5(rPC), rINST           # update the instruction
   3765     addl        $4, rPC                # update the program counter
   3766     jmp         *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
   3767 
   3768 
   3769 /* ------------------------------ */
   3770     .balign 64
   3771 .L_OP_IF_LEZ: /* 0x3d */
   3772 /* File: x86-atom/OP_IF_LEZ.S */
   3773    /* Copyright (C) 2008 The Android Open Source Project
   3774     *
   3775     * Licensed under the Apache License, Version 2.0 (the "License");
   3776     * you may not use this file except in compliance with the License.
   3777     * You may obtain a copy of the License at
   3778     *
   3779     * http://www.apache.org/licenses/LICENSE-2.0
   3780     *
   3781     * Unless required by applicable law or agreed to in writing, software
   3782     * distributed under the License is distributed on an "AS IS" BASIS,
   3783     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3784     * See the License for the specific language governing permissions and
   3785     * limitations under the License.
   3786     */
   3787 
   3788    /*
   3789     * File: OP_IF_LEZ.S
   3790     */
   3791 
   3792 /* File: x86-atom/zcmp.S */
   3793    /* Copyright (C) 2008 The Android Open Source Project
   3794     *
   3795     * Licensed under the Apache License, Version 2.0 (the "License");
   3796     * you may not use this file except in compliance with the License.
   3797     * You may obtain a copy of the License at
   3798     *
   3799     * http://www.apache.org/licenses/LICENSE-2.0
   3800     *
   3801     * Unless required by applicable law or agreed to in writing, software
   3802     * distributed under the License is distributed on an "AS IS" BASIS,
   3803     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3804     * See the License for the specific language governing permissions and
   3805     * limitations under the License.
   3806     */
   3807 
   3808    /*
   3809     * File: zcmp.S
   3810     *
   3811     * Code: Generic 32-bit comparison operation. Provides a "revcmp"
   3812     *       variable to specify the reverse comparison to perform
   3813     *
   3814     * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
   3815     *
   3816     * Description: Branch to the given destination if the given register's
   3817     *              value compares with 0 as specified.
   3818     *
   3819     * Format: AA|op BBBB (21t)
   3820     *
   3821     * Syntax: op vAA, +BBBB
   3822     */
   3823 
   3824     cmp         $0, (rFP, rINST, 4)    # compare vAA with zero
   3825     jg  OP_IF_LEZ_2f                    # goto next instruction or branch
   3826     FETCHs      1, %edx                 # %edx<- BBBB; branch offset
   3827     sal         $1, %edx               # %edx<- adjust byte offset
   3828 
   3829    /*
   3830     * Inline common_backwardBranch
   3831     */
   3832 
   3833     js          common_periodicChecks_backwardBranch  # jump on backwards branch
   3834 1:
   3835     FINISH_RB   %edx, %ecx              # jump to next instruction
   3836 
   3837    /*
   3838     * FINISH code
   3839     */
   3840 
   3841 OP_IF_LEZ_2f:
   3842     movzbl      4(rPC), %edx            # grab the next opcode
   3843     movzbl      5(rPC), rINST           # update the instruction
   3844     addl        $4, rPC                # update the program counter
   3845     jmp         *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
   3846 
   3847 
   3848 /* ------------------------------ */
   3849     .balign 64
   3850 .L_OP_UNUSED_3E: /* 0x3e */
   3851 /* File: x86-atom/OP_UNUSED_3E.S */
   3852    /* Copyright (C) 2008 The Android Open Source Project
   3853     *
   3854     * Licensed under the Apache License, Version 2.0 (the "License");
   3855     * you may not use this file except in compliance with the License.
   3856     * You may obtain a copy of the License at
   3857     *
   3858     * http://www.apache.org/licenses/LICENSE-2.0
   3859     *
   3860     * Unless required by applicable law or agreed to in writing, software
   3861     * distributed under the License is distributed on an "AS IS" BASIS,
   3862     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3863     * See the License for the specific language governing permissions and
   3864     * limitations under the License.
   3865     */
   3866 
   3867    /*
   3868     * File: OP_UNUSED_3E.S
   3869     */
   3870 
   3871 /* File: x86-atom/unused.S */
   3872    /* Copyright (C) 2008 The Android Open Source Project
   3873     *
   3874     * Licensed under the Apache License, Version 2.0 (the "License");
   3875     * you may not use this file except in compliance with the License.
   3876     * You may obtain a copy of the License at
   3877     *
   3878     * http://www.apache.org/licenses/LICENSE-2.0
   3879     *
   3880     * Unless required by applicable law or agreed to in writing, software
   3881     * distributed under the License is distributed on an "AS IS" BASIS,
   3882     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3883     * See the License for the specific language governing permissions and
   3884     * limitations under the License.
   3885     */
   3886 
   3887    /*
   3888     * File: unused.S
   3889     *
   3890     * Code: Common code for unused bytecodes. Uses no subtitutions.
   3891     *
   3892     * For: all unused bytecodes
   3893     *
   3894     * Description: aborts if executed.
   3895     *
   3896     * Format: |op (10x)
   3897     *
   3898     * Syntax: op
   3899     */
   3900 
   3901     call        common_abort
   3902 
   3903 
   3904 /* ------------------------------ */
   3905     .balign 64
   3906 .L_OP_UNUSED_3F: /* 0x3f */
   3907 /* File: x86-atom/OP_UNUSED_3F.S */
   3908    /* Copyright (C) 2008 The Android Open Source Project
   3909     *
   3910     * Licensed under the Apache License, Version 2.0 (the "License");
   3911     * you may not use this file except in compliance with the License.
   3912     * You may obtain a copy of the License at
   3913     *
   3914     * http://www.apache.org/licenses/LICENSE-2.0
   3915     *
   3916     * Unless required by applicable law or agreed to in writing, software
   3917     * distributed under the License is distributed on an "AS IS" BASIS,
   3918     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3919     * See the License for the specific language governing permissions and
   3920     * limitations under the License.
   3921     */
   3922 
   3923    /*
   3924     * File: OP_UNUSED_3F.S
   3925     */
   3926 
   3927 /* File: x86-atom/unused.S */
   3928    /* Copyright (C) 2008 The Android Open Source Project
   3929     *
   3930     * Licensed under the Apache License, Version 2.0 (the "License");
   3931     * you may not use this file except in compliance with the License.
   3932     * You may obtain a copy of the License at
   3933     *
   3934     * http://www.apache.org/licenses/LICENSE-2.0
   3935     *
   3936     * Unless required by applicable law or agreed to in writing, software
   3937     * distributed under the License is distributed on an "AS IS" BASIS,
   3938     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3939     * See the License for the specific language governing permissions and
   3940     * limitations under the License.
   3941     */
   3942 
   3943    /*
   3944     * File: unused.S
   3945     *
   3946     * Code: Common code for unused bytecodes. Uses no subtitutions.
   3947     *
   3948     * For: all unused bytecodes
   3949     *
   3950     * Description: aborts if executed.
   3951     *
   3952     * Format: |op (10x)
   3953     *
   3954     * Syntax: op
   3955     */
   3956 
   3957     call        common_abort
   3958 
   3959 
   3960 /* ------------------------------ */
   3961     .balign 64
   3962 .L_OP_UNUSED_40: /* 0x40 */
   3963 /* File: x86-atom/OP_UNUSED_40.S */
   3964    /* Copyright (C) 2008 The Android Open Source Project
   3965     *
   3966     * Licensed under the Apache License, Version 2.0 (the "License");
   3967     * you may not use this file except in compliance with the License.
   3968     * You may obtain a copy of the License at
   3969     *
   3970     * http://www.apache.org/licenses/LICENSE-2.0
   3971     *
   3972     * Unless required by applicable law or agreed to in writing, software
   3973     * distributed under the License is distributed on an "AS IS" BASIS,
   3974     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3975     * See the License for the specific language governing permissions and
   3976     * limitations under the License.
   3977     */
   3978 
   3979    /*
   3980     * File: OP_UNUSED_40.S
   3981     */
   3982 
   3983 /* File: x86-atom/unused.S */
   3984    /* Copyright (C) 2008 The Android Open Source Project
   3985     *
   3986     * Licensed under the Apache License, Version 2.0 (the "License");
   3987     * you may not use this file except in compliance with the License.
   3988     * You may obtain a copy of the License at
   3989     *
   3990     * http://www.apache.org/licenses/LICENSE-2.0
   3991     *
   3992     * Unless required by applicable law or agreed to in writing, software
   3993     * distributed under the License is distributed on an "AS IS" BASIS,
   3994     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   3995     * See the License for the specific language governing permissions and
   3996     * limitations under the License.
   3997     */
   3998 
   3999    /*
   4000     * File: unused.S
   4001     *
   4002     * Code: Common code for unused bytecodes. Uses no subtitutions.
   4003     *
   4004     * For: all unused bytecodes
   4005     *
   4006     * Description: aborts if executed.
   4007     *
   4008     * Format: |op (10x)
   4009     *
   4010     * Syntax: op
   4011     */
   4012 
   4013     call        common_abort
   4014 
   4015 
   4016 /* ------------------------------ */
   4017     .balign 64
   4018 .L_OP_UNUSED_41: /* 0x41 */
   4019 /* File: x86-atom/OP_UNUSED_41.S */
   4020    /* Copyright (C) 2008 The Android Open Source Project
   4021     *
   4022     * Licensed under the Apache License, Version 2.0 (the "License");
   4023     * you may not use this file except in compliance with the License.
   4024     * You may obtain a copy of the License at
   4025     *
   4026     * http://www.apache.org/licenses/LICENSE-2.0
   4027     *
   4028     * Unless required by applicable law or agreed to in writing, software
   4029     * distributed under the License is distributed on an "AS IS" BASIS,
   4030     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4031     * See the License for the specific language governing permissions and
   4032     * limitations under the License.
   4033     */
   4034 
   4035    /*
   4036     * File: OP_UNUSED_41.S
   4037     */
   4038 
   4039 /* File: x86-atom/unused.S */
   4040    /* Copyright (C) 2008 The Android Open Source Project
   4041     *
   4042     * Licensed under the Apache License, Version 2.0 (the "License");
   4043     * you may not use this file except in compliance with the License.
   4044     * You may obtain a copy of the License at
   4045     *
   4046     * http://www.apache.org/licenses/LICENSE-2.0
   4047     *
   4048     * Unless required by applicable law or agreed to in writing, software
   4049     * distributed under the License is distributed on an "AS IS" BASIS,
   4050     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4051     * See the License for the specific language governing permissions and
   4052     * limitations under the License.
   4053     */
   4054 
   4055    /*
   4056     * File: unused.S
   4057     *
   4058     * Code: Common code for unused bytecodes. Uses no subtitutions.
   4059     *
   4060     * For: all unused bytecodes
   4061     *
   4062     * Description: aborts if executed.
   4063     *
   4064     * Format: |op (10x)
   4065     *
   4066     * Syntax: op
   4067     */
   4068 
   4069     call        common_abort
   4070 
   4071 
   4072 /* ------------------------------ */
   4073     .balign 64
   4074 .L_OP_UNUSED_42: /* 0x42 */
   4075 /* File: x86-atom/OP_UNUSED_42.S */
   4076    /* Copyright (C) 2008 The Android Open Source Project
   4077     *
   4078     * Licensed under the Apache License, Version 2.0 (the "License");
   4079     * you may not use this file except in compliance with the License.
   4080     * You may obtain a copy of the License at
   4081     *
   4082     * http://www.apache.org/licenses/LICENSE-2.0
   4083     *
   4084     * Unless required by applicable law or agreed to in writing, software
   4085     * distributed under the License is distributed on an "AS IS" BASIS,
   4086     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4087     * See the License for the specific language governing permissions and
   4088     * limitations under the License.
   4089     */
   4090 
   4091    /*
   4092     * File: OP_UNUSED_42.S
   4093     */
   4094 
   4095 /* File: x86-atom/unused.S */
   4096    /* Copyright (C) 2008 The Android Open Source Project
   4097     *
   4098     * Licensed under the Apache License, Version 2.0 (the "License");
   4099     * you may not use this file except in compliance with the License.
   4100     * You may obtain a copy of the License at
   4101     *
   4102     * http://www.apache.org/licenses/LICENSE-2.0
   4103     *
   4104     * Unless required by applicable law or agreed to in writing, software
   4105     * distributed under the License is distributed on an "AS IS" BASIS,
   4106     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4107     * See the License for the specific language governing permissions and
   4108     * limitations under the License.
   4109     */
   4110 
   4111    /*
   4112     * File: unused.S
   4113     *
   4114     * Code: Common code for unused bytecodes. Uses no subtitutions.
   4115     *
   4116     * For: all unused bytecodes
   4117     *
   4118     * Description: aborts if executed.
   4119     *
   4120     * Format: |op (10x)
   4121     *
   4122     * Syntax: op
   4123     */
   4124 
   4125     call        common_abort
   4126 
   4127 
   4128 /* ------------------------------ */
   4129     .balign 64
   4130 .L_OP_UNUSED_43: /* 0x43 */
   4131 /* File: x86-atom/OP_UNUSED_43.S */
   4132    /* Copyright (C) 2008 The Android Open Source Project
   4133     *
   4134     * Licensed under the Apache License, Version 2.0 (the "License");
   4135     * you may not use this file except in compliance with the License.
   4136     * You may obtain a copy of the License at
   4137     *
   4138     * http://www.apache.org/licenses/LICENSE-2.0
   4139     *
   4140     * Unless required by applicable law or agreed to in writing, software
   4141     * distributed under the License is distributed on an "AS IS" BASIS,
   4142     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4143     * See the License for the specific language governing permissions and
   4144     * limitations under the License.
   4145     */
   4146 
   4147    /*
   4148     * File: OP_UNUSED_43.S
   4149     */
   4150 
   4151 /* File: x86-atom/unused.S */
   4152    /* Copyright (C) 2008 The Android Open Source Project
   4153     *
   4154     * Licensed under the Apache License, Version 2.0 (the "License");
   4155     * you may not use this file except in compliance with the License.
   4156     * You may obtain a copy of the License at
   4157     *
   4158     * http://www.apache.org/licenses/LICENSE-2.0
   4159     *
   4160     * Unless required by applicable law or agreed to in writing, software
   4161     * distributed under the License is distributed on an "AS IS" BASIS,
   4162     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4163     * See the License for the specific language governing permissions and
   4164     * limitations under the License.
   4165     */
   4166 
   4167    /*
   4168     * File: unused.S
   4169     *
   4170     * Code: Common code for unused bytecodes. Uses no subtitutions.
   4171     *
   4172     * For: all unused bytecodes
   4173     *
   4174     * Description: aborts if executed.
   4175     *
   4176     * Format: |op (10x)
   4177     *
   4178     * Syntax: op
   4179     */
   4180 
   4181     call        common_abort
   4182 
   4183 
   4184 /* ------------------------------ */
   4185     .balign 64
   4186 .L_OP_AGET: /* 0x44 */
   4187 /* File: x86-atom/OP_AGET.S */
   4188    /* Copyright (C) 2008 The Android Open Source Project
   4189     *
   4190     * Licensed under the Apache License, Version 2.0 (the "License");
   4191     * you may not use this file except in compliance with the License.
   4192     * You may obtain a copy of the License at
   4193     *
   4194     * http://www.apache.org/licenses/LICENSE-2.0
   4195     *
   4196     * Unless required by applicable law or agreed to in writing, software
   4197     * distributed under the License is distributed on an "AS IS" BASIS,
   4198     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4199     * See the License for the specific language governing permissions and
   4200     * limitations under the License.
   4201     */
   4202 
   4203    /*
   4204     * File: OP_AGET.S
   4205     *
   4206     * Code: Generic 32-bit array "get" operation.  Provides a "scale" variable
   4207     *       to specify a scale value which depends on the width of the array
   4208     *       elements. Provides a "mov" variable which determines the type of
   4209     *       mov performed also dependent on the type of the array element.
   4210     *
   4211     * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
   4212     *
   4213     * Description: Perform an array get operation at the identified index
   4214     *              of a given array; load the array value into the value
   4215     *              register. vAA <- vBB[vCC].
   4216     *
   4217     * Format: AA|op CC|BB (23x)
   4218     *
   4219     * Syntax: op vAA, vBB, vCC
   4220     */
   4221 
   4222 
   4223     FETCH_BB    1, %ecx                 # %ecx<- BB
   4224     FETCH_CC    1, %edx                 # %edx<- CC
   4225     GET_VREG    %ecx                    # %ecx<- vBB
   4226     GET_VREG    %edx                    # %edx<- vCC
   4227     cmp         $0, %ecx               # check for null array object
   4228     je          common_errNullObject    # handle null array object
   4229     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4230     jnc         common_errArrayIndex    # handle index >= length, bail
   4231     lea         (%ecx, %edx, 4), %ecx # %ecx<- &vBB[vCC]
   4232                                            # trying: lea (%ecx, %edx, scale), %ecx
   4233                                            # to reduce code size
   4234     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4235     movl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
   4236                                                 # doing this and the previous instr
   4237                                                 # with one instr was not faster
   4238     SET_VREG    %edx  rINST             # vAA<- %edx; value
   4239     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4240 
   4241 /* ------------------------------ */
   4242     .balign 64
   4243 .L_OP_AGET_WIDE: /* 0x45 */
   4244 /* File: x86-atom/OP_AGET_WIDE.S */
   4245    /* Copyright (C) 2008 The Android Open Source Project
   4246     *
   4247     * Licensed under the Apache License, Version 2.0 (the "License");
   4248     * you may not use this file except in compliance with the License.
   4249     * You may obtain a copy of the License at
   4250     *
   4251     * http://www.apache.org/licenses/LICENSE-2.0
   4252     *
   4253     * Unless required by applicable law or agreed to in writing, software
   4254     * distributed under the License is distributed on an "AS IS" BASIS,
   4255     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4256     * See the License for the specific language governing permissions and
   4257     * limitations under the License.
   4258     */
   4259 
   4260    /*
   4261     * File: OP_AGET_WIDE.S
   4262     *
   4263     * Code: 64-bit array get operation.
   4264     *
   4265     * For: aget-wide
   4266     *
   4267     * Description: Perform an array get operation at the identified index
   4268     *              of a given array; load the array value into the destination
   4269     *              register. vAA <- vBB[vCC].
   4270     *
   4271     * Format: AA|op CC|BB (23x)
   4272     *
   4273     * Syntax: op vAA, vBB, vCC
   4274     */
   4275 
   4276     FETCH_BB    1, %ecx                 # %ecx<- BB
   4277     FETCH_CC    1, %edx                 # %edx<- CC
   4278     GET_VREG    %ecx                    # %ecx<- vBB
   4279     GET_VREG    %edx                    # %edx<- vCC
   4280     cmp         $0, %ecx               # check for null array object
   4281     je          common_errNullObject    # handle null array object
   4282     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4283     jnc         common_errArrayIndex    # handle index >= length, bail
   4284     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4285     movq        offArrayObject_contents(%ecx, %edx, 8), %xmm0 # %xmm0<- vBB[vCC]
   4286     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %xmm0; value
   4287     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4288 
   4289 /* ------------------------------ */
   4290     .balign 64
   4291 .L_OP_AGET_OBJECT: /* 0x46 */
   4292 /* File: x86-atom/OP_AGET_OBJECT.S */
   4293    /* Copyright (C) 2008 The Android Open Source Project
   4294     *
   4295     * Licensed under the Apache License, Version 2.0 (the "License");
   4296     * you may not use this file except in compliance with the License.
   4297     * You may obtain a copy of the License at
   4298     *
   4299     * http://www.apache.org/licenses/LICENSE-2.0
   4300     *
   4301     * Unless required by applicable law or agreed to in writing, software
   4302     * distributed under the License is distributed on an "AS IS" BASIS,
   4303     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4304     * See the License for the specific language governing permissions and
   4305     * limitations under the License.
   4306     */
   4307 
   4308    /*
   4309     * File: OP_AGET_OBJECT.S
   4310     */
   4311 
   4312 /* File: x86-atom/OP_AGET.S */
   4313    /* Copyright (C) 2008 The Android Open Source Project
   4314     *
   4315     * Licensed under the Apache License, Version 2.0 (the "License");
   4316     * you may not use this file except in compliance with the License.
   4317     * You may obtain a copy of the License at
   4318     *
   4319     * http://www.apache.org/licenses/LICENSE-2.0
   4320     *
   4321     * Unless required by applicable law or agreed to in writing, software
   4322     * distributed under the License is distributed on an "AS IS" BASIS,
   4323     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4324     * See the License for the specific language governing permissions and
   4325     * limitations under the License.
   4326     */
   4327 
   4328    /*
   4329     * File: OP_AGET.S
   4330     *
   4331     * Code: Generic 32-bit array "get" operation.  Provides a "scale" variable
   4332     *       to specify a scale value which depends on the width of the array
   4333     *       elements. Provides a "mov" variable which determines the type of
   4334     *       mov performed also dependent on the type of the array element.
   4335     *
   4336     * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
   4337     *
   4338     * Description: Perform an array get operation at the identified index
   4339     *              of a given array; load the array value into the value
   4340     *              register. vAA <- vBB[vCC].
   4341     *
   4342     * Format: AA|op CC|BB (23x)
   4343     *
   4344     * Syntax: op vAA, vBB, vCC
   4345     */
   4346 
   4347 
   4348     FETCH_BB    1, %ecx                 # %ecx<- BB
   4349     FETCH_CC    1, %edx                 # %edx<- CC
   4350     GET_VREG    %ecx                    # %ecx<- vBB
   4351     GET_VREG    %edx                    # %edx<- vCC
   4352     cmp         $0, %ecx               # check for null array object
   4353     je          common_errNullObject    # handle null array object
   4354     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4355     jnc         common_errArrayIndex    # handle index >= length, bail
   4356     lea         (%ecx, %edx, 4), %ecx # %ecx<- &vBB[vCC]
   4357                                            # trying: lea (%ecx, %edx, scale), %ecx
   4358                                            # to reduce code size
   4359     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4360     movl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
   4361                                                 # doing this and the previous instr
   4362                                                 # with one instr was not faster
   4363     SET_VREG    %edx  rINST             # vAA<- %edx; value
   4364     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4365 
   4366 
   4367 /* ------------------------------ */
   4368     .balign 64
   4369 .L_OP_AGET_BOOLEAN: /* 0x47 */
   4370 /* File: x86-atom/OP_AGET_BOOLEAN.S */
   4371    /* Copyright (C) 2008 The Android Open Source Project
   4372     *
   4373     * Licensed under the Apache License, Version 2.0 (the "License");
   4374     * you may not use this file except in compliance with the License.
   4375     * You may obtain a copy of the License at
   4376     *
   4377     * http://www.apache.org/licenses/LICENSE-2.0
   4378     *
   4379     * Unless required by applicable law or agreed to in writing, software
   4380     * distributed under the License is distributed on an "AS IS" BASIS,
   4381     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4382     * See the License for the specific language governing permissions and
   4383     * limitations under the License.
   4384     */
   4385 
   4386    /*
   4387     * File: OP_AGET_BOOLEAN.S
   4388     */
   4389 
   4390 /* File: x86-atom/OP_AGET.S */
   4391    /* Copyright (C) 2008 The Android Open Source Project
   4392     *
   4393     * Licensed under the Apache License, Version 2.0 (the "License");
   4394     * you may not use this file except in compliance with the License.
   4395     * You may obtain a copy of the License at
   4396     *
   4397     * http://www.apache.org/licenses/LICENSE-2.0
   4398     *
   4399     * Unless required by applicable law or agreed to in writing, software
   4400     * distributed under the License is distributed on an "AS IS" BASIS,
   4401     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4402     * See the License for the specific language governing permissions and
   4403     * limitations under the License.
   4404     */
   4405 
   4406    /*
   4407     * File: OP_AGET.S
   4408     *
   4409     * Code: Generic 32-bit array "get" operation.  Provides a "scale" variable
   4410     *       to specify a scale value which depends on the width of the array
   4411     *       elements. Provides a "mov" variable which determines the type of
   4412     *       mov performed also dependent on the type of the array element.
   4413     *
   4414     * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
   4415     *
   4416     * Description: Perform an array get operation at the identified index
   4417     *              of a given array; load the array value into the value
   4418     *              register. vAA <- vBB[vCC].
   4419     *
   4420     * Format: AA|op CC|BB (23x)
   4421     *
   4422     * Syntax: op vAA, vBB, vCC
   4423     */
   4424 
   4425 
   4426     FETCH_BB    1, %ecx                 # %ecx<- BB
   4427     FETCH_CC    1, %edx                 # %edx<- CC
   4428     GET_VREG    %ecx                    # %ecx<- vBB
   4429     GET_VREG    %edx                    # %edx<- vCC
   4430     cmp         $0, %ecx               # check for null array object
   4431     je          common_errNullObject    # handle null array object
   4432     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4433     jnc         common_errArrayIndex    # handle index >= length, bail
   4434     lea         (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
   4435                                            # trying: lea (%ecx, %edx, scale), %ecx
   4436                                            # to reduce code size
   4437     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4438     movzbl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
   4439                                                 # doing this and the previous instr
   4440                                                 # with one instr was not faster
   4441     SET_VREG    %edx  rINST             # vAA<- %edx; value
   4442     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4443 
   4444 
   4445 /* ------------------------------ */
   4446     .balign 64
   4447 .L_OP_AGET_BYTE: /* 0x48 */
   4448 /* File: x86-atom/OP_AGET_BYTE.S */
   4449    /* Copyright (C) 2008 The Android Open Source Project
   4450     *
   4451     * Licensed under the Apache License, Version 2.0 (the "License");
   4452     * you may not use this file except in compliance with the License.
   4453     * You may obtain a copy of the License at
   4454     *
   4455     * http://www.apache.org/licenses/LICENSE-2.0
   4456     *
   4457     * Unless required by applicable law or agreed to in writing, software
   4458     * distributed under the License is distributed on an "AS IS" BASIS,
   4459     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4460     * See the License for the specific language governing permissions and
   4461     * limitations under the License.
   4462     */
   4463 
   4464    /*
   4465     * File: OP_AGET_BYTE.S
   4466     */
   4467 
   4468 /* File: x86-atom/OP_AGET.S */
   4469    /* Copyright (C) 2008 The Android Open Source Project
   4470     *
   4471     * Licensed under the Apache License, Version 2.0 (the "License");
   4472     * you may not use this file except in compliance with the License.
   4473     * You may obtain a copy of the License at
   4474     *
   4475     * http://www.apache.org/licenses/LICENSE-2.0
   4476     *
   4477     * Unless required by applicable law or agreed to in writing, software
   4478     * distributed under the License is distributed on an "AS IS" BASIS,
   4479     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4480     * See the License for the specific language governing permissions and
   4481     * limitations under the License.
   4482     */
   4483 
   4484    /*
   4485     * File: OP_AGET.S
   4486     *
   4487     * Code: Generic 32-bit array "get" operation.  Provides a "scale" variable
   4488     *       to specify a scale value which depends on the width of the array
   4489     *       elements. Provides a "mov" variable which determines the type of
   4490     *       mov performed also dependent on the type of the array element.
   4491     *
   4492     * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
   4493     *
   4494     * Description: Perform an array get operation at the identified index
   4495     *              of a given array; load the array value into the value
   4496     *              register. vAA <- vBB[vCC].
   4497     *
   4498     * Format: AA|op CC|BB (23x)
   4499     *
   4500     * Syntax: op vAA, vBB, vCC
   4501     */
   4502 
   4503 
   4504     FETCH_BB    1, %ecx                 # %ecx<- BB
   4505     FETCH_CC    1, %edx                 # %edx<- CC
   4506     GET_VREG    %ecx                    # %ecx<- vBB
   4507     GET_VREG    %edx                    # %edx<- vCC
   4508     cmp         $0, %ecx               # check for null array object
   4509     je          common_errNullObject    # handle null array object
   4510     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4511     jnc         common_errArrayIndex    # handle index >= length, bail
   4512     lea         (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
   4513                                            # trying: lea (%ecx, %edx, scale), %ecx
   4514                                            # to reduce code size
   4515     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4516     movsbl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
   4517                                                 # doing this and the previous instr
   4518                                                 # with one instr was not faster
   4519     SET_VREG    %edx  rINST             # vAA<- %edx; value
   4520     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4521 
   4522 
   4523 /* ------------------------------ */
   4524     .balign 64
   4525 .L_OP_AGET_CHAR: /* 0x49 */
   4526 /* File: x86-atom/OP_AGET_CHAR.S */
   4527    /* Copyright (C) 2008 The Android Open Source Project
   4528     *
   4529     * Licensed under the Apache License, Version 2.0 (the "License");
   4530     * you may not use this file except in compliance with the License.
   4531     * You may obtain a copy of the License at
   4532     *
   4533     * http://www.apache.org/licenses/LICENSE-2.0
   4534     *
   4535     * Unless required by applicable law or agreed to in writing, software
   4536     * distributed under the License is distributed on an "AS IS" BASIS,
   4537     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4538     * See the License for the specific language governing permissions and
   4539     * limitations under the License.
   4540     */
   4541 
   4542    /*
   4543     * File: OP_AGET_CHAR.S
   4544     */
   4545 
   4546 /* File: x86-atom/OP_AGET.S */
   4547    /* Copyright (C) 2008 The Android Open Source Project
   4548     *
   4549     * Licensed under the Apache License, Version 2.0 (the "License");
   4550     * you may not use this file except in compliance with the License.
   4551     * You may obtain a copy of the License at
   4552     *
   4553     * http://www.apache.org/licenses/LICENSE-2.0
   4554     *
   4555     * Unless required by applicable law or agreed to in writing, software
   4556     * distributed under the License is distributed on an "AS IS" BASIS,
   4557     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4558     * See the License for the specific language governing permissions and
   4559     * limitations under the License.
   4560     */
   4561 
   4562    /*
   4563     * File: OP_AGET.S
   4564     *
   4565     * Code: Generic 32-bit array "get" operation.  Provides a "scale" variable
   4566     *       to specify a scale value which depends on the width of the array
   4567     *       elements. Provides a "mov" variable which determines the type of
   4568     *       mov performed also dependent on the type of the array element.
   4569     *
   4570     * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
   4571     *
   4572     * Description: Perform an array get operation at the identified index
   4573     *              of a given array; load the array value into the value
   4574     *              register. vAA <- vBB[vCC].
   4575     *
   4576     * Format: AA|op CC|BB (23x)
   4577     *
   4578     * Syntax: op vAA, vBB, vCC
   4579     */
   4580 
   4581 
   4582     FETCH_BB    1, %ecx                 # %ecx<- BB
   4583     FETCH_CC    1, %edx                 # %edx<- CC
   4584     GET_VREG    %ecx                    # %ecx<- vBB
   4585     GET_VREG    %edx                    # %edx<- vCC
   4586     cmp         $0, %ecx               # check for null array object
   4587     je          common_errNullObject    # handle null array object
   4588     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4589     jnc         common_errArrayIndex    # handle index >= length, bail
   4590     lea         (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
   4591                                            # trying: lea (%ecx, %edx, scale), %ecx
   4592                                            # to reduce code size
   4593     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4594     movzwl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
   4595                                                 # doing this and the previous instr
   4596                                                 # with one instr was not faster
   4597     SET_VREG    %edx  rINST             # vAA<- %edx; value
   4598     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4599 
   4600 
   4601 /* ------------------------------ */
   4602     .balign 64
   4603 .L_OP_AGET_SHORT: /* 0x4a */
   4604 /* File: x86-atom/OP_AGET_SHORT.S */
   4605    /* Copyright (C) 2008 The Android Open Source Project
   4606     *
   4607     * Licensed under the Apache License, Version 2.0 (the "License");
   4608     * you may not use this file except in compliance with the License.
   4609     * You may obtain a copy of the License at
   4610     *
   4611     * http://www.apache.org/licenses/LICENSE-2.0
   4612     *
   4613     * Unless required by applicable law or agreed to in writing, software
   4614     * distributed under the License is distributed on an "AS IS" BASIS,
   4615     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4616     * See the License for the specific language governing permissions and
   4617     * limitations under the License.
   4618     */
   4619 
   4620    /*
   4621     * File: OP_AGET_SHORT.S
   4622     */
   4623 
   4624 /* File: x86-atom/OP_AGET.S */
   4625    /* Copyright (C) 2008 The Android Open Source Project
   4626     *
   4627     * Licensed under the Apache License, Version 2.0 (the "License");
   4628     * you may not use this file except in compliance with the License.
   4629     * You may obtain a copy of the License at
   4630     *
   4631     * http://www.apache.org/licenses/LICENSE-2.0
   4632     *
   4633     * Unless required by applicable law or agreed to in writing, software
   4634     * distributed under the License is distributed on an "AS IS" BASIS,
   4635     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4636     * See the License for the specific language governing permissions and
   4637     * limitations under the License.
   4638     */
   4639 
   4640    /*
   4641     * File: OP_AGET.S
   4642     *
   4643     * Code: Generic 32-bit array "get" operation.  Provides a "scale" variable
   4644     *       to specify a scale value which depends on the width of the array
   4645     *       elements. Provides a "mov" variable which determines the type of
   4646     *       mov performed also dependent on the type of the array element.
   4647     *
   4648     * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
   4649     *
   4650     * Description: Perform an array get operation at the identified index
   4651     *              of a given array; load the array value into the value
   4652     *              register. vAA <- vBB[vCC].
   4653     *
   4654     * Format: AA|op CC|BB (23x)
   4655     *
   4656     * Syntax: op vAA, vBB, vCC
   4657     */
   4658 
   4659 
   4660     FETCH_BB    1, %ecx                 # %ecx<- BB
   4661     FETCH_CC    1, %edx                 # %edx<- CC
   4662     GET_VREG    %ecx                    # %ecx<- vBB
   4663     GET_VREG    %edx                    # %edx<- vCC
   4664     cmp         $0, %ecx               # check for null array object
   4665     je          common_errNullObject    # handle null array object
   4666     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4667     jnc         common_errArrayIndex    # handle index >= length, bail
   4668     lea         (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
   4669                                            # trying: lea (%ecx, %edx, scale), %ecx
   4670                                            # to reduce code size
   4671     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4672     movswl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
   4673                                                 # doing this and the previous instr
   4674                                                 # with one instr was not faster
   4675     SET_VREG    %edx  rINST             # vAA<- %edx; value
   4676     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4677 
   4678 
   4679 /* ------------------------------ */
   4680     .balign 64
   4681 .L_OP_APUT: /* 0x4b */
   4682 /* File: x86-atom/OP_APUT.S */
   4683    /* Copyright (C) 2008 The Android Open Source Project
   4684     *
   4685     * Licensed under the Apache License, Version 2.0 (the "License");
   4686     * you may not use this file except in compliance with the License.
   4687     * You may obtain a copy of the License at
   4688     *
   4689     * http://www.apache.org/licenses/LICENSE-2.0
   4690     *
   4691     * Unless required by applicable law or agreed to in writing, software
   4692     * distributed under the License is distributed on an "AS IS" BASIS,
   4693     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4694     * See the License for the specific language governing permissions and
   4695     * limitations under the License.
   4696     */
   4697 
   4698    /*
   4699     * File: OP_APUT.S
   4700     *
   4701     * Code: Generic 32-bit array put operation.  Provides a "scale" variable
   4702     *       to specify a scale value which depends on the width of the array
   4703     *       elements. Provides a "mov" variable which determines the type of
   4704     *       move performed also dependent on the type of the array element.
   4705     *       Provides a "value" register to specify the source of the move
   4706     *
   4707     * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
   4708     *
   4709     * Description: Perform an array put operation from the value register;
   4710     *              store the value register at the identified index of a
   4711     *              given array. vBB[vCC] <- vAA
   4712     *
   4713     * Format: AA|op CC|BB (23x)
   4714     *
   4715     * Syntax: op vAA, vBB, vCC
   4716     */
   4717 
   4718 
   4719     FETCH_BB    1, %ecx                 # %ecx<- BB
   4720     FETCH_CC    1, %edx                 # %edx<- CC
   4721     GET_VREG    %ecx                    # %ecx<- vBB
   4722     GET_VREG    %edx                    # %edx<- vCC
   4723     cmp         $0, %ecx               # check for null array object
   4724     je          common_errNullObject    # handle null array object
   4725     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4726     jnc         common_errArrayIndex    # handle index >= length, bail
   4727     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4728     lea         (%ecx, %edx, 4), %ecx # %ecx<- &vBB[vCC]
   4729     GET_VREG    rINST                   # rINST<- vAA
   4730     movl     rINST, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
   4731     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4732 
   4733 /* ------------------------------ */
   4734     .balign 64
   4735 .L_OP_APUT_WIDE: /* 0x4c */
   4736 /* File: x86-atom/OP_APUT_WIDE.S */
   4737    /* Copyright (C) 2008 The Android Open Source Project
   4738     *
   4739     * Licensed under the Apache License, Version 2.0 (the "License");
   4740     * you may not use this file except in compliance with the License.
   4741     * You may obtain a copy of the License at
   4742     *
   4743     * http://www.apache.org/licenses/LICENSE-2.0
   4744     *
   4745     * Unless required by applicable law or agreed to in writing, software
   4746     * distributed under the License is distributed on an "AS IS" BASIS,
   4747     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4748     * See the License for the specific language governing permissions and
   4749     * limitations under the License.
   4750     */
   4751 
   4752    /*
   4753     * File: OP_APUT_WIDE.S
   4754     *
   4755     * Code: 64-bit array put operation.
   4756     *
   4757     * For: aput-wide
   4758     *
   4759     * Description: Perform an array put operation from the value register;
   4760     *              store the value register at the identified index of a
   4761     *              given array. vBB[vCC] <- vAA.
   4762     *
   4763     * Format: AA|op CC|BB (23x)
   4764     *
   4765     * Syntax: op vAA, vBB, vCC
   4766     */
   4767 
   4768     FETCH_BB    1, %ecx                 # %ecx<- BB
   4769     FETCH_CC    1, %edx                 # %edx<- CC
   4770     GET_VREG    %ecx                    # %ecx<- vBB
   4771     GET_VREG    %edx                    # %edx<- vCC
   4772     cmp         $0, %ecx               # check for null array object
   4773     je          common_errNullObject    # handle null array object
   4774     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4775     jnc         common_errArrayIndex    # handle index >= length, bail
   4776     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4777     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vAA
   4778     movq        %xmm0, offArrayObject_contents(%ecx, %edx, 8) # vBB[vCC]<- %xmm0; value
   4779     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4780 
   4781 /* ------------------------------ */
   4782     .balign 64
   4783 .L_OP_APUT_OBJECT: /* 0x4d */
   4784 /* File: x86-atom/OP_APUT_OBJECT.S */
   4785    /* Copyright (C) 2008 The Android Open Source Project
   4786     *
   4787     * Licensed under the Apache License, Version 2.0 (the "License");
   4788     * you may not use this file except in compliance with the License.
   4789     * You may obtain a copy of the License at
   4790     *
   4791     * http://www.apache.org/licenses/LICENSE-2.0
   4792     *
   4793     * Unless required by applicable law or agreed to in writing, software
   4794     * distributed under the License is distributed on an "AS IS" BASIS,
   4795     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4796     * See the License for the specific language governing permissions and
   4797     * limitations under the License.
   4798     */
   4799 
   4800    /*
   4801     * File: OP_APUT_OBJECT.S
   4802     *
   4803     * Code: 32-bit array put operation.  Provides an "scale" variable
   4804     *       specify a scale value which depends on the width of the array
   4805     *       elements. Provides a "mov" variable which determines the type of
   4806     *       mov performed also dependent on the type of the array element.
   4807     *       Provides a "value" register to specify the source of the mov
   4808     *
   4809     * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
   4810     *
   4811     * Description: Perform an array put operation from the value register;
   4812     *              store the value register at the identified index of a
   4813     *              given array. vBB[vCC] <- vAA
   4814     *
   4815     * Format: AA|op CC|BB (23x)
   4816     *
   4817     * Syntax: op vAA, vBB, vCC
   4818     */
   4819 
   4820     FETCH_BB    1, %eax                 # %eax<- BB
   4821     FETCH_CC    1, %edx                 # %edx<- CC
   4822     GET_VREG    %eax                    # %eax<- vBB
   4823     GET_VREG    %edx                    # %edx<- vCC
   4824     cmp         $0, %eax               # check for null array object
   4825     je          common_errNullObject    # handle null array object
   4826     cmp         offArrayObject_length(%eax), %edx # compare index to arrayObj->length
   4827     jnc         common_errArrayIndex    # handle index >= length, bail
   4828     GET_VREG    rINST                   # rINST<- vAA
   4829     lea         (%eax, %edx, 4), %edx   # %edx<- &vBB[vCC]
   4830     cmp         $0, rINST              # check for null reference
   4831     je          .LOP_APUT_OBJECT_skip_check  # reference is null so skip type check
   4832     jmp         .LOP_APUT_OBJECT_finish
   4833 
   4834 /* ------------------------------ */
   4835     .balign 64
   4836 .L_OP_APUT_BOOLEAN: /* 0x4e */
   4837 /* File: x86-atom/OP_APUT_BOOLEAN.S */
   4838    /* Copyright (C) 2008 The Android Open Source Project
   4839     *
   4840     * Licensed under the Apache License, Version 2.0 (the "License");
   4841     * you may not use this file except in compliance with the License.
   4842     * You may obtain a copy of the License at
   4843     *
   4844     * http://www.apache.org/licenses/LICENSE-2.0
   4845     *
   4846     * Unless required by applicable law or agreed to in writing, software
   4847     * distributed under the License is distributed on an "AS IS" BASIS,
   4848     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4849     * See the License for the specific language governing permissions and
   4850     * limitations under the License.
   4851     */
   4852 
   4853    /*
   4854     * File: OP_APUT_BOOLEAN.S
   4855     */
   4856 
   4857 /* File: x86-atom/OP_APUT.S */
   4858    /* Copyright (C) 2008 The Android Open Source Project
   4859     *
   4860     * Licensed under the Apache License, Version 2.0 (the "License");
   4861     * you may not use this file except in compliance with the License.
   4862     * You may obtain a copy of the License at
   4863     *
   4864     * http://www.apache.org/licenses/LICENSE-2.0
   4865     *
   4866     * Unless required by applicable law or agreed to in writing, software
   4867     * distributed under the License is distributed on an "AS IS" BASIS,
   4868     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4869     * See the License for the specific language governing permissions and
   4870     * limitations under the License.
   4871     */
   4872 
   4873    /*
   4874     * File: OP_APUT.S
   4875     *
   4876     * Code: Generic 32-bit array put operation.  Provides a "scale" variable
   4877     *       to specify a scale value which depends on the width of the array
   4878     *       elements. Provides a "mov" variable which determines the type of
   4879     *       move performed also dependent on the type of the array element.
   4880     *       Provides a "value" register to specify the source of the move
   4881     *
   4882     * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
   4883     *
   4884     * Description: Perform an array put operation from the value register;
   4885     *              store the value register at the identified index of a
   4886     *              given array. vBB[vCC] <- vAA
   4887     *
   4888     * Format: AA|op CC|BB (23x)
   4889     *
   4890     * Syntax: op vAA, vBB, vCC
   4891     */
   4892 
   4893 
   4894     FETCH_BB    1, %ecx                 # %ecx<- BB
   4895     FETCH_CC    1, %edx                 # %edx<- CC
   4896     GET_VREG    %ecx                    # %ecx<- vBB
   4897     GET_VREG    %edx                    # %edx<- vCC
   4898     cmp         $0, %ecx               # check for null array object
   4899     je          common_errNullObject    # handle null array object
   4900     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4901     jnc         common_errArrayIndex    # handle index >= length, bail
   4902     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4903     lea         (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
   4904     GET_VREG    rINST                   # rINST<- vAA
   4905     movb     rINSTbl, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
   4906     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4907 
   4908 
   4909 /* ------------------------------ */
   4910     .balign 64
   4911 .L_OP_APUT_BYTE: /* 0x4f */
   4912 /* File: x86-atom/OP_APUT_BYTE.S */
   4913    /* Copyright (C) 2008 The Android Open Source Project
   4914     *
   4915     * Licensed under the Apache License, Version 2.0 (the "License");
   4916     * you may not use this file except in compliance with the License.
   4917     * You may obtain a copy of the License at
   4918     *
   4919     * http://www.apache.org/licenses/LICENSE-2.0
   4920     *
   4921     * Unless required by applicable law or agreed to in writing, software
   4922     * distributed under the License is distributed on an "AS IS" BASIS,
   4923     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4924     * See the License for the specific language governing permissions and
   4925     * limitations under the License.
   4926     */
   4927 
   4928    /*
   4929     * File: OP_APUT_BYTE.S
   4930     */
   4931 
   4932 /* File: x86-atom/OP_APUT.S */
   4933    /* Copyright (C) 2008 The Android Open Source Project
   4934     *
   4935     * Licensed under the Apache License, Version 2.0 (the "License");
   4936     * you may not use this file except in compliance with the License.
   4937     * You may obtain a copy of the License at
   4938     *
   4939     * http://www.apache.org/licenses/LICENSE-2.0
   4940     *
   4941     * Unless required by applicable law or agreed to in writing, software
   4942     * distributed under the License is distributed on an "AS IS" BASIS,
   4943     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4944     * See the License for the specific language governing permissions and
   4945     * limitations under the License.
   4946     */
   4947 
   4948    /*
   4949     * File: OP_APUT.S
   4950     *
   4951     * Code: Generic 32-bit array put operation.  Provides a "scale" variable
   4952     *       to specify a scale value which depends on the width of the array
   4953     *       elements. Provides a "mov" variable which determines the type of
   4954     *       move performed also dependent on the type of the array element.
   4955     *       Provides a "value" register to specify the source of the move
   4956     *
   4957     * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
   4958     *
   4959     * Description: Perform an array put operation from the value register;
   4960     *              store the value register at the identified index of a
   4961     *              given array. vBB[vCC] <- vAA
   4962     *
   4963     * Format: AA|op CC|BB (23x)
   4964     *
   4965     * Syntax: op vAA, vBB, vCC
   4966     */
   4967 
   4968 
   4969     FETCH_BB    1, %ecx                 # %ecx<- BB
   4970     FETCH_CC    1, %edx                 # %edx<- CC
   4971     GET_VREG    %ecx                    # %ecx<- vBB
   4972     GET_VREG    %edx                    # %edx<- vCC
   4973     cmp         $0, %ecx               # check for null array object
   4974     je          common_errNullObject    # handle null array object
   4975     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   4976     jnc         common_errArrayIndex    # handle index >= length, bail
   4977     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   4978     lea         (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
   4979     GET_VREG    rINST                   # rINST<- vAA
   4980     movb     rINSTbl, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
   4981     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   4982 
   4983 
   4984 /* ------------------------------ */
   4985     .balign 64
   4986 .L_OP_APUT_CHAR: /* 0x50 */
   4987 /* File: x86-atom/OP_APUT_CHAR.S */
   4988    /* Copyright (C) 2008 The Android Open Source Project
   4989     *
   4990     * Licensed under the Apache License, Version 2.0 (the "License");
   4991     * you may not use this file except in compliance with the License.
   4992     * You may obtain a copy of the License at
   4993     *
   4994     * http://www.apache.org/licenses/LICENSE-2.0
   4995     *
   4996     * Unless required by applicable law or agreed to in writing, software
   4997     * distributed under the License is distributed on an "AS IS" BASIS,
   4998     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   4999     * See the License for the specific language governing permissions and
   5000     * limitations under the License.
   5001     */
   5002 
   5003    /*
   5004     * File: OP_APUT_CHAR.S
   5005     */
   5006 
   5007 /* File: x86-atom/OP_APUT.S */
   5008    /* Copyright (C) 2008 The Android Open Source Project
   5009     *
   5010     * Licensed under the Apache License, Version 2.0 (the "License");
   5011     * you may not use this file except in compliance with the License.
   5012     * You may obtain a copy of the License at
   5013     *
   5014     * http://www.apache.org/licenses/LICENSE-2.0
   5015     *
   5016     * Unless required by applicable law or agreed to in writing, software
   5017     * distributed under the License is distributed on an "AS IS" BASIS,
   5018     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5019     * See the License for the specific language governing permissions and
   5020     * limitations under the License.
   5021     */
   5022 
   5023    /*
   5024     * File: OP_APUT.S
   5025     *
   5026     * Code: Generic 32-bit array put operation.  Provides a "scale" variable
   5027     *       to specify a scale value which depends on the width of the array
   5028     *       elements. Provides a "mov" variable which determines the type of
   5029     *       move performed also dependent on the type of the array element.
   5030     *       Provides a "value" register to specify the source of the move
   5031     *
   5032     * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
   5033     *
   5034     * Description: Perform an array put operation from the value register;
   5035     *              store the value register at the identified index of a
   5036     *              given array. vBB[vCC] <- vAA
   5037     *
   5038     * Format: AA|op CC|BB (23x)
   5039     *
   5040     * Syntax: op vAA, vBB, vCC
   5041     */
   5042 
   5043 
   5044     FETCH_BB    1, %ecx                 # %ecx<- BB
   5045     FETCH_CC    1, %edx                 # %edx<- CC
   5046     GET_VREG    %ecx                    # %ecx<- vBB
   5047     GET_VREG    %edx                    # %edx<- vCC
   5048     cmp         $0, %ecx               # check for null array object
   5049     je          common_errNullObject    # handle null array object
   5050     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   5051     jnc         common_errArrayIndex    # handle index >= length, bail
   5052     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   5053     lea         (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
   5054     GET_VREG    rINST                   # rINST<- vAA
   5055     movw     rINSTw, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
   5056     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   5057 
   5058 
   5059 /* ------------------------------ */
   5060     .balign 64
   5061 .L_OP_APUT_SHORT: /* 0x51 */
   5062 /* File: x86-atom/OP_APUT_SHORT.S */
   5063    /* Copyright (C) 2008 The Android Open Source Project
   5064     *
   5065     * Licensed under the Apache License, Version 2.0 (the "License");
   5066     * you may not use this file except in compliance with the License.
   5067     * You may obtain a copy of the License at
   5068     *
   5069     * http://www.apache.org/licenses/LICENSE-2.0
   5070     *
   5071     * Unless required by applicable law or agreed to in writing, software
   5072     * distributed under the License is distributed on an "AS IS" BASIS,
   5073     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5074     * See the License for the specific language governing permissions and
   5075     * limitations under the License.
   5076     */
   5077 
   5078    /*
   5079     * File: OP_APUT_SHORT.S
   5080     */
   5081 
   5082 /* File: x86-atom/OP_APUT.S */
   5083    /* Copyright (C) 2008 The Android Open Source Project
   5084     *
   5085     * Licensed under the Apache License, Version 2.0 (the "License");
   5086     * you may not use this file except in compliance with the License.
   5087     * You may obtain a copy of the License at
   5088     *
   5089     * http://www.apache.org/licenses/LICENSE-2.0
   5090     *
   5091     * Unless required by applicable law or agreed to in writing, software
   5092     * distributed under the License is distributed on an "AS IS" BASIS,
   5093     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5094     * See the License for the specific language governing permissions and
   5095     * limitations under the License.
   5096     */
   5097 
   5098    /*
   5099     * File: OP_APUT.S
   5100     *
   5101     * Code: Generic 32-bit array put operation.  Provides a "scale" variable
   5102     *       to specify a scale value which depends on the width of the array
   5103     *       elements. Provides a "mov" variable which determines the type of
   5104     *       move performed also dependent on the type of the array element.
   5105     *       Provides a "value" register to specify the source of the move
   5106     *
   5107     * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
   5108     *
   5109     * Description: Perform an array put operation from the value register;
   5110     *              store the value register at the identified index of a
   5111     *              given array. vBB[vCC] <- vAA
   5112     *
   5113     * Format: AA|op CC|BB (23x)
   5114     *
   5115     * Syntax: op vAA, vBB, vCC
   5116     */
   5117 
   5118 
   5119     FETCH_BB    1, %ecx                 # %ecx<- BB
   5120     FETCH_CC    1, %edx                 # %edx<- CC
   5121     GET_VREG    %ecx                    # %ecx<- vBB
   5122     GET_VREG    %edx                    # %edx<- vCC
   5123     cmp         $0, %ecx               # check for null array object
   5124     je          common_errNullObject    # handle null array object
   5125     cmp         offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
   5126     jnc         common_errArrayIndex    # handle index >= length, bail
   5127     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   5128     lea         (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
   5129     GET_VREG    rINST                   # rINST<- vAA
   5130     movw     rINSTw, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
   5131     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   5132 
   5133 
   5134 /* ------------------------------ */
   5135     .balign 64
   5136 .L_OP_IGET: /* 0x52 */
   5137 /* File: x86-atom/OP_IGET.S */
   5138    /* Copyright (C) 2008 The Android Open Source Project
   5139     *
   5140     * Licensed under the Apache License, Version 2.0 (the "License");
   5141     * you may not use this file except in compliance with the License.
   5142     * You may obtain a copy of the License at
   5143     *
   5144     * http://www.apache.org/licenses/LICENSE-2.0
   5145     *
   5146     * Unless required by applicable law or agreed to in writing, software
   5147     * distributed under the License is distributed on an "AS IS" BASIS,
   5148     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5149     * See the License for the specific language governing permissions and
   5150     * limitations under the License.
   5151     */
   5152 
   5153    /*
   5154     * File: OP_IGET.S
   5155     *
   5156     * Code: Generic 32-bit instance field "get" operation. Provides a
   5157     *       "mov" variable which determines the type of mov performed.
   5158     *       Currently, none of the iget's use this variable - may want
   5159     *       to change this, but seems ok for now.
   5160     *
   5161     * For: iget-boolean, iget-byte, iget-char, iget-object, iget
   5162     *      iget-short
   5163     *
   5164     * Description: Perform the object instance field "get" operation
   5165     *              with the identified field; load the instance value into
   5166     *              the value register.
   5167     *
   5168     *
   5169     * Format: B|A|op CCCC (22c)
   5170     *
   5171     * Syntax: op vA, vB, type@CCCC
   5172     *         op vA, vB, field@CCCC
   5173     */
   5174 
   5175 
   5176     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5177     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5178     FETCH       1, %ecx                 # %ecx<- CCCC
   5179     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5180     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5181     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5182     jne         .LOP_IGET_finish2
   5183     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5184     movl        offGlue_method(%edx), %edx # %edx <- current method
   5185     EXPORT_PC                           # in case an exception is thrown
   5186     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   5187     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   5188     movl        %edx, -8(%esp)          # push parameter method->clazz
   5189     lea         -8(%esp), %esp
   5190     jmp         .LOP_IGET_finish
   5191 
   5192 /* ------------------------------ */
   5193     .balign 64
   5194 .L_OP_IGET_WIDE: /* 0x53 */
   5195 /* File: x86-atom/OP_IGET_WIDE.S */
   5196    /* Copyright (C) 2008 The Android Open Source Project
   5197     *
   5198     * Licensed under the Apache License, Version 2.0 (the "License");
   5199     * you may not use this file except in compliance with the License.
   5200     * You may obtain a copy of the License at
   5201     *
   5202     * http://www.apache.org/licenses/LICENSE-2.0
   5203     *
   5204     * Unless required by applicable law or agreed to in writing, software
   5205     * distributed under the License is distributed on an "AS IS" BASIS,
   5206     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5207     * See the License for the specific language governing permissions and
   5208     * limitations under the License.
   5209     */
   5210 
   5211    /*
   5212     * File: OP_IGET_WIDE.S
   5213     *
   5214     * Code: 64 bit instance field "get" operation. Uses no substitutions.
   5215     *
   5216     * For: iget-wide
   5217     *
   5218     * Description: Perform the object instance field "get" operation
   5219     *              with the identified field; load the instance value into
   5220     *              the value register.
   5221     *
   5222     * Format:  B|A|op CCCC (22c)
   5223     *
   5224     * Syntax: op vA, vB, type@CCCC
   5225     *         op vA, vB, field@CCCC
   5226     */
   5227 
   5228     movl        rGLUE, %eax             # %eax<- MterpGlue pointer
   5229     movl        offGlue_methodClassDex(%eax), %ecx # %ecx<- pDvmDex
   5230     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- CCCC
   5231     FETCH       1, %edx                 # %edx<- pDvmDex->pResFields
   5232     movl        (%ecx, %edx, 4), %ecx   # %ecx<- resolved InstField ptr
   5233     cmp         $0, %ecx               # check for null ptr; resolved InstField ptr
   5234     jne         .LOP_IGET_WIDE_finish
   5235     movl        offGlue_method(%eax), %ecx # %ecx <- current method
   5236     EXPORT_PC                           # in case an exception is thrown
   5237     movl        offMethod_clazz(%ecx), %ecx # %ecx<- method->clazz
   5238     movl        %ecx, -8(%esp)          # push parameter CCCC; field ref
   5239     movl        %edx, -4(%esp)          # push parameter method->clazz
   5240     jmp         .LOP_IGET_WIDE_finish2
   5241 
   5242 /* ------------------------------ */
   5243     .balign 64
   5244 .L_OP_IGET_OBJECT: /* 0x54 */
   5245 /* File: x86-atom/OP_IGET_OBJECT.S */
   5246    /* Copyright (C) 2008 The Android Open Source Project
   5247     *
   5248     * Licensed under the Apache License, Version 2.0 (the "License");
   5249     * you may not use this file except in compliance with the License.
   5250     * You may obtain a copy of the License at
   5251     *
   5252     * http://www.apache.org/licenses/LICENSE-2.0
   5253     *
   5254     * Unless required by applicable law or agreed to in writing, software
   5255     * distributed under the License is distributed on an "AS IS" BASIS,
   5256     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5257     * See the License for the specific language governing permissions and
   5258     * limitations under the License.
   5259     */
   5260 
   5261    /*
   5262     * File: OP_IGET_OBJECT.S
   5263     */
   5264 
   5265 /* File: x86-atom/OP_IGET.S */
   5266    /* Copyright (C) 2008 The Android Open Source Project
   5267     *
   5268     * Licensed under the Apache License, Version 2.0 (the "License");
   5269     * you may not use this file except in compliance with the License.
   5270     * You may obtain a copy of the License at
   5271     *
   5272     * http://www.apache.org/licenses/LICENSE-2.0
   5273     *
   5274     * Unless required by applicable law or agreed to in writing, software
   5275     * distributed under the License is distributed on an "AS IS" BASIS,
   5276     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5277     * See the License for the specific language governing permissions and
   5278     * limitations under the License.
   5279     */
   5280 
   5281    /*
   5282     * File: OP_IGET.S
   5283     *
   5284     * Code: Generic 32-bit instance field "get" operation. Provides a
   5285     *       "mov" variable which determines the type of mov performed.
   5286     *       Currently, none of the iget's use this variable - may want
   5287     *       to change this, but seems ok for now.
   5288     *
   5289     * For: iget-boolean, iget-byte, iget-char, iget-object, iget
   5290     *      iget-short
   5291     *
   5292     * Description: Perform the object instance field "get" operation
   5293     *              with the identified field; load the instance value into
   5294     *              the value register.
   5295     *
   5296     *
   5297     * Format: B|A|op CCCC (22c)
   5298     *
   5299     * Syntax: op vA, vB, type@CCCC
   5300     *         op vA, vB, field@CCCC
   5301     */
   5302 
   5303 
   5304     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5305     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5306     FETCH       1, %ecx                 # %ecx<- CCCC
   5307     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5308     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5309     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5310     jne         .LOP_IGET_OBJECT_finish2
   5311     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5312     movl        offGlue_method(%edx), %edx # %edx <- current method
   5313     EXPORT_PC                           # in case an exception is thrown
   5314     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   5315     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   5316     movl        %edx, -8(%esp)          # push parameter method->clazz
   5317     lea         -8(%esp), %esp
   5318     jmp         .LOP_IGET_OBJECT_finish
   5319 
   5320 
   5321 /* ------------------------------ */
   5322     .balign 64
   5323 .L_OP_IGET_BOOLEAN: /* 0x55 */
   5324 /* File: x86-atom/OP_IGET_BOOLEAN.S */
   5325    /* Copyright (C) 2008 The Android Open Source Project
   5326     *
   5327     * Licensed under the Apache License, Version 2.0 (the "License");
   5328     * you may not use this file except in compliance with the License.
   5329     * You may obtain a copy of the License at
   5330     *
   5331     * http://www.apache.org/licenses/LICENSE-2.0
   5332     *
   5333     * Unless required by applicable law or agreed to in writing, software
   5334     * distributed under the License is distributed on an "AS IS" BASIS,
   5335     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5336     * See the License for the specific language governing permissions and
   5337     * limitations under the License.
   5338     */
   5339 
   5340    /*
   5341     * File: OP_IGET_BOOLEAN.S
   5342     */
   5343 
   5344 /* File: x86-atom/OP_IGET.S */
   5345    /* Copyright (C) 2008 The Android Open Source Project
   5346     *
   5347     * Licensed under the Apache License, Version 2.0 (the "License");
   5348     * you may not use this file except in compliance with the License.
   5349     * You may obtain a copy of the License at
   5350     *
   5351     * http://www.apache.org/licenses/LICENSE-2.0
   5352     *
   5353     * Unless required by applicable law or agreed to in writing, software
   5354     * distributed under the License is distributed on an "AS IS" BASIS,
   5355     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5356     * See the License for the specific language governing permissions and
   5357     * limitations under the License.
   5358     */
   5359 
   5360    /*
   5361     * File: OP_IGET.S
   5362     *
   5363     * Code: Generic 32-bit instance field "get" operation. Provides a
   5364     *       "mov" variable which determines the type of mov performed.
   5365     *       Currently, none of the iget's use this variable - may want
   5366     *       to change this, but seems ok for now.
   5367     *
   5368     * For: iget-boolean, iget-byte, iget-char, iget-object, iget
   5369     *      iget-short
   5370     *
   5371     * Description: Perform the object instance field "get" operation
   5372     *              with the identified field; load the instance value into
   5373     *              the value register.
   5374     *
   5375     *
   5376     * Format: B|A|op CCCC (22c)
   5377     *
   5378     * Syntax: op vA, vB, type@CCCC
   5379     *         op vA, vB, field@CCCC
   5380     */
   5381 
   5382 
   5383     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5384     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5385     FETCH       1, %ecx                 # %ecx<- CCCC
   5386     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5387     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5388     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5389     jne         .LOP_IGET_BOOLEAN_finish2
   5390     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5391     movl        offGlue_method(%edx), %edx # %edx <- current method
   5392     EXPORT_PC                           # in case an exception is thrown
   5393     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   5394     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   5395     movl        %edx, -8(%esp)          # push parameter method->clazz
   5396     lea         -8(%esp), %esp
   5397     jmp         .LOP_IGET_BOOLEAN_finish
   5398 
   5399 
   5400 /* ------------------------------ */
   5401     .balign 64
   5402 .L_OP_IGET_BYTE: /* 0x56 */
   5403 /* File: x86-atom/OP_IGET_BYTE.S */
   5404    /* Copyright (C) 2008 The Android Open Source Project
   5405     *
   5406     * Licensed under the Apache License, Version 2.0 (the "License");
   5407     * you may not use this file except in compliance with the License.
   5408     * You may obtain a copy of the License at
   5409     *
   5410     * http://www.apache.org/licenses/LICENSE-2.0
   5411     *
   5412     * Unless required by applicable law or agreed to in writing, software
   5413     * distributed under the License is distributed on an "AS IS" BASIS,
   5414     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5415     * See the License for the specific language governing permissions and
   5416     * limitations under the License.
   5417     */
   5418 
   5419    /*
   5420     * File: OP_IGET_BYTE.S
   5421     */
   5422 
   5423 /* File: x86-atom/OP_IGET.S */
   5424    /* Copyright (C) 2008 The Android Open Source Project
   5425     *
   5426     * Licensed under the Apache License, Version 2.0 (the "License");
   5427     * you may not use this file except in compliance with the License.
   5428     * You may obtain a copy of the License at
   5429     *
   5430     * http://www.apache.org/licenses/LICENSE-2.0
   5431     *
   5432     * Unless required by applicable law or agreed to in writing, software
   5433     * distributed under the License is distributed on an "AS IS" BASIS,
   5434     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5435     * See the License for the specific language governing permissions and
   5436     * limitations under the License.
   5437     */
   5438 
   5439    /*
   5440     * File: OP_IGET.S
   5441     *
   5442     * Code: Generic 32-bit instance field "get" operation. Provides a
   5443     *       "mov" variable which determines the type of mov performed.
   5444     *       Currently, none of the iget's use this variable - may want
   5445     *       to change this, but seems ok for now.
   5446     *
   5447     * For: iget-boolean, iget-byte, iget-char, iget-object, iget
   5448     *      iget-short
   5449     *
   5450     * Description: Perform the object instance field "get" operation
   5451     *              with the identified field; load the instance value into
   5452     *              the value register.
   5453     *
   5454     *
   5455     * Format: B|A|op CCCC (22c)
   5456     *
   5457     * Syntax: op vA, vB, type@CCCC
   5458     *         op vA, vB, field@CCCC
   5459     */
   5460 
   5461 
   5462     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5463     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5464     FETCH       1, %ecx                 # %ecx<- CCCC
   5465     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5466     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5467     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5468     jne         .LOP_IGET_BYTE_finish2
   5469     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5470     movl        offGlue_method(%edx), %edx # %edx <- current method
   5471     EXPORT_PC                           # in case an exception is thrown
   5472     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   5473     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   5474     movl        %edx, -8(%esp)          # push parameter method->clazz
   5475     lea         -8(%esp), %esp
   5476     jmp         .LOP_IGET_BYTE_finish
   5477 
   5478 
   5479 /* ------------------------------ */
   5480     .balign 64
   5481 .L_OP_IGET_CHAR: /* 0x57 */
   5482 /* File: x86-atom/OP_IGET_CHAR.S */
   5483    /* Copyright (C) 2008 The Android Open Source Project
   5484     *
   5485     * Licensed under the Apache License, Version 2.0 (the "License");
   5486     * you may not use this file except in compliance with the License.
   5487     * You may obtain a copy of the License at
   5488     *
   5489     * http://www.apache.org/licenses/LICENSE-2.0
   5490     *
   5491     * Unless required by applicable law or agreed to in writing, software
   5492     * distributed under the License is distributed on an "AS IS" BASIS,
   5493     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5494     * See the License for the specific language governing permissions and
   5495     * limitations under the License.
   5496     */
   5497 
   5498    /*
   5499     * File: OP_IGET_CHAR.S
   5500     */
   5501 
   5502 /* File: x86-atom/OP_IGET.S */
   5503    /* Copyright (C) 2008 The Android Open Source Project
   5504     *
   5505     * Licensed under the Apache License, Version 2.0 (the "License");
   5506     * you may not use this file except in compliance with the License.
   5507     * You may obtain a copy of the License at
   5508     *
   5509     * http://www.apache.org/licenses/LICENSE-2.0
   5510     *
   5511     * Unless required by applicable law or agreed to in writing, software
   5512     * distributed under the License is distributed on an "AS IS" BASIS,
   5513     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5514     * See the License for the specific language governing permissions and
   5515     * limitations under the License.
   5516     */
   5517 
   5518    /*
   5519     * File: OP_IGET.S
   5520     *
   5521     * Code: Generic 32-bit instance field "get" operation. Provides a
   5522     *       "mov" variable which determines the type of mov performed.
   5523     *       Currently, none of the iget's use this variable - may want
   5524     *       to change this, but seems ok for now.
   5525     *
   5526     * For: iget-boolean, iget-byte, iget-char, iget-object, iget
   5527     *      iget-short
   5528     *
   5529     * Description: Perform the object instance field "get" operation
   5530     *              with the identified field; load the instance value into
   5531     *              the value register.
   5532     *
   5533     *
   5534     * Format: B|A|op CCCC (22c)
   5535     *
   5536     * Syntax: op vA, vB, type@CCCC
   5537     *         op vA, vB, field@CCCC
   5538     */
   5539 
   5540 
   5541     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5542     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5543     FETCH       1, %ecx                 # %ecx<- CCCC
   5544     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5545     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5546     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5547     jne         .LOP_IGET_CHAR_finish2
   5548     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5549     movl        offGlue_method(%edx), %edx # %edx <- current method
   5550     EXPORT_PC                           # in case an exception is thrown
   5551     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   5552     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   5553     movl        %edx, -8(%esp)          # push parameter method->clazz
   5554     lea         -8(%esp), %esp
   5555     jmp         .LOP_IGET_CHAR_finish
   5556 
   5557 
   5558 /* ------------------------------ */
   5559     .balign 64
   5560 .L_OP_IGET_SHORT: /* 0x58 */
   5561 /* File: x86-atom/OP_IGET_SHORT.S */
   5562    /* Copyright (C) 2008 The Android Open Source Project
   5563     *
   5564     * Licensed under the Apache License, Version 2.0 (the "License");
   5565     * you may not use this file except in compliance with the License.
   5566     * You may obtain a copy of the License at
   5567     *
   5568     * http://www.apache.org/licenses/LICENSE-2.0
   5569     *
   5570     * Unless required by applicable law or agreed to in writing, software
   5571     * distributed under the License is distributed on an "AS IS" BASIS,
   5572     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5573     * See the License for the specific language governing permissions and
   5574     * limitations under the License.
   5575     */
   5576 
   5577    /*
   5578     * File: OP_IGET_SHORT.S
   5579     */
   5580 
   5581 /* File: x86-atom/OP_IGET.S */
   5582    /* Copyright (C) 2008 The Android Open Source Project
   5583     *
   5584     * Licensed under the Apache License, Version 2.0 (the "License");
   5585     * you may not use this file except in compliance with the License.
   5586     * You may obtain a copy of the License at
   5587     *
   5588     * http://www.apache.org/licenses/LICENSE-2.0
   5589     *
   5590     * Unless required by applicable law or agreed to in writing, software
   5591     * distributed under the License is distributed on an "AS IS" BASIS,
   5592     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5593     * See the License for the specific language governing permissions and
   5594     * limitations under the License.
   5595     */
   5596 
   5597    /*
   5598     * File: OP_IGET.S
   5599     *
   5600     * Code: Generic 32-bit instance field "get" operation. Provides a
   5601     *       "mov" variable which determines the type of mov performed.
   5602     *       Currently, none of the iget's use this variable - may want
   5603     *       to change this, but seems ok for now.
   5604     *
   5605     * For: iget-boolean, iget-byte, iget-char, iget-object, iget
   5606     *      iget-short
   5607     *
   5608     * Description: Perform the object instance field "get" operation
   5609     *              with the identified field; load the instance value into
   5610     *              the value register.
   5611     *
   5612     *
   5613     * Format: B|A|op CCCC (22c)
   5614     *
   5615     * Syntax: op vA, vB, type@CCCC
   5616     *         op vA, vB, field@CCCC
   5617     */
   5618 
   5619 
   5620     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5621     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5622     FETCH       1, %ecx                 # %ecx<- CCCC
   5623     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5624     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5625     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5626     jne         .LOP_IGET_SHORT_finish2
   5627     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5628     movl        offGlue_method(%edx), %edx # %edx <- current method
   5629     EXPORT_PC                           # in case an exception is thrown
   5630     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   5631     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   5632     movl        %edx, -8(%esp)          # push parameter method->clazz
   5633     lea         -8(%esp), %esp
   5634     jmp         .LOP_IGET_SHORT_finish
   5635 
   5636 
   5637 /* ------------------------------ */
   5638     .balign 64
   5639 .L_OP_IPUT: /* 0x59 */
   5640 /* File: x86-atom/OP_IPUT.S */
   5641    /* Copyright (C) 2008 The Android Open Source Project
   5642     *
   5643     * Licensed under the Apache License, Version 2.0 (the "License");
   5644     * you may not use this file except in compliance with the License.
   5645     * You may obtain a copy of the License at
   5646     *
   5647     * http://www.apache.org/licenses/LICENSE-2.0
   5648     *
   5649     * Unless required by applicable law or agreed to in writing, software
   5650     * distributed under the License is distributed on an "AS IS" BASIS,
   5651     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5652     * See the License for the specific language governing permissions and
   5653     * limitations under the License.
   5654     */
   5655 
   5656     /*
   5657     * File: OP_IPUT.S
   5658     *
   5659     * Code: Generic 32-bit instance field "put" operation. Provides a
   5660     *       "mov" variable which determines the type of mov performed.
   5661     *       Currently, none of the iput's use this variable - may want
   5662     *       to change this, but seems ok for now.
   5663     *
   5664     * For: iput-boolean, iput-byte, iput-char, iput-object, iput
   5665     *      iput-short
   5666     *
   5667     * Description: Perform the object instance field "get" operation
   5668     *              with the identified field; load the instance value into
   5669     *              the value register.
   5670     *
   5671     *
   5672     * Format: B|A|op CCCC (22c)
   5673     *
   5674     * Syntax: op vA, vB, type@CCCC
   5675     *         op vA, vB, field@CCCC
   5676     */
   5677 
   5678 
   5679     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5680     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5681     FETCH       1, %ecx                 # %ecx<- CCCC
   5682     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5683     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5684     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5685     jne         .LOP_IPUT_finish2
   5686     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5687     jmp         .LOP_IPUT_finish
   5688 
   5689 /* ------------------------------ */
   5690     .balign 64
   5691 .L_OP_IPUT_WIDE: /* 0x5a */
   5692 /* File: x86-atom/OP_IPUT_WIDE.S */
   5693    /* Copyright (C) 2008 The Android Open Source Project
   5694     *
   5695     * Licensed under the Apache License, Version 2.0 (the "License");
   5696     * you may not use this file except in compliance with the License.
   5697     * You may obtain a copy of the License at
   5698     *
   5699     * http://www.apache.org/licenses/LICENSE-2.0
   5700     *
   5701     * Unless required by applicable law or agreed to in writing, software
   5702     * distributed under the License is distributed on an "AS IS" BASIS,
   5703     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5704     * See the License for the specific language governing permissions and
   5705     * limitations under the License.
   5706     */
   5707 
   5708    /*
   5709     * File: OP_IPUT_WIDE.S
   5710     *
   5711     * Code: 64 bit instance field "put" operation. Uses no substitutions.
   5712     *
   5713     * For: iget-wide
   5714     *
   5715     * Description: Perform the object instance field "put" operation
   5716     *              with the identified field; load the instance value into
   5717     *              the value register.
   5718     *
   5719     * Format:  B|A|op CCCC (22c)
   5720     *
   5721     * Syntax: op vA, vB, type@CCCC
   5722     *         op vA, vB, field@CCCC
   5723     */
   5724 
   5725     movl        rGLUE, %eax             # %eax<- MterpGlue pointer
   5726     movl        offGlue_methodClassDex(%eax), %ecx # %ecx<- pDvmDex
   5727     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- CCCC
   5728     FETCH       1, %edx                 # %edx<- pDvmDex->pResFields
   5729     movl        (%ecx, %edx, 4), %ecx   # %ecx<- resolved InstField ptr
   5730     cmp         $0, %ecx               # check for null ptr; resolved InstField ptr
   5731     jne         .LOP_IPUT_WIDE_finish
   5732     movl        offGlue_method(%eax), %ecx # %ecx <- current method
   5733     EXPORT_PC                           # in case an exception is thrown
   5734     movl        offMethod_clazz(%ecx), %ecx # %ecx<- method->clazz
   5735     movl        %ecx, -8(%esp)          # push parameter CCCC; field ref
   5736     movl        %edx, -4(%esp)          # push parameter method->clazz
   5737     jmp         .LOP_IPUT_WIDE_finish2
   5738 
   5739 /* ------------------------------ */
   5740     .balign 64
   5741 .L_OP_IPUT_OBJECT: /* 0x5b */
   5742 /* File: x86-atom/OP_IPUT_OBJECT.S */
   5743    /* Copyright (C) 2008 The Android Open Source Project
   5744     *
   5745     * Licensed under the Apache License, Version 2.0 (the "License");
   5746     * you may not use this file except in compliance with the License.
   5747     * You may obtain a copy of the License at
   5748     *
   5749     * http://www.apache.org/licenses/LICENSE-2.0
   5750     *
   5751     * Unless required by applicable law or agreed to in writing, software
   5752     * distributed under the License is distributed on an "AS IS" BASIS,
   5753     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5754     * See the License for the specific language governing permissions and
   5755     * limitations under the License.
   5756     */
   5757 
   5758     /*
   5759     * File: OP_IPUT.S
   5760     *
   5761     * Code: Generic 32-bit instance field "put" operation. Provides a
   5762     *       "mov" variable which determines the type of mov performed.
   5763     *       Currently, none of the iput's use this variable - may want
   5764     *       to change this, but seems ok for now.
   5765     *
   5766     * For: iput-boolean, iput-byte, iput-char, iput-object, iput
   5767     *      iput-short
   5768     *
   5769     * Description: Perform the object instance field "get" operation
   5770     *              with the identified field; load the instance value into
   5771     *              the value register.
   5772     *
   5773     *
   5774     * Format: B|A|op CCCC (22c)
   5775     *
   5776     * Syntax: op vA, vB, type@CCCC
   5777     *         op vA, vB, field@CCCC
   5778     */
   5779 
   5780     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5781     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5782     FETCH       1, %ecx                 # %ecx<- CCCC
   5783     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5784     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5785     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5786     jne         .LOP_IPUT_OBJECT_finish2
   5787     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5788     jmp         .LOP_IPUT_OBJECT_finish
   5789 
   5790 /* ------------------------------ */
   5791     .balign 64
   5792 .L_OP_IPUT_BOOLEAN: /* 0x5c */
   5793 /* File: x86-atom/OP_IPUT_BOOLEAN.S */
   5794    /* Copyright (C) 2008 The Android Open Source Project
   5795     *
   5796     * Licensed under the Apache License, Version 2.0 (the "License");
   5797     * you may not use this file except in compliance with the License.
   5798     * You may obtain a copy of the License at
   5799     *
   5800     * http://www.apache.org/licenses/LICENSE-2.0
   5801     *
   5802     * Unless required by applicable law or agreed to in writing, software
   5803     * distributed under the License is distributed on an "AS IS" BASIS,
   5804     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5805     * See the License for the specific language governing permissions and
   5806     * limitations under the License.
   5807     */
   5808 
   5809    /*
   5810     * File: OP_IPUT_BOOLEAN.S
   5811     */
   5812 
   5813 /* File: x86-atom/OP_IPUT.S */
   5814    /* Copyright (C) 2008 The Android Open Source Project
   5815     *
   5816     * Licensed under the Apache License, Version 2.0 (the "License");
   5817     * you may not use this file except in compliance with the License.
   5818     * You may obtain a copy of the License at
   5819     *
   5820     * http://www.apache.org/licenses/LICENSE-2.0
   5821     *
   5822     * Unless required by applicable law or agreed to in writing, software
   5823     * distributed under the License is distributed on an "AS IS" BASIS,
   5824     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5825     * See the License for the specific language governing permissions and
   5826     * limitations under the License.
   5827     */
   5828 
   5829     /*
   5830     * File: OP_IPUT.S
   5831     *
   5832     * Code: Generic 32-bit instance field "put" operation. Provides a
   5833     *       "mov" variable which determines the type of mov performed.
   5834     *       Currently, none of the iput's use this variable - may want
   5835     *       to change this, but seems ok for now.
   5836     *
   5837     * For: iput-boolean, iput-byte, iput-char, iput-object, iput
   5838     *      iput-short
   5839     *
   5840     * Description: Perform the object instance field "get" operation
   5841     *              with the identified field; load the instance value into
   5842     *              the value register.
   5843     *
   5844     *
   5845     * Format: B|A|op CCCC (22c)
   5846     *
   5847     * Syntax: op vA, vB, type@CCCC
   5848     *         op vA, vB, field@CCCC
   5849     */
   5850 
   5851 
   5852     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5853     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5854     FETCH       1, %ecx                 # %ecx<- CCCC
   5855     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5856     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5857     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5858     jne         .LOP_IPUT_BOOLEAN_finish2
   5859     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5860     jmp         .LOP_IPUT_BOOLEAN_finish
   5861 
   5862 
   5863 /* ------------------------------ */
   5864     .balign 64
   5865 .L_OP_IPUT_BYTE: /* 0x5d */
   5866 /* File: x86-atom/OP_IPUT_BYTE.S */
   5867    /* Copyright (C) 2008 The Android Open Source Project
   5868     *
   5869     * Licensed under the Apache License, Version 2.0 (the "License");
   5870     * you may not use this file except in compliance with the License.
   5871     * You may obtain a copy of the License at
   5872     *
   5873     * http://www.apache.org/licenses/LICENSE-2.0
   5874     *
   5875     * Unless required by applicable law or agreed to in writing, software
   5876     * distributed under the License is distributed on an "AS IS" BASIS,
   5877     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5878     * See the License for the specific language governing permissions and
   5879     * limitations under the License.
   5880     */
   5881 
   5882    /*
   5883     * File: OP_IPUT_BYTE.S
   5884     */
   5885 
   5886 /* File: x86-atom/OP_IPUT.S */
   5887    /* Copyright (C) 2008 The Android Open Source Project
   5888     *
   5889     * Licensed under the Apache License, Version 2.0 (the "License");
   5890     * you may not use this file except in compliance with the License.
   5891     * You may obtain a copy of the License at
   5892     *
   5893     * http://www.apache.org/licenses/LICENSE-2.0
   5894     *
   5895     * Unless required by applicable law or agreed to in writing, software
   5896     * distributed under the License is distributed on an "AS IS" BASIS,
   5897     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5898     * See the License for the specific language governing permissions and
   5899     * limitations under the License.
   5900     */
   5901 
   5902     /*
   5903     * File: OP_IPUT.S
   5904     *
   5905     * Code: Generic 32-bit instance field "put" operation. Provides a
   5906     *       "mov" variable which determines the type of mov performed.
   5907     *       Currently, none of the iput's use this variable - may want
   5908     *       to change this, but seems ok for now.
   5909     *
   5910     * For: iput-boolean, iput-byte, iput-char, iput-object, iput
   5911     *      iput-short
   5912     *
   5913     * Description: Perform the object instance field "get" operation
   5914     *              with the identified field; load the instance value into
   5915     *              the value register.
   5916     *
   5917     *
   5918     * Format: B|A|op CCCC (22c)
   5919     *
   5920     * Syntax: op vA, vB, type@CCCC
   5921     *         op vA, vB, field@CCCC
   5922     */
   5923 
   5924 
   5925     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5926     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   5927     FETCH       1, %ecx                 # %ecx<- CCCC
   5928     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   5929     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   5930     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   5931     jne         .LOP_IPUT_BYTE_finish2
   5932     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5933     jmp         .LOP_IPUT_BYTE_finish
   5934 
   5935 
   5936 /* ------------------------------ */
   5937     .balign 64
   5938 .L_OP_IPUT_CHAR: /* 0x5e */
   5939 /* File: x86-atom/OP_IPUT_CHAR.S */
   5940    /* Copyright (C) 2008 The Android Open Source Project
   5941     *
   5942     * Licensed under the Apache License, Version 2.0 (the "License");
   5943     * you may not use this file except in compliance with the License.
   5944     * You may obtain a copy of the License at
   5945     *
   5946     * http://www.apache.org/licenses/LICENSE-2.0
   5947     *
   5948     * Unless required by applicable law or agreed to in writing, software
   5949     * distributed under the License is distributed on an "AS IS" BASIS,
   5950     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5951     * See the License for the specific language governing permissions and
   5952     * limitations under the License.
   5953     */
   5954 
   5955    /*
   5956     * File: OP_IPUT_CHAR.S
   5957     */
   5958 
   5959 /* File: x86-atom/OP_IPUT.S */
   5960    /* Copyright (C) 2008 The Android Open Source Project
   5961     *
   5962     * Licensed under the Apache License, Version 2.0 (the "License");
   5963     * you may not use this file except in compliance with the License.
   5964     * You may obtain a copy of the License at
   5965     *
   5966     * http://www.apache.org/licenses/LICENSE-2.0
   5967     *
   5968     * Unless required by applicable law or agreed to in writing, software
   5969     * distributed under the License is distributed on an "AS IS" BASIS,
   5970     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   5971     * See the License for the specific language governing permissions and
   5972     * limitations under the License.
   5973     */
   5974 
   5975     /*
   5976     * File: OP_IPUT.S
   5977     *
   5978     * Code: Generic 32-bit instance field "put" operation. Provides a
   5979     *       "mov" variable which determines the type of mov performed.
   5980     *       Currently, none of the iput's use this variable - may want
   5981     *       to change this, but seems ok for now.
   5982     *
   5983     * For: iput-boolean, iput-byte, iput-char, iput-object, iput
   5984     *      iput-short
   5985     *
   5986     * Description: Perform the object instance field "get" operation
   5987     *              with the identified field; load the instance value into
   5988     *              the value register.
   5989     *
   5990     *
   5991     * Format: B|A|op CCCC (22c)
   5992     *
   5993     * Syntax: op vA, vB, type@CCCC
   5994     *         op vA, vB, field@CCCC
   5995     */
   5996 
   5997 
   5998     movl        rGLUE, %edx             # %edx<- pMterpGlue
   5999     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   6000     FETCH       1, %ecx                 # %ecx<- CCCC
   6001     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   6002     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   6003     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   6004     jne         .LOP_IPUT_CHAR_finish2
   6005     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6006     jmp         .LOP_IPUT_CHAR_finish
   6007 
   6008 
   6009 /* ------------------------------ */
   6010     .balign 64
   6011 .L_OP_IPUT_SHORT: /* 0x5f */
   6012 /* File: x86-atom/OP_IPUT_SHORT.S */
   6013    /* Copyright (C) 2008 The Android Open Source Project
   6014     *
   6015     * Licensed under the Apache License, Version 2.0 (the "License");
   6016     * you may not use this file except in compliance with the License.
   6017     * You may obtain a copy of the License at
   6018     *
   6019     * http://www.apache.org/licenses/LICENSE-2.0
   6020     *
   6021     * Unless required by applicable law or agreed to in writing, software
   6022     * distributed under the License is distributed on an "AS IS" BASIS,
   6023     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6024     * See the License for the specific language governing permissions and
   6025     * limitations under the License.
   6026     */
   6027 
   6028    /*
   6029     * File: OP_IPUT_SHORT.S
   6030     */
   6031 
   6032 /* File: x86-atom/OP_IPUT.S */
   6033    /* Copyright (C) 2008 The Android Open Source Project
   6034     *
   6035     * Licensed under the Apache License, Version 2.0 (the "License");
   6036     * you may not use this file except in compliance with the License.
   6037     * You may obtain a copy of the License at
   6038     *
   6039     * http://www.apache.org/licenses/LICENSE-2.0
   6040     *
   6041     * Unless required by applicable law or agreed to in writing, software
   6042     * distributed under the License is distributed on an "AS IS" BASIS,
   6043     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6044     * See the License for the specific language governing permissions and
   6045     * limitations under the License.
   6046     */
   6047 
   6048     /*
   6049     * File: OP_IPUT.S
   6050     *
   6051     * Code: Generic 32-bit instance field "put" operation. Provides a
   6052     *       "mov" variable which determines the type of mov performed.
   6053     *       Currently, none of the iput's use this variable - may want
   6054     *       to change this, but seems ok for now.
   6055     *
   6056     * For: iput-boolean, iput-byte, iput-char, iput-object, iput
   6057     *      iput-short
   6058     *
   6059     * Description: Perform the object instance field "get" operation
   6060     *              with the identified field; load the instance value into
   6061     *              the value register.
   6062     *
   6063     *
   6064     * Format: B|A|op CCCC (22c)
   6065     *
   6066     * Syntax: op vA, vB, type@CCCC
   6067     *         op vA, vB, field@CCCC
   6068     */
   6069 
   6070 
   6071     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6072     movl        offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
   6073     FETCH       1, %ecx                 # %ecx<- CCCC
   6074     movl        offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
   6075     cmp         $0, (%edx, %ecx, 4)    # check for null ptr; resolved InstField ptr
   6076     movl        (%edx, %ecx, 4), %eax   # %eax<- resolved InstField ptr
   6077     jne         .LOP_IPUT_SHORT_finish2
   6078     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6079     jmp         .LOP_IPUT_SHORT_finish
   6080 
   6081 
   6082 /* ------------------------------ */
   6083     .balign 64
   6084 .L_OP_SGET: /* 0x60 */
   6085 /* File: x86-atom/OP_SGET.S */
   6086    /* Copyright (C) 2008 The Android Open Source Project
   6087     *
   6088     * Licensed under the Apache License, Version 2.0 (the "License");
   6089     * you may not use this file except in compliance with the License.
   6090     * You may obtain a copy of the License at
   6091     *
   6092     * http://www.apache.org/licenses/LICENSE-2.0
   6093     *
   6094     * Unless required by applicable law or agreed to in writing, software
   6095     * distributed under the License is distributed on an "AS IS" BASIS,
   6096     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6097     * See the License for the specific language governing permissions and
   6098     * limitations under the License.
   6099     */
   6100 
   6101    /*
   6102     * File: OP_SGET.S
   6103     *
   6104     * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
   6105     *
   6106     * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
   6107     *
   6108     * Description: Perform the identified object static field operation
   6109     *              with the identified static field; load the field value
   6110     *              into the value register.
   6111     *
   6112     * Format: AA|op BBBB (21c)
   6113     *
   6114     * Syntax: op vAA, string@BBBB
   6115     */
   6116 
   6117     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6118     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
   6119     FETCH       1, %eax                 # %eax<- BBBB
   6120     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6121     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6122     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6123     je          .LOP_SGET_resolve
   6124     jmp         .LOP_SGET_finish
   6125 
   6126 /* ------------------------------ */
   6127     .balign 64
   6128 .L_OP_SGET_WIDE: /* 0x61 */
   6129 /* File: x86-atom/OP_SGET_WIDE.S */
   6130    /* Copyright (C) 2008 The Android Open Source Project
   6131     *
   6132     * Licensed under the Apache License, Version 2.0 (the "License");
   6133     * you may not use this file except in compliance with the License.
   6134     * You may obtain a copy of the License at
   6135     *
   6136     * http://www.apache.org/licenses/LICENSE-2.0
   6137     *
   6138     * Unless required by applicable law or agreed to in writing, software
   6139     * distributed under the License is distributed on an "AS IS" BASIS,
   6140     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6141     * See the License for the specific language governing permissions and
   6142     * limitations under the License.
   6143     */
   6144 
   6145    /*
   6146     * File: OP_SGET_WIDE.S
   6147     *
   6148     * Code: 64-bit static field "get" operation. Uses no substitutions.
   6149     *
   6150     * For: sget-wide
   6151     *
   6152     * Description: Perform the identified object static field operation
   6153     *              with the identified static field, loading or storing
   6154     *              into the value register.
   6155     *
   6156     * Format: AA|op BBBB (21c)
   6157     *
   6158     * Syntax: op vAA, string@BBBB
   6159     */
   6160 
   6161     movl        rGLUE, %eax             # %eax<- pMterpGlue
   6162     movl        offGlue_methodClassDex(%eax), %ecx # %ecx<- glue->pDvmDex
   6163     FETCH       1, %edx                 # %edx<- BBBB
   6164     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6165     cmp         $0, (%ecx, %edx, 4)    # check for null ptr; resolved StaticField ptr
   6166     movl        (%ecx, %edx, 4), %ecx   # %ecx<- resolved StaticField ptr
   6167     je          .LOP_SGET_WIDE_resolve
   6168 
   6169 .LOP_SGET_WIDE_finish:
   6170     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   6171     movq        offStaticField_value(%ecx), %xmm0 # %xmm0<- field value
   6172     movq        %xmm0, (rFP, rINST, 4)  # vAA<- field value
   6173     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   6174 
   6175 /* ------------------------------ */
   6176     .balign 64
   6177 .L_OP_SGET_OBJECT: /* 0x62 */
   6178 /* File: x86-atom/OP_SGET_OBJECT.S */
   6179    /* Copyright (C) 2008 The Android Open Source Project
   6180     *
   6181     * Licensed under the Apache License, Version 2.0 (the "License");
   6182     * you may not use this file except in compliance with the License.
   6183     * You may obtain a copy of the License at
   6184     *
   6185     * http://www.apache.org/licenses/LICENSE-2.0
   6186     *
   6187     * Unless required by applicable law or agreed to in writing, software
   6188     * distributed under the License is distributed on an "AS IS" BASIS,
   6189     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6190     * See the License for the specific language governing permissions and
   6191     * limitations under the License.
   6192     */
   6193 
   6194    /*
   6195     * File: OP_SGET_OBJECT.S
   6196     */
   6197 
   6198 /* File: x86-atom/OP_SGET.S */
   6199    /* Copyright (C) 2008 The Android Open Source Project
   6200     *
   6201     * Licensed under the Apache License, Version 2.0 (the "License");
   6202     * you may not use this file except in compliance with the License.
   6203     * You may obtain a copy of the License at
   6204     *
   6205     * http://www.apache.org/licenses/LICENSE-2.0
   6206     *
   6207     * Unless required by applicable law or agreed to in writing, software
   6208     * distributed under the License is distributed on an "AS IS" BASIS,
   6209     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6210     * See the License for the specific language governing permissions and
   6211     * limitations under the License.
   6212     */
   6213 
   6214    /*
   6215     * File: OP_SGET.S
   6216     *
   6217     * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
   6218     *
   6219     * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
   6220     *
   6221     * Description: Perform the identified object static field operation
   6222     *              with the identified static field; load the field value
   6223     *              into the value register.
   6224     *
   6225     * Format: AA|op BBBB (21c)
   6226     *
   6227     * Syntax: op vAA, string@BBBB
   6228     */
   6229 
   6230     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6231     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
   6232     FETCH       1, %eax                 # %eax<- BBBB
   6233     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6234     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6235     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6236     je          .LOP_SGET_OBJECT_resolve
   6237     jmp         .LOP_SGET_OBJECT_finish
   6238 
   6239 
   6240 /* ------------------------------ */
   6241     .balign 64
   6242 .L_OP_SGET_BOOLEAN: /* 0x63 */
   6243 /* File: x86-atom/OP_SGET_BOOLEAN.S */
   6244    /* Copyright (C) 2008 The Android Open Source Project
   6245     *
   6246     * Licensed under the Apache License, Version 2.0 (the "License");
   6247     * you may not use this file except in compliance with the License.
   6248     * You may obtain a copy of the License at
   6249     *
   6250     * http://www.apache.org/licenses/LICENSE-2.0
   6251     *
   6252     * Unless required by applicable law or agreed to in writing, software
   6253     * distributed under the License is distributed on an "AS IS" BASIS,
   6254     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6255     * See the License for the specific language governing permissions and
   6256     * limitations under the License.
   6257     */
   6258 
   6259    /*
   6260     * File: OP_SGET_BOOLEAN.S
   6261     */
   6262 
   6263 /* File: x86-atom/OP_SGET.S */
   6264    /* Copyright (C) 2008 The Android Open Source Project
   6265     *
   6266     * Licensed under the Apache License, Version 2.0 (the "License");
   6267     * you may not use this file except in compliance with the License.
   6268     * You may obtain a copy of the License at
   6269     *
   6270     * http://www.apache.org/licenses/LICENSE-2.0
   6271     *
   6272     * Unless required by applicable law or agreed to in writing, software
   6273     * distributed under the License is distributed on an "AS IS" BASIS,
   6274     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6275     * See the License for the specific language governing permissions and
   6276     * limitations under the License.
   6277     */
   6278 
   6279    /*
   6280     * File: OP_SGET.S
   6281     *
   6282     * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
   6283     *
   6284     * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
   6285     *
   6286     * Description: Perform the identified object static field operation
   6287     *              with the identified static field; load the field value
   6288     *              into the value register.
   6289     *
   6290     * Format: AA|op BBBB (21c)
   6291     *
   6292     * Syntax: op vAA, string@BBBB
   6293     */
   6294 
   6295     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6296     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
   6297     FETCH       1, %eax                 # %eax<- BBBB
   6298     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6299     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6300     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6301     je          .LOP_SGET_BOOLEAN_resolve
   6302     jmp         .LOP_SGET_BOOLEAN_finish
   6303 
   6304 
   6305 /* ------------------------------ */
   6306     .balign 64
   6307 .L_OP_SGET_BYTE: /* 0x64 */
   6308 /* File: x86-atom/OP_SGET_BYTE.S */
   6309    /* Copyright (C) 2008 The Android Open Source Project
   6310     *
   6311     * Licensed under the Apache License, Version 2.0 (the "License");
   6312     * you may not use this file except in compliance with the License.
   6313     * You may obtain a copy of the License at
   6314     *
   6315     * http://www.apache.org/licenses/LICENSE-2.0
   6316     *
   6317     * Unless required by applicable law or agreed to in writing, software
   6318     * distributed under the License is distributed on an "AS IS" BASIS,
   6319     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6320     * See the License for the specific language governing permissions and
   6321     * limitations under the License.
   6322     */
   6323 
   6324    /*
   6325     * File: OP_SGET_BYTE.S
   6326     */
   6327 
   6328 /* File: x86-atom/OP_SGET.S */
   6329    /* Copyright (C) 2008 The Android Open Source Project
   6330     *
   6331     * Licensed under the Apache License, Version 2.0 (the "License");
   6332     * you may not use this file except in compliance with the License.
   6333     * You may obtain a copy of the License at
   6334     *
   6335     * http://www.apache.org/licenses/LICENSE-2.0
   6336     *
   6337     * Unless required by applicable law or agreed to in writing, software
   6338     * distributed under the License is distributed on an "AS IS" BASIS,
   6339     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6340     * See the License for the specific language governing permissions and
   6341     * limitations under the License.
   6342     */
   6343 
   6344    /*
   6345     * File: OP_SGET.S
   6346     *
   6347     * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
   6348     *
   6349     * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
   6350     *
   6351     * Description: Perform the identified object static field operation
   6352     *              with the identified static field; load the field value
   6353     *              into the value register.
   6354     *
   6355     * Format: AA|op BBBB (21c)
   6356     *
   6357     * Syntax: op vAA, string@BBBB
   6358     */
   6359 
   6360     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6361     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
   6362     FETCH       1, %eax                 # %eax<- BBBB
   6363     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6364     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6365     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6366     je          .LOP_SGET_BYTE_resolve
   6367     jmp         .LOP_SGET_BYTE_finish
   6368 
   6369 
   6370 /* ------------------------------ */
   6371     .balign 64
   6372 .L_OP_SGET_CHAR: /* 0x65 */
   6373 /* File: x86-atom/OP_SGET_CHAR.S */
   6374    /* Copyright (C) 2008 The Android Open Source Project
   6375     *
   6376     * Licensed under the Apache License, Version 2.0 (the "License");
   6377     * you may not use this file except in compliance with the License.
   6378     * You may obtain a copy of the License at
   6379     *
   6380     * http://www.apache.org/licenses/LICENSE-2.0
   6381     *
   6382     * Unless required by applicable law or agreed to in writing, software
   6383     * distributed under the License is distributed on an "AS IS" BASIS,
   6384     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6385     * See the License for the specific language governing permissions and
   6386     * limitations under the License.
   6387     */
   6388 
   6389    /*
   6390     * File: OP_SGET_CHAR.S
   6391     */
   6392 
   6393 /* File: x86-atom/OP_SGET.S */
   6394    /* Copyright (C) 2008 The Android Open Source Project
   6395     *
   6396     * Licensed under the Apache License, Version 2.0 (the "License");
   6397     * you may not use this file except in compliance with the License.
   6398     * You may obtain a copy of the License at
   6399     *
   6400     * http://www.apache.org/licenses/LICENSE-2.0
   6401     *
   6402     * Unless required by applicable law or agreed to in writing, software
   6403     * distributed under the License is distributed on an "AS IS" BASIS,
   6404     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6405     * See the License for the specific language governing permissions and
   6406     * limitations under the License.
   6407     */
   6408 
   6409    /*
   6410     * File: OP_SGET.S
   6411     *
   6412     * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
   6413     *
   6414     * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
   6415     *
   6416     * Description: Perform the identified object static field operation
   6417     *              with the identified static field; load the field value
   6418     *              into the value register.
   6419     *
   6420     * Format: AA|op BBBB (21c)
   6421     *
   6422     * Syntax: op vAA, string@BBBB
   6423     */
   6424 
   6425     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6426     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
   6427     FETCH       1, %eax                 # %eax<- BBBB
   6428     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6429     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6430     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6431     je          .LOP_SGET_CHAR_resolve
   6432     jmp         .LOP_SGET_CHAR_finish
   6433 
   6434 
   6435 /* ------------------------------ */
   6436     .balign 64
   6437 .L_OP_SGET_SHORT: /* 0x66 */
   6438 /* File: x86-atom/OP_SGET_SHORT.S */
   6439    /* Copyright (C) 2008 The Android Open Source Project
   6440     *
   6441     * Licensed under the Apache License, Version 2.0 (the "License");
   6442     * you may not use this file except in compliance with the License.
   6443     * You may obtain a copy of the License at
   6444     *
   6445     * http://www.apache.org/licenses/LICENSE-2.0
   6446     *
   6447     * Unless required by applicable law or agreed to in writing, software
   6448     * distributed under the License is distributed on an "AS IS" BASIS,
   6449     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6450     * See the License for the specific language governing permissions and
   6451     * limitations under the License.
   6452     */
   6453 
   6454    /*
   6455     * File: OP_SGET_SHORT.S
   6456     */
   6457 
   6458 /* File: x86-atom/OP_SGET.S */
   6459    /* Copyright (C) 2008 The Android Open Source Project
   6460     *
   6461     * Licensed under the Apache License, Version 2.0 (the "License");
   6462     * you may not use this file except in compliance with the License.
   6463     * You may obtain a copy of the License at
   6464     *
   6465     * http://www.apache.org/licenses/LICENSE-2.0
   6466     *
   6467     * Unless required by applicable law or agreed to in writing, software
   6468     * distributed under the License is distributed on an "AS IS" BASIS,
   6469     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6470     * See the License for the specific language governing permissions and
   6471     * limitations under the License.
   6472     */
   6473 
   6474    /*
   6475     * File: OP_SGET.S
   6476     *
   6477     * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
   6478     *
   6479     * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
   6480     *
   6481     * Description: Perform the identified object static field operation
   6482     *              with the identified static field; load the field value
   6483     *              into the value register.
   6484     *
   6485     * Format: AA|op BBBB (21c)
   6486     *
   6487     * Syntax: op vAA, string@BBBB
   6488     */
   6489 
   6490     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6491     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
   6492     FETCH       1, %eax                 # %eax<- BBBB
   6493     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6494     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6495     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6496     je          .LOP_SGET_SHORT_resolve
   6497     jmp         .LOP_SGET_SHORT_finish
   6498 
   6499 
   6500 /* ------------------------------ */
   6501     .balign 64
   6502 .L_OP_SPUT: /* 0x67 */
   6503 /* File: x86-atom/OP_SPUT.S */
   6504    /* Copyright (C) 2008 The Android Open Source Project
   6505     *
   6506     * Licensed under the Apache License, Version 2.0 (the "License");
   6507     * you may not use this file except in compliance with the License.
   6508     * You may obtain a copy of the License at
   6509     *
   6510     * http://www.apache.org/licenses/LICENSE-2.0
   6511     *
   6512     * Unless required by applicable law or agreed to in writing, software
   6513     * distributed under the License is distributed on an "AS IS" BASIS,
   6514     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6515     * See the License for the specific language governing permissions and
   6516     * limitations under the License.
   6517     */
   6518 
   6519    /*
   6520     * File: OP_SPUT.S
   6521     *
   6522     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6523     *
   6524     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6525     *
   6526     * Description: Perform the identified object static field operation
   6527     *              with the identified static field; store the field value
   6528     *              register.
   6529     *
   6530     * Format: AA|op BBBB (21c)
   6531     *
   6532     * Syntax: op vAA, string@BBBB
   6533     */
   6534 
   6535     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6536     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
   6537     FETCH       1, %eax                 # %eax<- BBBB
   6538     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6539     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6540     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6541     je          .LOP_SPUT_resolve
   6542     jmp         .LOP_SPUT_finish
   6543 
   6544 /* ------------------------------ */
   6545     .balign 64
   6546 .L_OP_SPUT_WIDE: /* 0x68 */
   6547 /* File: x86-atom/OP_SPUT_WIDE.S */
   6548    /* Copyright (C) 2008 The Android Open Source Project
   6549     *
   6550     * Licensed under the Apache License, Version 2.0 (the "License");
   6551     * you may not use this file except in compliance with the License.
   6552     * You may obtain a copy of the License at
   6553     *
   6554     * http://www.apache.org/licenses/LICENSE-2.0
   6555     *
   6556     * Unless required by applicable law or agreed to in writing, software
   6557     * distributed under the License is distributed on an "AS IS" BASIS,
   6558     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6559     * See the License for the specific language governing permissions and
   6560     * limitations under the License.
   6561     */
   6562 
   6563    /*
   6564     * File: OP_SPUT_WIDE.S
   6565     *
   6566     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6567     *
   6568     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6569     *
   6570     * Description: Perform the identified object static field operation
   6571     *              with the identified static field; store the field value
   6572     *              register.
   6573     *
   6574     * Format: AA|op BBBB (21c)
   6575     *
   6576     * Syntax: op vAA, string@BBBB
   6577     */
   6578 
   6579     movl        rGLUE, %eax             # %eax<- pMterpGlue
   6580     movl        offGlue_methodClassDex(%eax), %ecx # %ecx<- glue->pDvmDex
   6581     FETCH       1, %edx                 # %edx<- BBBB
   6582     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6583     cmp         $0, (%ecx, %edx, 4)    # check for null ptr; resolved StaticField ptr
   6584     movl        (%ecx, %edx, 4), %ecx   # %ecx<- resolved StaticField ptr
   6585     je          .LOP_SPUT_WIDE_resolve
   6586 
   6587 .LOP_SPUT_WIDE_finish:
   6588     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   6589     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vAA
   6590     movq        %xmm0, offStaticField_value(%ecx) # field value<- field value
   6591     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   6592 
   6593 /* ------------------------------ */
   6594     .balign 64
   6595 .L_OP_SPUT_OBJECT: /* 0x69 */
   6596 /* File: x86-atom/OP_SPUT_OBJECT.S */
   6597    /* Copyright (C) 2008 The Android Open Source Project
   6598     *
   6599     * Licensed under the Apache License, Version 2.0 (the "License");
   6600     * you may not use this file except in compliance with the License.
   6601     * You may obtain a copy of the License at
   6602     *
   6603     * http://www.apache.org/licenses/LICENSE-2.0
   6604     *
   6605     * Unless required by applicable law or agreed to in writing, software
   6606     * distributed under the License is distributed on an "AS IS" BASIS,
   6607     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6608     * See the License for the specific language governing permissions and
   6609     * limitations under the License.
   6610     */
   6611 
   6612    /*
   6613     * File: OP_SPUT_OBJECT.S
   6614     *
   6615     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6616     *
   6617     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6618     *
   6619     * Description: Perform the identified object static field operation
   6620     *              with the identified static field; store the field value
   6621     *              register.
   6622     *
   6623     * Format: AA|op BBBB (21c)
   6624     *
   6625     * Syntax: op vAA, string@BBBB
   6626     */
   6627 
   6628     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6629     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
   6630     FETCH       1, %eax                 # %eax<- BBBB
   6631     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6632     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField
   6633     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField
   6634     je          .LOP_SPUT_OBJECT_resolve
   6635     jmp         .LOP_SPUT_OBJECT_finish
   6636 
   6637 /* ------------------------------ */
   6638     .balign 64
   6639 .L_OP_SPUT_BOOLEAN: /* 0x6a */
   6640 /* File: x86-atom/OP_SPUT_BOOLEAN.S */
   6641    /* Copyright (C) 2008 The Android Open Source Project
   6642     *
   6643     * Licensed under the Apache License, Version 2.0 (the "License");
   6644     * you may not use this file except in compliance with the License.
   6645     * You may obtain a copy of the License at
   6646     *
   6647     * http://www.apache.org/licenses/LICENSE-2.0
   6648     *
   6649     * Unless required by applicable law or agreed to in writing, software
   6650     * distributed under the License is distributed on an "AS IS" BASIS,
   6651     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6652     * See the License for the specific language governing permissions and
   6653     * limitations under the License.
   6654     */
   6655 
   6656    /*
   6657     * File: OP_SPUT_BOOLEAN.S
   6658     */
   6659 
   6660 /* File: x86-atom/OP_SPUT.S */
   6661    /* Copyright (C) 2008 The Android Open Source Project
   6662     *
   6663     * Licensed under the Apache License, Version 2.0 (the "License");
   6664     * you may not use this file except in compliance with the License.
   6665     * You may obtain a copy of the License at
   6666     *
   6667     * http://www.apache.org/licenses/LICENSE-2.0
   6668     *
   6669     * Unless required by applicable law or agreed to in writing, software
   6670     * distributed under the License is distributed on an "AS IS" BASIS,
   6671     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6672     * See the License for the specific language governing permissions and
   6673     * limitations under the License.
   6674     */
   6675 
   6676    /*
   6677     * File: OP_SPUT.S
   6678     *
   6679     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6680     *
   6681     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6682     *
   6683     * Description: Perform the identified object static field operation
   6684     *              with the identified static field; store the field value
   6685     *              register.
   6686     *
   6687     * Format: AA|op BBBB (21c)
   6688     *
   6689     * Syntax: op vAA, string@BBBB
   6690     */
   6691 
   6692     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6693     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
   6694     FETCH       1, %eax                 # %eax<- BBBB
   6695     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6696     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6697     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6698     je          .LOP_SPUT_BOOLEAN_resolve
   6699     jmp         .LOP_SPUT_BOOLEAN_finish
   6700 
   6701 
   6702 /* ------------------------------ */
   6703     .balign 64
   6704 .L_OP_SPUT_BYTE: /* 0x6b */
   6705 /* File: x86-atom/OP_SPUT_BYTE.S */
   6706    /* Copyright (C) 2008 The Android Open Source Project
   6707     *
   6708     * Licensed under the Apache License, Version 2.0 (the "License");
   6709     * you may not use this file except in compliance with the License.
   6710     * You may obtain a copy of the License at
   6711     *
   6712     * http://www.apache.org/licenses/LICENSE-2.0
   6713     *
   6714     * Unless required by applicable law or agreed to in writing, software
   6715     * distributed under the License is distributed on an "AS IS" BASIS,
   6716     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6717     * See the License for the specific language governing permissions and
   6718     * limitations under the License.
   6719     */
   6720 
   6721    /*
   6722     * File: OP_SPUT_BYTE.S
   6723     */
   6724 
   6725 /* File: x86-atom/OP_SPUT.S */
   6726    /* Copyright (C) 2008 The Android Open Source Project
   6727     *
   6728     * Licensed under the Apache License, Version 2.0 (the "License");
   6729     * you may not use this file except in compliance with the License.
   6730     * You may obtain a copy of the License at
   6731     *
   6732     * http://www.apache.org/licenses/LICENSE-2.0
   6733     *
   6734     * Unless required by applicable law or agreed to in writing, software
   6735     * distributed under the License is distributed on an "AS IS" BASIS,
   6736     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6737     * See the License for the specific language governing permissions and
   6738     * limitations under the License.
   6739     */
   6740 
   6741    /*
   6742     * File: OP_SPUT.S
   6743     *
   6744     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6745     *
   6746     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6747     *
   6748     * Description: Perform the identified object static field operation
   6749     *              with the identified static field; store the field value
   6750     *              register.
   6751     *
   6752     * Format: AA|op BBBB (21c)
   6753     *
   6754     * Syntax: op vAA, string@BBBB
   6755     */
   6756 
   6757     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6758     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
   6759     FETCH       1, %eax                 # %eax<- BBBB
   6760     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6761     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6762     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6763     je          .LOP_SPUT_BYTE_resolve
   6764     jmp         .LOP_SPUT_BYTE_finish
   6765 
   6766 
   6767 /* ------------------------------ */
   6768     .balign 64
   6769 .L_OP_SPUT_CHAR: /* 0x6c */
   6770 /* File: x86-atom/OP_SPUT_CHAR.S */
   6771    /* Copyright (C) 2008 The Android Open Source Project
   6772     *
   6773     * Licensed under the Apache License, Version 2.0 (the "License");
   6774     * you may not use this file except in compliance with the License.
   6775     * You may obtain a copy of the License at
   6776     *
   6777     * http://www.apache.org/licenses/LICENSE-2.0
   6778     *
   6779     * Unless required by applicable law or agreed to in writing, software
   6780     * distributed under the License is distributed on an "AS IS" BASIS,
   6781     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6782     * See the License for the specific language governing permissions and
   6783     * limitations under the License.
   6784     */
   6785 
   6786    /*
   6787     * File: OP_SPUT_CHAR.S
   6788     */
   6789 
   6790 /* File: x86-atom/OP_SPUT.S */
   6791    /* Copyright (C) 2008 The Android Open Source Project
   6792     *
   6793     * Licensed under the Apache License, Version 2.0 (the "License");
   6794     * you may not use this file except in compliance with the License.
   6795     * You may obtain a copy of the License at
   6796     *
   6797     * http://www.apache.org/licenses/LICENSE-2.0
   6798     *
   6799     * Unless required by applicable law or agreed to in writing, software
   6800     * distributed under the License is distributed on an "AS IS" BASIS,
   6801     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6802     * See the License for the specific language governing permissions and
   6803     * limitations under the License.
   6804     */
   6805 
   6806    /*
   6807     * File: OP_SPUT.S
   6808     *
   6809     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6810     *
   6811     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6812     *
   6813     * Description: Perform the identified object static field operation
   6814     *              with the identified static field; store the field value
   6815     *              register.
   6816     *
   6817     * Format: AA|op BBBB (21c)
   6818     *
   6819     * Syntax: op vAA, string@BBBB
   6820     */
   6821 
   6822     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6823     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
   6824     FETCH       1, %eax                 # %eax<- BBBB
   6825     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6826     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6827     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6828     je          .LOP_SPUT_CHAR_resolve
   6829     jmp         .LOP_SPUT_CHAR_finish
   6830 
   6831 
   6832 /* ------------------------------ */
   6833     .balign 64
   6834 .L_OP_SPUT_SHORT: /* 0x6d */
   6835 /* File: x86-atom/OP_SPUT_SHORT.S */
   6836    /* Copyright (C) 2008 The Android Open Source Project
   6837     *
   6838     * Licensed under the Apache License, Version 2.0 (the "License");
   6839     * you may not use this file except in compliance with the License.
   6840     * You may obtain a copy of the License at
   6841     *
   6842     * http://www.apache.org/licenses/LICENSE-2.0
   6843     *
   6844     * Unless required by applicable law or agreed to in writing, software
   6845     * distributed under the License is distributed on an "AS IS" BASIS,
   6846     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6847     * See the License for the specific language governing permissions and
   6848     * limitations under the License.
   6849     */
   6850 
   6851    /*
   6852     * File: OP_SPUT_SHORT.S
   6853     */
   6854 
   6855 /* File: x86-atom/OP_SPUT.S */
   6856    /* Copyright (C) 2008 The Android Open Source Project
   6857     *
   6858     * Licensed under the Apache License, Version 2.0 (the "License");
   6859     * you may not use this file except in compliance with the License.
   6860     * You may obtain a copy of the License at
   6861     *
   6862     * http://www.apache.org/licenses/LICENSE-2.0
   6863     *
   6864     * Unless required by applicable law or agreed to in writing, software
   6865     * distributed under the License is distributed on an "AS IS" BASIS,
   6866     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6867     * See the License for the specific language governing permissions and
   6868     * limitations under the License.
   6869     */
   6870 
   6871    /*
   6872     * File: OP_SPUT.S
   6873     *
   6874     * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
   6875     *
   6876     * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
   6877     *
   6878     * Description: Perform the identified object static field operation
   6879     *              with the identified static field; store the field value
   6880     *              register.
   6881     *
   6882     * Format: AA|op BBBB (21c)
   6883     *
   6884     * Syntax: op vAA, string@BBBB
   6885     */
   6886 
   6887     movl        rGLUE, %edx             # %edx<- pMterpGlue
   6888     movl        offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
   6889     FETCH       1, %eax                 # %eax<- BBBB
   6890     movl        offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
   6891     cmp         $0, (%ecx, %eax, 4)    # check for null ptr; resolved StaticField ptr
   6892     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved StaticField ptr
   6893     je          .LOP_SPUT_SHORT_resolve
   6894     jmp         .LOP_SPUT_SHORT_finish
   6895 
   6896 
   6897 /* ------------------------------ */
   6898     .balign 64
   6899 .L_OP_INVOKE_VIRTUAL: /* 0x6e */
   6900 /* File: x86-atom/OP_INVOKE_VIRTUAL.S */
   6901    /* Copyright (C) 2008 The Android Open Source Project
   6902     *
   6903     * Licensed under the Apache License, Version 2.0 (the "License");
   6904     * you may not use this file except in compliance with the License.
   6905     * You may obtain a copy of the License at
   6906     *
   6907     * http://www.apache.org/licenses/LICENSE-2.0
   6908     *
   6909     * Unless required by applicable law or agreed to in writing, software
   6910     * distributed under the License is distributed on an "AS IS" BASIS,
   6911     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6912     * See the License for the specific language governing permissions and
   6913     * limitations under the License.
   6914     */
   6915 
   6916    /*
   6917     * File: OP_INVOKE_VIRTUAL.S
   6918     *
   6919     * Code: Call a virtual method. Provides an "isrange" variable and
   6920     *       a "routine" variable to specify this is the "range" version of
   6921     *       invoke_direct that allows up to 255 arguments.
   6922     *
   6923     * For: invoke-virtual, invoke-virtual/range
   6924     *
   6925     * Description: invoke-virtual is used to invoke a normal virtual method;
   6926     *              a method that is not static or final, and is not a constructor.
   6927     *
   6928     * Format: B|A|op CCCC G|F|E|D (35c)
   6929     *         AA|op BBBB CCCC (3rc)
   6930     *
   6931     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   6932     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   6933     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   6934     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   6935     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   6936     *         [B=1] op {vD}, kind@CCCC (35c)
   6937     *         [B=0] op {}, kind@CCCC (35c)
   6938     *
   6939     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   6940     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   6941     *                                              and C determines the first register)
   6942     */
   6943 
   6944 
   6945     movl        rGLUE, %eax             # %eax<- pMterpGlue
   6946     EXPORT_PC                           # must export pc for invoke
   6947     movl        offGlue_methodClassDex(%eax), %eax # %eax<- pDvmDex
   6948     FETCH       1, %ecx                 # %ecx<- method index
   6949     movl        offDvmDex_pResMethods(%eax), %eax # %eax<- pDvmDex->pResMethods
   6950     FETCH       2, %edx                 # %edx<- GFED or CCCC
   6951     .if         (!0)
   6952     and         $15, %edx              # %edx<- D if not range
   6953     .endif
   6954     cmp         $0, (%eax, %ecx, 4)    # check if already resolved
   6955     je          .LOP_INVOKE_VIRTUAL_break
   6956     movl        (%eax, %ecx, 4), %eax   # %eax<- resolved base method
   6957     jmp         .LOP_INVOKE_VIRTUAL_continue
   6958 
   6959 /* ------------------------------ */
   6960     .balign 64
   6961 .L_OP_INVOKE_SUPER: /* 0x6f */
   6962 /* File: x86-atom/OP_INVOKE_SUPER.S */
   6963    /* Copyright (C) 2008 The Android Open Source Project
   6964     *
   6965     * Licensed under the Apache License, Version 2.0 (the "License");
   6966     * you may not use this file except in compliance with the License.
   6967     * You may obtain a copy of the License at
   6968     *
   6969     * http://www.apache.org/licenses/LICENSE-2.0
   6970     *
   6971     * Unless required by applicable law or agreed to in writing, software
   6972     * distributed under the License is distributed on an "AS IS" BASIS,
   6973     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   6974     * See the License for the specific language governing permissions and
   6975     * limitations under the License.
   6976     */
   6977 
   6978    /*
   6979     * File: OP_INVOKE_SUPER.S
   6980     *
   6981     * Code: Call super method.
   6982     *
   6983     * For: invoke-super, invoke-super/range
   6984     *
   6985     * Description: invoke-super is used to invoke the closest superclass's virtual
   6986     *              method (as opposed to the one with the same method_id in the
   6987     *              calling class).
   6988     *
   6989     * Format: B|A|op CCCC G|F|E|D (35c)
   6990     *         AA|op BBBB CCCC (3rc)
   6991     *
   6992     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   6993     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   6994     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   6995     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   6996     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   6997     *         [B=1] op {vD}, kind@CCCC (35c)
   6998     *         [B=0] op {}, kind@CCCC (35c)
   6999     *
   7000     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7001     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7002     *                                              and C determines the first register)
   7003     */
   7004 
   7005 
   7006     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   7007     FETCH       2, %eax                 # %eax<- GFED or CCCC
   7008     movl        offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
   7009     .if         (!0)
   7010     and         $15, %eax              # %eax<- D if not range
   7011     .endif
   7012     FETCH       1, %edx                 # %edx<- method index
   7013     movl        offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
   7014     cmp         $0, (rFP, %eax, 4)     # check for null object
   7015     movl        (%ecx, %edx, 4), %ecx   # %ecx<- resolved base method
   7016     je          common_errNullObject    # handle null object
   7017     jmp         .LOP_INVOKE_SUPER_continue2
   7018 
   7019 /* ------------------------------ */
   7020     .balign 64
   7021 .L_OP_INVOKE_DIRECT: /* 0x70 */
   7022 /* File: x86-atom/OP_INVOKE_DIRECT.S */
   7023    /* Copyright (C) 2008 The Android Open Source Project
   7024     *
   7025     * Licensed under the Apache License, Version 2.0 (the "License");
   7026     * you may not use this file except in compliance with the License.
   7027     * You may obtain a copy of the License at
   7028     *
   7029     * http://www.apache.org/licenses/LICENSE-2.0
   7030     *
   7031     * Unless required by applicable law or agreed to in writing, software
   7032     * distributed under the License is distributed on an "AS IS" BASIS,
   7033     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7034     * See the License for the specific language governing permissions and
   7035     * limitations under the License.
   7036     */
   7037 
   7038    /*
   7039     * File: OP_INVOKE_DIRECT.S
   7040     *
   7041     * Code: Call a non-static direct method. Provides an "isrange" variable and
   7042     *       a "routine" variable to specify this is the "range" version of
   7043     *       invoke_direct that allows up to 255 arguments.
   7044     *
   7045     * For: invoke-direct, invoke-direct/range
   7046     *
   7047     * Description: invoke-direct is used to invoke a non-static direct method;
   7048     *              an instance method that is non-overridable, for example,
   7049     *              either a private instance method or a constructor.
   7050     *
   7051     * Format: B|A|op CCCC G|F|E|D (35c)
   7052     *         AA|op BBBB CCCC (3rc)
   7053     *
   7054     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7055     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7056     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7057     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7058     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7059     *         [B=1] op {vD}, kind@CCCC (35c)
   7060     *         [B=0] op {}, kind@CCCC (35c)
   7061     *
   7062     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7063     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7064     *                                              and C determines the first register)
   7065     */
   7066 
   7067 
   7068     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   7069     movl        offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
   7070     FETCH       1, %eax                 # %eax<- method index
   7071     movl        offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
   7072     FETCH       2, %edx                 # %edx<- GFED or CCCC
   7073     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved method to call
   7074     .if         (!0)
   7075     andl        $15, %edx              # %edx<- D if not range
   7076     .endif
   7077     EXPORT_PC                           # must export for invoke
   7078     movl        %edx, -4(%esp)          # save "this" pointer register
   7079     cmp         $0, %ecx               # check if already resolved
   7080     GET_VREG    %edx                    # %edx<- "this" pointer
   7081     je          .LOP_INVOKE_DIRECT_resolve     # handle resolve
   7082 
   7083 .LOP_INVOKE_DIRECT_finish:
   7084     cmp         $0, %edx               # check for null "this"
   7085     jne         common_invokeMethodNoRange # invoke method common code
   7086     jmp         common_errNullObject
   7087 
   7088 /* ------------------------------ */
   7089     .balign 64
   7090 .L_OP_INVOKE_STATIC: /* 0x71 */
   7091 /* File: x86-atom/OP_INVOKE_STATIC.S */
   7092    /* Copyright (C) 2008 The Android Open Source Project
   7093     *
   7094     * Licensed under the Apache License, Version 2.0 (the "License");
   7095     * you may not use this file except in compliance with the License.
   7096     * You may obtain a copy of the License at
   7097     *
   7098     * http://www.apache.org/licenses/LICENSE-2.0
   7099     *
   7100     * Unless required by applicable law or agreed to in writing, software
   7101     * distributed under the License is distributed on an "AS IS" BASIS,
   7102     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7103     * See the License for the specific language governing permissions and
   7104     * limitations under the License.
   7105     */
   7106 
   7107    /*
   7108     * File: OP_INVOKE_STATIC.S
   7109     *
   7110     * Code: Call static direct method. Provides an "isrange" variable and
   7111     *       a "routine" variable to specify this is the "range" version of
   7112     *       invoke_static that allows up to 255 arguments.
   7113     *
   7114     * For: invoke-static, invoke-static/range
   7115     *
   7116     * Description: invoke-static is used to invoke static direct method.
   7117     *
   7118     * Format: B|A|op CCCC G|F|E|D (35c)
   7119     *         AA|op BBBB CCCC (3rc)
   7120     *
   7121     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7122     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7123     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7124     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7125     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7126     *         [B=1] op {vD}, kind@CCCC (35c)
   7127     *         [B=0] op {}, kind@CCCC (35c)
   7128     *
   7129     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7130     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7131     *                                              and C determines the first register)
   7132     */
   7133 
   7134 
   7135     movl        rGLUE, %edx             # %edx<- pMterpGlue
   7136     movl        offGlue_methodClassDex(%edx), %ecx # %edx<- pDvmDex
   7137     FETCH       1, %eax                 # %eax<- method index
   7138     movl        offDvmDex_pResMethods(%ecx), %ecx # %edx<- pDvmDex->pResMethods
   7139     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved method to call
   7140     cmp         $0, %ecx               # check if already resolved
   7141     EXPORT_PC                           # must export for invoke
   7142     jne         common_invokeMethodNoRange # invoke method common code
   7143     jmp         .LOP_INVOKE_STATIC_break
   7144 
   7145 /* ------------------------------ */
   7146     .balign 64
   7147 .L_OP_INVOKE_INTERFACE: /* 0x72 */
   7148 /* File: x86-atom/OP_INVOKE_INTERFACE.S */
   7149    /* Copyright (C) 2008 The Android Open Source Project
   7150     *
   7151     * Licensed under the Apache License, Version 2.0 (the "License");
   7152     * you may not use this file except in compliance with the License.
   7153     * You may obtain a copy of the License at
   7154     *
   7155     * http://www.apache.org/licenses/LICENSE-2.0
   7156     *
   7157     * Unless required by applicable law or agreed to in writing, software
   7158     * distributed under the License is distributed on an "AS IS" BASIS,
   7159     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7160     * See the License for the specific language governing permissions and
   7161     * limitations under the License.
   7162     */
   7163 
   7164    /*
   7165     * File: OP_INVOKE_INTERFACE.S
   7166     *
   7167     * Code: Call at method. Provides an "isrange" variable and
   7168     *       a "routine" variable to specify this is the "range" version of
   7169     *       invoke_interface that allows up to 255 arguments.
   7170     *
   7171     * For: invoke-interface, invoke-interface-range
   7172     *
   7173     * Description: invoke-interface is used to invoke an interface method; on an
   7174     *              object whose concrete class isn't known, using a method_id that
   7175     *              refers to an interface.
   7176     *
   7177     * Format: B|A|op CCCC G|F|E|D (35c)
   7178     *         AA|op BBBB CCCC (3rc)
   7179     *
   7180     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7181     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7182     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7183     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7184     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7185     *         [B=1] op {vD}, kind@CCCC (35c)
   7186     *         [B=0] op {}, kind@CCCC (35c)
   7187     *
   7188     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7189     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7190     *                                              and C determines the first register)
   7191     */
   7192 
   7193 
   7194     FETCH       2, %edx                 # %edx<- GFED or CCCC
   7195     FETCH       1, %ecx                 # %ecx<- method index
   7196     movl        %ecx, -12(%esp)         # push argument method index
   7197     .if         (!0)
   7198     and         $15, %edx              # %edx<- D if not range
   7199     .endif
   7200     EXPORT_PC                           # must export for invoke
   7201     GET_VREG    %edx                    # %edx<- first arg "this pointer"
   7202     movl        rGLUE, %eax             # %eax<- pMterpGlue
   7203     movl        offGlue_methodClassDex(%eax), %eax # %eax<- glue->pDvmDex
   7204     movl        %eax, -4(%esp)          # push parameter class
   7205     cmp         $0, %edx               # check for null object
   7206     je          common_errNullObject    # handle null object
   7207     jmp         .LOP_INVOKE_INTERFACE_break
   7208 
   7209 /* ------------------------------ */
   7210     .balign 64
   7211 .L_OP_UNUSED_73: /* 0x73 */
   7212 /* File: x86-atom/OP_UNUSED_73.S */
   7213    /* Copyright (C) 2008 The Android Open Source Project
   7214     *
   7215     * Licensed under the Apache License, Version 2.0 (the "License");
   7216     * you may not use this file except in compliance with the License.
   7217     * You may obtain a copy of the License at
   7218     *
   7219     * http://www.apache.org/licenses/LICENSE-2.0
   7220     *
   7221     * Unless required by applicable law or agreed to in writing, software
   7222     * distributed under the License is distributed on an "AS IS" BASIS,
   7223     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7224     * See the License for the specific language governing permissions and
   7225     * limitations under the License.
   7226     */
   7227 
   7228    /*
   7229     * File: OP_UNUSED_73.S
   7230     */
   7231 
   7232 /* File: x86-atom/unused.S */
   7233    /* Copyright (C) 2008 The Android Open Source Project
   7234     *
   7235     * Licensed under the Apache License, Version 2.0 (the "License");
   7236     * you may not use this file except in compliance with the License.
   7237     * You may obtain a copy of the License at
   7238     *
   7239     * http://www.apache.org/licenses/LICENSE-2.0
   7240     *
   7241     * Unless required by applicable law or agreed to in writing, software
   7242     * distributed under the License is distributed on an "AS IS" BASIS,
   7243     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7244     * See the License for the specific language governing permissions and
   7245     * limitations under the License.
   7246     */
   7247 
   7248    /*
   7249     * File: unused.S
   7250     *
   7251     * Code: Common code for unused bytecodes. Uses no subtitutions.
   7252     *
   7253     * For: all unused bytecodes
   7254     *
   7255     * Description: aborts if executed.
   7256     *
   7257     * Format: |op (10x)
   7258     *
   7259     * Syntax: op
   7260     */
   7261 
   7262     call        common_abort
   7263 
   7264 
   7265 /* ------------------------------ */
   7266     .balign 64
   7267 .L_OP_INVOKE_VIRTUAL_RANGE: /* 0x74 */
   7268 /* File: x86-atom/OP_INVOKE_VIRTUAL_RANGE.S */
   7269    /* Copyright (C) 2008 The Android Open Source Project
   7270     *
   7271     * Licensed under the Apache License, Version 2.0 (the "License");
   7272     * you may not use this file except in compliance with the License.
   7273     * You may obtain a copy of the License at
   7274     *
   7275     * http://www.apache.org/licenses/LICENSE-2.0
   7276     *
   7277     * Unless required by applicable law or agreed to in writing, software
   7278     * distributed under the License is distributed on an "AS IS" BASIS,
   7279     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7280     * See the License for the specific language governing permissions and
   7281     * limitations under the License.
   7282     */
   7283 
   7284    /*
   7285     * File: OP_INVOKE_VIRTUAL_RANGE.S
   7286     */
   7287 
   7288 /* File: x86-atom/OP_INVOKE_VIRTUAL.S */
   7289    /* Copyright (C) 2008 The Android Open Source Project
   7290     *
   7291     * Licensed under the Apache License, Version 2.0 (the "License");
   7292     * you may not use this file except in compliance with the License.
   7293     * You may obtain a copy of the License at
   7294     *
   7295     * http://www.apache.org/licenses/LICENSE-2.0
   7296     *
   7297     * Unless required by applicable law or agreed to in writing, software
   7298     * distributed under the License is distributed on an "AS IS" BASIS,
   7299     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7300     * See the License for the specific language governing permissions and
   7301     * limitations under the License.
   7302     */
   7303 
   7304    /*
   7305     * File: OP_INVOKE_VIRTUAL.S
   7306     *
   7307     * Code: Call a virtual method. Provides an "isrange" variable and
   7308     *       a "routine" variable to specify this is the "range" version of
   7309     *       invoke_direct that allows up to 255 arguments.
   7310     *
   7311     * For: invoke-virtual, invoke-virtual/range
   7312     *
   7313     * Description: invoke-virtual is used to invoke a normal virtual method;
   7314     *              a method that is not static or final, and is not a constructor.
   7315     *
   7316     * Format: B|A|op CCCC G|F|E|D (35c)
   7317     *         AA|op BBBB CCCC (3rc)
   7318     *
   7319     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7320     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7321     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7322     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7323     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7324     *         [B=1] op {vD}, kind@CCCC (35c)
   7325     *         [B=0] op {}, kind@CCCC (35c)
   7326     *
   7327     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7328     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7329     *                                              and C determines the first register)
   7330     */
   7331 
   7332 
   7333     movl        rGLUE, %eax             # %eax<- pMterpGlue
   7334     EXPORT_PC                           # must export pc for invoke
   7335     movl        offGlue_methodClassDex(%eax), %eax # %eax<- pDvmDex
   7336     FETCH       1, %ecx                 # %ecx<- method index
   7337     movl        offDvmDex_pResMethods(%eax), %eax # %eax<- pDvmDex->pResMethods
   7338     FETCH       2, %edx                 # %edx<- GFED or CCCC
   7339     .if         (!1)
   7340     and         $15, %edx              # %edx<- D if not range
   7341     .endif
   7342     cmp         $0, (%eax, %ecx, 4)    # check if already resolved
   7343     je          .LOP_INVOKE_VIRTUAL_RANGE_break
   7344     movl        (%eax, %ecx, 4), %eax   # %eax<- resolved base method
   7345     jmp         .LOP_INVOKE_VIRTUAL_RANGE_continue
   7346 
   7347 
   7348 /* ------------------------------ */
   7349     .balign 64
   7350 .L_OP_INVOKE_SUPER_RANGE: /* 0x75 */
   7351 /* File: x86-atom/OP_INVOKE_SUPER_RANGE.S */
   7352    /* Copyright (C) 2008 The Android Open Source Project
   7353     *
   7354     * Licensed under the Apache License, Version 2.0 (the "License");
   7355     * you may not use this file except in compliance with the License.
   7356     * You may obtain a copy of the License at
   7357     *
   7358     * http://www.apache.org/licenses/LICENSE-2.0
   7359     *
   7360     * Unless required by applicable law or agreed to in writing, software
   7361     * distributed under the License is distributed on an "AS IS" BASIS,
   7362     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7363     * See the License for the specific language governing permissions and
   7364     * limitations under the License.
   7365     */
   7366 
   7367    /*
   7368     * File: OP_INVOKE_SUPER_RANGE.S
   7369     */
   7370 
   7371 /* File: x86-atom/OP_INVOKE_SUPER.S */
   7372    /* Copyright (C) 2008 The Android Open Source Project
   7373     *
   7374     * Licensed under the Apache License, Version 2.0 (the "License");
   7375     * you may not use this file except in compliance with the License.
   7376     * You may obtain a copy of the License at
   7377     *
   7378     * http://www.apache.org/licenses/LICENSE-2.0
   7379     *
   7380     * Unless required by applicable law or agreed to in writing, software
   7381     * distributed under the License is distributed on an "AS IS" BASIS,
   7382     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7383     * See the License for the specific language governing permissions and
   7384     * limitations under the License.
   7385     */
   7386 
   7387    /*
   7388     * File: OP_INVOKE_SUPER.S
   7389     *
   7390     * Code: Call super method.
   7391     *
   7392     * For: invoke-super, invoke-super/range
   7393     *
   7394     * Description: invoke-super is used to invoke the closest superclass's virtual
   7395     *              method (as opposed to the one with the same method_id in the
   7396     *              calling class).
   7397     *
   7398     * Format: B|A|op CCCC G|F|E|D (35c)
   7399     *         AA|op BBBB CCCC (3rc)
   7400     *
   7401     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7402     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7403     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7404     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7405     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7406     *         [B=1] op {vD}, kind@CCCC (35c)
   7407     *         [B=0] op {}, kind@CCCC (35c)
   7408     *
   7409     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7410     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7411     *                                              and C determines the first register)
   7412     */
   7413 
   7414 
   7415     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   7416     FETCH       2, %eax                 # %eax<- GFED or CCCC
   7417     movl        offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
   7418     .if         (!1)
   7419     and         $15, %eax              # %eax<- D if not range
   7420     .endif
   7421     FETCH       1, %edx                 # %edx<- method index
   7422     movl        offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
   7423     cmp         $0, (rFP, %eax, 4)     # check for null object
   7424     movl        (%ecx, %edx, 4), %ecx   # %ecx<- resolved base method
   7425     je          common_errNullObject    # handle null object
   7426     jmp         .LOP_INVOKE_SUPER_RANGE_continue2
   7427 
   7428 
   7429 /* ------------------------------ */
   7430     .balign 64
   7431 .L_OP_INVOKE_DIRECT_RANGE: /* 0x76 */
   7432 /* File: x86-atom/OP_INVOKE_DIRECT_RANGE.S */
   7433    /* Copyright (C) 2008 The Android Open Source Project
   7434     *
   7435     * Licensed under the Apache License, Version 2.0 (the "License");
   7436     * you may not use this file except in compliance with the License.
   7437     * You may obtain a copy of the License at
   7438     *
   7439     * http://www.apache.org/licenses/LICENSE-2.0
   7440     *
   7441     * Unless required by applicable law or agreed to in writing, software
   7442     * distributed under the License is distributed on an "AS IS" BASIS,
   7443     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7444     * See the License for the specific language governing permissions and
   7445     * limitations under the License.
   7446     */
   7447 
   7448    /*
   7449     * File: OP_INVOKE_DIRECT_RANGE.S
   7450     */
   7451 
   7452 /* File: x86-atom/OP_INVOKE_DIRECT.S */
   7453    /* Copyright (C) 2008 The Android Open Source Project
   7454     *
   7455     * Licensed under the Apache License, Version 2.0 (the "License");
   7456     * you may not use this file except in compliance with the License.
   7457     * You may obtain a copy of the License at
   7458     *
   7459     * http://www.apache.org/licenses/LICENSE-2.0
   7460     *
   7461     * Unless required by applicable law or agreed to in writing, software
   7462     * distributed under the License is distributed on an "AS IS" BASIS,
   7463     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7464     * See the License for the specific language governing permissions and
   7465     * limitations under the License.
   7466     */
   7467 
   7468    /*
   7469     * File: OP_INVOKE_DIRECT.S
   7470     *
   7471     * Code: Call a non-static direct method. Provides an "isrange" variable and
   7472     *       a "routine" variable to specify this is the "range" version of
   7473     *       invoke_direct that allows up to 255 arguments.
   7474     *
   7475     * For: invoke-direct, invoke-direct/range
   7476     *
   7477     * Description: invoke-direct is used to invoke a non-static direct method;
   7478     *              an instance method that is non-overridable, for example,
   7479     *              either a private instance method or a constructor.
   7480     *
   7481     * Format: B|A|op CCCC G|F|E|D (35c)
   7482     *         AA|op BBBB CCCC (3rc)
   7483     *
   7484     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7485     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7486     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7487     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7488     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7489     *         [B=1] op {vD}, kind@CCCC (35c)
   7490     *         [B=0] op {}, kind@CCCC (35c)
   7491     *
   7492     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7493     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7494     *                                              and C determines the first register)
   7495     */
   7496 
   7497 
   7498     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   7499     movl        offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
   7500     FETCH       1, %eax                 # %eax<- method index
   7501     movl        offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
   7502     FETCH       2, %edx                 # %edx<- GFED or CCCC
   7503     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved method to call
   7504     .if         (!1)
   7505     andl        $15, %edx              # %edx<- D if not range
   7506     .endif
   7507     EXPORT_PC                           # must export for invoke
   7508     movl        %edx, -4(%esp)          # save "this" pointer register
   7509     cmp         $0, %ecx               # check if already resolved
   7510     GET_VREG    %edx                    # %edx<- "this" pointer
   7511     je          .LOP_INVOKE_DIRECT_RANGE_resolve     # handle resolve
   7512 
   7513 .LOP_INVOKE_DIRECT_RANGE_finish:
   7514     cmp         $0, %edx               # check for null "this"
   7515     jne         common_invokeMethodRange # invoke method common code
   7516     jmp         common_errNullObject
   7517 
   7518 
   7519 /* ------------------------------ */
   7520     .balign 64
   7521 .L_OP_INVOKE_STATIC_RANGE: /* 0x77 */
   7522 /* File: x86-atom/OP_INVOKE_STATIC_RANGE.S */
   7523    /* Copyright (C) 2008 The Android Open Source Project
   7524     *
   7525     * Licensed under the Apache License, Version 2.0 (the "License");
   7526     * you may not use this file except in compliance with the License.
   7527     * You may obtain a copy of the License at
   7528     *
   7529     * http://www.apache.org/licenses/LICENSE-2.0
   7530     *
   7531     * Unless required by applicable law or agreed to in writing, software
   7532     * distributed under the License is distributed on an "AS IS" BASIS,
   7533     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7534     * See the License for the specific language governing permissions and
   7535     * limitations under the License.
   7536     */
   7537 
   7538    /*
   7539     * File: OP_INVOKE_STATIC_RANGE.S
   7540     */
   7541 
   7542 /* File: x86-atom/OP_INVOKE_STATIC.S */
   7543    /* Copyright (C) 2008 The Android Open Source Project
   7544     *
   7545     * Licensed under the Apache License, Version 2.0 (the "License");
   7546     * you may not use this file except in compliance with the License.
   7547     * You may obtain a copy of the License at
   7548     *
   7549     * http://www.apache.org/licenses/LICENSE-2.0
   7550     *
   7551     * Unless required by applicable law or agreed to in writing, software
   7552     * distributed under the License is distributed on an "AS IS" BASIS,
   7553     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7554     * See the License for the specific language governing permissions and
   7555     * limitations under the License.
   7556     */
   7557 
   7558    /*
   7559     * File: OP_INVOKE_STATIC.S
   7560     *
   7561     * Code: Call static direct method. Provides an "isrange" variable and
   7562     *       a "routine" variable to specify this is the "range" version of
   7563     *       invoke_static that allows up to 255 arguments.
   7564     *
   7565     * For: invoke-static, invoke-static/range
   7566     *
   7567     * Description: invoke-static is used to invoke static direct method.
   7568     *
   7569     * Format: B|A|op CCCC G|F|E|D (35c)
   7570     *         AA|op BBBB CCCC (3rc)
   7571     *
   7572     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7573     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7574     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7575     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7576     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7577     *         [B=1] op {vD}, kind@CCCC (35c)
   7578     *         [B=0] op {}, kind@CCCC (35c)
   7579     *
   7580     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7581     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7582     *                                              and C determines the first register)
   7583     */
   7584 
   7585 
   7586     movl        rGLUE, %edx             # %edx<- pMterpGlue
   7587     movl        offGlue_methodClassDex(%edx), %ecx # %edx<- pDvmDex
   7588     FETCH       1, %eax                 # %eax<- method index
   7589     movl        offDvmDex_pResMethods(%ecx), %ecx # %edx<- pDvmDex->pResMethods
   7590     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved method to call
   7591     cmp         $0, %ecx               # check if already resolved
   7592     EXPORT_PC                           # must export for invoke
   7593     jne         common_invokeMethodRange # invoke method common code
   7594     jmp         .LOP_INVOKE_STATIC_RANGE_break
   7595 
   7596 
   7597 /* ------------------------------ */
   7598     .balign 64
   7599 .L_OP_INVOKE_INTERFACE_RANGE: /* 0x78 */
   7600 /* File: x86-atom/OP_INVOKE_INTERFACE_RANGE.S */
   7601    /* Copyright (C) 2008 The Android Open Source Project
   7602     *
   7603     * Licensed under the Apache License, Version 2.0 (the "License");
   7604     * you may not use this file except in compliance with the License.
   7605     * You may obtain a copy of the License at
   7606     *
   7607     * http://www.apache.org/licenses/LICENSE-2.0
   7608     *
   7609     * Unless required by applicable law or agreed to in writing, software
   7610     * distributed under the License is distributed on an "AS IS" BASIS,
   7611     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7612     * See the License for the specific language governing permissions and
   7613     * limitations under the License.
   7614     */
   7615 
   7616    /*
   7617     * File: OP_INVOKE_INTERFACE_RANGE.S
   7618     */
   7619 
   7620 /* File: x86-atom/OP_INVOKE_INTERFACE.S */
   7621    /* Copyright (C) 2008 The Android Open Source Project
   7622     *
   7623     * Licensed under the Apache License, Version 2.0 (the "License");
   7624     * you may not use this file except in compliance with the License.
   7625     * You may obtain a copy of the License at
   7626     *
   7627     * http://www.apache.org/licenses/LICENSE-2.0
   7628     *
   7629     * Unless required by applicable law or agreed to in writing, software
   7630     * distributed under the License is distributed on an "AS IS" BASIS,
   7631     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7632     * See the License for the specific language governing permissions and
   7633     * limitations under the License.
   7634     */
   7635 
   7636    /*
   7637     * File: OP_INVOKE_INTERFACE.S
   7638     *
   7639     * Code: Call at method. Provides an "isrange" variable and
   7640     *       a "routine" variable to specify this is the "range" version of
   7641     *       invoke_interface that allows up to 255 arguments.
   7642     *
   7643     * For: invoke-interface, invoke-interface-range
   7644     *
   7645     * Description: invoke-interface is used to invoke an interface method; on an
   7646     *              object whose concrete class isn't known, using a method_id that
   7647     *              refers to an interface.
   7648     *
   7649     * Format: B|A|op CCCC G|F|E|D (35c)
   7650     *         AA|op BBBB CCCC (3rc)
   7651     *
   7652     * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
   7653     *         [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
   7654     *         [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
   7655     *         [B=3] op {vD, vE, vF}, kind@CCCC (35c)
   7656     *         [B=2] op {vD, vE}, kind@CCCC (35c)
   7657     *         [B=1] op {vD}, kind@CCCC (35c)
   7658     *         [B=0] op {}, kind@CCCC (35c)
   7659     *
   7660     *         op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
   7661     *         op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
   7662     *                                              and C determines the first register)
   7663     */
   7664 
   7665 
   7666     FETCH       2, %edx                 # %edx<- GFED or CCCC
   7667     FETCH       1, %ecx                 # %ecx<- method index
   7668     movl        %ecx, -12(%esp)         # push argument method index
   7669     .if         (!1)
   7670     and         $15, %edx              # %edx<- D if not range
   7671     .endif
   7672     EXPORT_PC                           # must export for invoke
   7673     GET_VREG    %edx                    # %edx<- first arg "this pointer"
   7674     movl        rGLUE, %eax             # %eax<- pMterpGlue
   7675     movl        offGlue_methodClassDex(%eax), %eax # %eax<- glue->pDvmDex
   7676     movl        %eax, -4(%esp)          # push parameter class
   7677     cmp         $0, %edx               # check for null object
   7678     je          common_errNullObject    # handle null object
   7679     jmp         .LOP_INVOKE_INTERFACE_RANGE_break
   7680 
   7681 
   7682 /* ------------------------------ */
   7683     .balign 64
   7684 .L_OP_UNUSED_79: /* 0x79 */
   7685 /* File: x86-atom/OP_UNUSED_79.S */
   7686    /* Copyright (C) 2008 The Android Open Source Project
   7687     *
   7688     * Licensed under the Apache License, Version 2.0 (the "License");
   7689     * you may not use this file except in compliance with the License.
   7690     * You may obtain a copy of the License at
   7691     *
   7692     * http://www.apache.org/licenses/LICENSE-2.0
   7693     *
   7694     * Unless required by applicable law or agreed to in writing, software
   7695     * distributed under the License is distributed on an "AS IS" BASIS,
   7696     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7697     * See the License for the specific language governing permissions and
   7698     * limitations under the License.
   7699     */
   7700 
   7701    /*
   7702     * File: OP_UNUSED_79.S
   7703     */
   7704 
   7705 /* File: x86-atom/unused.S */
   7706    /* Copyright (C) 2008 The Android Open Source Project
   7707     *
   7708     * Licensed under the Apache License, Version 2.0 (the "License");
   7709     * you may not use this file except in compliance with the License.
   7710     * You may obtain a copy of the License at
   7711     *
   7712     * http://www.apache.org/licenses/LICENSE-2.0
   7713     *
   7714     * Unless required by applicable law or agreed to in writing, software
   7715     * distributed under the License is distributed on an "AS IS" BASIS,
   7716     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7717     * See the License for the specific language governing permissions and
   7718     * limitations under the License.
   7719     */
   7720 
   7721    /*
   7722     * File: unused.S
   7723     *
   7724     * Code: Common code for unused bytecodes. Uses no subtitutions.
   7725     *
   7726     * For: all unused bytecodes
   7727     *
   7728     * Description: aborts if executed.
   7729     *
   7730     * Format: |op (10x)
   7731     *
   7732     * Syntax: op
   7733     */
   7734 
   7735     call        common_abort
   7736 
   7737 
   7738 /* ------------------------------ */
   7739     .balign 64
   7740 .L_OP_UNUSED_7A: /* 0x7a */
   7741 /* File: x86-atom/OP_UNUSED_7A.S */
   7742    /* Copyright (C) 2008 The Android Open Source Project
   7743     *
   7744     * Licensed under the Apache License, Version 2.0 (the "License");
   7745     * you may not use this file except in compliance with the License.
   7746     * You may obtain a copy of the License at
   7747     *
   7748     * http://www.apache.org/licenses/LICENSE-2.0
   7749     *
   7750     * Unless required by applicable law or agreed to in writing, software
   7751     * distributed under the License is distributed on an "AS IS" BASIS,
   7752     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7753     * See the License for the specific language governing permissions and
   7754     * limitations under the License.
   7755     */
   7756 
   7757    /*
   7758     * File: OP_UNUSED_7A.S
   7759     */
   7760 
   7761 /* File: x86-atom/unused.S */
   7762    /* Copyright (C) 2008 The Android Open Source Project
   7763     *
   7764     * Licensed under the Apache License, Version 2.0 (the "License");
   7765     * you may not use this file except in compliance with the License.
   7766     * You may obtain a copy of the License at
   7767     *
   7768     * http://www.apache.org/licenses/LICENSE-2.0
   7769     *
   7770     * Unless required by applicable law or agreed to in writing, software
   7771     * distributed under the License is distributed on an "AS IS" BASIS,
   7772     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7773     * See the License for the specific language governing permissions and
   7774     * limitations under the License.
   7775     */
   7776 
   7777    /*
   7778     * File: unused.S
   7779     *
   7780     * Code: Common code for unused bytecodes. Uses no subtitutions.
   7781     *
   7782     * For: all unused bytecodes
   7783     *
   7784     * Description: aborts if executed.
   7785     *
   7786     * Format: |op (10x)
   7787     *
   7788     * Syntax: op
   7789     */
   7790 
   7791     call        common_abort
   7792 
   7793 
   7794 /* ------------------------------ */
   7795     .balign 64
   7796 .L_OP_NEG_INT: /* 0x7b */
   7797 /* File: x86-atom/OP_NEG_INT.S */
   7798    /* Copyright (C) 2008 The Android Open Source Project
   7799     *
   7800     * Licensed under the Apache License, Version 2.0 (the "License");
   7801     * you may not use this file except in compliance with the License.
   7802     * You may obtain a copy of the License at
   7803     *
   7804     * http://www.apache.org/licenses/LICENSE-2.0
   7805     *
   7806     * Unless required by applicable law or agreed to in writing, software
   7807     * distributed under the License is distributed on an "AS IS" BASIS,
   7808     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7809     * See the License for the specific language governing permissions and
   7810     * limitations under the License.
   7811     */
   7812 
   7813    /*
   7814     * File: OP_NEG_INT.S
   7815     */
   7816 
   7817 /* File: x86-atom/unop.S */
   7818    /* Copyright (C) 2008 The Android Open Source Project
   7819     *
   7820     * Licensed under the Apache License, Version 2.0 (the "License");
   7821     * you may not use this file except in compliance with the License.
   7822     * You may obtain a copy of the License at
   7823     *
   7824     * http://www.apache.org/licenses/LICENSE-2.0
   7825     *
   7826     * Unless required by applicable law or agreed to in writing, software
   7827     * distributed under the License is distributed on an "AS IS" BASIS,
   7828     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7829     * See the License for the specific language governing permissions and
   7830     * limitations under the License.
   7831     */
   7832 
   7833    /*
   7834     * File: unop.S
   7835     *
   7836     * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
   7837     *       preinstr variable that together specify an instruction that
   7838     *       performs, for example, "%ecx = op %edx".
   7839     *
   7840     * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
   7841     *
   7842     * Description: Perform the identified unary operation on the source
   7843     *              register, storing the result in the destination register
   7844     *
   7845     * Format: B|A|op (12x)
   7846     *
   7847     * Syntax: op vA, vB
   7848     */
   7849 
   7850 
   7851     movl        rINST, %ecx             # %ecx<- BA+
   7852     shr         $4, %ecx               # %ecx<- B
   7853     and         $15, rINST             # rINST<- A
   7854     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   7855     GET_VREG    %ecx                    # %ecx<- vB
   7856                                # do operation part 1
   7857     neg        %ecx                              # do operation part 2
   7858     SET_VREG    %ecx, rINST             # vA<- result
   7859     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   7860 
   7861 
   7862 /* ------------------------------ */
   7863     .balign 64
   7864 .L_OP_NOT_INT: /* 0x7c */
   7865 /* File: x86-atom/OP_NOT_INT.S */
   7866    /* Copyright (C) 2008 The Android Open Source Project
   7867     *
   7868     * Licensed under the Apache License, Version 2.0 (the "License");
   7869     * you may not use this file except in compliance with the License.
   7870     * You may obtain a copy of the License at
   7871     *
   7872     * http://www.apache.org/licenses/LICENSE-2.0
   7873     *
   7874     * Unless required by applicable law or agreed to in writing, software
   7875     * distributed under the License is distributed on an "AS IS" BASIS,
   7876     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7877     * See the License for the specific language governing permissions and
   7878     * limitations under the License.
   7879     */
   7880 
   7881    /*
   7882     * File: OP_NOT_INT.S
   7883     */
   7884 
   7885 /* File: x86-atom/unop.S */
   7886    /* Copyright (C) 2008 The Android Open Source Project
   7887     *
   7888     * Licensed under the Apache License, Version 2.0 (the "License");
   7889     * you may not use this file except in compliance with the License.
   7890     * You may obtain a copy of the License at
   7891     *
   7892     * http://www.apache.org/licenses/LICENSE-2.0
   7893     *
   7894     * Unless required by applicable law or agreed to in writing, software
   7895     * distributed under the License is distributed on an "AS IS" BASIS,
   7896     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7897     * See the License for the specific language governing permissions and
   7898     * limitations under the License.
   7899     */
   7900 
   7901    /*
   7902     * File: unop.S
   7903     *
   7904     * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
   7905     *       preinstr variable that together specify an instruction that
   7906     *       performs, for example, "%ecx = op %edx".
   7907     *
   7908     * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
   7909     *
   7910     * Description: Perform the identified unary operation on the source
   7911     *              register, storing the result in the destination register
   7912     *
   7913     * Format: B|A|op (12x)
   7914     *
   7915     * Syntax: op vA, vB
   7916     */
   7917 
   7918 
   7919     movl        rINST, %ecx             # %ecx<- BA+
   7920     shr         $4, %ecx               # %ecx<- B
   7921     and         $15, rINST             # rINST<- A
   7922     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   7923     GET_VREG    %ecx                    # %ecx<- vB
   7924                                # do operation part 1
   7925     not        %ecx                              # do operation part 2
   7926     SET_VREG    %ecx, rINST             # vA<- result
   7927     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   7928 
   7929 
   7930 /* ------------------------------ */
   7931     .balign 64
   7932 .L_OP_NEG_LONG: /* 0x7d */
   7933 /* File: x86-atom/OP_NEG_LONG.S */
   7934    /* Copyright (C) 2008 The Android Open Source Project
   7935     *
   7936     * Licensed under the Apache License, Version 2.0 (the "License");
   7937     * you may not use this file except in compliance with the License.
   7938     * You may obtain a copy of the License at
   7939     *
   7940     * http://www.apache.org/licenses/LICENSE-2.0
   7941     *
   7942     * Unless required by applicable law or agreed to in writing, software
   7943     * distributed under the License is distributed on an "AS IS" BASIS,
   7944     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7945     * See the License for the specific language governing permissions and
   7946     * limitations under the License.
   7947     */
   7948 
   7949    /*
   7950     * File: OP_NEG_LONG.S
   7951     */
   7952 
   7953 /* File: x86-atom/unopWide.S */
   7954    /* Copyright (C) 2008 The Android Open Source Project
   7955     *
   7956     * Licensed under the Apache License, Version 2.0 (the "License");
   7957     * you may not use this file except in compliance with the License.
   7958     * You may obtain a copy of the License at
   7959     *
   7960     * http://www.apache.org/licenses/LICENSE-2.0
   7961     *
   7962     * Unless required by applicable law or agreed to in writing, software
   7963     * distributed under the License is distributed on an "AS IS" BASIS,
   7964     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   7965     * See the License for the specific language governing permissions and
   7966     * limitations under the License.
   7967     */
   7968 
   7969    /*
   7970     * File: unopWide.S
   7971     *
   7972     * Code: Generic 64-bit unary operation. Provide an "instr" variable and a
   7973     *       preinstr variable that together specify an instruction that
   7974     *       performs, for example, "%xmm0 = op %xmm1".
   7975     *
   7976     * For:  neg-double, neg-long, not-long
   7977     *
   7978     * Description: Perform the identified unary operation on the source
   7979     *              register, storing the result in the destination register
   7980     *
   7981     * Format: B|A|op (12x)
   7982     *
   7983     * Syntax: op vA, vB
   7984     */
   7985 
   7986 
   7987     movl        rINST, %ecx             # %ecx<- BA+
   7988     shr         $4, rINST              # rINST<- B
   7989     and         $15, %ecx              # %ecx<- A
   7990     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   7991     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vB
   7992     xorps %xmm1, %xmm1                           # do operation part 1
   7993     psubq %xmm0, %xmm1                              # do operation part 2
   7994     movq        %xmm1, (rFP, %ecx, 4) # vA<- result
   7995     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   7996 
   7997 
   7998 /* ------------------------------ */
   7999     .balign 64
   8000 .L_OP_NOT_LONG: /* 0x7e */
   8001 /* File: x86-atom/OP_NOT_LONG.S */
   8002    /* Copyright (C) 2008 The Android Open Source Project
   8003     *
   8004     * Licensed under the Apache License, Version 2.0 (the "License");
   8005     * you may not use this file except in compliance with the License.
   8006     * You may obtain a copy of the License at
   8007     *
   8008     * http://www.apache.org/licenses/LICENSE-2.0
   8009     *
   8010     * Unless required by applicable law or agreed to in writing, software
   8011     * distributed under the License is distributed on an "AS IS" BASIS,
   8012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8013     * See the License for the specific language governing permissions and
   8014     * limitations under the License.
   8015     */
   8016 
   8017    /*
   8018     * File: OP_NOT_LONG.S
   8019     */
   8020 
   8021 /* File: x86-atom/unopWide.S */
   8022    /* Copyright (C) 2008 The Android Open Source Project
   8023     *
   8024     * Licensed under the Apache License, Version 2.0 (the "License");
   8025     * you may not use this file except in compliance with the License.
   8026     * You may obtain a copy of the License at
   8027     *
   8028     * http://www.apache.org/licenses/LICENSE-2.0
   8029     *
   8030     * Unless required by applicable law or agreed to in writing, software
   8031     * distributed under the License is distributed on an "AS IS" BASIS,
   8032     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8033     * See the License for the specific language governing permissions and
   8034     * limitations under the License.
   8035     */
   8036 
   8037    /*
   8038     * File: unopWide.S
   8039     *
   8040     * Code: Generic 64-bit unary operation. Provide an "instr" variable and a
   8041     *       preinstr variable that together specify an instruction that
   8042     *       performs, for example, "%xmm0 = op %xmm1".
   8043     *
   8044     * For:  neg-double, neg-long, not-long
   8045     *
   8046     * Description: Perform the identified unary operation on the source
   8047     *              register, storing the result in the destination register
   8048     *
   8049     * Format: B|A|op (12x)
   8050     *
   8051     * Syntax: op vA, vB
   8052     */
   8053 
   8054 
   8055     movl        rINST, %ecx             # %ecx<- BA+
   8056     shr         $4, rINST              # rINST<- B
   8057     and         $15, %ecx              # %ecx<- A
   8058     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8059     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vB
   8060                                # do operation part 1
   8061     pandn  0xFFFFFFFF, %xmm0                              # do operation part 2
   8062     movq        %xmm0, (rFP, %ecx, 4) # vA<- result
   8063     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8064 
   8065 
   8066 /* ------------------------------ */
   8067     .balign 64
   8068 .L_OP_NEG_FLOAT: /* 0x7f */
   8069 /* File: x86-atom/OP_NEG_FLOAT.S */
   8070    /* Copyright (C) 2008 The Android Open Source Project
   8071     *
   8072     * Licensed under the Apache License, Version 2.0 (the "License");
   8073     * you may not use this file except in compliance with the License.
   8074     * You may obtain a copy of the License at
   8075     *
   8076     * http://www.apache.org/licenses/LICENSE-2.0
   8077     *
   8078     * Unless required by applicable law or agreed to in writing, software
   8079     * distributed under the License is distributed on an "AS IS" BASIS,
   8080     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8081     * See the License for the specific language governing permissions and
   8082     * limitations under the License.
   8083     */
   8084 
   8085    /*
   8086     * File: OP_NEG_FLOAT.S
   8087     */
   8088 
   8089 /* File: x86-atom/unop.S */
   8090    /* Copyright (C) 2008 The Android Open Source Project
   8091     *
   8092     * Licensed under the Apache License, Version 2.0 (the "License");
   8093     * you may not use this file except in compliance with the License.
   8094     * You may obtain a copy of the License at
   8095     *
   8096     * http://www.apache.org/licenses/LICENSE-2.0
   8097     *
   8098     * Unless required by applicable law or agreed to in writing, software
   8099     * distributed under the License is distributed on an "AS IS" BASIS,
   8100     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8101     * See the License for the specific language governing permissions and
   8102     * limitations under the License.
   8103     */
   8104 
   8105    /*
   8106     * File: unop.S
   8107     *
   8108     * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
   8109     *       preinstr variable that together specify an instruction that
   8110     *       performs, for example, "%ecx = op %edx".
   8111     *
   8112     * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
   8113     *
   8114     * Description: Perform the identified unary operation on the source
   8115     *              register, storing the result in the destination register
   8116     *
   8117     * Format: B|A|op (12x)
   8118     *
   8119     * Syntax: op vA, vB
   8120     */
   8121 
   8122 
   8123     movl        rINST, %ecx             # %ecx<- BA+
   8124     shr         $4, %ecx               # %ecx<- B
   8125     and         $15, rINST             # rINST<- A
   8126     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8127     GET_VREG    %ecx                    # %ecx<- vB
   8128                                # do operation part 1
   8129     addl      $0x80000000, %ecx                              # do operation part 2
   8130     SET_VREG    %ecx, rINST             # vA<- result
   8131     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8132 
   8133 
   8134 /* ------------------------------ */
   8135     .balign 64
   8136 .L_OP_NEG_DOUBLE: /* 0x80 */
   8137 /* File: x86-atom/OP_NEG_DOUBLE.S */
   8138    /* Copyright (C) 2008 The Android Open Source Project
   8139     *
   8140     * Licensed under the Apache License, Version 2.0 (the "License");
   8141     * you may not use this file except in compliance with the License.
   8142     * You may obtain a copy of the License at
   8143     *
   8144     * http://www.apache.org/licenses/LICENSE-2.0
   8145     *
   8146     * Unless required by applicable law or agreed to in writing, software
   8147     * distributed under the License is distributed on an "AS IS" BASIS,
   8148     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8149     * See the License for the specific language governing permissions and
   8150     * limitations under the License.
   8151     */
   8152 
   8153    /*
   8154     * File: OP_NEG_DOUBLE.S
   8155     */
   8156 
   8157 /* File: x86-atom/unopWide.S */
   8158    /* Copyright (C) 2008 The Android Open Source Project
   8159     *
   8160     * Licensed under the Apache License, Version 2.0 (the "License");
   8161     * you may not use this file except in compliance with the License.
   8162     * You may obtain a copy of the License at
   8163     *
   8164     * http://www.apache.org/licenses/LICENSE-2.0
   8165     *
   8166     * Unless required by applicable law or agreed to in writing, software
   8167     * distributed under the License is distributed on an "AS IS" BASIS,
   8168     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8169     * See the License for the specific language governing permissions and
   8170     * limitations under the License.
   8171     */
   8172 
   8173    /*
   8174     * File: unopWide.S
   8175     *
   8176     * Code: Generic 64-bit unary operation. Provide an "instr" variable and a
   8177     *       preinstr variable that together specify an instruction that
   8178     *       performs, for example, "%xmm0 = op %xmm1".
   8179     *
   8180     * For:  neg-double, neg-long, not-long
   8181     *
   8182     * Description: Perform the identified unary operation on the source
   8183     *              register, storing the result in the destination register
   8184     *
   8185     * Format: B|A|op (12x)
   8186     *
   8187     * Syntax: op vA, vB
   8188     */
   8189 
   8190 
   8191     movl        rINST, %ecx             # %ecx<- BA+
   8192     shr         $4, rINST              # rINST<- B
   8193     and         $15, %ecx              # %ecx<- A
   8194     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8195     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vB
   8196     movq .LdoubNeg, %xmm1                           # do operation part 1
   8197     pxor %xmm1, %xmm0                              # do operation part 2
   8198     movq        %xmm0, (rFP, %ecx, 4) # vA<- result
   8199     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8200 
   8201 
   8202 /* ------------------------------ */
   8203     .balign 64
   8204 .L_OP_INT_TO_LONG: /* 0x81 */
   8205 /* File: x86-atom/OP_INT_TO_LONG.S */
   8206    /* Copyright (C) 2008 The Android Open Source Project
   8207     *
   8208     * Licensed under the Apache License, Version 2.0 (the "License");
   8209     * you may not use this file except in compliance with the License.
   8210     * You may obtain a copy of the License at
   8211     *
   8212     * http://www.apache.org/licenses/LICENSE-2.0
   8213     *
   8214     * Unless required by applicable law or agreed to in writing, software
   8215     * distributed under the License is distributed on an "AS IS" BASIS,
   8216     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8217     * See the License for the specific language governing permissions and
   8218     * limitations under the License.
   8219     */
   8220 
   8221    /*
   8222     * File: OP_INT_TO_LONG.S
   8223     *
   8224     * Code:  Convert an int to a long. Uses no substitutions.
   8225     *
   8226     * For:
   8227     *
   8228     * Description: Convert an int in the source register, to a long, and
   8229     *              stores the result in the destintation register. vA<- (long) vB
   8230     *
   8231     *
   8232     * Format: B|A|op (12x)
   8233     *
   8234     * Syntax: op vA, vB
   8235     */
   8236 
   8237     movl        rINST, %eax             # %eax<- BA+
   8238     movl        rINST, %ecx             # %ecx<- BA+
   8239     shr         $4, %eax               # %eax<- B
   8240     andl        $15, %ecx              # %ecx<- A
   8241     GET_VREG    %eax                    # %eax<- vB
   8242     cdq                                 # %edx:%eax<- sign-extend of %eax
   8243     movl        %eax, (rFP, %ecx, 4)    # vA<- lo part
   8244     movl        %edx, 4(rFP, %ecx, 4)   # vA+1<- hi part
   8245     FINISH      1                       # jump to next instruction
   8246 
   8247 /* ------------------------------ */
   8248     .balign 64
   8249 .L_OP_INT_TO_FLOAT: /* 0x82 */
   8250 /* File: x86-atom/OP_INT_TO_FLOAT.S */
   8251    /* Copyright (C) 2008 The Android Open Source Project
   8252     *
   8253     * Licensed under the Apache License, Version 2.0 (the "License");
   8254     * you may not use this file except in compliance with the License.
   8255     * You may obtain a copy of the License at
   8256     *
   8257     * http://www.apache.org/licenses/LICENSE-2.0
   8258     *
   8259     * Unless required by applicable law or agreed to in writing, software
   8260     * distributed under the License is distributed on an "AS IS" BASIS,
   8261     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8262     * See the License for the specific language governing permissions and
   8263     * limitations under the License.
   8264     */
   8265 
   8266    /*
   8267     * File: OP_INT_TO_FLOAT.S
   8268     *
   8269     * Code: Convert an int to a float. Uses no substitutions.
   8270     *
   8271     * For: int-to-float
   8272     *
   8273     * Description: Convert an int in the source register, to a float, and
   8274     *              stores the result in the destintation register. vA<- (float) vB
   8275     *
   8276     * Format: B|A|op (12x)
   8277     *
   8278     * Syntax: op vA, vB
   8279     */
   8280 
   8281     movl        rINST, %eax             # %eax<- BA+
   8282     shr         $4, %eax               # %eax<- B
   8283     andl        $15,  rINST            # rINST<- A
   8284     cvtsi2ss    (rFP,%eax,4), %xmm0     # %xmm0<- vB
   8285     movss       %xmm0, (rFP, rINST, 4)  # vA<- %xmm0
   8286     FINISH      1                       # jump to next instruction
   8287 
   8288 /* ------------------------------ */
   8289     .balign 64
   8290 .L_OP_INT_TO_DOUBLE: /* 0x83 */
   8291 /* File: x86-atom/OP_INT_TO_DOUBLE.S */
   8292    /* Copyright (C) 2008 The Android Open Source Project
   8293     *
   8294     * Licensed under the Apache License, Version 2.0 (the "License");
   8295     * you may not use this file except in compliance with the License.
   8296     * You may obtain a copy of the License at
   8297     *
   8298     * http://www.apache.org/licenses/LICENSE-2.0
   8299     *
   8300     * Unless required by applicable law or agreed to in writing, software
   8301     * distributed under the License is distributed on an "AS IS" BASIS,
   8302     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8303     * See the License for the specific language governing permissions and
   8304     * limitations under the License.
   8305     */
   8306 
   8307    /*
   8308     * File: OP_INT_TO_DOUBLE.S
   8309     *
   8310     * Code: Convert an int to a double. Uses no substitutions.
   8311     *
   8312     * For: int-to-double
   8313     *
   8314     * Description: Converts an int in the source register, to a double, and
   8315     *              stores the result in the destination register. vA<- (double) vB
   8316     *
   8317     * Format: B|A|op (12x)
   8318     *
   8319     * Syntax: op vA, vB
   8320     */
   8321 
   8322     movl        rINST, %eax             # %eax<- BA+
   8323     shr         $4, %eax               # %eax<- B
   8324     andl        $15, rINST             # rINST<- A
   8325     cvtsi2sd    (rFP, %eax, 4), %xmm0   # %xmm0<- vB
   8326     movq        %xmm0, (rFP, rINST, 4)  # vA<- %xmm0; (double) vB
   8327     FFETCH_ADV  1, %edx                 # %edx<- next instruction hi; fetch, advance
   8328     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   8329 
   8330 /* ------------------------------ */
   8331     .balign 64
   8332 .L_OP_LONG_TO_INT: /* 0x84 */
   8333 /* File: x86-atom/OP_LONG_TO_INT.S */
   8334    /* Copyright (C) 2008 The Android Open Source Project
   8335     *
   8336     * Licensed under the Apache License, Version 2.0 (the "License");
   8337     * you may not use this file except in compliance with the License.
   8338     * You may obtain a copy of the License at
   8339     *
   8340     * http://www.apache.org/licenses/LICENSE-2.0
   8341     *
   8342     * Unless required by applicable law or agreed to in writing, software
   8343     * distributed under the License is distributed on an "AS IS" BASIS,
   8344     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8345     * See the License for the specific language governing permissions and
   8346     * limitations under the License.
   8347     */
   8348 
   8349    /*
   8350     * File: OP_LONG_TO_INT.S
   8351     */
   8352 
   8353 /* File: x86-atom/OP_MOVE.S */
   8354    /* Copyright (C) 2008 The Android Open Source Project
   8355     *
   8356     * Licensed under the Apache License, Version 2.0 (the "License");
   8357     * you may not use this file except in compliance with the License.
   8358     * You may obtain a copy of the License at
   8359     *
   8360     * http://www.apache.org/licenses/LICENSE-2.0
   8361     *
   8362     * Unless required by applicable law or agreed to in writing, software
   8363     * distributed under the License is distributed on an "AS IS" BASIS,
   8364     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8365     * See the License for the specific language governing permissions and
   8366     * limitations under the License.
   8367     */
   8368 
   8369    /*
   8370     * File: OP_MOVE.S
   8371     *
   8372     * Code: Copies contents from one register to another. Uses no
   8373     *       substitutions.
   8374     *
   8375     * For: move, move-object, long-to-int
   8376     *
   8377     * Description: Copies contents from one non-object register to another.
   8378     *              vA<- vB; fp[A]<- fp[B]
   8379     *
   8380     * Format: B|A|op (12x)
   8381     *
   8382     * Syntax: op vA, vB
   8383     */
   8384 
   8385     movl        rINST, %ecx             # %ecx<- BA
   8386     shr         $4, rINST              # rINST<- B
   8387     and         $15, %ecx              # %ecx<- A
   8388     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8389     GET_VREG    rINST                   # rINST<- vB
   8390     SET_VREG    rINST, %ecx             # vA<- vB; %edx
   8391     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8392 
   8393 
   8394 /* ------------------------------ */
   8395     .balign 64
   8396 .L_OP_LONG_TO_FLOAT: /* 0x85 */
   8397 /* File: x86-atom/OP_LONG_TO_FLOAT.S */
   8398    /* Copyright (C) 2008 The Android Open Source Project
   8399     *
   8400     * Licensed under the Apache License, Version 2.0 (the "License");
   8401     * you may not use this file except in compliance with the License.
   8402     * You may obtain a copy of the License at
   8403     *
   8404     * http://www.apache.org/licenses/LICENSE-2.0
   8405     *
   8406     * Unless required by applicable law or agreed to in writing, software
   8407     * distributed under the License is distributed on an "AS IS" BASIS,
   8408     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8409     * See the License for the specific language governing permissions and
   8410     * limitations under the License.
   8411     */
   8412 
   8413    /*
   8414     * File: OP_LONG_TO_FLOAT.S
   8415     *
   8416     * Code: Convert a long to a float. Uses no substitutions.
   8417     *
   8418     * For: int-to-float
   8419     *
   8420     * Description: Converts a float in the source register, to a float, and
   8421     *              stores the result in the destination register. vA<- (double) vB
   8422     *
   8423     * Format: B|A|op (12x)
   8424     *
   8425     * Syntax: op vA, vB
   8426     */
   8427 
   8428     movl        rINST, %ecx             # %ecx<- BA+
   8429     shr         $4, rINST              # rINST<- B
   8430     and         $15, %ecx              # %ecx<- A
   8431     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8432     fildll      (rFP, rINST, 4)         # FPU<- vB
   8433     fstps       (rFP, %ecx, 4)          # vA<- FPU; (float) vB
   8434     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8435 
   8436 /* ------------------------------ */
   8437     .balign 64
   8438 .L_OP_LONG_TO_DOUBLE: /* 0x86 */
   8439 /* File: x86-atom/OP_LONG_TO_DOUBLE.S */
   8440    /* Copyright (C) 2008 The Android Open Source Project
   8441     *
   8442     * Licensed under the Apache License, Version 2.0 (the "License");
   8443     * you may not use this file except in compliance with the License.
   8444     * You may obtain a copy of the License at
   8445     *
   8446     * http://www.apache.org/licenses/LICENSE-2.0
   8447     *
   8448     * Unless required by applicable law or agreed to in writing, software
   8449     * distributed under the License is distributed on an "AS IS" BASIS,
   8450     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8451     * See the License for the specific language governing permissions and
   8452     * limitations under the License.
   8453     */
   8454 
   8455    /*
   8456     * File: OP_LONG_TO_DOUBLE.S
   8457     *
   8458     * Code: Convert a long to a dobule. Uses no substitutions.
   8459     *
   8460     * For: long-to-double
   8461     *
   8462     * Description: Converts a long in the source register to a double, and
   8463     *              stores the result in the destination register. vA<- (double) vB
   8464     *
   8465     * Format: B|A|op (12x)
   8466     *
   8467     * Syntax: op vA, vB
   8468     */
   8469 
   8470     movl        rINST, %ecx             # %ecx<- BA+
   8471     shr         $4, rINST              # rINST<- B
   8472     and         $15, %ecx              # %ecx<- A
   8473     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8474     fildll      (rFP, rINST, 4)         # FPU<- vB
   8475     fstpl       (rFP, %ecx, 4)          # vA<- FPU; (double) vB
   8476     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8477 
   8478 /* ------------------------------ */
   8479     .balign 64
   8480 .L_OP_FLOAT_TO_INT: /* 0x87 */
   8481 /* File: x86-atom/OP_FLOAT_TO_INT.S */
   8482    /* Copyright (C) 2008 The Android Open Source Project
   8483     *
   8484     * Licensed under the Apache License, Version 2.0 (the "License");
   8485     * you may not use this file except in compliance with the License.
   8486     * You may obtain a copy of the License at
   8487     *
   8488     * http://www.apache.org/licenses/LICENSE-2.0
   8489     *
   8490     * Unless required by applicable law or agreed to in writing, software
   8491     * distributed under the License is distributed on an "AS IS" BASIS,
   8492     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8493     * See the License for the specific language governing permissions and
   8494     * limitations under the License.
   8495     */
   8496 
   8497    /*
   8498     * File: OP_FLOAT_TO_INT.S
   8499     *
   8500     * Code: Converts a float to a int. Uses no substitutions.
   8501     *
   8502     * For: float-to-int
   8503     *
   8504     * Description: Convert the float in source register to a int
   8505     *              and store the result in the destintation register
   8506     *
   8507     * Format: B|A|op (12x)
   8508     *
   8509     * Syntax: op vA, vB
   8510     */
   8511 
   8512     movl        rINST, %edx             # %edx<- BA
   8513     shr         $4, rINST              # rINST<- B
   8514     and         $15, %edx              # %edx<- A
   8515     flds        (rFP, rINST, 4)         # push vB to floating point stack
   8516     fildl       .LintMax                # push max int value
   8517     fildl       .LintMin                # push min int value
   8518     fucomip     %st(2), %st(0)          # check for negInf
   8519     jae         .LOP_FLOAT_TO_INT_negInf      # handle negInf
   8520     fucomip     %st(1), %st(0)          # check for posInf or NaN
   8521     jc          .LOP_FLOAT_TO_INT_nanInf      # handle posInf or NaN
   8522     jmp         .LOP_FLOAT_TO_INT_break       # do conversion
   8523 
   8524 /* ------------------------------ */
   8525     .balign 64
   8526 .L_OP_FLOAT_TO_LONG: /* 0x88 */
   8527 /* File: x86-atom/OP_FLOAT_TO_LONG.S */
   8528    /* Copyright (C) 2008 The Android Open Source Project
   8529     *
   8530     * Licensed under the Apache License, Version 2.0 (the "License");
   8531     * you may not use this file except in compliance with the License.
   8532     * You may obtain a copy of the License at
   8533     *
   8534     * http://www.apache.org/licenses/LICENSE-2.0
   8535     *
   8536     * Unless required by applicable law or agreed to in writing, software
   8537     * distributed under the License is distributed on an "AS IS" BASIS,
   8538     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8539     * See the License for the specific language governing permissions and
   8540     * limitations under the License.
   8541     */
   8542 
   8543    /*
   8544     * File: OP_FLOAT_TO_LONG.S
   8545     *
   8546     * Code: Converts a float to a long. Uses no substitutions.
   8547     *
   8548     * For: float-to-long
   8549     *
   8550     * Description: Convert the float in source register to a long
   8551     *              and store the result in the destintation register
   8552     *
   8553     * Format: B|A|op (12x)
   8554     *
   8555     * Syntax: op vA, vB
   8556     */
   8557 
   8558     movl        rINST, %edx             # %edx<- BA
   8559     shr         $4, rINST              # rINST<- B
   8560     and         $15, %edx              # %edx<- A
   8561     flds        (rFP, rINST, 4)         # push vB to floating point stack
   8562     fildll      .LvaluePosInfLong       # push max int value
   8563     fildll      .LvalueNegInfLong       # push min int value
   8564     fucomip     %st(2), %st(0)          # check for negInf
   8565     jae         .LOP_FLOAT_TO_LONG_negInf      # handle negInf
   8566     fucomip     %st(1), %st(0)          # check for posInf or NaN
   8567     jc          .LOP_FLOAT_TO_LONG_nanInf      # handle posInf or NaN
   8568     jmp         .LOP_FLOAT_TO_LONG_break       # do conversion
   8569 
   8570 /* ------------------------------ */
   8571     .balign 64
   8572 .L_OP_FLOAT_TO_DOUBLE: /* 0x89 */
   8573 /* File: x86-atom/OP_FLOAT_TO_DOUBLE.S */
   8574    /* Copyright (C) 2008 The Android Open Source Project
   8575     *
   8576     * Licensed under the Apache License, Version 2.0 (the "License");
   8577     * you may not use this file except in compliance with the License.
   8578     * You may obtain a copy of the License at
   8579     *
   8580     * http://www.apache.org/licenses/LICENSE-2.0
   8581     *
   8582     * Unless required by applicable law or agreed to in writing, software
   8583     * distributed under the License is distributed on an "AS IS" BASIS,
   8584     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8585     * See the License for the specific language governing permissions and
   8586     * limitations under the License.
   8587     */
   8588 
   8589    /*
   8590     * File: OP_FLOAT_TO_DOUBLE.S
   8591     *
   8592     * Code: Converts a float to a double. Uses no substitutions.
   8593     *
   8594     * For: float-to-double
   8595     *
   8596     * Description: Convert the float in source register to a double
   8597     *              and store the result in the destintation register
   8598     *
   8599     * Format: B|A|op (12x)
   8600     *
   8601     * Syntax: op vA, vB
   8602     */
   8603 
   8604     movl        rINST, %edx             # %edx<- BA
   8605     shr         $4, rINST              # rINST<- B
   8606     and         $15, %edx              # %edx<- A
   8607     flds        (rFP, rINST, 4)         # load float
   8608     fstpl       (rFP, %edx, 4)          # store double
   8609     FINISH      1                       # jump to next instruction
   8610 
   8611 /* ------------------------------ */
   8612     .balign 64
   8613 .L_OP_DOUBLE_TO_INT: /* 0x8a */
   8614 /* File: x86-atom/OP_DOUBLE_TO_INT.S */
   8615    /* Copyright (C) 2008 The Android Open Source Project
   8616     *
   8617     * Licensed under the Apache License, Version 2.0 (the "License");
   8618     * you may not use this file except in compliance with the License.
   8619     * You may obtain a copy of the License at
   8620     *
   8621     * http://www.apache.org/licenses/LICENSE-2.0
   8622     *
   8623     * Unless required by applicable law or agreed to in writing, software
   8624     * distributed under the License is distributed on an "AS IS" BASIS,
   8625     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8626     * See the License for the specific language governing permissions and
   8627     * limitations under the License.
   8628     */
   8629 
   8630    /*
   8631     * File: OP_DOUBLE_TO_INT.S
   8632     *
   8633     * Code: Converts a double to an integer. Uses no substitutions.
   8634     *
   8635     * For: double-to-int
   8636     *
   8637     * Description: Convert the source register (a double) to an integer
   8638     *              and store the result in the destination register
   8639     *
   8640     * Format: B|A|op (12x)
   8641     *
   8642     * Syntax: op vA, vB
   8643     */
   8644 
   8645     movl        rINST, %edx             # %edx<- BA
   8646     shr         $4, rINST              # rINST<- B
   8647     and         $15, %edx              # %edx<- A
   8648     fldl        (rFP, rINST, 4)         # load &vB
   8649     fildl       .LintMax                # push max int value
   8650     fildl       .LintMin                # push min int value
   8651     fucomip     %st(2), %st(0)          # check for negInf
   8652     jae         .LOP_DOUBLE_TO_INT_negInf      # handle negInf
   8653     fucomip     %st(1), %st(0)          # check for posInf or NaN
   8654     jc          .LOP_DOUBLE_TO_INT_nanInf      # handle posInf or NaN
   8655     jmp         .LOP_DOUBLE_TO_INT_break       # do conversion
   8656 
   8657 /* ------------------------------ */
   8658     .balign 64
   8659 .L_OP_DOUBLE_TO_LONG: /* 0x8b */
   8660 /* File: x86-atom/OP_DOUBLE_TO_LONG.S */
   8661    /* Copyright (C) 2008 The Android Open Source Project
   8662     *
   8663     * Licensed under the Apache License, Version 2.0 (the "License");
   8664     * you may not use this file except in compliance with the License.
   8665     * You may obtain a copy of the License at
   8666     *
   8667     * http://www.apache.org/licenses/LICENSE-2.0
   8668     *
   8669     * Unless required by applicable law or agreed to in writing, software
   8670     * distributed under the License is distributed on an "AS IS" BASIS,
   8671     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8672     * See the License for the specific language governing permissions and
   8673     * limitations under the License.
   8674     */
   8675 
   8676    /*
   8677     * File: OP_DOUBLE_TO_LONG.S
   8678     *
   8679     * Code: Converts a double to a long. Uses no substitutions.
   8680     *
   8681     * For: double-to-long
   8682     *
   8683     * Description: Convert the double in source register to a long
   8684     *              and store in the destintation register
   8685     *
   8686     * Format: B|A|op (12x)
   8687     *
   8688     * Syntax: op vA, vB
   8689     */
   8690 
   8691     movl        rINST, %edx             # %ecx<- BA
   8692     shr         $4, rINST              # rINST<- B
   8693     and         $15, %edx              # %ecx<- A
   8694     fldl        (rFP, rINST, 4)         # push vB to floating point stack
   8695     fildll      .LvaluePosInfLong       # push max int value
   8696     fildll      .LvalueNegInfLong       # push min int value
   8697     fucomip     %st(2), %st(0)          # check for negInf
   8698     jae         .LOP_DOUBLE_TO_LONG_negInf      # handle negInf
   8699     fucomip     %st(1), %st(0)          # check for posInf or NaN
   8700     jc          .LOP_DOUBLE_TO_LONG_nanInf      # handle posInf or NaN
   8701     jmp         .LOP_DOUBLE_TO_LONG_break       # do conversion
   8702 
   8703 /* ------------------------------ */
   8704     .balign 64
   8705 .L_OP_DOUBLE_TO_FLOAT: /* 0x8c */
   8706 /* File: x86-atom/OP_DOUBLE_TO_FLOAT.S */
   8707    /* Copyright (C) 2008 The Android Open Source Project
   8708     *
   8709     * Licensed under the Apache License, Version 2.0 (the "License");
   8710     * you may not use this file except in compliance with the License.
   8711     * You may obtain a copy of the License at
   8712     *
   8713     * http://www.apache.org/licenses/LICENSE-2.0
   8714     *
   8715     * Unless required by applicable law or agreed to in writing, software
   8716     * distributed under the License is distributed on an "AS IS" BASIS,
   8717     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8718     * See the License for the specific language governing permissions and
   8719     * limitations under the License.
   8720     */
   8721 
   8722    /*
   8723     * File: OP_DOUBLE_TO_FLOAT.S
   8724     *
   8725     * Code: Converts a double to a float. Uses no substitutions.
   8726     *
   8727     * For: double-to-float
   8728     *
   8729     * Description: Convert the source register (a double) to a float
   8730     *              and store the result in the destination register
   8731     *
   8732     * Format: B|A|op (12x)
   8733     *
   8734     * Syntax: op vA, vB
   8735     */
   8736 
   8737     movl        rINST, %edx             # %edx<- BA
   8738     shr         $4, rINST              # rINST<- B
   8739     and         $15, %edx              # %edx<- A
   8740     fldl        (rFP, rINST, 4)         # load &vB
   8741     fstps       (rFP, %edx, 4)          # store float
   8742     FINISH      1                       # jump to next instruction
   8743 
   8744 /* ------------------------------ */
   8745     .balign 64
   8746 .L_OP_INT_TO_BYTE: /* 0x8d */
   8747 /* File: x86-atom/OP_INT_TO_BYTE.S */
   8748    /* Copyright (C) 2008 The Android Open Source Project
   8749     *
   8750     * Licensed under the Apache License, Version 2.0 (the "License");
   8751     * you may not use this file except in compliance with the License.
   8752     * You may obtain a copy of the License at
   8753     *
   8754     * http://www.apache.org/licenses/LICENSE-2.0
   8755     *
   8756     * Unless required by applicable law or agreed to in writing, software
   8757     * distributed under the License is distributed on an "AS IS" BASIS,
   8758     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8759     * See the License for the specific language governing permissions and
   8760     * limitations under the License.
   8761     */
   8762 
   8763    /*
   8764     * File: OP_INT_TO_BYTE.S
   8765     */
   8766 
   8767 /* File: x86-atom/unop.S */
   8768    /* Copyright (C) 2008 The Android Open Source Project
   8769     *
   8770     * Licensed under the Apache License, Version 2.0 (the "License");
   8771     * you may not use this file except in compliance with the License.
   8772     * You may obtain a copy of the License at
   8773     *
   8774     * http://www.apache.org/licenses/LICENSE-2.0
   8775     *
   8776     * Unless required by applicable law or agreed to in writing, software
   8777     * distributed under the License is distributed on an "AS IS" BASIS,
   8778     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8779     * See the License for the specific language governing permissions and
   8780     * limitations under the License.
   8781     */
   8782 
   8783    /*
   8784     * File: unop.S
   8785     *
   8786     * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
   8787     *       preinstr variable that together specify an instruction that
   8788     *       performs, for example, "%ecx = op %edx".
   8789     *
   8790     * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
   8791     *
   8792     * Description: Perform the identified unary operation on the source
   8793     *              register, storing the result in the destination register
   8794     *
   8795     * Format: B|A|op (12x)
   8796     *
   8797     * Syntax: op vA, vB
   8798     */
   8799 
   8800 
   8801     movl        rINST, %ecx             # %ecx<- BA+
   8802     shr         $4, %ecx               # %ecx<- B
   8803     and         $15, rINST             # rINST<- A
   8804     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8805     GET_VREG    %ecx                    # %ecx<- vB
   8806     sal $24, %ecx                           # do operation part 1
   8807     sar $24, %ecx                              # do operation part 2
   8808     SET_VREG    %ecx, rINST             # vA<- result
   8809     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8810 
   8811 
   8812 /* ------------------------------ */
   8813     .balign 64
   8814 .L_OP_INT_TO_CHAR: /* 0x8e */
   8815 /* File: x86-atom/OP_INT_TO_CHAR.S */
   8816    /* Copyright (C) 2008 The Android Open Source Project
   8817     *
   8818     * Licensed under the Apache License, Version 2.0 (the "License");
   8819     * you may not use this file except in compliance with the License.
   8820     * You may obtain a copy of the License at
   8821     *
   8822     * http://www.apache.org/licenses/LICENSE-2.0
   8823     *
   8824     * Unless required by applicable law or agreed to in writing, software
   8825     * distributed under the License is distributed on an "AS IS" BASIS,
   8826     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8827     * See the License for the specific language governing permissions and
   8828     * limitations under the License.
   8829     */
   8830 
   8831    /*
   8832     * File: OP_INT_TO_CHAR.S
   8833     */
   8834 
   8835 /* File: x86-atom/unop.S */
   8836    /* Copyright (C) 2008 The Android Open Source Project
   8837     *
   8838     * Licensed under the Apache License, Version 2.0 (the "License");
   8839     * you may not use this file except in compliance with the License.
   8840     * You may obtain a copy of the License at
   8841     *
   8842     * http://www.apache.org/licenses/LICENSE-2.0
   8843     *
   8844     * Unless required by applicable law or agreed to in writing, software
   8845     * distributed under the License is distributed on an "AS IS" BASIS,
   8846     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8847     * See the License for the specific language governing permissions and
   8848     * limitations under the License.
   8849     */
   8850 
   8851    /*
   8852     * File: unop.S
   8853     *
   8854     * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
   8855     *       preinstr variable that together specify an instruction that
   8856     *       performs, for example, "%ecx = op %edx".
   8857     *
   8858     * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
   8859     *
   8860     * Description: Perform the identified unary operation on the source
   8861     *              register, storing the result in the destination register
   8862     *
   8863     * Format: B|A|op (12x)
   8864     *
   8865     * Syntax: op vA, vB
   8866     */
   8867 
   8868 
   8869     movl        rINST, %ecx             # %ecx<- BA+
   8870     shr         $4, %ecx               # %ecx<- B
   8871     and         $15, rINST             # rINST<- A
   8872     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8873     GET_VREG    %ecx                    # %ecx<- vB
   8874     sal $16, %ecx                           # do operation part 1
   8875     shr $16, %ecx                              # do operation part 2
   8876     SET_VREG    %ecx, rINST             # vA<- result
   8877     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8878 
   8879 
   8880 /* ------------------------------ */
   8881     .balign 64
   8882 .L_OP_INT_TO_SHORT: /* 0x8f */
   8883 /* File: x86-atom/OP_INT_TO_SHORT.S */
   8884    /* Copyright (C) 2008 The Android Open Source Project
   8885     *
   8886     * Licensed under the Apache License, Version 2.0 (the "License");
   8887     * you may not use this file except in compliance with the License.
   8888     * You may obtain a copy of the License at
   8889     *
   8890     * http://www.apache.org/licenses/LICENSE-2.0
   8891     *
   8892     * Unless required by applicable law or agreed to in writing, software
   8893     * distributed under the License is distributed on an "AS IS" BASIS,
   8894     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8895     * See the License for the specific language governing permissions and
   8896     * limitations under the License.
   8897     */
   8898 
   8899    /*
   8900     * File: OP_INT_TO_SHORT.S
   8901     */
   8902 
   8903 /* File: x86-atom/unop.S */
   8904    /* Copyright (C) 2008 The Android Open Source Project
   8905     *
   8906     * Licensed under the Apache License, Version 2.0 (the "License");
   8907     * you may not use this file except in compliance with the License.
   8908     * You may obtain a copy of the License at
   8909     *
   8910     * http://www.apache.org/licenses/LICENSE-2.0
   8911     *
   8912     * Unless required by applicable law or agreed to in writing, software
   8913     * distributed under the License is distributed on an "AS IS" BASIS,
   8914     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8915     * See the License for the specific language governing permissions and
   8916     * limitations under the License.
   8917     */
   8918 
   8919    /*
   8920     * File: unop.S
   8921     *
   8922     * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
   8923     *       preinstr variable that together specify an instruction that
   8924     *       performs, for example, "%ecx = op %edx".
   8925     *
   8926     * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
   8927     *
   8928     * Description: Perform the identified unary operation on the source
   8929     *              register, storing the result in the destination register
   8930     *
   8931     * Format: B|A|op (12x)
   8932     *
   8933     * Syntax: op vA, vB
   8934     */
   8935 
   8936 
   8937     movl        rINST, %ecx             # %ecx<- BA+
   8938     shr         $4, %ecx               # %ecx<- B
   8939     and         $15, rINST             # rINST<- A
   8940     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   8941     GET_VREG    %ecx                    # %ecx<- vB
   8942     sal $16, %ecx                           # do operation part 1
   8943     sar $16, %ecx                              # do operation part 2
   8944     SET_VREG    %ecx, rINST             # vA<- result
   8945     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   8946 
   8947 
   8948 /* ------------------------------ */
   8949     .balign 64
   8950 .L_OP_ADD_INT: /* 0x90 */
   8951 /* File: x86-atom/OP_ADD_INT.S */
   8952    /* Copyright (C) 2008 The Android Open Source Project
   8953     *
   8954     * Licensed under the Apache License, Version 2.0 (the "License");
   8955     * you may not use this file except in compliance with the License.
   8956     * You may obtain a copy of the License at
   8957     *
   8958     * http://www.apache.org/licenses/LICENSE-2.0
   8959     *
   8960     * Unless required by applicable law or agreed to in writing, software
   8961     * distributed under the License is distributed on an "AS IS" BASIS,
   8962     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8963     * See the License for the specific language governing permissions and
   8964     * limitations under the License.
   8965     */
   8966 
   8967    /*
   8968     * File: OP_ADD_INT.S
   8969     */
   8970 
   8971 /* File: x86-atom/binop.S */
   8972    /* Copyright (C) 2008 The Android Open Source Project
   8973     *
   8974     * Licensed under the Apache License, Version 2.0 (the "License");
   8975     * you may not use this file except in compliance with the License.
   8976     * You may obtain a copy of the License at
   8977     *
   8978     * http://www.apache.org/licenses/LICENSE-2.0
   8979     *
   8980     * Unless required by applicable law or agreed to in writing, software
   8981     * distributed under the License is distributed on an "AS IS" BASIS,
   8982     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   8983     * See the License for the specific language governing permissions and
   8984     * limitations under the License.
   8985     */
   8986 
   8987    /*
   8988     * File: binop.S
   8989     *
   8990     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   8991     *       specify an instruction that performs "%ecx = %ecx op %edx"
   8992     *
   8993     * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
   8994     *
   8995     * Description: Perform a binary operation on two source registers
   8996     *              and store the result in a destination register.
   8997     *
   8998     * Format: AA|op CC|BB (23x)
   8999     *
   9000     * Syntax: op vAA, vBB, vCC
   9001     */
   9002 
   9003     FETCH_BB    1, %ecx                 # %ecx<- BB
   9004     FETCH_CC    1, %edx                 # %edx<- CC
   9005     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9006     GET_VREG    %ecx                    # %ecx<- vBB
   9007     GET_VREG    %edx                    # %edx<- vCC
   9008     addl     %edx, %ecx                              # %ecx<- vBB op vCC
   9009     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   9010     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9011 
   9012 
   9013 /* ------------------------------ */
   9014     .balign 64
   9015 .L_OP_SUB_INT: /* 0x91 */
   9016 /* File: x86-atom/OP_SUB_INT.S */
   9017    /* Copyright (C) 2008 The Android Open Source Project
   9018     *
   9019     * Licensed under the Apache License, Version 2.0 (the "License");
   9020     * you may not use this file except in compliance with the License.
   9021     * You may obtain a copy of the License at
   9022     *
   9023     * http://www.apache.org/licenses/LICENSE-2.0
   9024     *
   9025     * Unless required by applicable law or agreed to in writing, software
   9026     * distributed under the License is distributed on an "AS IS" BASIS,
   9027     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9028     * See the License for the specific language governing permissions and
   9029     * limitations under the License.
   9030     */
   9031 
   9032    /*
   9033     * File: OP_SUB_INT.S
   9034     */
   9035 
   9036 /* File: x86-atom/binop.S */
   9037    /* Copyright (C) 2008 The Android Open Source Project
   9038     *
   9039     * Licensed under the Apache License, Version 2.0 (the "License");
   9040     * you may not use this file except in compliance with the License.
   9041     * You may obtain a copy of the License at
   9042     *
   9043     * http://www.apache.org/licenses/LICENSE-2.0
   9044     *
   9045     * Unless required by applicable law or agreed to in writing, software
   9046     * distributed under the License is distributed on an "AS IS" BASIS,
   9047     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9048     * See the License for the specific language governing permissions and
   9049     * limitations under the License.
   9050     */
   9051 
   9052    /*
   9053     * File: binop.S
   9054     *
   9055     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9056     *       specify an instruction that performs "%ecx = %ecx op %edx"
   9057     *
   9058     * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
   9059     *
   9060     * Description: Perform a binary operation on two source registers
   9061     *              and store the result in a destination register.
   9062     *
   9063     * Format: AA|op CC|BB (23x)
   9064     *
   9065     * Syntax: op vAA, vBB, vCC
   9066     */
   9067 
   9068     FETCH_BB    1, %ecx                 # %ecx<- BB
   9069     FETCH_CC    1, %edx                 # %edx<- CC
   9070     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9071     GET_VREG    %ecx                    # %ecx<- vBB
   9072     GET_VREG    %edx                    # %edx<- vCC
   9073     subl     %edx, %ecx                              # %ecx<- vBB op vCC
   9074     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   9075     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9076 
   9077 
   9078 /* ------------------------------ */
   9079     .balign 64
   9080 .L_OP_MUL_INT: /* 0x92 */
   9081 /* File: x86-atom/OP_MUL_INT.S */
   9082    /* Copyright (C) 2008 The Android Open Source Project
   9083     *
   9084     * Licensed under the Apache License, Version 2.0 (the "License");
   9085     * you may not use this file except in compliance with the License.
   9086     * You may obtain a copy of the License at
   9087     *
   9088     * http://www.apache.org/licenses/LICENSE-2.0
   9089     *
   9090     * Unless required by applicable law or agreed to in writing, software
   9091     * distributed under the License is distributed on an "AS IS" BASIS,
   9092     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9093     * See the License for the specific language governing permissions and
   9094     * limitations under the License.
   9095     */
   9096 
   9097    /*
   9098     * File: OP_MUL_INT.S
   9099     */
   9100 
   9101 /* File: x86-atom/binop.S */
   9102    /* Copyright (C) 2008 The Android Open Source Project
   9103     *
   9104     * Licensed under the Apache License, Version 2.0 (the "License");
   9105     * you may not use this file except in compliance with the License.
   9106     * You may obtain a copy of the License at
   9107     *
   9108     * http://www.apache.org/licenses/LICENSE-2.0
   9109     *
   9110     * Unless required by applicable law or agreed to in writing, software
   9111     * distributed under the License is distributed on an "AS IS" BASIS,
   9112     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9113     * See the License for the specific language governing permissions and
   9114     * limitations under the License.
   9115     */
   9116 
   9117    /*
   9118     * File: binop.S
   9119     *
   9120     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9121     *       specify an instruction that performs "%ecx = %ecx op %edx"
   9122     *
   9123     * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
   9124     *
   9125     * Description: Perform a binary operation on two source registers
   9126     *              and store the result in a destination register.
   9127     *
   9128     * Format: AA|op CC|BB (23x)
   9129     *
   9130     * Syntax: op vAA, vBB, vCC
   9131     */
   9132 
   9133     FETCH_BB    1, %ecx                 # %ecx<- BB
   9134     FETCH_CC    1, %edx                 # %edx<- CC
   9135     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9136     GET_VREG    %ecx                    # %ecx<- vBB
   9137     GET_VREG    %edx                    # %edx<- vCC
   9138     imul     %edx, %ecx                              # %ecx<- vBB op vCC
   9139     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   9140     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9141 
   9142 
   9143 /* ------------------------------ */
   9144     .balign 64
   9145 .L_OP_DIV_INT: /* 0x93 */
   9146 /* File: x86-atom/OP_DIV_INT.S */
   9147    /* Copyright (C) 2008 The Android Open Source Project
   9148     *
   9149     * Licensed under the Apache License, Version 2.0 (the "License");
   9150     * you may not use this file except in compliance with the License.
   9151     * You may obtain a copy of the License at
   9152     *
   9153     * http://www.apache.org/licenses/LICENSE-2.0
   9154     *
   9155     * Unless required by applicable law or agreed to in writing, software
   9156     * distributed under the License is distributed on an "AS IS" BASIS,
   9157     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9158     * See the License for the specific language governing permissions and
   9159     * limitations under the License.
   9160     */
   9161 
   9162    /*
   9163     * File: OP_DIV_INT.S
   9164     */
   9165 
   9166 /* File: x86-atom/binopD.S */
   9167    /* Copyright (C) 2008 The Android Open Source Project
   9168     *
   9169     * Licensed under the Apache License, Version 2.0 (the "License");
   9170     * you may not use this file except in compliance with the License.
   9171     * You may obtain a copy of the License at
   9172     *
   9173     * http://www.apache.org/licenses/LICENSE-2.0
   9174     *
   9175     * Unless required by applicable law or agreed to in writing, software
   9176     * distributed under the License is distributed on an "AS IS" BASIS,
   9177     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9178     * See the License for the specific language governing permissions and
   9179     * limitations under the License.
   9180     */
   9181 
   9182    /*
   9183     * File: binopD.S
   9184     *
   9185     * Code: 32-bit integer divide operation. If "div" is set, the code
   9186     *       returns the quotient, else it returns the remainder.
   9187     *       Also, a divide-by-zero check is done.
   9188     *
   9189     * For: div-int, rem-int
   9190     *
   9191     * Description: Perform a binary operation on two source
   9192     *
   9193     * Format: AA|op CC|BB (23x)
   9194     *
   9195     * Syntax: op vAA, vBB, vCC
   9196     */
   9197 
   9198 
   9199     FETCH_BB    1, %eax                 # %eax<- BB
   9200     FETCH_CC    1, %ecx                 # %ecx<- CC
   9201     GET_VREG    %eax                    # %eax<- vBB
   9202     GET_VREG    %ecx                    # %ecx<- vCC
   9203     cmp         $0, %ecx               # check for divide by zero
   9204     je          common_errDivideByZero  # handle divide by zero
   9205     cmpl        $-1, %ecx              # handle -1 special case divide error
   9206     jne         .LOP_DIV_INT_noerror
   9207     cmpl        $0x80000000,%eax       # handle min int special case divide error
   9208     je         .LOP_DIV_INT_break
   9209 .LOP_DIV_INT_noerror:
   9210     cdq                                 # sign-extend %eax to %edx
   9211     idiv        %ecx                    # divide %edx:%eax by %ecx
   9212     .if  1
   9213     SET_VREG    %eax rINST              # vAA<- %eax (quotient)
   9214     .else
   9215     SET_VREG    %edx rINST              # vAA<- %edx (remainder)
   9216     .endif
   9217     jmp         .LOP_DIV_INT_break2
   9218 
   9219 
   9220 /* ------------------------------ */
   9221     .balign 64
   9222 .L_OP_REM_INT: /* 0x94 */
   9223 /* File: x86-atom/OP_REM_INT.S */
   9224    /* Copyright (C) 2008 The Android Open Source Project
   9225     *
   9226     * Licensed under the Apache License, Version 2.0 (the "License");
   9227     * you may not use this file except in compliance with the License.
   9228     * You may obtain a copy of the License at
   9229     *
   9230     * http://www.apache.org/licenses/LICENSE-2.0
   9231     *
   9232     * Unless required by applicable law or agreed to in writing, software
   9233     * distributed under the License is distributed on an "AS IS" BASIS,
   9234     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9235     * See the License for the specific language governing permissions and
   9236     * limitations under the License.
   9237     */
   9238 
   9239    /*
   9240     * File: OP_REM_INT.S
   9241     */
   9242 
   9243 /* File: x86-atom/binopD.S */
   9244    /* Copyright (C) 2008 The Android Open Source Project
   9245     *
   9246     * Licensed under the Apache License, Version 2.0 (the "License");
   9247     * you may not use this file except in compliance with the License.
   9248     * You may obtain a copy of the License at
   9249     *
   9250     * http://www.apache.org/licenses/LICENSE-2.0
   9251     *
   9252     * Unless required by applicable law or agreed to in writing, software
   9253     * distributed under the License is distributed on an "AS IS" BASIS,
   9254     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9255     * See the License for the specific language governing permissions and
   9256     * limitations under the License.
   9257     */
   9258 
   9259    /*
   9260     * File: binopD.S
   9261     *
   9262     * Code: 32-bit integer divide operation. If "div" is set, the code
   9263     *       returns the quotient, else it returns the remainder.
   9264     *       Also, a divide-by-zero check is done.
   9265     *
   9266     * For: div-int, rem-int
   9267     *
   9268     * Description: Perform a binary operation on two source
   9269     *
   9270     * Format: AA|op CC|BB (23x)
   9271     *
   9272     * Syntax: op vAA, vBB, vCC
   9273     */
   9274 
   9275 
   9276     FETCH_BB    1, %eax                 # %eax<- BB
   9277     FETCH_CC    1, %ecx                 # %ecx<- CC
   9278     GET_VREG    %eax                    # %eax<- vBB
   9279     GET_VREG    %ecx                    # %ecx<- vCC
   9280     cmp         $0, %ecx               # check for divide by zero
   9281     je          common_errDivideByZero  # handle divide by zero
   9282     cmpl        $-1, %ecx              # handle -1 special case divide error
   9283     jne         .LOP_REM_INT_noerror
   9284     cmpl        $0x80000000,%eax       # handle min int special case divide error
   9285     je         .LOP_REM_INT_break
   9286 .LOP_REM_INT_noerror:
   9287     cdq                                 # sign-extend %eax to %edx
   9288     idiv        %ecx                    # divide %edx:%eax by %ecx
   9289     .if  0
   9290     SET_VREG    %eax rINST              # vAA<- %eax (quotient)
   9291     .else
   9292     SET_VREG    %edx rINST              # vAA<- %edx (remainder)
   9293     .endif
   9294     jmp         .LOP_REM_INT_break2
   9295 
   9296 
   9297 /* ------------------------------ */
   9298     .balign 64
   9299 .L_OP_AND_INT: /* 0x95 */
   9300 /* File: x86-atom/OP_AND_INT.S */
   9301    /* Copyright (C) 2008 The Android Open Source Project
   9302     *
   9303     * Licensed under the Apache License, Version 2.0 (the "License");
   9304     * you may not use this file except in compliance with the License.
   9305     * You may obtain a copy of the License at
   9306     *
   9307     * http://www.apache.org/licenses/LICENSE-2.0
   9308     *
   9309     * Unless required by applicable law or agreed to in writing, software
   9310     * distributed under the License is distributed on an "AS IS" BASIS,
   9311     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9312     * See the License for the specific language governing permissions and
   9313     * limitations under the License.
   9314     */
   9315 
   9316    /*
   9317     * File: OP_AND_INT.S
   9318     */
   9319 
   9320 /* File: x86-atom/binop.S */
   9321    /* Copyright (C) 2008 The Android Open Source Project
   9322     *
   9323     * Licensed under the Apache License, Version 2.0 (the "License");
   9324     * you may not use this file except in compliance with the License.
   9325     * You may obtain a copy of the License at
   9326     *
   9327     * http://www.apache.org/licenses/LICENSE-2.0
   9328     *
   9329     * Unless required by applicable law or agreed to in writing, software
   9330     * distributed under the License is distributed on an "AS IS" BASIS,
   9331     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9332     * See the License for the specific language governing permissions and
   9333     * limitations under the License.
   9334     */
   9335 
   9336    /*
   9337     * File: binop.S
   9338     *
   9339     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9340     *       specify an instruction that performs "%ecx = %ecx op %edx"
   9341     *
   9342     * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
   9343     *
   9344     * Description: Perform a binary operation on two source registers
   9345     *              and store the result in a destination register.
   9346     *
   9347     * Format: AA|op CC|BB (23x)
   9348     *
   9349     * Syntax: op vAA, vBB, vCC
   9350     */
   9351 
   9352     FETCH_BB    1, %ecx                 # %ecx<- BB
   9353     FETCH_CC    1, %edx                 # %edx<- CC
   9354     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9355     GET_VREG    %ecx                    # %ecx<- vBB
   9356     GET_VREG    %edx                    # %edx<- vCC
   9357     andl     %edx, %ecx                              # %ecx<- vBB op vCC
   9358     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   9359     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9360 
   9361 
   9362 /* ------------------------------ */
   9363     .balign 64
   9364 .L_OP_OR_INT: /* 0x96 */
   9365 /* File: x86-atom/OP_OR_INT.S */
   9366    /* Copyright (C) 2008 The Android Open Source Project
   9367     *
   9368     * Licensed under the Apache License, Version 2.0 (the "License");
   9369     * you may not use this file except in compliance with the License.
   9370     * You may obtain a copy of the License at
   9371     *
   9372     * http://www.apache.org/licenses/LICENSE-2.0
   9373     *
   9374     * Unless required by applicable law or agreed to in writing, software
   9375     * distributed under the License is distributed on an "AS IS" BASIS,
   9376     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9377     * See the License for the specific language governing permissions and
   9378     * limitations under the License.
   9379     */
   9380 
   9381    /*
   9382     * File: OP_OR_INT.S
   9383     */
   9384 
   9385 /* File: x86-atom/binop.S */
   9386    /* Copyright (C) 2008 The Android Open Source Project
   9387     *
   9388     * Licensed under the Apache License, Version 2.0 (the "License");
   9389     * you may not use this file except in compliance with the License.
   9390     * You may obtain a copy of the License at
   9391     *
   9392     * http://www.apache.org/licenses/LICENSE-2.0
   9393     *
   9394     * Unless required by applicable law or agreed to in writing, software
   9395     * distributed under the License is distributed on an "AS IS" BASIS,
   9396     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9397     * See the License for the specific language governing permissions and
   9398     * limitations under the License.
   9399     */
   9400 
   9401    /*
   9402     * File: binop.S
   9403     *
   9404     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9405     *       specify an instruction that performs "%ecx = %ecx op %edx"
   9406     *
   9407     * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
   9408     *
   9409     * Description: Perform a binary operation on two source registers
   9410     *              and store the result in a destination register.
   9411     *
   9412     * Format: AA|op CC|BB (23x)
   9413     *
   9414     * Syntax: op vAA, vBB, vCC
   9415     */
   9416 
   9417     FETCH_BB    1, %ecx                 # %ecx<- BB
   9418     FETCH_CC    1, %edx                 # %edx<- CC
   9419     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9420     GET_VREG    %ecx                    # %ecx<- vBB
   9421     GET_VREG    %edx                    # %edx<- vCC
   9422     or %edx, %ecx                              # %ecx<- vBB op vCC
   9423     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   9424     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9425 
   9426 
   9427 /* ------------------------------ */
   9428     .balign 64
   9429 .L_OP_XOR_INT: /* 0x97 */
   9430 /* File: x86-atom/OP_XOR_INT.S */
   9431    /* Copyright (C) 2008 The Android Open Source Project
   9432     *
   9433     * Licensed under the Apache License, Version 2.0 (the "License");
   9434     * you may not use this file except in compliance with the License.
   9435     * You may obtain a copy of the License at
   9436     *
   9437     * http://www.apache.org/licenses/LICENSE-2.0
   9438     *
   9439     * Unless required by applicable law or agreed to in writing, software
   9440     * distributed under the License is distributed on an "AS IS" BASIS,
   9441     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9442     * See the License for the specific language governing permissions and
   9443     * limitations under the License.
   9444     */
   9445 
   9446    /*
   9447     * File: OP_XOR_INT.S
   9448     */
   9449 
   9450 /* File: x86-atom/binop.S */
   9451    /* Copyright (C) 2008 The Android Open Source Project
   9452     *
   9453     * Licensed under the Apache License, Version 2.0 (the "License");
   9454     * you may not use this file except in compliance with the License.
   9455     * You may obtain a copy of the License at
   9456     *
   9457     * http://www.apache.org/licenses/LICENSE-2.0
   9458     *
   9459     * Unless required by applicable law or agreed to in writing, software
   9460     * distributed under the License is distributed on an "AS IS" BASIS,
   9461     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9462     * See the License for the specific language governing permissions and
   9463     * limitations under the License.
   9464     */
   9465 
   9466    /*
   9467     * File: binop.S
   9468     *
   9469     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9470     *       specify an instruction that performs "%ecx = %ecx op %edx"
   9471     *
   9472     * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
   9473     *
   9474     * Description: Perform a binary operation on two source registers
   9475     *              and store the result in a destination register.
   9476     *
   9477     * Format: AA|op CC|BB (23x)
   9478     *
   9479     * Syntax: op vAA, vBB, vCC
   9480     */
   9481 
   9482     FETCH_BB    1, %ecx                 # %ecx<- BB
   9483     FETCH_CC    1, %edx                 # %edx<- CC
   9484     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9485     GET_VREG    %ecx                    # %ecx<- vBB
   9486     GET_VREG    %edx                    # %edx<- vCC
   9487     xor     %edx, %ecx                              # %ecx<- vBB op vCC
   9488     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   9489     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9490 
   9491 
   9492 /* ------------------------------ */
   9493     .balign 64
   9494 .L_OP_SHL_INT: /* 0x98 */
   9495 /* File: x86-atom/OP_SHL_INT.S */
   9496    /* Copyright (C) 2008 The Android Open Source Project
   9497     *
   9498     * Licensed under the Apache License, Version 2.0 (the "License");
   9499     * you may not use this file except in compliance with the License.
   9500     * You may obtain a copy of the License at
   9501     *
   9502     * http://www.apache.org/licenses/LICENSE-2.0
   9503     *
   9504     * Unless required by applicable law or agreed to in writing, software
   9505     * distributed under the License is distributed on an "AS IS" BASIS,
   9506     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9507     * See the License for the specific language governing permissions and
   9508     * limitations under the License.
   9509     */
   9510 
   9511    /*
   9512     * File: OP_SHL_INT.S
   9513     */
   9514 
   9515 /* File: x86-atom/binopS.S */
   9516    /* Copyright (C) 2008 The Android Open Source Project
   9517     *
   9518     * Licensed under the Apache License, Version 2.0 (the "License");
   9519     * you may not use this file except in compliance with the License.
   9520     * You may obtain a copy of the License at
   9521     *
   9522     * http://www.apache.org/licenses/LICENSE-2.0
   9523     *
   9524     * Unless required by applicable law or agreed to in writing, software
   9525     * distributed under the License is distributed on an "AS IS" BASIS,
   9526     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9527     * See the License for the specific language governing permissions and
   9528     * limitations under the License.
   9529     */
   9530 
   9531    /*
   9532     * File: binopS.S
   9533     *
   9534     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9535     *       specify an instruction that performs "%edx = %edx op %cl"
   9536     *
   9537     * For: shl-int, shr-int, ushr-int
   9538     *
   9539     * Description: Perform a binary operation on two source registers
   9540     *              and store the result in a destination register.
   9541     *
   9542     * Format: AA|op CC|BB (23x)
   9543     *
   9544     * Syntax: op vAA, vBB, vCC
   9545     */
   9546 
   9547     FETCH_BB    1, %edx                 # %edx<- BB
   9548     FETCH_CC    1, %ecx                 # %ecx<- CC
   9549     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9550     GET_VREG    %edx                    # %edx<- vBB
   9551     GET_VREG    %ecx                    # %ecx<- vCC
   9552     sal     %cl, %edx                              # %edx<- vBB op +CC
   9553     SET_VREG    %edx, rINST             # vAA<- %edx; result
   9554     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9555 
   9556 
   9557 /* ------------------------------ */
   9558     .balign 64
   9559 .L_OP_SHR_INT: /* 0x99 */
   9560 /* File: x86-atom/OP_SHR_INT.S */
   9561    /* Copyright (C) 2008 The Android Open Source Project
   9562     *
   9563     * Licensed under the Apache License, Version 2.0 (the "License");
   9564     * you may not use this file except in compliance with the License.
   9565     * You may obtain a copy of the License at
   9566     *
   9567     * http://www.apache.org/licenses/LICENSE-2.0
   9568     *
   9569     * Unless required by applicable law or agreed to in writing, software
   9570     * distributed under the License is distributed on an "AS IS" BASIS,
   9571     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9572     * See the License for the specific language governing permissions and
   9573     * limitations under the License.
   9574     */
   9575 
   9576    /*
   9577     * File: OP_SHR_INT.S
   9578     */
   9579 
   9580 /* File: x86-atom/binopS.S */
   9581    /* Copyright (C) 2008 The Android Open Source Project
   9582     *
   9583     * Licensed under the Apache License, Version 2.0 (the "License");
   9584     * you may not use this file except in compliance with the License.
   9585     * You may obtain a copy of the License at
   9586     *
   9587     * http://www.apache.org/licenses/LICENSE-2.0
   9588     *
   9589     * Unless required by applicable law or agreed to in writing, software
   9590     * distributed under the License is distributed on an "AS IS" BASIS,
   9591     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9592     * See the License for the specific language governing permissions and
   9593     * limitations under the License.
   9594     */
   9595 
   9596    /*
   9597     * File: binopS.S
   9598     *
   9599     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9600     *       specify an instruction that performs "%edx = %edx op %cl"
   9601     *
   9602     * For: shl-int, shr-int, ushr-int
   9603     *
   9604     * Description: Perform a binary operation on two source registers
   9605     *              and store the result in a destination register.
   9606     *
   9607     * Format: AA|op CC|BB (23x)
   9608     *
   9609     * Syntax: op vAA, vBB, vCC
   9610     */
   9611 
   9612     FETCH_BB    1, %edx                 # %edx<- BB
   9613     FETCH_CC    1, %ecx                 # %ecx<- CC
   9614     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9615     GET_VREG    %edx                    # %edx<- vBB
   9616     GET_VREG    %ecx                    # %ecx<- vCC
   9617     sar     %cl, %edx                              # %edx<- vBB op +CC
   9618     SET_VREG    %edx, rINST             # vAA<- %edx; result
   9619     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9620 
   9621 
   9622 /* ------------------------------ */
   9623     .balign 64
   9624 .L_OP_USHR_INT: /* 0x9a */
   9625 /* File: x86-atom/OP_USHR_INT.S */
   9626    /* Copyright (C) 2008 The Android Open Source Project
   9627     *
   9628     * Licensed under the Apache License, Version 2.0 (the "License");
   9629     * you may not use this file except in compliance with the License.
   9630     * You may obtain a copy of the License at
   9631     *
   9632     * http://www.apache.org/licenses/LICENSE-2.0
   9633     *
   9634     * Unless required by applicable law or agreed to in writing, software
   9635     * distributed under the License is distributed on an "AS IS" BASIS,
   9636     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9637     * See the License for the specific language governing permissions and
   9638     * limitations under the License.
   9639     */
   9640 
   9641    /*
   9642     * File: OP_USHR_INT.S
   9643     */
   9644 
   9645 /* File: x86-atom/binopS.S */
   9646    /* Copyright (C) 2008 The Android Open Source Project
   9647     *
   9648     * Licensed under the Apache License, Version 2.0 (the "License");
   9649     * you may not use this file except in compliance with the License.
   9650     * You may obtain a copy of the License at
   9651     *
   9652     * http://www.apache.org/licenses/LICENSE-2.0
   9653     *
   9654     * Unless required by applicable law or agreed to in writing, software
   9655     * distributed under the License is distributed on an "AS IS" BASIS,
   9656     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9657     * See the License for the specific language governing permissions and
   9658     * limitations under the License.
   9659     */
   9660 
   9661    /*
   9662     * File: binopS.S
   9663     *
   9664     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   9665     *       specify an instruction that performs "%edx = %edx op %cl"
   9666     *
   9667     * For: shl-int, shr-int, ushr-int
   9668     *
   9669     * Description: Perform a binary operation on two source registers
   9670     *              and store the result in a destination register.
   9671     *
   9672     * Format: AA|op CC|BB (23x)
   9673     *
   9674     * Syntax: op vAA, vBB, vCC
   9675     */
   9676 
   9677     FETCH_BB    1, %edx                 # %edx<- BB
   9678     FETCH_CC    1, %ecx                 # %ecx<- CC
   9679     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9680     GET_VREG    %edx                    # %edx<- vBB
   9681     GET_VREG    %ecx                    # %ecx<- vCC
   9682     shr     %cl, %edx                              # %edx<- vBB op +CC
   9683     SET_VREG    %edx, rINST             # vAA<- %edx; result
   9684     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9685 
   9686 
   9687 /* ------------------------------ */
   9688     .balign 64
   9689 .L_OP_ADD_LONG: /* 0x9b */
   9690 /* File: x86-atom/OP_ADD_LONG.S */
   9691    /* Copyright (C) 2008 The Android Open Source Project
   9692     *
   9693     * Licensed under the Apache License, Version 2.0 (the "License");
   9694     * you may not use this file except in compliance with the License.
   9695     * You may obtain a copy of the License at
   9696     *
   9697     * http://www.apache.org/licenses/LICENSE-2.0
   9698     *
   9699     * Unless required by applicable law or agreed to in writing, software
   9700     * distributed under the License is distributed on an "AS IS" BASIS,
   9701     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9702     * See the License for the specific language governing permissions and
   9703     * limitations under the License.
   9704     */
   9705 
   9706    /*
   9707     * File: OP_ADD_LONG.S
   9708     */
   9709 
   9710 /* File: x86-atom/binopWide.S */
   9711    /* Copyright (C) 2008 The Android Open Source Project
   9712     *
   9713     * Licensed under the Apache License, Version 2.0 (the "License");
   9714     * you may not use this file except in compliance with the License.
   9715     * You may obtain a copy of the License at
   9716     *
   9717     * http://www.apache.org/licenses/LICENSE-2.0
   9718     *
   9719     * Unless required by applicable law or agreed to in writing, software
   9720     * distributed under the License is distributed on an "AS IS" BASIS,
   9721     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9722     * See the License for the specific language governing permissions and
   9723     * limitations under the License.
   9724     */
   9725 
   9726    /*
   9727     * File: binopWide.S
   9728     *
   9729     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   9730     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   9731     *
   9732     * For: add-double, add-long, and-long, mul-double, or-long,
   9733     *      sub-double, sub-long, xor-long
   9734     *
   9735     * Description: Perform a binary operation on two source registers
   9736     *              and store the result in a destination register.
   9737     *
   9738     * Format: AA|op CC|BB (23x)
   9739     *
   9740     * Syntax: op vAA, vBB, vCC
   9741     */
   9742 
   9743     FETCH_BB    1, %ecx                 # %ecx<- BB
   9744     FETCH_CC    1, %edx                 # %edx<- CC
   9745     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9746     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   9747     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   9748     paddq   %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   9749     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   9750     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9751 
   9752 
   9753 /* ------------------------------ */
   9754     .balign 64
   9755 .L_OP_SUB_LONG: /* 0x9c */
   9756 /* File: x86-atom/OP_SUB_LONG.S */
   9757    /* Copyright (C) 2008 The Android Open Source Project
   9758     *
   9759     * Licensed under the Apache License, Version 2.0 (the "License");
   9760     * you may not use this file except in compliance with the License.
   9761     * You may obtain a copy of the License at
   9762     *
   9763     * http://www.apache.org/licenses/LICENSE-2.0
   9764     *
   9765     * Unless required by applicable law or agreed to in writing, software
   9766     * distributed under the License is distributed on an "AS IS" BASIS,
   9767     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9768     * See the License for the specific language governing permissions and
   9769     * limitations under the License.
   9770     */
   9771 
   9772    /*
   9773     * File: OP_SUB_LONG.S
   9774     */
   9775 
   9776 /* File: x86-atom/binopWide.S */
   9777    /* Copyright (C) 2008 The Android Open Source Project
   9778     *
   9779     * Licensed under the Apache License, Version 2.0 (the "License");
   9780     * you may not use this file except in compliance with the License.
   9781     * You may obtain a copy of the License at
   9782     *
   9783     * http://www.apache.org/licenses/LICENSE-2.0
   9784     *
   9785     * Unless required by applicable law or agreed to in writing, software
   9786     * distributed under the License is distributed on an "AS IS" BASIS,
   9787     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9788     * See the License for the specific language governing permissions and
   9789     * limitations under the License.
   9790     */
   9791 
   9792    /*
   9793     * File: binopWide.S
   9794     *
   9795     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   9796     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   9797     *
   9798     * For: add-double, add-long, and-long, mul-double, or-long,
   9799     *      sub-double, sub-long, xor-long
   9800     *
   9801     * Description: Perform a binary operation on two source registers
   9802     *              and store the result in a destination register.
   9803     *
   9804     * Format: AA|op CC|BB (23x)
   9805     *
   9806     * Syntax: op vAA, vBB, vCC
   9807     */
   9808 
   9809     FETCH_BB    1, %ecx                 # %ecx<- BB
   9810     FETCH_CC    1, %edx                 # %edx<- CC
   9811     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   9812     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   9813     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   9814     psubq    %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   9815     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   9816     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   9817 
   9818 
   9819 /* ------------------------------ */
   9820     .balign 64
   9821 .L_OP_MUL_LONG: /* 0x9d */
   9822 /* File: x86-atom/OP_MUL_LONG.S */
   9823    /* Copyright (C) 2008 The Android Open Source Project
   9824     *
   9825     * Licensed under the Apache License, Version 2.0 (the "License");
   9826     * you may not use this file except in compliance with the License.
   9827     * You may obtain a copy of the License at
   9828     *
   9829     * http://www.apache.org/licenses/LICENSE-2.0
   9830     *
   9831     * Unless required by applicable law or agreed to in writing, software
   9832     * distributed under the License is distributed on an "AS IS" BASIS,
   9833     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9834     * See the License for the specific language governing permissions and
   9835     * limitations under the License.
   9836     */
   9837 
   9838    /*
   9839     * File: OP_MUL_LONG.S
   9840     *
   9841     * Code: 64-bit integer multiply
   9842     *
   9843     * For: mul-long
   9844     *
   9845     * Description: Multiply two source registers and store the
   9846     *              result in a destination register.
   9847     *
   9848     * Format: AA|op CC|BB (23x)
   9849     *
   9850     * Syntax: op vAA, vBB, vCC
   9851     */
   9852 
   9853    /*
   9854     * Signed 64-bit integer multiply.
   9855     *
   9856     * Consider WXxYZ (r1r0 x r3r2) with a long multiply:
   9857     *        WX
   9858     *      x YZ
   9859     *  --------
   9860     *     ZW ZX
   9861     *  YW YX
   9862     *
   9863     * The low word of the result holds ZX, the high word holds
   9864     * (ZW+YX) + (the high overflow from ZX).  YW doesn't matter because
   9865     * it doesn't fit in the low 64 bits.
   9866     */
   9867 
   9868     movl        rINST, -4(%esp)         # -4(%esp)<- AA+
   9869     FETCH_BB    1, rINST                # rINST<- BB
   9870     FETCH_CC    1, %edx                 # %edx<- CC
   9871     jmp         .LOP_MUL_LONG_finish
   9872 
   9873 /* ------------------------------ */
   9874     .balign 64
   9875 .L_OP_DIV_LONG: /* 0x9e */
   9876 /* File: x86-atom/OP_DIV_LONG.S */
   9877    /* Copyright (C) 2008 The Android Open Source Project
   9878     *
   9879     * Licensed under the Apache License, Version 2.0 (the "License");
   9880     * you may not use this file except in compliance with the License.
   9881     * You may obtain a copy of the License at
   9882     *
   9883     * http://www.apache.org/licenses/LICENSE-2.0
   9884     *
   9885     * Unless required by applicable law or agreed to in writing, software
   9886     * distributed under the License is distributed on an "AS IS" BASIS,
   9887     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9888     * See the License for the specific language governing permissions and
   9889     * limitations under the License.
   9890     */
   9891 
   9892    /*
   9893     * File: OP_DIV_LONG.S
   9894     */
   9895 
   9896 /* File: x86-atom/binopDivRemLong.S */
   9897    /* Copyright (C) 2008 The Android Open Source Project
   9898     *
   9899     * Licensed under the Apache License, Version 2.0 (the "License");
   9900     * you may not use this file except in compliance with the License.
   9901     * You may obtain a copy of the License at
   9902     *
   9903     * http://www.apache.org/licenses/LICENSE-2.0
   9904     *
   9905     * Unless required by applicable law or agreed to in writing, software
   9906     * distributed under the License is distributed on an "AS IS" BASIS,
   9907     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9908     * See the License for the specific language governing permissions and
   9909     * limitations under the License.
   9910     */
   9911 
   9912    /*
   9913     * File: binopDivRemLong.S
   9914     *
   9915     * Code: 64-bit long divide operation. Variable
   9916     *       "func" defines the function called to do the operation.
   9917     *
   9918     * For: div-long, rem-long
   9919     *
   9920     * Description: Perform a binary operation on two source registers
   9921     *              and store the result in a destination register.
   9922     *
   9923     * Format: AA|op CC|BB (23x)
   9924     *
   9925     * Syntax: op vAA, vBB, vCC
   9926     */
   9927 
   9928 
   9929     FETCH_CC    1, %edx                 # %edx<- CC
   9930     movl        (rFP, %edx, 4), %eax    # %eax<- vCC
   9931     movl        4(rFP, %edx, 4), %ecx   # %ecx<- vCC+1
   9932     movl        %eax, -8(%esp)          # push arg vCC
   9933     or          %ecx, %eax              # check for divide by zero
   9934     je          common_errDivideByZero  # handle divide by zero
   9935     FETCH_BB    1, %edx                 # %edx<- BB
   9936     movl        %ecx, -4(%esp)          # push arg vCC+1
   9937     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vBB,vBB+1
   9938     jmp         .LOP_DIV_LONG_finish
   9939 
   9940 
   9941 /* ------------------------------ */
   9942     .balign 64
   9943 .L_OP_REM_LONG: /* 0x9f */
   9944 /* File: x86-atom/OP_REM_LONG.S */
   9945    /* Copyright (C) 2008 The Android Open Source Project
   9946     *
   9947     * Licensed under the Apache License, Version 2.0 (the "License");
   9948     * you may not use this file except in compliance with the License.
   9949     * You may obtain a copy of the License at
   9950     *
   9951     * http://www.apache.org/licenses/LICENSE-2.0
   9952     *
   9953     * Unless required by applicable law or agreed to in writing, software
   9954     * distributed under the License is distributed on an "AS IS" BASIS,
   9955     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9956     * See the License for the specific language governing permissions and
   9957     * limitations under the License.
   9958     */
   9959 
   9960    /*
   9961     * File: OP_REM_LONG.S
   9962     */
   9963 
   9964 /* File: x86-atom/binopDivRemLong.S */
   9965    /* Copyright (C) 2008 The Android Open Source Project
   9966     *
   9967     * Licensed under the Apache License, Version 2.0 (the "License");
   9968     * you may not use this file except in compliance with the License.
   9969     * You may obtain a copy of the License at
   9970     *
   9971     * http://www.apache.org/licenses/LICENSE-2.0
   9972     *
   9973     * Unless required by applicable law or agreed to in writing, software
   9974     * distributed under the License is distributed on an "AS IS" BASIS,
   9975     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   9976     * See the License for the specific language governing permissions and
   9977     * limitations under the License.
   9978     */
   9979 
   9980    /*
   9981     * File: binopDivRemLong.S
   9982     *
   9983     * Code: 64-bit long divide operation. Variable
   9984     *       "func" defines the function called to do the operation.
   9985     *
   9986     * For: div-long, rem-long
   9987     *
   9988     * Description: Perform a binary operation on two source registers
   9989     *              and store the result in a destination register.
   9990     *
   9991     * Format: AA|op CC|BB (23x)
   9992     *
   9993     * Syntax: op vAA, vBB, vCC
   9994     */
   9995 
   9996 
   9997     FETCH_CC    1, %edx                 # %edx<- CC
   9998     movl        (rFP, %edx, 4), %eax    # %eax<- vCC
   9999     movl        4(rFP, %edx, 4), %ecx   # %ecx<- vCC+1
   10000     movl        %eax, -8(%esp)          # push arg vCC
   10001     or          %ecx, %eax              # check for divide by zero
   10002     je          common_errDivideByZero  # handle divide by zero
   10003     FETCH_BB    1, %edx                 # %edx<- BB
   10004     movl        %ecx, -4(%esp)          # push arg vCC+1
   10005     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vBB,vBB+1
   10006     jmp         .LOP_REM_LONG_finish
   10007 
   10008 
   10009 /* ------------------------------ */
   10010     .balign 64
   10011 .L_OP_AND_LONG: /* 0xa0 */
   10012 /* File: x86-atom/OP_AND_LONG.S */
   10013    /* Copyright (C) 2008 The Android Open Source Project
   10014     *
   10015     * Licensed under the Apache License, Version 2.0 (the "License");
   10016     * you may not use this file except in compliance with the License.
   10017     * You may obtain a copy of the License at
   10018     *
   10019     * http://www.apache.org/licenses/LICENSE-2.0
   10020     *
   10021     * Unless required by applicable law or agreed to in writing, software
   10022     * distributed under the License is distributed on an "AS IS" BASIS,
   10023     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10024     * See the License for the specific language governing permissions and
   10025     * limitations under the License.
   10026     */
   10027 
   10028    /*
   10029     * File: OP_AND_LONG.S
   10030     */
   10031 
   10032 /* File: x86-atom/binopWide.S */
   10033    /* Copyright (C) 2008 The Android Open Source Project
   10034     *
   10035     * Licensed under the Apache License, Version 2.0 (the "License");
   10036     * you may not use this file except in compliance with the License.
   10037     * You may obtain a copy of the License at
   10038     *
   10039     * http://www.apache.org/licenses/LICENSE-2.0
   10040     *
   10041     * Unless required by applicable law or agreed to in writing, software
   10042     * distributed under the License is distributed on an "AS IS" BASIS,
   10043     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10044     * See the License for the specific language governing permissions and
   10045     * limitations under the License.
   10046     */
   10047 
   10048    /*
   10049     * File: binopWide.S
   10050     *
   10051     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   10052     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10053     *
   10054     * For: add-double, add-long, and-long, mul-double, or-long,
   10055     *      sub-double, sub-long, xor-long
   10056     *
   10057     * Description: Perform a binary operation on two source registers
   10058     *              and store the result in a destination register.
   10059     *
   10060     * Format: AA|op CC|BB (23x)
   10061     *
   10062     * Syntax: op vAA, vBB, vCC
   10063     */
   10064 
   10065     FETCH_BB    1, %ecx                 # %ecx<- BB
   10066     FETCH_CC    1, %edx                 # %edx<- CC
   10067     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10068     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   10069     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10070     pand   %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10071     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   10072     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10073 
   10074 
   10075 /* ------------------------------ */
   10076     .balign 64
   10077 .L_OP_OR_LONG: /* 0xa1 */
   10078 /* File: x86-atom/OP_OR_LONG.S */
   10079    /* Copyright (C) 2008 The Android Open Source Project
   10080     *
   10081     * Licensed under the Apache License, Version 2.0 (the "License");
   10082     * you may not use this file except in compliance with the License.
   10083     * You may obtain a copy of the License at
   10084     *
   10085     * http://www.apache.org/licenses/LICENSE-2.0
   10086     *
   10087     * Unless required by applicable law or agreed to in writing, software
   10088     * distributed under the License is distributed on an "AS IS" BASIS,
   10089     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10090     * See the License for the specific language governing permissions and
   10091     * limitations under the License.
   10092     */
   10093 
   10094    /*
   10095     * File: OP_OR_LONG.S
   10096     */
   10097 
   10098 /* File: x86-atom/binopWide.S */
   10099    /* Copyright (C) 2008 The Android Open Source Project
   10100     *
   10101     * Licensed under the Apache License, Version 2.0 (the "License");
   10102     * you may not use this file except in compliance with the License.
   10103     * You may obtain a copy of the License at
   10104     *
   10105     * http://www.apache.org/licenses/LICENSE-2.0
   10106     *
   10107     * Unless required by applicable law or agreed to in writing, software
   10108     * distributed under the License is distributed on an "AS IS" BASIS,
   10109     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10110     * See the License for the specific language governing permissions and
   10111     * limitations under the License.
   10112     */
   10113 
   10114    /*
   10115     * File: binopWide.S
   10116     *
   10117     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   10118     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10119     *
   10120     * For: add-double, add-long, and-long, mul-double, or-long,
   10121     *      sub-double, sub-long, xor-long
   10122     *
   10123     * Description: Perform a binary operation on two source registers
   10124     *              and store the result in a destination register.
   10125     *
   10126     * Format: AA|op CC|BB (23x)
   10127     *
   10128     * Syntax: op vAA, vBB, vCC
   10129     */
   10130 
   10131     FETCH_BB    1, %ecx                 # %ecx<- BB
   10132     FETCH_CC    1, %edx                 # %edx<- CC
   10133     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10134     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   10135     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10136     por %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10137     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   10138     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10139 
   10140 
   10141 /* ------------------------------ */
   10142     .balign 64
   10143 .L_OP_XOR_LONG: /* 0xa2 */
   10144 /* File: x86-atom/OP_XOR_LONG.S */
   10145    /* Copyright (C) 2008 The Android Open Source Project
   10146     *
   10147     * Licensed under the Apache License, Version 2.0 (the "License");
   10148     * you may not use this file except in compliance with the License.
   10149     * You may obtain a copy of the License at
   10150     *
   10151     * http://www.apache.org/licenses/LICENSE-2.0
   10152     *
   10153     * Unless required by applicable law or agreed to in writing, software
   10154     * distributed under the License is distributed on an "AS IS" BASIS,
   10155     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10156     * See the License for the specific language governing permissions and
   10157     * limitations under the License.
   10158     */
   10159 
   10160    /*
   10161     * File: OP_XOR_LONG.S
   10162     */
   10163 
   10164 /* File: x86-atom/binopWide.S */
   10165    /* Copyright (C) 2008 The Android Open Source Project
   10166     *
   10167     * Licensed under the Apache License, Version 2.0 (the "License");
   10168     * you may not use this file except in compliance with the License.
   10169     * You may obtain a copy of the License at
   10170     *
   10171     * http://www.apache.org/licenses/LICENSE-2.0
   10172     *
   10173     * Unless required by applicable law or agreed to in writing, software
   10174     * distributed under the License is distributed on an "AS IS" BASIS,
   10175     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10176     * See the License for the specific language governing permissions and
   10177     * limitations under the License.
   10178     */
   10179 
   10180    /*
   10181     * File: binopWide.S
   10182     *
   10183     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   10184     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10185     *
   10186     * For: add-double, add-long, and-long, mul-double, or-long,
   10187     *      sub-double, sub-long, xor-long
   10188     *
   10189     * Description: Perform a binary operation on two source registers
   10190     *              and store the result in a destination register.
   10191     *
   10192     * Format: AA|op CC|BB (23x)
   10193     *
   10194     * Syntax: op vAA, vBB, vCC
   10195     */
   10196 
   10197     FETCH_BB    1, %ecx                 # %ecx<- BB
   10198     FETCH_CC    1, %edx                 # %edx<- CC
   10199     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10200     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   10201     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10202     pxor   %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10203     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   10204     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10205 
   10206 
   10207 /* ------------------------------ */
   10208     .balign 64
   10209 .L_OP_SHL_LONG: /* 0xa3 */
   10210 /* File: x86-atom/OP_SHL_LONG.S */
   10211    /* Copyright (C) 2008 The Android Open Source Project
   10212     *
   10213     * Licensed under the Apache License, Version 2.0 (the "License");
   10214     * you may not use this file except in compliance with the License.
   10215     * You may obtain a copy of the License at
   10216     *
   10217     * http://www.apache.org/licenses/LICENSE-2.0
   10218     *
   10219     * Unless required by applicable law or agreed to in writing, software
   10220     * distributed under the License is distributed on an "AS IS" BASIS,
   10221     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10222     * See the License for the specific language governing permissions and
   10223     * limitations under the License.
   10224     */
   10225 
   10226    /*
   10227     * File: OP_SHL_LONG.S
   10228     *
   10229     * Code: Performs a shift left long. Uses no substitutions.
   10230     *
   10231     * For: shl-long
   10232     *
   10233     * Description: Perform a binary shift operation using two source registers
   10234     *              where one is the shift amount and the other is the value to shift.
   10235     *              Store the result in a destination register.
   10236     *
   10237     * Format: AA|op CC|BB (23x)
   10238     *
   10239     * Syntax: op vAA, vBB, vCC
   10240     */
   10241 
   10242     FETCH_CC    1, %eax                 # %eax<- CC
   10243     FETCH_BB    1, %edx                 # %edx<- BB
   10244     movq        .LshiftMask, %xmm2      # %xmm2<- mask for the shift bits
   10245     movss       (rFP, %eax, 4), %xmm0   # %xmm0<- vCC
   10246     pand        %xmm2, %xmm0            # %xmm0<- masked shift bits
   10247     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vBB
   10248     psllq       %xmm0, %xmm1            # %xmm1<- shifted vBB
   10249     movq        %xmm1, (rFP, rINST, 4)  # vAA<- shifted vBB
   10250     FINISH      2                       # jump to next instruction
   10251 
   10252 /* ------------------------------ */
   10253     .balign 64
   10254 .L_OP_SHR_LONG: /* 0xa4 */
   10255 /* File: x86-atom/OP_SHR_LONG.S */
   10256    /* Copyright (C) 2008 The Android Open Source Project
   10257     *
   10258     * Licensed under the Apache License, Version 2.0 (the "License");
   10259     * you may not use this file except in compliance with the License.
   10260     * You may obtain a copy of the License at
   10261     *
   10262     * http://www.apache.org/licenses/LICENSE-2.0
   10263     *
   10264     * Unless required by applicable law or agreed to in writing, software
   10265     * distributed under the License is distributed on an "AS IS" BASIS,
   10266     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10267     * See the License for the specific language governing permissions and
   10268     * limitations under the License.
   10269     */
   10270 
   10271    /*
   10272     * File: OP_SHR_LONG.S
   10273     *
   10274     * Code: Performs a shift right long
   10275     *
   10276     * For: shl-long
   10277     *
   10278     * Description: Perform a binary shift operation using two source registers
   10279     *              where one is the shift amount and the other is the value to shift.
   10280     *              Store the result in a destination register.
   10281     *
   10282     * Format: AA|op CC|BB (23x)
   10283     *
   10284     * Syntax: op vAA, vBB, vCC
   10285     */
   10286 
   10287     FETCH_BB    1, %edx                 # %edx<- BB
   10288     FETCH_CC    1, %eax                 # %eax<- CC
   10289     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vBB
   10290     movss       (rFP, %eax, 4), %xmm0   # %xmm0<- vCC
   10291     movq        .LshiftMask, %xmm2
   10292     pand        %xmm2, %xmm0            # %xmm0<- masked for the shift bits
   10293     psrlq       %xmm0, %xmm1            # %xmm1<- shifted vBB
   10294     cmpl        $0, 4(rFP, %edx, 4)    # check if we need to consider sign
   10295     jl          .LOP_SHR_LONG_finish      # consider sign
   10296     jmp         .LOP_SHR_LONG_final       # sign is fine, finish
   10297 
   10298 /* ------------------------------ */
   10299     .balign 64
   10300 .L_OP_USHR_LONG: /* 0xa5 */
   10301 /* File: x86-atom/OP_USHR_LONG.S */
   10302    /* Copyright (C) 2008 The Android Open Source Project
   10303     *
   10304     * Licensed under the Apache License, Version 2.0 (the "License");
   10305     * you may not use this file except in compliance with the License.
   10306     * You may obtain a copy of the License at
   10307     *
   10308     * http://www.apache.org/licenses/LICENSE-2.0
   10309     *
   10310     * Unless required by applicable law or agreed to in writing, software
   10311     * distributed under the License is distributed on an "AS IS" BASIS,
   10312     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10313     * See the License for the specific language governing permissions and
   10314     * limitations under the License.
   10315     */
   10316 
   10317    /*
   10318     * File: OP_USHR_LONG.S
   10319     *
   10320     * Code: Performs an unsigned shift right long operation. Uses no substitutions.
   10321     *
   10322     * For: ushr-long
   10323     *
   10324     * Description: Perform a binary shift operation using two source registers
   10325     *              where one is the shift amount and the other is the value to shift.
   10326     *
   10327     * Format: AA|op CC|BB (23x)
   10328     *
   10329     * Syntax: op vAA, vBB, vCC
   10330     */
   10331 
   10332     FETCH_CC    1, %eax                 # %eax<- CC
   10333     FETCH_BB    1, %edx                 # %edx<- BB
   10334     movsd        .LshiftMask, %xmm2     # %xmm2<- mask for the shift bits
   10335     movss       (rFP, %eax, 4), %xmm0   # %xmm0<- vCC
   10336     pand        %xmm2, %xmm0            # %xmm0<- masked shift bits
   10337     movsd       (rFP, %edx, 4), %xmm1   # %xmm1<- vBB
   10338     psrlq       %xmm0, %xmm1            # %xmm1<- shifted vBB
   10339     movsd       %xmm1, (rFP, rINST, 4)  # vAA<- shifted vBB
   10340     FINISH      2                       # jump to next instruction
   10341 
   10342 /* ------------------------------ */
   10343     .balign 64
   10344 .L_OP_ADD_FLOAT: /* 0xa6 */
   10345 /* File: x86-atom/OP_ADD_FLOAT.S */
   10346    /* Copyright (C) 2008 The Android Open Source Project
   10347     *
   10348     * Licensed under the Apache License, Version 2.0 (the "License");
   10349     * you may not use this file except in compliance with the License.
   10350     * You may obtain a copy of the License at
   10351     *
   10352     * http://www.apache.org/licenses/LICENSE-2.0
   10353     *
   10354     * Unless required by applicable law or agreed to in writing, software
   10355     * distributed under the License is distributed on an "AS IS" BASIS,
   10356     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10357     * See the License for the specific language governing permissions and
   10358     * limitations under the License.
   10359     */
   10360 
   10361    /*
   10362     * File: OP_ADD_FLOAT.S
   10363     */
   10364 
   10365 /* File: x86-atom/binopF.S */
   10366    /* Copyright (C) 2008 The Android Open Source Project
   10367     *
   10368     * Licensed under the Apache License, Version 2.0 (the "License");
   10369     * you may not use this file except in compliance with the License.
   10370     * You may obtain a copy of the License at
   10371     *
   10372     * http://www.apache.org/licenses/LICENSE-2.0
   10373     *
   10374     * Unless required by applicable law or agreed to in writing, software
   10375     * distributed under the License is distributed on an "AS IS" BASIS,
   10376     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10377     * See the License for the specific language governing permissions and
   10378     * limitations under the License.
   10379     */
   10380 
   10381    /*
   10382     * File: binopF.S
   10383     *
   10384     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   10385     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10386     *
   10387     * For: add-float, mul-float, sub-float
   10388     *
   10389     * Description: Perform a binary operation on two source registers
   10390     *              and store the result in a destination register.
   10391     *
   10392     * Format: AA|op CC|BB (23x)
   10393     *
   10394     * Syntax: op vAA, vBB, vCC
   10395     */
   10396 
   10397     FETCH_BB    1, %ecx                 # %ecx<- BB
   10398     FETCH_CC    1, %edx                 # %edx<- CC
   10399     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10400     movss       (rFP, %ecx, 4), %xmm0   # %xmm0<-vBB
   10401     movss       (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10402     addss     %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10403     movss       %xmm0, (rFP, rINST, 4)  # vAA<- %xmm0; result
   10404     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10405 
   10406 
   10407 /* ------------------------------ */
   10408     .balign 64
   10409 .L_OP_SUB_FLOAT: /* 0xa7 */
   10410 /* File: x86-atom/OP_SUB_FLOAT.S */
   10411    /* Copyright (C) 2008 The Android Open Source Project
   10412     *
   10413     * Licensed under the Apache License, Version 2.0 (the "License");
   10414     * you may not use this file except in compliance with the License.
   10415     * You may obtain a copy of the License at
   10416     *
   10417     * http://www.apache.org/licenses/LICENSE-2.0
   10418     *
   10419     * Unless required by applicable law or agreed to in writing, software
   10420     * distributed under the License is distributed on an "AS IS" BASIS,
   10421     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10422     * See the License for the specific language governing permissions and
   10423     * limitations under the License.
   10424     */
   10425 
   10426    /*
   10427     * File: OP_SUB_FLOAT.S
   10428     */
   10429 
   10430 /* File: x86-atom/binopF.S */
   10431    /* Copyright (C) 2008 The Android Open Source Project
   10432     *
   10433     * Licensed under the Apache License, Version 2.0 (the "License");
   10434     * you may not use this file except in compliance with the License.
   10435     * You may obtain a copy of the License at
   10436     *
   10437     * http://www.apache.org/licenses/LICENSE-2.0
   10438     *
   10439     * Unless required by applicable law or agreed to in writing, software
   10440     * distributed under the License is distributed on an "AS IS" BASIS,
   10441     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10442     * See the License for the specific language governing permissions and
   10443     * limitations under the License.
   10444     */
   10445 
   10446    /*
   10447     * File: binopF.S
   10448     *
   10449     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   10450     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10451     *
   10452     * For: add-float, mul-float, sub-float
   10453     *
   10454     * Description: Perform a binary operation on two source registers
   10455     *              and store the result in a destination register.
   10456     *
   10457     * Format: AA|op CC|BB (23x)
   10458     *
   10459     * Syntax: op vAA, vBB, vCC
   10460     */
   10461 
   10462     FETCH_BB    1, %ecx                 # %ecx<- BB
   10463     FETCH_CC    1, %edx                 # %edx<- CC
   10464     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10465     movss       (rFP, %ecx, 4), %xmm0   # %xmm0<-vBB
   10466     movss       (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10467     subss     %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10468     movss       %xmm0, (rFP, rINST, 4)  # vAA<- %xmm0; result
   10469     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10470 
   10471 
   10472 /* ------------------------------ */
   10473     .balign 64
   10474 .L_OP_MUL_FLOAT: /* 0xa8 */
   10475 /* File: x86-atom/OP_MUL_FLOAT.S */
   10476    /* Copyright (C) 2008 The Android Open Source Project
   10477     *
   10478     * Licensed under the Apache License, Version 2.0 (the "License");
   10479     * you may not use this file except in compliance with the License.
   10480     * You may obtain a copy of the License at
   10481     *
   10482     * http://www.apache.org/licenses/LICENSE-2.0
   10483     *
   10484     * Unless required by applicable law or agreed to in writing, software
   10485     * distributed under the License is distributed on an "AS IS" BASIS,
   10486     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10487     * See the License for the specific language governing permissions and
   10488     * limitations under the License.
   10489     */
   10490 
   10491    /*
   10492     * File: OP_MUL_FLOAT.S
   10493     */
   10494 
   10495 /* File: x86-atom/binopF.S */
   10496    /* Copyright (C) 2008 The Android Open Source Project
   10497     *
   10498     * Licensed under the Apache License, Version 2.0 (the "License");
   10499     * you may not use this file except in compliance with the License.
   10500     * You may obtain a copy of the License at
   10501     *
   10502     * http://www.apache.org/licenses/LICENSE-2.0
   10503     *
   10504     * Unless required by applicable law or agreed to in writing, software
   10505     * distributed under the License is distributed on an "AS IS" BASIS,
   10506     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10507     * See the License for the specific language governing permissions and
   10508     * limitations under the License.
   10509     */
   10510 
   10511    /*
   10512     * File: binopF.S
   10513     *
   10514     * Code: Generic 32-bit binary operation.  Provides an "instr" line to
   10515     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10516     *
   10517     * For: add-float, mul-float, sub-float
   10518     *
   10519     * Description: Perform a binary operation on two source registers
   10520     *              and store the result in a destination register.
   10521     *
   10522     * Format: AA|op CC|BB (23x)
   10523     *
   10524     * Syntax: op vAA, vBB, vCC
   10525     */
   10526 
   10527     FETCH_BB    1, %ecx                 # %ecx<- BB
   10528     FETCH_CC    1, %edx                 # %edx<- CC
   10529     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10530     movss       (rFP, %ecx, 4), %xmm0   # %xmm0<-vBB
   10531     movss       (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10532     mulss %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10533     movss       %xmm0, (rFP, rINST, 4)  # vAA<- %xmm0; result
   10534     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10535 
   10536 
   10537 /* ------------------------------ */
   10538     .balign 64
   10539 .L_OP_DIV_FLOAT: /* 0xa9 */
   10540 /* File: x86-atom/OP_DIV_FLOAT.S */
   10541    /* Copyright (C) 2008 The Android Open Source Project
   10542     *
   10543     * Licensed under the Apache License, Version 2.0 (the "License");
   10544     * you may not use this file except in compliance with the License.
   10545     * You may obtain a copy of the License at
   10546     *
   10547     * http://www.apache.org/licenses/LICENSE-2.0
   10548     *
   10549     * Unless required by applicable law or agreed to in writing, software
   10550     * distributed under the License is distributed on an "AS IS" BASIS,
   10551     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10552     * See the License for the specific language governing permissions and
   10553     * limitations under the License.
   10554     */
   10555 
   10556    /*
   10557     * File: OP_DIV_FLOAT.S
   10558     *
   10559     * Code: Divides floats. Uses no substitutions.
   10560     *
   10561     * For: div-float
   10562     *
   10563     * Description: Divide operation on two source registers, storing
   10564     *              the result in a destiniation register
   10565     *
   10566     * Format: AA|op CC|BB (23x)
   10567     *
   10568     * Syntax: op vAA, vBB, vCC
   10569     */
   10570 
   10571     FETCH_BB    1, %eax                 # %eax<- BB
   10572     FETCH_CC    1, %ecx                 # %ecx<- CC
   10573     flds        (rFP, %eax, 4)          # floating point stack vBB
   10574     fdivs       (rFP, %ecx, 4)          # divide double; vBB/vCC
   10575     fstps       (rFP, rINST, 4)         # vAA<- result
   10576     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10577     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10578 
   10579 /* ------------------------------ */
   10580     .balign 64
   10581 .L_OP_REM_FLOAT: /* 0xaa */
   10582 /* File: x86-atom/OP_REM_FLOAT.S */
   10583    /* Copyright (C) 2008 The Android Open Source Project
   10584     *
   10585     * Licensed under the Apache License, Version 2.0 (the "License");
   10586     * you may not use this file except in compliance with the License.
   10587     * You may obtain a copy of the License at
   10588     *
   10589     * http://www.apache.org/licenses/LICENSE-2.0
   10590     *
   10591     * Unless required by applicable law or agreed to in writing, software
   10592     * distributed under the License is distributed on an "AS IS" BASIS,
   10593     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10594     * See the License for the specific language governing permissions and
   10595     * limitations under the License.
   10596     */
   10597 
   10598    /*
   10599     * File: OP_REM_FLOAT.S
   10600     *
   10601     * Code: Computes the remainder of a division. Performs no substitutions.
   10602     *
   10603     * For: rem-float
   10604     *
   10605     * Description: Calls fmod to compute the remainder of the result of dividing a
   10606     *              source register by a second, and stores the result in a
   10607     *              destination register.
   10608     *
   10609     * Format: AA|op CC|BB (23x)
   10610     *
   10611     * Syntax: op vAA, vBB, vCC
   10612     */
   10613 
   10614     FETCH_BB    1, %ecx                 # %ecx<- BB
   10615     FETCH_CC    1, %edx                 # %edx<- CC
   10616     GET_VREG    %ecx                    # %ecx<- vBB
   10617     GET_VREG    %edx                    # %edx<- vCC
   10618     movl        %ecx, -8(%esp)          # push parameter float
   10619     movl        %edx, -4(%esp)          # push parameter float
   10620     lea         -8(%esp), %esp
   10621     call        fmodf                   # call: (float x, float y)
   10622                                         # return: float
   10623     lea         8(%esp), %esp
   10624     fstps       (rFP, rINST, 4)         # vAA<- remainder; return of fmod
   10625     FINISH      2                       # jump to next instruction
   10626 
   10627 /* ------------------------------ */
   10628     .balign 64
   10629 .L_OP_ADD_DOUBLE: /* 0xab */
   10630 /* File: x86-atom/OP_ADD_DOUBLE.S */
   10631    /* Copyright (C) 2008 The Android Open Source Project
   10632     *
   10633     * Licensed under the Apache License, Version 2.0 (the "License");
   10634     * you may not use this file except in compliance with the License.
   10635     * You may obtain a copy of the License at
   10636     *
   10637     * http://www.apache.org/licenses/LICENSE-2.0
   10638     *
   10639     * Unless required by applicable law or agreed to in writing, software
   10640     * distributed under the License is distributed on an "AS IS" BASIS,
   10641     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10642     * See the License for the specific language governing permissions and
   10643     * limitations under the License.
   10644     */
   10645 
   10646    /*
   10647     * File: OP_ADD_DOUBLE.S
   10648     */
   10649 
   10650 /* File: x86-atom/binopWide.S */
   10651    /* Copyright (C) 2008 The Android Open Source Project
   10652     *
   10653     * Licensed under the Apache License, Version 2.0 (the "License");
   10654     * you may not use this file except in compliance with the License.
   10655     * You may obtain a copy of the License at
   10656     *
   10657     * http://www.apache.org/licenses/LICENSE-2.0
   10658     *
   10659     * Unless required by applicable law or agreed to in writing, software
   10660     * distributed under the License is distributed on an "AS IS" BASIS,
   10661     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10662     * See the License for the specific language governing permissions and
   10663     * limitations under the License.
   10664     */
   10665 
   10666    /*
   10667     * File: binopWide.S
   10668     *
   10669     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   10670     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10671     *
   10672     * For: add-double, add-long, and-long, mul-double, or-long,
   10673     *      sub-double, sub-long, xor-long
   10674     *
   10675     * Description: Perform a binary operation on two source registers
   10676     *              and store the result in a destination register.
   10677     *
   10678     * Format: AA|op CC|BB (23x)
   10679     *
   10680     * Syntax: op vAA, vBB, vCC
   10681     */
   10682 
   10683     FETCH_BB    1, %ecx                 # %ecx<- BB
   10684     FETCH_CC    1, %edx                 # %edx<- CC
   10685     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10686     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   10687     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10688     addsd   %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10689     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   10690     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10691 
   10692 
   10693 /* ------------------------------ */
   10694     .balign 64
   10695 .L_OP_SUB_DOUBLE: /* 0xac */
   10696 /* File: x86-atom/OP_SUB_DOUBLE.S */
   10697    /* Copyright (C) 2008 The Android Open Source Project
   10698     *
   10699     * Licensed under the Apache License, Version 2.0 (the "License");
   10700     * you may not use this file except in compliance with the License.
   10701     * You may obtain a copy of the License at
   10702     *
   10703     * http://www.apache.org/licenses/LICENSE-2.0
   10704     *
   10705     * Unless required by applicable law or agreed to in writing, software
   10706     * distributed under the License is distributed on an "AS IS" BASIS,
   10707     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10708     * See the License for the specific language governing permissions and
   10709     * limitations under the License.
   10710     */
   10711 
   10712    /*
   10713     * File: OP_SUB_DOUBLE.S
   10714     */
   10715 
   10716 /* File: x86-atom/binopWide.S */
   10717    /* Copyright (C) 2008 The Android Open Source Project
   10718     *
   10719     * Licensed under the Apache License, Version 2.0 (the "License");
   10720     * you may not use this file except in compliance with the License.
   10721     * You may obtain a copy of the License at
   10722     *
   10723     * http://www.apache.org/licenses/LICENSE-2.0
   10724     *
   10725     * Unless required by applicable law or agreed to in writing, software
   10726     * distributed under the License is distributed on an "AS IS" BASIS,
   10727     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10728     * See the License for the specific language governing permissions and
   10729     * limitations under the License.
   10730     */
   10731 
   10732    /*
   10733     * File: binopWide.S
   10734     *
   10735     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   10736     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10737     *
   10738     * For: add-double, add-long, and-long, mul-double, or-long,
   10739     *      sub-double, sub-long, xor-long
   10740     *
   10741     * Description: Perform a binary operation on two source registers
   10742     *              and store the result in a destination register.
   10743     *
   10744     * Format: AA|op CC|BB (23x)
   10745     *
   10746     * Syntax: op vAA, vBB, vCC
   10747     */
   10748 
   10749     FETCH_BB    1, %ecx                 # %ecx<- BB
   10750     FETCH_CC    1, %edx                 # %edx<- CC
   10751     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10752     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   10753     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10754     subsd   %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10755     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   10756     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10757 
   10758 
   10759 /* ------------------------------ */
   10760     .balign 64
   10761 .L_OP_MUL_DOUBLE: /* 0xad */
   10762 /* File: x86-atom/OP_MUL_DOUBLE.S */
   10763    /* Copyright (C) 2008 The Android Open Source Project
   10764     *
   10765     * Licensed under the Apache License, Version 2.0 (the "License");
   10766     * you may not use this file except in compliance with the License.
   10767     * You may obtain a copy of the License at
   10768     *
   10769     * http://www.apache.org/licenses/LICENSE-2.0
   10770     *
   10771     * Unless required by applicable law or agreed to in writing, software
   10772     * distributed under the License is distributed on an "AS IS" BASIS,
   10773     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10774     * See the License for the specific language governing permissions and
   10775     * limitations under the License.
   10776     */
   10777 
   10778    /*
   10779     * File: OP_MUL_DOUBLE.S
   10780     */
   10781 
   10782 /* File: x86-atom/binopWide.S */
   10783    /* Copyright (C) 2008 The Android Open Source Project
   10784     *
   10785     * Licensed under the Apache License, Version 2.0 (the "License");
   10786     * you may not use this file except in compliance with the License.
   10787     * You may obtain a copy of the License at
   10788     *
   10789     * http://www.apache.org/licenses/LICENSE-2.0
   10790     *
   10791     * Unless required by applicable law or agreed to in writing, software
   10792     * distributed under the License is distributed on an "AS IS" BASIS,
   10793     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10794     * See the License for the specific language governing permissions and
   10795     * limitations under the License.
   10796     */
   10797 
   10798    /*
   10799     * File: binopWide.S
   10800     *
   10801     * Code: Generic 64-bit binary operation.  Provides an "instr" variable to
   10802     *       specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
   10803     *
   10804     * For: add-double, add-long, and-long, mul-double, or-long,
   10805     *      sub-double, sub-long, xor-long
   10806     *
   10807     * Description: Perform a binary operation on two source registers
   10808     *              and store the result in a destination register.
   10809     *
   10810     * Format: AA|op CC|BB (23x)
   10811     *
   10812     * Syntax: op vAA, vBB, vCC
   10813     */
   10814 
   10815     FETCH_BB    1, %ecx                 # %ecx<- BB
   10816     FETCH_CC    1, %edx                 # %edx<- CC
   10817     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10818     movq        (rFP, %ecx, 4), %xmm0   # %xmm0<- vBB
   10819     movq        (rFP, %edx, 4), %xmm1   # %xmm1<- vCC
   10820     mulsd   %xmm1, %xmm0                              # %xmm0<- vBB op vCC
   10821     movq        %xmm0, (rFP, rINST, 4)  # vAA<- %ecx
   10822     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10823 
   10824 
   10825 /* ------------------------------ */
   10826     .balign 64
   10827 .L_OP_DIV_DOUBLE: /* 0xae */
   10828 /* File: x86-atom/OP_DIV_DOUBLE.S */
   10829    /* Copyright (C) 2008 The Android Open Source Project
   10830     *
   10831     * Licensed under the Apache License, Version 2.0 (the "License");
   10832     * you may not use this file except in compliance with the License.
   10833     * You may obtain a copy of the License at
   10834     *
   10835     * http://www.apache.org/licenses/LICENSE-2.0
   10836     *
   10837     * Unless required by applicable law or agreed to in writing, software
   10838     * distributed under the License is distributed on an "AS IS" BASIS,
   10839     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10840     * See the License for the specific language governing permissions and
   10841     * limitations under the License.
   10842     */
   10843 
   10844    /*
   10845     * File: OP_DIV_DOUBLE.S
   10846     *
   10847     * Code: Divides doubles. Uses no substitutions.
   10848     *
   10849     * For: div-double
   10850     *
   10851     * Description: Divide operation on two source registers, storing
   10852     *              the result in a destination register
   10853     *
   10854     * Format: AA|op CC|BB (23x)
   10855     *
   10856     * Syntax: op vAA, vBB, vCC
   10857     */
   10858 
   10859     FETCH_BB    1, %ecx                 # %ecx<- BB
   10860     FETCH_CC    1, %edx                 # %edx<- CC
   10861     fldl        (rFP, %ecx, 4)          # floating point stack vBB
   10862     fdivl       (rFP, %edx, 4)          # divide double; vBB/vCC
   10863     fstpl       (rFP, rINST, 4)         # vAA<- result
   10864     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   10865     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   10866 
   10867 /* ------------------------------ */
   10868     .balign 64
   10869 .L_OP_REM_DOUBLE: /* 0xaf */
   10870 /* File: x86-atom/OP_REM_DOUBLE.S */
   10871    /* Copyright (C) 2008 The Android Open Source Project
   10872     *
   10873     * Licensed under the Apache License, Version 2.0 (the "License");
   10874     * you may not use this file except in compliance with the License.
   10875     * You may obtain a copy of the License at
   10876     *
   10877     * http://www.apache.org/licenses/LICENSE-2.0
   10878     *
   10879     * Unless required by applicable law or agreed to in writing, software
   10880     * distributed under the License is distributed on an "AS IS" BASIS,
   10881     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10882     * See the License for the specific language governing permissions and
   10883     * limitations under the License.
   10884     */
   10885 
   10886    /*
   10887     * File: OP_REM_DOUBLE.S
   10888     *
   10889     * Code: Computes the remainder of a division. Performs no substitutions.
   10890     *
   10891     * For: rem-double
   10892     *
   10893     * Description: Calls fmod to compute the remainder of the result of dividing a
   10894     *              source register by a second, and stores the result in a
   10895     *              destination register.
   10896     *
   10897     * Format: AA|op CC|BB (23x)
   10898     *
   10899     * Syntax: op vAA, vBB, vCC
   10900     */
   10901 
   10902     FETCH_BB    1, %ecx                 # %ecx<- BB
   10903     FETCH_CC    1, %edx                 # %edx<- CC
   10904     movl        (rFP, %ecx, 4), %eax    # %eax<- vBBlo
   10905     movl        %eax, -16(%esp)         # push parameter double lo
   10906     movl        4(rFP, %ecx, 4), %eax   # %eax<- vBBhi
   10907     movl        %eax, -12(%esp)         # push parameter double hi
   10908     movl        (rFP, %edx, 4), %eax    # %eax<- vCClo
   10909     movl        %eax, -8(%esp)          # push parameter double lo
   10910     movl        4(rFP, %edx, 4), %eax   # %eax<- vCChi
   10911     movl        %eax, -4(%esp)          # push parameter double hi
   10912     lea         -16(%esp), %esp
   10913     jmp         .LOP_REM_DOUBLE_break
   10914 
   10915 /* ------------------------------ */
   10916     .balign 64
   10917 .L_OP_ADD_INT_2ADDR: /* 0xb0 */
   10918 /* File: x86-atom/OP_ADD_INT_2ADDR.S */
   10919    /* Copyright (C) 2008 The Android Open Source Project
   10920     *
   10921     * Licensed under the Apache License, Version 2.0 (the "License");
   10922     * you may not use this file except in compliance with the License.
   10923     * You may obtain a copy of the License at
   10924     *
   10925     * http://www.apache.org/licenses/LICENSE-2.0
   10926     *
   10927     * Unless required by applicable law or agreed to in writing, software
   10928     * distributed under the License is distributed on an "AS IS" BASIS,
   10929     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10930     * See the License for the specific language governing permissions and
   10931     * limitations under the License.
   10932     */
   10933 
   10934    /*
   10935     * File: OP_ADD_INT_2ADDR.S
   10936     */
   10937 
   10938 /* File: x86-atom/binop2addr.S */
   10939    /* Copyright (C) 2008 The Android Open Source Project
   10940     *
   10941     * Licensed under the Apache License, Version 2.0 (the "License");
   10942     * you may not use this file except in compliance with the License.
   10943     * You may obtain a copy of the License at
   10944     *
   10945     * http://www.apache.org/licenses/LICENSE-2.0
   10946     *
   10947     * Unless required by applicable law or agreed to in writing, software
   10948     * distributed under the License is distributed on an "AS IS" BASIS,
   10949     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   10950     * See the License for the specific language governing permissions and
   10951     * limitations under the License.
   10952     */
   10953 
   10954    /*
   10955     * File: binop2addr.S
   10956     *
   10957     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   10958     *       "instr" line to specify an instruction that performs
   10959     *       "%ecx = %ecx op %edx".
   10960     *
   10961     * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
   10962     *      sub-int/2addr, xor-int/2addr
   10963     *
   10964     * Description: Perform a binary operation on two sources registers
   10965     *              and store the result in the first source register
   10966     *
   10967     * Format: B|A|op (12x)
   10968     *
   10969     * Syntax: op vA, vB
   10970     */
   10971 
   10972     movl        rINST, %edx             # %edx<- BA
   10973     shr         $4, %edx               # %edx<- B
   10974     andl        $15, rINST             # rINST<- A
   10975     movl        rINST, %ecx             # %ecx<- A
   10976     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   10977     GET_VREG    %edx                    # %edx<- vB
   10978     GET_VREG    %ecx                    # %ecx<- vA
   10979     addl     %edx, %ecx                              # %ecx<- vA op vB
   10980     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   10981     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   10982 
   10983 
   10984 
   10985 
   10986 /* ------------------------------ */
   10987     .balign 64
   10988 .L_OP_SUB_INT_2ADDR: /* 0xb1 */
   10989 /* File: x86-atom/OP_SUB_INT_2ADDR.S */
   10990    /* Copyright (C) 2008 The Android Open Source Project
   10991     *
   10992     * Licensed under the Apache License, Version 2.0 (the "License");
   10993     * you may not use this file except in compliance with the License.
   10994     * You may obtain a copy of the License at
   10995     *
   10996     * http://www.apache.org/licenses/LICENSE-2.0
   10997     *
   10998     * Unless required by applicable law or agreed to in writing, software
   10999     * distributed under the License is distributed on an "AS IS" BASIS,
   11000     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11001     * See the License for the specific language governing permissions and
   11002     * limitations under the License.
   11003     */
   11004 
   11005    /*
   11006     * File: OP_SUB_INT_2ADDR.S
   11007     */
   11008 
   11009 /* File: x86-atom/binop2addr.S */
   11010    /* Copyright (C) 2008 The Android Open Source Project
   11011     *
   11012     * Licensed under the Apache License, Version 2.0 (the "License");
   11013     * you may not use this file except in compliance with the License.
   11014     * You may obtain a copy of the License at
   11015     *
   11016     * http://www.apache.org/licenses/LICENSE-2.0
   11017     *
   11018     * Unless required by applicable law or agreed to in writing, software
   11019     * distributed under the License is distributed on an "AS IS" BASIS,
   11020     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11021     * See the License for the specific language governing permissions and
   11022     * limitations under the License.
   11023     */
   11024 
   11025    /*
   11026     * File: binop2addr.S
   11027     *
   11028     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11029     *       "instr" line to specify an instruction that performs
   11030     *       "%ecx = %ecx op %edx".
   11031     *
   11032     * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
   11033     *      sub-int/2addr, xor-int/2addr
   11034     *
   11035     * Description: Perform a binary operation on two sources registers
   11036     *              and store the result in the first source register
   11037     *
   11038     * Format: B|A|op (12x)
   11039     *
   11040     * Syntax: op vA, vB
   11041     */
   11042 
   11043     movl        rINST, %edx             # %edx<- BA
   11044     shr         $4, %edx               # %edx<- B
   11045     andl        $15, rINST             # rINST<- A
   11046     movl        rINST, %ecx             # %ecx<- A
   11047     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   11048     GET_VREG    %edx                    # %edx<- vB
   11049     GET_VREG    %ecx                    # %ecx<- vA
   11050     subl     %edx, %ecx                              # %ecx<- vA op vB
   11051     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   11052     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11053 
   11054 
   11055 
   11056 
   11057 /* ------------------------------ */
   11058     .balign 64
   11059 .L_OP_MUL_INT_2ADDR: /* 0xb2 */
   11060 /* File: x86-atom/OP_MUL_INT_2ADDR.S */
   11061    /* Copyright (C) 2008 The Android Open Source Project
   11062     *
   11063     * Licensed under the Apache License, Version 2.0 (the "License");
   11064     * you may not use this file except in compliance with the License.
   11065     * You may obtain a copy of the License at
   11066     *
   11067     * http://www.apache.org/licenses/LICENSE-2.0
   11068     *
   11069     * Unless required by applicable law or agreed to in writing, software
   11070     * distributed under the License is distributed on an "AS IS" BASIS,
   11071     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11072     * See the License for the specific language governing permissions and
   11073     * limitations under the License.
   11074     */
   11075 
   11076    /*
   11077     * File: OP_MUL_INT_2ADDR.S
   11078     */
   11079 
   11080 /* File: x86-atom/binop2addr.S */
   11081    /* Copyright (C) 2008 The Android Open Source Project
   11082     *
   11083     * Licensed under the Apache License, Version 2.0 (the "License");
   11084     * you may not use this file except in compliance with the License.
   11085     * You may obtain a copy of the License at
   11086     *
   11087     * http://www.apache.org/licenses/LICENSE-2.0
   11088     *
   11089     * Unless required by applicable law or agreed to in writing, software
   11090     * distributed under the License is distributed on an "AS IS" BASIS,
   11091     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11092     * See the License for the specific language governing permissions and
   11093     * limitations under the License.
   11094     */
   11095 
   11096    /*
   11097     * File: binop2addr.S
   11098     *
   11099     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11100     *       "instr" line to specify an instruction that performs
   11101     *       "%ecx = %ecx op %edx".
   11102     *
   11103     * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
   11104     *      sub-int/2addr, xor-int/2addr
   11105     *
   11106     * Description: Perform a binary operation on two sources registers
   11107     *              and store the result in the first source register
   11108     *
   11109     * Format: B|A|op (12x)
   11110     *
   11111     * Syntax: op vA, vB
   11112     */
   11113 
   11114     movl        rINST, %edx             # %edx<- BA
   11115     shr         $4, %edx               # %edx<- B
   11116     andl        $15, rINST             # rINST<- A
   11117     movl        rINST, %ecx             # %ecx<- A
   11118     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   11119     GET_VREG    %edx                    # %edx<- vB
   11120     GET_VREG    %ecx                    # %ecx<- vA
   11121     imul     %edx, %ecx                              # %ecx<- vA op vB
   11122     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   11123     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11124 
   11125 
   11126 
   11127 
   11128 /* ------------------------------ */
   11129     .balign 64
   11130 .L_OP_DIV_INT_2ADDR: /* 0xb3 */
   11131 /* File: x86-atom/OP_DIV_INT_2ADDR.S */
   11132    /* Copyright (C) 2008 The Android Open Source Project
   11133     *
   11134     * Licensed under the Apache License, Version 2.0 (the "License");
   11135     * you may not use this file except in compliance with the License.
   11136     * You may obtain a copy of the License at
   11137     *
   11138     * http://www.apache.org/licenses/LICENSE-2.0
   11139     *
   11140     * Unless required by applicable law or agreed to in writing, software
   11141     * distributed under the License is distributed on an "AS IS" BASIS,
   11142     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11143     * See the License for the specific language governing permissions and
   11144     * limitations under the License.
   11145     */
   11146 
   11147    /*
   11148     * File: OP_DIV_INT_2ADDR.S
   11149     */
   11150 
   11151 /* File: x86-atom/binopD2addr.S */
   11152    /* Copyright (C) 2008 The Android Open Source Project
   11153     *
   11154     * Licensed under the Apache License, Version 2.0 (the "License");
   11155     * you may not use this file except in compliance with the License.
   11156     * You may obtain a copy of the License at
   11157     *
   11158     * http://www.apache.org/licenses/LICENSE-2.0
   11159     *
   11160     * Unless required by applicable law or agreed to in writing, software
   11161     * distributed under the License is distributed on an "AS IS" BASIS,
   11162     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11163     * See the License for the specific language governing permissions and
   11164     * limitations under the License.
   11165     */
   11166 
   11167    /*
   11168     * File: binopD2addr.S
   11169     *
   11170     * Code: 32-bit "/2addr" integer divde operation. If "div"
   11171     *       is set, the code returns the quotient, else it returns
   11172     *       the remainder. Also, a divide-by-zero check is done.
   11173     *
   11174     * For: div-int/2addr, rem-int/2addr
   11175     *
   11176     * Description: Perform a binary operation on two sources registers
   11177     *              and store the result in the first source register
   11178     *
   11179     * Format: B|A|op (12x)
   11180     *
   11181     * Syntax: op vA, vB
   11182     */
   11183 
   11184     movl        rINST, %ecx             # %ecx<- BA
   11185     andl        $15, rINST             # rINST<- A, to be used as dest
   11186     movl        rINST, %eax             # %eax<- A
   11187     shr         $4, %ecx               # %ecx<- B
   11188     GET_VREG    %eax                    # %eax<- vA
   11189     GET_VREG    %ecx                    # %edx<- vB
   11190     cmp         $0, %ecx               # check for divide by zero
   11191     je          common_errDivideByZero  # handle divide by zero
   11192     cmpl        $-1, %ecx              # handle -1 special case divide error
   11193     jne         .LOP_DIV_INT_2ADDR_noerror
   11194     cmpl        $0x80000000,%eax       # handle min int special case divide error
   11195     je         .LOP_DIV_INT_2ADDR_break
   11196 .LOP_DIV_INT_2ADDR_noerror:
   11197     cdq                                 # sign-extend %eax to %edx
   11198     idiv        %ecx                    # divide %edx:%eax by %ecx
   11199      .if  1
   11200     SET_VREG    %eax rINST              # vAA<- %eax (quotient)
   11201     .else
   11202     SET_VREG    %edx rINST              # vAA<- %edx (remainder)
   11203     .endif
   11204     jmp         .LOP_DIV_INT_2ADDR_break2
   11205     #FFETCH_ADV 1, %edx  # %ecx<- next instruction hi; fetch, advance
   11206     #FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   11207 
   11208 
   11209 
   11210 /* ------------------------------ */
   11211     .balign 64
   11212 .L_OP_REM_INT_2ADDR: /* 0xb4 */
   11213 /* File: x86-atom/OP_REM_INT_2ADDR.S */
   11214    /* Copyright (C) 2008 The Android Open Source Project
   11215     *
   11216     * Licensed under the Apache License, Version 2.0 (the "License");
   11217     * you may not use this file except in compliance with the License.
   11218     * You may obtain a copy of the License at
   11219     *
   11220     * http://www.apache.org/licenses/LICENSE-2.0
   11221     *
   11222     * Unless required by applicable law or agreed to in writing, software
   11223     * distributed under the License is distributed on an "AS IS" BASIS,
   11224     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11225     * See the License for the specific language governing permissions and
   11226     * limitations under the License.
   11227     */
   11228 
   11229    /*
   11230     * File: OP_REM_INT_2ADDR.S
   11231     */
   11232 
   11233 /* File: x86-atom/binopD2addr.S */
   11234    /* Copyright (C) 2008 The Android Open Source Project
   11235     *
   11236     * Licensed under the Apache License, Version 2.0 (the "License");
   11237     * you may not use this file except in compliance with the License.
   11238     * You may obtain a copy of the License at
   11239     *
   11240     * http://www.apache.org/licenses/LICENSE-2.0
   11241     *
   11242     * Unless required by applicable law or agreed to in writing, software
   11243     * distributed under the License is distributed on an "AS IS" BASIS,
   11244     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11245     * See the License for the specific language governing permissions and
   11246     * limitations under the License.
   11247     */
   11248 
   11249    /*
   11250     * File: binopD2addr.S
   11251     *
   11252     * Code: 32-bit "/2addr" integer divde operation. If "div"
   11253     *       is set, the code returns the quotient, else it returns
   11254     *       the remainder. Also, a divide-by-zero check is done.
   11255     *
   11256     * For: div-int/2addr, rem-int/2addr
   11257     *
   11258     * Description: Perform a binary operation on two sources registers
   11259     *              and store the result in the first source register
   11260     *
   11261     * Format: B|A|op (12x)
   11262     *
   11263     * Syntax: op vA, vB
   11264     */
   11265 
   11266     movl        rINST, %ecx             # %ecx<- BA
   11267     andl        $15, rINST             # rINST<- A, to be used as dest
   11268     movl        rINST, %eax             # %eax<- A
   11269     shr         $4, %ecx               # %ecx<- B
   11270     GET_VREG    %eax                    # %eax<- vA
   11271     GET_VREG    %ecx                    # %edx<- vB
   11272     cmp         $0, %ecx               # check for divide by zero
   11273     je          common_errDivideByZero  # handle divide by zero
   11274     cmpl        $-1, %ecx              # handle -1 special case divide error
   11275     jne         .LOP_REM_INT_2ADDR_noerror
   11276     cmpl        $0x80000000,%eax       # handle min int special case divide error
   11277     je         .LOP_REM_INT_2ADDR_break
   11278 .LOP_REM_INT_2ADDR_noerror:
   11279     cdq                                 # sign-extend %eax to %edx
   11280     idiv        %ecx                    # divide %edx:%eax by %ecx
   11281      .if  0
   11282     SET_VREG    %eax rINST              # vAA<- %eax (quotient)
   11283     .else
   11284     SET_VREG    %edx rINST              # vAA<- %edx (remainder)
   11285     .endif
   11286     jmp         .LOP_REM_INT_2ADDR_break2
   11287     #FFETCH_ADV 1, %edx  # %ecx<- next instruction hi; fetch, advance
   11288     #FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   11289 
   11290 
   11291 
   11292 /* ------------------------------ */
   11293     .balign 64
   11294 .L_OP_AND_INT_2ADDR: /* 0xb5 */
   11295 /* File: x86-atom/OP_AND_INT_2ADDR.S */
   11296    /* Copyright (C) 2008 The Android Open Source Project
   11297     *
   11298     * Licensed under the Apache License, Version 2.0 (the "License");
   11299     * you may not use this file except in compliance with the License.
   11300     * You may obtain a copy of the License at
   11301     *
   11302     * http://www.apache.org/licenses/LICENSE-2.0
   11303     *
   11304     * Unless required by applicable law or agreed to in writing, software
   11305     * distributed under the License is distributed on an "AS IS" BASIS,
   11306     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11307     * See the License for the specific language governing permissions and
   11308     * limitations under the License.
   11309     */
   11310 
   11311    /*
   11312     * File: OP_AND_INT_2ADDR.S
   11313     */
   11314 
   11315 /* File: x86-atom/binop2addr.S */
   11316    /* Copyright (C) 2008 The Android Open Source Project
   11317     *
   11318     * Licensed under the Apache License, Version 2.0 (the "License");
   11319     * you may not use this file except in compliance with the License.
   11320     * You may obtain a copy of the License at
   11321     *
   11322     * http://www.apache.org/licenses/LICENSE-2.0
   11323     *
   11324     * Unless required by applicable law or agreed to in writing, software
   11325     * distributed under the License is distributed on an "AS IS" BASIS,
   11326     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11327     * See the License for the specific language governing permissions and
   11328     * limitations under the License.
   11329     */
   11330 
   11331    /*
   11332     * File: binop2addr.S
   11333     *
   11334     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11335     *       "instr" line to specify an instruction that performs
   11336     *       "%ecx = %ecx op %edx".
   11337     *
   11338     * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
   11339     *      sub-int/2addr, xor-int/2addr
   11340     *
   11341     * Description: Perform a binary operation on two sources registers
   11342     *              and store the result in the first source register
   11343     *
   11344     * Format: B|A|op (12x)
   11345     *
   11346     * Syntax: op vA, vB
   11347     */
   11348 
   11349     movl        rINST, %edx             # %edx<- BA
   11350     shr         $4, %edx               # %edx<- B
   11351     andl        $15, rINST             # rINST<- A
   11352     movl        rINST, %ecx             # %ecx<- A
   11353     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   11354     GET_VREG    %edx                    # %edx<- vB
   11355     GET_VREG    %ecx                    # %ecx<- vA
   11356     andl     %edx, %ecx                              # %ecx<- vA op vB
   11357     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   11358     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11359 
   11360 
   11361 
   11362 
   11363 /* ------------------------------ */
   11364     .balign 64
   11365 .L_OP_OR_INT_2ADDR: /* 0xb6 */
   11366 /* File: x86-atom/OP_OR_INT_2ADDR.S */
   11367    /* Copyright (C) 2008 The Android Open Source Project
   11368     *
   11369     * Licensed under the Apache License, Version 2.0 (the "License");
   11370     * you may not use this file except in compliance with the License.
   11371     * You may obtain a copy of the License at
   11372     *
   11373     * http://www.apache.org/licenses/LICENSE-2.0
   11374     *
   11375     * Unless required by applicable law or agreed to in writing, software
   11376     * distributed under the License is distributed on an "AS IS" BASIS,
   11377     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11378     * See the License for the specific language governing permissions and
   11379     * limitations under the License.
   11380     */
   11381 
   11382    /*
   11383     * File: OP_OR_INT_2ADDR.S
   11384     */
   11385 
   11386 /* File: x86-atom/binop2addr.S */
   11387    /* Copyright (C) 2008 The Android Open Source Project
   11388     *
   11389     * Licensed under the Apache License, Version 2.0 (the "License");
   11390     * you may not use this file except in compliance with the License.
   11391     * You may obtain a copy of the License at
   11392     *
   11393     * http://www.apache.org/licenses/LICENSE-2.0
   11394     *
   11395     * Unless required by applicable law or agreed to in writing, software
   11396     * distributed under the License is distributed on an "AS IS" BASIS,
   11397     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11398     * See the License for the specific language governing permissions and
   11399     * limitations under the License.
   11400     */
   11401 
   11402    /*
   11403     * File: binop2addr.S
   11404     *
   11405     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11406     *       "instr" line to specify an instruction that performs
   11407     *       "%ecx = %ecx op %edx".
   11408     *
   11409     * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
   11410     *      sub-int/2addr, xor-int/2addr
   11411     *
   11412     * Description: Perform a binary operation on two sources registers
   11413     *              and store the result in the first source register
   11414     *
   11415     * Format: B|A|op (12x)
   11416     *
   11417     * Syntax: op vA, vB
   11418     */
   11419 
   11420     movl        rINST, %edx             # %edx<- BA
   11421     shr         $4, %edx               # %edx<- B
   11422     andl        $15, rINST             # rINST<- A
   11423     movl        rINST, %ecx             # %ecx<- A
   11424     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   11425     GET_VREG    %edx                    # %edx<- vB
   11426     GET_VREG    %ecx                    # %ecx<- vA
   11427     or %edx, %ecx                              # %ecx<- vA op vB
   11428     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   11429     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11430 
   11431 
   11432 
   11433 
   11434 /* ------------------------------ */
   11435     .balign 64
   11436 .L_OP_XOR_INT_2ADDR: /* 0xb7 */
   11437 /* File: x86-atom/OP_XOR_INT_2ADDR.S */
   11438    /* Copyright (C) 2008 The Android Open Source Project
   11439     *
   11440     * Licensed under the Apache License, Version 2.0 (the "License");
   11441     * you may not use this file except in compliance with the License.
   11442     * You may obtain a copy of the License at
   11443     *
   11444     * http://www.apache.org/licenses/LICENSE-2.0
   11445     *
   11446     * Unless required by applicable law or agreed to in writing, software
   11447     * distributed under the License is distributed on an "AS IS" BASIS,
   11448     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11449     * See the License for the specific language governing permissions and
   11450     * limitations under the License.
   11451     */
   11452 
   11453    /*
   11454     * File: OP_XOR_INT_2ADDR.S
   11455     */
   11456 
   11457 /* File: x86-atom/binop2addr.S */
   11458    /* Copyright (C) 2008 The Android Open Source Project
   11459     *
   11460     * Licensed under the Apache License, Version 2.0 (the "License");
   11461     * you may not use this file except in compliance with the License.
   11462     * You may obtain a copy of the License at
   11463     *
   11464     * http://www.apache.org/licenses/LICENSE-2.0
   11465     *
   11466     * Unless required by applicable law or agreed to in writing, software
   11467     * distributed under the License is distributed on an "AS IS" BASIS,
   11468     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11469     * See the License for the specific language governing permissions and
   11470     * limitations under the License.
   11471     */
   11472 
   11473    /*
   11474     * File: binop2addr.S
   11475     *
   11476     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11477     *       "instr" line to specify an instruction that performs
   11478     *       "%ecx = %ecx op %edx".
   11479     *
   11480     * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
   11481     *      sub-int/2addr, xor-int/2addr
   11482     *
   11483     * Description: Perform a binary operation on two sources registers
   11484     *              and store the result in the first source register
   11485     *
   11486     * Format: B|A|op (12x)
   11487     *
   11488     * Syntax: op vA, vB
   11489     */
   11490 
   11491     movl        rINST, %edx             # %edx<- BA
   11492     shr         $4, %edx               # %edx<- B
   11493     andl        $15, rINST             # rINST<- A
   11494     movl        rINST, %ecx             # %ecx<- A
   11495     FFETCH_ADV  1, %eax                 # %eax<- next instruction hi; fetch, advance
   11496     GET_VREG    %edx                    # %edx<- vB
   11497     GET_VREG    %ecx                    # %ecx<- vA
   11498     xor     %edx, %ecx                              # %ecx<- vA op vB
   11499     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   11500     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11501 
   11502 
   11503 
   11504 
   11505 /* ------------------------------ */
   11506     .balign 64
   11507 .L_OP_SHL_INT_2ADDR: /* 0xb8 */
   11508 /* File: x86-atom/OP_SHL_INT_2ADDR.S */
   11509    /* Copyright (C) 2008 The Android Open Source Project
   11510     *
   11511     * Licensed under the Apache License, Version 2.0 (the "License");
   11512     * you may not use this file except in compliance with the License.
   11513     * You may obtain a copy of the License at
   11514     *
   11515     * http://www.apache.org/licenses/LICENSE-2.0
   11516     *
   11517     * Unless required by applicable law or agreed to in writing, software
   11518     * distributed under the License is distributed on an "AS IS" BASIS,
   11519     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11520     * See the License for the specific language governing permissions and
   11521     * limitations under the License.
   11522     */
   11523 
   11524    /*
   11525     * File: OP_SHL_INT_2ADDR.S
   11526     */
   11527 
   11528 /* File: x86-atom/binopS2addr.S */
   11529    /* Copyright (C) 2008 The Android Open Source Project
   11530     *
   11531     * Licensed under the Apache License, Version 2.0 (the "License");
   11532     * you may not use this file except in compliance with the License.
   11533     * You may obtain a copy of the License at
   11534     *
   11535     * http://www.apache.org/licenses/LICENSE-2.0
   11536     *
   11537     * Unless required by applicable law or agreed to in writing, software
   11538     * distributed under the License is distributed on an "AS IS" BASIS,
   11539     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11540     * See the License for the specific language governing permissions and
   11541     * limitations under the License.
   11542     */
   11543 
   11544    /*
   11545     * File: binopS2addr.S
   11546     *
   11547     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11548     *       "instr" line to specify an instruction that performs
   11549     *       "%edx = %edx op %cl".
   11550     *
   11551     * For: shl-int/2addr, shr-int/2addr, ushr-int/2addr
   11552     *
   11553     * Description: Perform a binary operation on two sources registers
   11554     *              and store the result in the first source register
   11555     *
   11556     * Format: B|A|op (12x)
   11557     *
   11558     * Syntax: op vA, vB
   11559     */
   11560 
   11561     movl        rINST, %ecx             # %ecx<- BA
   11562     shr         $4, %ecx               # %ecx<- B
   11563     andl        $15, rINST             # rINST<- A
   11564     movl        rINST, %edx             # %edx<- A
   11565     FFETCH_ADV  1, %eax                 # %ecx<- next instruction hi; fetch, advance
   11566     GET_VREG    %ecx                    # %ecx<- vB
   11567     GET_VREG    %edx                    # %edx<- vA
   11568     sal     %cl, %edx                              # %edx<- vA op vB
   11569     SET_VREG    %edx, rINST             # vAA<- %edx; result
   11570     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11571 
   11572 
   11573 /* ------------------------------ */
   11574     .balign 64
   11575 .L_OP_SHR_INT_2ADDR: /* 0xb9 */
   11576 /* File: x86-atom/OP_SHR_INT_2ADDR.S */
   11577    /* Copyright (C) 2008 The Android Open Source Project
   11578     *
   11579     * Licensed under the Apache License, Version 2.0 (the "License");
   11580     * you may not use this file except in compliance with the License.
   11581     * You may obtain a copy of the License at
   11582     *
   11583     * http://www.apache.org/licenses/LICENSE-2.0
   11584     *
   11585     * Unless required by applicable law or agreed to in writing, software
   11586     * distributed under the License is distributed on an "AS IS" BASIS,
   11587     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11588     * See the License for the specific language governing permissions and
   11589     * limitations under the License.
   11590     */
   11591 
   11592    /*
   11593     * File: OP_SHR_INT_2ADDR.S
   11594     */
   11595 
   11596 /* File: x86-atom/binopS2addr.S */
   11597    /* Copyright (C) 2008 The Android Open Source Project
   11598     *
   11599     * Licensed under the Apache License, Version 2.0 (the "License");
   11600     * you may not use this file except in compliance with the License.
   11601     * You may obtain a copy of the License at
   11602     *
   11603     * http://www.apache.org/licenses/LICENSE-2.0
   11604     *
   11605     * Unless required by applicable law or agreed to in writing, software
   11606     * distributed under the License is distributed on an "AS IS" BASIS,
   11607     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11608     * See the License for the specific language governing permissions and
   11609     * limitations under the License.
   11610     */
   11611 
   11612    /*
   11613     * File: binopS2addr.S
   11614     *
   11615     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11616     *       "instr" line to specify an instruction that performs
   11617     *       "%edx = %edx op %cl".
   11618     *
   11619     * For: shl-int/2addr, shr-int/2addr, ushr-int/2addr
   11620     *
   11621     * Description: Perform a binary operation on two sources registers
   11622     *              and store the result in the first source register
   11623     *
   11624     * Format: B|A|op (12x)
   11625     *
   11626     * Syntax: op vA, vB
   11627     */
   11628 
   11629     movl        rINST, %ecx             # %ecx<- BA
   11630     shr         $4, %ecx               # %ecx<- B
   11631     andl        $15, rINST             # rINST<- A
   11632     movl        rINST, %edx             # %edx<- A
   11633     FFETCH_ADV  1, %eax                 # %ecx<- next instruction hi; fetch, advance
   11634     GET_VREG    %ecx                    # %ecx<- vB
   11635     GET_VREG    %edx                    # %edx<- vA
   11636     sar     %cl, %edx                              # %edx<- vA op vB
   11637     SET_VREG    %edx, rINST             # vAA<- %edx; result
   11638     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11639 
   11640 
   11641 /* ------------------------------ */
   11642     .balign 64
   11643 .L_OP_USHR_INT_2ADDR: /* 0xba */
   11644 /* File: x86-atom/OP_USHR_INT_2ADDR.S */
   11645    /* Copyright (C) 2008 The Android Open Source Project
   11646     *
   11647     * Licensed under the Apache License, Version 2.0 (the "License");
   11648     * you may not use this file except in compliance with the License.
   11649     * You may obtain a copy of the License at
   11650     *
   11651     * http://www.apache.org/licenses/LICENSE-2.0
   11652     *
   11653     * Unless required by applicable law or agreed to in writing, software
   11654     * distributed under the License is distributed on an "AS IS" BASIS,
   11655     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11656     * See the License for the specific language governing permissions and
   11657     * limitations under the License.
   11658     */
   11659 
   11660    /*
   11661     * File: OP_USHR_INT_2ADDR.S
   11662     */
   11663 
   11664 /* File: x86-atom/binopS2addr.S */
   11665    /* Copyright (C) 2008 The Android Open Source Project
   11666     *
   11667     * Licensed under the Apache License, Version 2.0 (the "License");
   11668     * you may not use this file except in compliance with the License.
   11669     * You may obtain a copy of the License at
   11670     *
   11671     * http://www.apache.org/licenses/LICENSE-2.0
   11672     *
   11673     * Unless required by applicable law or agreed to in writing, software
   11674     * distributed under the License is distributed on an "AS IS" BASIS,
   11675     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11676     * See the License for the specific language governing permissions and
   11677     * limitations under the License.
   11678     */
   11679 
   11680    /*
   11681     * File: binopS2addr.S
   11682     *
   11683     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   11684     *       "instr" line to specify an instruction that performs
   11685     *       "%edx = %edx op %cl".
   11686     *
   11687     * For: shl-int/2addr, shr-int/2addr, ushr-int/2addr
   11688     *
   11689     * Description: Perform a binary operation on two sources registers
   11690     *              and store the result in the first source register
   11691     *
   11692     * Format: B|A|op (12x)
   11693     *
   11694     * Syntax: op vA, vB
   11695     */
   11696 
   11697     movl        rINST, %ecx             # %ecx<- BA
   11698     shr         $4, %ecx               # %ecx<- B
   11699     andl        $15, rINST             # rINST<- A
   11700     movl        rINST, %edx             # %edx<- A
   11701     FFETCH_ADV  1, %eax                 # %ecx<- next instruction hi; fetch, advance
   11702     GET_VREG    %ecx                    # %ecx<- vB
   11703     GET_VREG    %edx                    # %edx<- vA
   11704     shr     %cl, %edx                              # %edx<- vA op vB
   11705     SET_VREG    %edx, rINST             # vAA<- %edx; result
   11706     FGETOP_JMP  1, %eax                 # jump to next instruction; getop, jmp
   11707 
   11708 
   11709 /* ------------------------------ */
   11710     .balign 64
   11711 .L_OP_ADD_LONG_2ADDR: /* 0xbb */
   11712 /* File: x86-atom/OP_ADD_LONG_2ADDR.S */
   11713    /* Copyright (C) 2008 The Android Open Source Project
   11714     *
   11715     * Licensed under the Apache License, Version 2.0 (the "License");
   11716     * you may not use this file except in compliance with the License.
   11717     * You may obtain a copy of the License at
   11718     *
   11719     * http://www.apache.org/licenses/LICENSE-2.0
   11720     *
   11721     * Unless required by applicable law or agreed to in writing, software
   11722     * distributed under the License is distributed on an "AS IS" BASIS,
   11723     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11724     * See the License for the specific language governing permissions and
   11725     * limitations under the License.
   11726     */
   11727 
   11728    /*
   11729     * File: OP_ADD_LONG_2ADDR.S
   11730     */
   11731 
   11732 /* File: x86-atom/binopWide2addr.S */
   11733    /* Copyright (C) 2008 The Android Open Source Project
   11734     *
   11735     * Licensed under the Apache License, Version 2.0 (the "License");
   11736     * you may not use this file except in compliance with the License.
   11737     * You may obtain a copy of the License at
   11738     *
   11739     * http://www.apache.org/licenses/LICENSE-2.0
   11740     *
   11741     * Unless required by applicable law or agreed to in writing, software
   11742     * distributed under the License is distributed on an "AS IS" BASIS,
   11743     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11744     * See the License for the specific language governing permissions and
   11745     * limitations under the License.
   11746     */
   11747 
   11748    /*
   11749     * File: binopWide2addr.S
   11750     *
   11751     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   11752     *       "instr" line to specify an instruction that performs
   11753     *       "%xmm0= %xmm0 op %xmm1".
   11754     *
   11755     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   11756     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   11757     *
   11758     * Description: Perform a binary operation on two sources registers
   11759     *              and store the result in the first source register
   11760     *
   11761     * Format: B|A|op (12x)
   11762     *
   11763     * Syntax: op vA, vB
   11764     */
   11765 
   11766     movl        rINST, %edx             # %edx<- BA
   11767     shr         $4, rINST              # rINST<- B
   11768     andl        $15, %edx              # %edx<- A
   11769     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   11770     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   11771     paddq   %xmm1, %xmm0                              # %xmm0<- vA op vB
   11772     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   11773     FINISH      1                       # jump to next instruction
   11774 
   11775 
   11776 /* ------------------------------ */
   11777     .balign 64
   11778 .L_OP_SUB_LONG_2ADDR: /* 0xbc */
   11779 /* File: x86-atom/OP_SUB_LONG_2ADDR.S */
   11780    /* Copyright (C) 2008 The Android Open Source Project
   11781     *
   11782     * Licensed under the Apache License, Version 2.0 (the "License");
   11783     * you may not use this file except in compliance with the License.
   11784     * You may obtain a copy of the License at
   11785     *
   11786     * http://www.apache.org/licenses/LICENSE-2.0
   11787     *
   11788     * Unless required by applicable law or agreed to in writing, software
   11789     * distributed under the License is distributed on an "AS IS" BASIS,
   11790     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11791     * See the License for the specific language governing permissions and
   11792     * limitations under the License.
   11793     */
   11794 
   11795    /*
   11796     * File: OP_SUB_LONG_2ADDR.S
   11797     */
   11798 
   11799 /* File: x86-atom/binopWide2addr.S */
   11800    /* Copyright (C) 2008 The Android Open Source Project
   11801     *
   11802     * Licensed under the Apache License, Version 2.0 (the "License");
   11803     * you may not use this file except in compliance with the License.
   11804     * You may obtain a copy of the License at
   11805     *
   11806     * http://www.apache.org/licenses/LICENSE-2.0
   11807     *
   11808     * Unless required by applicable law or agreed to in writing, software
   11809     * distributed under the License is distributed on an "AS IS" BASIS,
   11810     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11811     * See the License for the specific language governing permissions and
   11812     * limitations under the License.
   11813     */
   11814 
   11815    /*
   11816     * File: binopWide2addr.S
   11817     *
   11818     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   11819     *       "instr" line to specify an instruction that performs
   11820     *       "%xmm0= %xmm0 op %xmm1".
   11821     *
   11822     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   11823     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   11824     *
   11825     * Description: Perform a binary operation on two sources registers
   11826     *              and store the result in the first source register
   11827     *
   11828     * Format: B|A|op (12x)
   11829     *
   11830     * Syntax: op vA, vB
   11831     */
   11832 
   11833     movl        rINST, %edx             # %edx<- BA
   11834     shr         $4, rINST              # rINST<- B
   11835     andl        $15, %edx              # %edx<- A
   11836     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   11837     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   11838     psubq    %xmm1, %xmm0                              # %xmm0<- vA op vB
   11839     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   11840     FINISH      1                       # jump to next instruction
   11841 
   11842 
   11843 /* ------------------------------ */
   11844     .balign 64
   11845 .L_OP_MUL_LONG_2ADDR: /* 0xbd */
   11846 /* File: x86-atom/OP_MUL_LONG_2ADDR.S */
   11847    /* Copyright (C) 2008 The Android Open Source Project
   11848     *
   11849     * Licensed under the Apache License, Version 2.0 (the "License");
   11850     * you may not use this file except in compliance with the License.
   11851     * You may obtain a copy of the License at
   11852     *
   11853     * http://www.apache.org/licenses/LICENSE-2.0
   11854     *
   11855     * Unless required by applicable law or agreed to in writing, software
   11856     * distributed under the License is distributed on an "AS IS" BASIS,
   11857     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11858     * See the License for the specific language governing permissions and
   11859     * limitations under the License.
   11860     */
   11861 
   11862    /*
   11863     * File: OP_MUL_LONG_2ADDR.S
   11864     *
   11865     * Code:  64-bit integer multiply
   11866     *
   11867     * For: mul-long/2addr
   11868     *
   11869     * Description: Multiply two sources registers and store the result
   11870     *              in the first source register.
   11871     *
   11872     * Format: B|A|op (12x)
   11873     *
   11874     * Syntax: op vA, vB
   11875     */
   11876 
   11877    /*
   11878     * Signed 64-bit integer multiply.
   11879     *
   11880     * Consider WXxYZ (r1r0 x r3r2) with a long multiply:
   11881     *        WX
   11882     *      x YZ
   11883     *  --------
   11884     *     ZW ZX
   11885     *  YW YX
   11886     *
   11887     * The low word of the result holds ZX, the high word holds
   11888     * (ZW+YX) + (the high overflow from ZX).  YW doesn't matter because
   11889     * it doesn't fit in the low 64 bits.
   11890     */
   11891 
   11892     movl        rINST, %edx             # %edx<- BA+
   11893     shr         $4, rINST              # rINST<- B
   11894     andl        $15, %edx              # %edx<- A
   11895     movl        %edx, sReg0             # sReg0<- A
   11896     jmp         .LOP_MUL_LONG_2ADDR_finish
   11897 
   11898 /* ------------------------------ */
   11899     .balign 64
   11900 .L_OP_DIV_LONG_2ADDR: /* 0xbe */
   11901 /* File: x86-atom/OP_DIV_LONG_2ADDR.S */
   11902    /* Copyright (C) 2008 The Android Open Source Project
   11903     *
   11904     * Licensed under the Apache License, Version 2.0 (the "License");
   11905     * you may not use this file except in compliance with the License.
   11906     * You may obtain a copy of the License at
   11907     *
   11908     * http://www.apache.org/licenses/LICENSE-2.0
   11909     *
   11910     * Unless required by applicable law or agreed to in writing, software
   11911     * distributed under the License is distributed on an "AS IS" BASIS,
   11912     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11913     * See the License for the specific language governing permissions and
   11914     * limitations under the License.
   11915     */
   11916 
   11917    /*
   11918     * File: OP_DIV_LONG_2ADDR.S
   11919     */
   11920 
   11921 /* File: x86-atom/binopDivRemLong2Addr.S */
   11922    /* Copyright (C) 2008 The Android Open Source Project
   11923     *
   11924     * Licensed under the Apache License, Version 2.0 (the "License");
   11925     * you may not use this file except in compliance with the License.
   11926     * You may obtain a copy of the License at
   11927     *
   11928     * http://www.apache.org/licenses/LICENSE-2.0
   11929     *
   11930     * Unless required by applicable law or agreed to in writing, software
   11931     * distributed under the License is distributed on an "AS IS" BASIS,
   11932     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11933     * See the License for the specific language governing permissions and
   11934     * limitations under the License.
   11935     */
   11936 
   11937    /*
   11938     * File: binopDivRemLong2Addr.S
   11939     *
   11940     * Code: 64-bit "/2addr" long divide operation. Variable
   11941     *       "func" defines the function called to do the operation.
   11942     *
   11943     * For: div-long/2addr, rem-long/2addr
   11944     *
   11945     * Description: Perform a binary operation on two sources registers
   11946     *              and store the result in the first source register.
   11947     *
   11948     * Format: B|A|op (12x)
   11949     *
   11950     * Syntax: op vA, vB
   11951     */
   11952 
   11953 
   11954     movl        rINST, %edx             # %edx<- BA
   11955     shr         $4, %edx               # %edx<- B
   11956     and         $15, rINST             # rINST<- A
   11957     movl        (rFP, %edx, 4), %eax    # %eax<- vB
   11958     movl        %eax, -12(%esp)         # push arg vB
   11959     movl        4(rFP, %edx, 4), %ecx   # %ecx<- vB+1
   11960     or          %ecx, %eax              # check for divide by zero
   11961     je          common_errDivideByZero  # handle divide by zero
   11962     movl        %ecx, -8(%esp)          # push arg vB+1
   11963     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vA,vA+1
   11964     jmp         .LOP_DIV_LONG_2ADDR_break
   11965 
   11966 
   11967 /* ------------------------------ */
   11968     .balign 64
   11969 .L_OP_REM_LONG_2ADDR: /* 0xbf */
   11970 /* File: x86-atom/OP_REM_LONG_2ADDR.S */
   11971    /* Copyright (C) 2008 The Android Open Source Project
   11972     *
   11973     * Licensed under the Apache License, Version 2.0 (the "License");
   11974     * you may not use this file except in compliance with the License.
   11975     * You may obtain a copy of the License at
   11976     *
   11977     * http://www.apache.org/licenses/LICENSE-2.0
   11978     *
   11979     * Unless required by applicable law or agreed to in writing, software
   11980     * distributed under the License is distributed on an "AS IS" BASIS,
   11981     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   11982     * See the License for the specific language governing permissions and
   11983     * limitations under the License.
   11984     */
   11985 
   11986    /*
   11987     * File: OP_REM_LONG_2ADDR.S
   11988     */
   11989 
   11990 /* File: x86-atom/binopDivRemLong2Addr.S */
   11991    /* Copyright (C) 2008 The Android Open Source Project
   11992     *
   11993     * Licensed under the Apache License, Version 2.0 (the "License");
   11994     * you may not use this file except in compliance with the License.
   11995     * You may obtain a copy of the License at
   11996     *
   11997     * http://www.apache.org/licenses/LICENSE-2.0
   11998     *
   11999     * Unless required by applicable law or agreed to in writing, software
   12000     * distributed under the License is distributed on an "AS IS" BASIS,
   12001     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12002     * See the License for the specific language governing permissions and
   12003     * limitations under the License.
   12004     */
   12005 
   12006    /*
   12007     * File: binopDivRemLong2Addr.S
   12008     *
   12009     * Code: 64-bit "/2addr" long divide operation. Variable
   12010     *       "func" defines the function called to do the operation.
   12011     *
   12012     * For: div-long/2addr, rem-long/2addr
   12013     *
   12014     * Description: Perform a binary operation on two sources registers
   12015     *              and store the result in the first source register.
   12016     *
   12017     * Format: B|A|op (12x)
   12018     *
   12019     * Syntax: op vA, vB
   12020     */
   12021 
   12022 
   12023     movl        rINST, %edx             # %edx<- BA
   12024     shr         $4, %edx               # %edx<- B
   12025     and         $15, rINST             # rINST<- A
   12026     movl        (rFP, %edx, 4), %eax    # %eax<- vB
   12027     movl        %eax, -12(%esp)         # push arg vB
   12028     movl        4(rFP, %edx, 4), %ecx   # %ecx<- vB+1
   12029     or          %ecx, %eax              # check for divide by zero
   12030     je          common_errDivideByZero  # handle divide by zero
   12031     movl        %ecx, -8(%esp)          # push arg vB+1
   12032     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vA,vA+1
   12033     jmp         .LOP_REM_LONG_2ADDR_break
   12034 
   12035 
   12036 /* ------------------------------ */
   12037     .balign 64
   12038 .L_OP_AND_LONG_2ADDR: /* 0xc0 */
   12039 /* File: x86-atom/OP_AND_LONG_2ADDR.S */
   12040    /* Copyright (C) 2008 The Android Open Source Project
   12041     *
   12042     * Licensed under the Apache License, Version 2.0 (the "License");
   12043     * you may not use this file except in compliance with the License.
   12044     * You may obtain a copy of the License at
   12045     *
   12046     * http://www.apache.org/licenses/LICENSE-2.0
   12047     *
   12048     * Unless required by applicable law or agreed to in writing, software
   12049     * distributed under the License is distributed on an "AS IS" BASIS,
   12050     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12051     * See the License for the specific language governing permissions and
   12052     * limitations under the License.
   12053     */
   12054 
   12055    /*
   12056     * File: OP_AND_LONG_2ADDR.S
   12057     */
   12058 
   12059 /* File: x86-atom/binopWide2addr.S */
   12060    /* Copyright (C) 2008 The Android Open Source Project
   12061     *
   12062     * Licensed under the Apache License, Version 2.0 (the "License");
   12063     * you may not use this file except in compliance with the License.
   12064     * You may obtain a copy of the License at
   12065     *
   12066     * http://www.apache.org/licenses/LICENSE-2.0
   12067     *
   12068     * Unless required by applicable law or agreed to in writing, software
   12069     * distributed under the License is distributed on an "AS IS" BASIS,
   12070     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12071     * See the License for the specific language governing permissions and
   12072     * limitations under the License.
   12073     */
   12074 
   12075    /*
   12076     * File: binopWide2addr.S
   12077     *
   12078     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   12079     *       "instr" line to specify an instruction that performs
   12080     *       "%xmm0= %xmm0 op %xmm1".
   12081     *
   12082     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   12083     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   12084     *
   12085     * Description: Perform a binary operation on two sources registers
   12086     *              and store the result in the first source register
   12087     *
   12088     * Format: B|A|op (12x)
   12089     *
   12090     * Syntax: op vA, vB
   12091     */
   12092 
   12093     movl        rINST, %edx             # %edx<- BA
   12094     shr         $4, rINST              # rINST<- B
   12095     andl        $15, %edx              # %edx<- A
   12096     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12097     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   12098     pand   %xmm1, %xmm0                              # %xmm0<- vA op vB
   12099     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   12100     FINISH      1                       # jump to next instruction
   12101 
   12102 
   12103 /* ------------------------------ */
   12104     .balign 64
   12105 .L_OP_OR_LONG_2ADDR: /* 0xc1 */
   12106 /* File: x86-atom/OP_OR_LONG_2ADDR.S */
   12107    /* Copyright (C) 2008 The Android Open Source Project
   12108     *
   12109     * Licensed under the Apache License, Version 2.0 (the "License");
   12110     * you may not use this file except in compliance with the License.
   12111     * You may obtain a copy of the License at
   12112     *
   12113     * http://www.apache.org/licenses/LICENSE-2.0
   12114     *
   12115     * Unless required by applicable law or agreed to in writing, software
   12116     * distributed under the License is distributed on an "AS IS" BASIS,
   12117     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12118     * See the License for the specific language governing permissions and
   12119     * limitations under the License.
   12120     */
   12121 
   12122    /*
   12123     * File: OP_OR_LONG_2ADDR.S
   12124     */
   12125 
   12126 /* File: x86-atom/binopWide2addr.S */
   12127    /* Copyright (C) 2008 The Android Open Source Project
   12128     *
   12129     * Licensed under the Apache License, Version 2.0 (the "License");
   12130     * you may not use this file except in compliance with the License.
   12131     * You may obtain a copy of the License at
   12132     *
   12133     * http://www.apache.org/licenses/LICENSE-2.0
   12134     *
   12135     * Unless required by applicable law or agreed to in writing, software
   12136     * distributed under the License is distributed on an "AS IS" BASIS,
   12137     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12138     * See the License for the specific language governing permissions and
   12139     * limitations under the License.
   12140     */
   12141 
   12142    /*
   12143     * File: binopWide2addr.S
   12144     *
   12145     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   12146     *       "instr" line to specify an instruction that performs
   12147     *       "%xmm0= %xmm0 op %xmm1".
   12148     *
   12149     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   12150     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   12151     *
   12152     * Description: Perform a binary operation on two sources registers
   12153     *              and store the result in the first source register
   12154     *
   12155     * Format: B|A|op (12x)
   12156     *
   12157     * Syntax: op vA, vB
   12158     */
   12159 
   12160     movl        rINST, %edx             # %edx<- BA
   12161     shr         $4, rINST              # rINST<- B
   12162     andl        $15, %edx              # %edx<- A
   12163     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12164     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   12165     por %xmm1, %xmm0                              # %xmm0<- vA op vB
   12166     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   12167     FINISH      1                       # jump to next instruction
   12168 
   12169 
   12170 /* ------------------------------ */
   12171     .balign 64
   12172 .L_OP_XOR_LONG_2ADDR: /* 0xc2 */
   12173 /* File: x86-atom/OP_XOR_LONG_2ADDR.S */
   12174    /* Copyright (C) 2008 The Android Open Source Project
   12175     *
   12176     * Licensed under the Apache License, Version 2.0 (the "License");
   12177     * you may not use this file except in compliance with the License.
   12178     * You may obtain a copy of the License at
   12179     *
   12180     * http://www.apache.org/licenses/LICENSE-2.0
   12181     *
   12182     * Unless required by applicable law or agreed to in writing, software
   12183     * distributed under the License is distributed on an "AS IS" BASIS,
   12184     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12185     * See the License for the specific language governing permissions and
   12186     * limitations under the License.
   12187     */
   12188 
   12189    /*
   12190     * File: OP_XOR_LONG_2ADDR.S
   12191     */
   12192 
   12193 /* File: x86-atom/binopWide2addr.S */
   12194    /* Copyright (C) 2008 The Android Open Source Project
   12195     *
   12196     * Licensed under the Apache License, Version 2.0 (the "License");
   12197     * you may not use this file except in compliance with the License.
   12198     * You may obtain a copy of the License at
   12199     *
   12200     * http://www.apache.org/licenses/LICENSE-2.0
   12201     *
   12202     * Unless required by applicable law or agreed to in writing, software
   12203     * distributed under the License is distributed on an "AS IS" BASIS,
   12204     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12205     * See the License for the specific language governing permissions and
   12206     * limitations under the License.
   12207     */
   12208 
   12209    /*
   12210     * File: binopWide2addr.S
   12211     *
   12212     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   12213     *       "instr" line to specify an instruction that performs
   12214     *       "%xmm0= %xmm0 op %xmm1".
   12215     *
   12216     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   12217     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   12218     *
   12219     * Description: Perform a binary operation on two sources registers
   12220     *              and store the result in the first source register
   12221     *
   12222     * Format: B|A|op (12x)
   12223     *
   12224     * Syntax: op vA, vB
   12225     */
   12226 
   12227     movl        rINST, %edx             # %edx<- BA
   12228     shr         $4, rINST              # rINST<- B
   12229     andl        $15, %edx              # %edx<- A
   12230     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12231     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   12232     pxor   %xmm1, %xmm0                              # %xmm0<- vA op vB
   12233     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   12234     FINISH      1                       # jump to next instruction
   12235 
   12236 
   12237 /* ------------------------------ */
   12238     .balign 64
   12239 .L_OP_SHL_LONG_2ADDR: /* 0xc3 */
   12240 /* File: x86-atom/OP_SHL_LONG_2ADDR.S */
   12241    /* Copyright (C) 2008 The Android Open Source Project
   12242     *
   12243     * Licensed under the Apache License, Version 2.0 (the "License");
   12244     * you may not use this file except in compliance with the License.
   12245     * You may obtain a copy of the License at
   12246     *
   12247     * http://www.apache.org/licenses/LICENSE-2.0
   12248     *
   12249     * Unless required by applicable law or agreed to in writing, software
   12250     * distributed under the License is distributed on an "AS IS" BASIS,
   12251     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12252     * See the License for the specific language governing permissions and
   12253     * limitations under the License.
   12254     */
   12255 
   12256    /*
   12257     * File: OP_SHL_LONG_2ADDR.S
   12258     *
   12259     * Code: Performs a shift left long. Uses no substitutions.
   12260     *
   12261     * For: shl-long/2addr
   12262     *
   12263     * Description: Perform a binary shift operation using two source registers
   12264     *              where the fist is the value to shift and the second is the
   12265     *              shift amount. Store the result in the first source register.
   12266     *
   12267     * Format: B|A|op (12x)
   12268     *
   12269     * Syntax: op vA, vB
   12270     */
   12271 
   12272     movl        rINST, %edx             # %edx<- BA
   12273     shr         $4, %edx               # %edx<- B
   12274     andl        $15, rINST             # rINST<- A
   12275     movss       (rFP, %edx, 4),  %xmm0  # %xmm0<- vB
   12276     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vA
   12277     movq        .LshiftMask, %xmm2      # %xmm2<- mask for the shift bits
   12278     pand        %xmm2, %xmm0            # %xmm0<- masked shift bits
   12279     psllq       %xmm0, %xmm1            # %xmm1<- shifted vA
   12280     movq        %xmm1, (rFP, rINST, 4)  # vA<- shifted vA
   12281     FINISH      1                       # jump to next instruction
   12282 
   12283 /* ------------------------------ */
   12284     .balign 64
   12285 .L_OP_SHR_LONG_2ADDR: /* 0xc4 */
   12286 /* File: x86-atom/OP_SHR_LONG_2ADDR.S */
   12287    /* Copyright (C) 2008 The Android Open Source Project
   12288     *
   12289     * Licensed under the Apache License, Version 2.0 (the "License");
   12290     * you may not use this file except in compliance with the License.
   12291     * You may obtain a copy of the License at
   12292     *
   12293     * http://www.apache.org/licenses/LICENSE-2.0
   12294     *
   12295     * Unless required by applicable law or agreed to in writing, software
   12296     * distributed under the License is distributed on an "AS IS" BASIS,
   12297     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12298     * See the License for the specific language governing permissions and
   12299     * limitations under the License.
   12300     */
   12301 
   12302    /*
   12303     * File: OP_SHR_LONG_2ADDR.S
   12304     *
   12305     * Code: Performs a shift left long
   12306     *
   12307     * For: shl-long/2addr
   12308     *
   12309     * Description: Perform a binary shift operation using two source registers
   12310     *              where the fist is the value to shift and the second is the
   12311     *              shift amount. Store the result in the first source register.
   12312     *
   12313     * Format: B|A|op (12x)
   12314     *
   12315     * Syntax: op vA, vB
   12316     */
   12317 
   12318     movl        rINST, %edx             # %edx<- BA
   12319     shr         $4, %edx               # %edx<- B
   12320     andl        $15, rINST             # rINST<- BA
   12321     movss       (rFP, %edx, 4),  %xmm0  # %xmm0<- vB
   12322     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vA
   12323     movq        .LshiftMask, %xmm2
   12324     pand        %xmm2, %xmm0            # %xmm0<- masked for the shift bits
   12325     psrlq       %xmm0, %xmm1            # %xmm1<- shifted vBB
   12326     cmpl        $0, 4(rFP, rINST, 4)   # check if we need to consider sign
   12327     jl          .LOP_SHR_LONG_2ADDR_finish      # consider sign
   12328     jmp         .LOP_SHR_LONG_2ADDR_final       # sign is fine, finish
   12329 
   12330 /* ------------------------------ */
   12331     .balign 64
   12332 .L_OP_USHR_LONG_2ADDR: /* 0xc5 */
   12333 /* File: x86-atom/OP_USHR_LONG_2ADDR.S */
   12334    /* Copyright (C) 2008 The Android Open Source Project
   12335     *
   12336     * Licensed under the Apache License, Version 2.0 (the "License");
   12337     * you may not use this file except in compliance with the License.
   12338     * You may obtain a copy of the License at
   12339     *
   12340     * http://www.apache.org/licenses/LICENSE-2.0
   12341     *
   12342     * Unless required by applicable law or agreed to in writing, software
   12343     * distributed under the License is distributed on an "AS IS" BASIS,
   12344     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12345     * See the License for the specific language governing permissions and
   12346     * limitations under the License.
   12347     */
   12348 
   12349    /*
   12350     * File: OP_USHR_LONG_2ADDR.S
   12351     *
   12352     * Code: Performs an unsigned shift right long operation. Uses no substiutions.
   12353     *
   12354     * For: ushr-long/2addr
   12355     *
   12356     * Description: Perform a binary shift operation using two source registers
   12357     *              where the fist is the value to shift and the second is the
   12358     *              shift amount. Store the result in the first source register.
   12359     *
   12360     * Format: B|A|op (12x)
   12361     *
   12362     * Syntax: op vA, vB
   12363     */
   12364 
   12365     movl        rINST, %edx             # %edx<- BA
   12366     shr         $4, %edx               # %edx<- B
   12367     andl        $15, rINST             # rINST<- A
   12368     movq        .LshiftMask, %xmm2      # %xmm2<- mask for the shift bits
   12369     movss       (rFP, %edx, 4),  %xmm0  # %xmm0<- vB
   12370     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vA
   12371     pand        %xmm2, %xmm0            # %xmm0<- masked shift bits
   12372     psrlq       %xmm0, %xmm1            # %xmm1<- shifted vA
   12373     movq        %xmm1, (rFP, rINST, 4)  # vA<- shifted vA
   12374     FINISH      1                       # jump to next instruction
   12375 
   12376 /* ------------------------------ */
   12377     .balign 64
   12378 .L_OP_ADD_FLOAT_2ADDR: /* 0xc6 */
   12379 /* File: x86-atom/OP_ADD_FLOAT_2ADDR.S */
   12380    /* Copyright (C) 2008 The Android Open Source Project
   12381     *
   12382     * Licensed under the Apache License, Version 2.0 (the "License");
   12383     * you may not use this file except in compliance with the License.
   12384     * You may obtain a copy of the License at
   12385     *
   12386     * http://www.apache.org/licenses/LICENSE-2.0
   12387     *
   12388     * Unless required by applicable law or agreed to in writing, software
   12389     * distributed under the License is distributed on an "AS IS" BASIS,
   12390     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12391     * See the License for the specific language governing permissions and
   12392     * limitations under the License.
   12393     */
   12394 
   12395    /*
   12396     * File: OP_ADD_FLOAT_2ADDR.S
   12397     */
   12398 
   12399 /* File: x86-atom/binopF2addr.S */
   12400    /* Copyright (C) 2008 The Android Open Source Project
   12401     *
   12402     * Licensed under the Apache License, Version 2.0 (the "License");
   12403     * you may not use this file except in compliance with the License.
   12404     * You may obtain a copy of the License at
   12405     *
   12406     * http://www.apache.org/licenses/LICENSE-2.0
   12407     *
   12408     * Unless required by applicable law or agreed to in writing, software
   12409     * distributed under the License is distributed on an "AS IS" BASIS,
   12410     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12411     * See the License for the specific language governing permissions and
   12412     * limitations under the License.
   12413     */
   12414 
   12415    /*
   12416     * File: binopF2addr.S
   12417     *
   12418     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   12419     *       "instr" line to specify an instruction that performs
   12420     *       "%xmm0 = %xmm0 op %xmm1".
   12421     *
   12422     * For: add-float/2addr, mul-float/2addr, sub-float/2addr
   12423     *
   12424     * Description: Perform a binary operation on two sources registers
   12425     *              and store the result in the first source register
   12426     *
   12427     * Format: B|A|op (12x)
   12428     *
   12429     * Syntax: op vA, vB
   12430     */
   12431 
   12432     movl        rINST, %ecx             # %ecx<- BA
   12433     andl        $15, %ecx              # %ecx<- A
   12434     shr         $4, rINST              # rINST<- B
   12435     FFETCH_ADV  1, %edx                 # %ecx<- next instruction hi; fetch, advance
   12436     movss       (rFP, %ecx, 4), %xmm0   # %xmm0<- vA
   12437     movss       (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12438     addss     %xmm1, %xmm0                              # %xmm0<- vA op vB
   12439     movss       %xmm0, (rFP, %ecx, 4)   # vA<- %xmm0; result
   12440     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   12441 
   12442 
   12443 /* ------------------------------ */
   12444     .balign 64
   12445 .L_OP_SUB_FLOAT_2ADDR: /* 0xc7 */
   12446 /* File: x86-atom/OP_SUB_FLOAT_2ADDR.S */
   12447    /* Copyright (C) 2008 The Android Open Source Project
   12448     *
   12449     * Licensed under the Apache License, Version 2.0 (the "License");
   12450     * you may not use this file except in compliance with the License.
   12451     * You may obtain a copy of the License at
   12452     *
   12453     * http://www.apache.org/licenses/LICENSE-2.0
   12454     *
   12455     * Unless required by applicable law or agreed to in writing, software
   12456     * distributed under the License is distributed on an "AS IS" BASIS,
   12457     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12458     * See the License for the specific language governing permissions and
   12459     * limitations under the License.
   12460     */
   12461 
   12462    /*
   12463     * File: OP_SUB_FLOAT_2ADDR.S
   12464     */
   12465 
   12466 /* File: x86-atom/binopF2addr.S */
   12467    /* Copyright (C) 2008 The Android Open Source Project
   12468     *
   12469     * Licensed under the Apache License, Version 2.0 (the "License");
   12470     * you may not use this file except in compliance with the License.
   12471     * You may obtain a copy of the License at
   12472     *
   12473     * http://www.apache.org/licenses/LICENSE-2.0
   12474     *
   12475     * Unless required by applicable law or agreed to in writing, software
   12476     * distributed under the License is distributed on an "AS IS" BASIS,
   12477     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12478     * See the License for the specific language governing permissions and
   12479     * limitations under the License.
   12480     */
   12481 
   12482    /*
   12483     * File: binopF2addr.S
   12484     *
   12485     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   12486     *       "instr" line to specify an instruction that performs
   12487     *       "%xmm0 = %xmm0 op %xmm1".
   12488     *
   12489     * For: add-float/2addr, mul-float/2addr, sub-float/2addr
   12490     *
   12491     * Description: Perform a binary operation on two sources registers
   12492     *              and store the result in the first source register
   12493     *
   12494     * Format: B|A|op (12x)
   12495     *
   12496     * Syntax: op vA, vB
   12497     */
   12498 
   12499     movl        rINST, %ecx             # %ecx<- BA
   12500     andl        $15, %ecx              # %ecx<- A
   12501     shr         $4, rINST              # rINST<- B
   12502     FFETCH_ADV  1, %edx                 # %ecx<- next instruction hi; fetch, advance
   12503     movss       (rFP, %ecx, 4), %xmm0   # %xmm0<- vA
   12504     movss       (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12505     subss     %xmm1, %xmm0                              # %xmm0<- vA op vB
   12506     movss       %xmm0, (rFP, %ecx, 4)   # vA<- %xmm0; result
   12507     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   12508 
   12509 
   12510 /* ------------------------------ */
   12511     .balign 64
   12512 .L_OP_MUL_FLOAT_2ADDR: /* 0xc8 */
   12513 /* File: x86-atom/OP_MUL_FLOAT_2ADDR.S */
   12514    /* Copyright (C) 2008 The Android Open Source Project
   12515     *
   12516     * Licensed under the Apache License, Version 2.0 (the "License");
   12517     * you may not use this file except in compliance with the License.
   12518     * You may obtain a copy of the License at
   12519     *
   12520     * http://www.apache.org/licenses/LICENSE-2.0
   12521     *
   12522     * Unless required by applicable law or agreed to in writing, software
   12523     * distributed under the License is distributed on an "AS IS" BASIS,
   12524     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12525     * See the License for the specific language governing permissions and
   12526     * limitations under the License.
   12527     */
   12528 
   12529    /*
   12530     * File: OP_MUL_FLOAT_2ADDR.S
   12531     */
   12532 
   12533 /* File: x86-atom/binopF2addr.S */
   12534    /* Copyright (C) 2008 The Android Open Source Project
   12535     *
   12536     * Licensed under the Apache License, Version 2.0 (the "License");
   12537     * you may not use this file except in compliance with the License.
   12538     * You may obtain a copy of the License at
   12539     *
   12540     * http://www.apache.org/licenses/LICENSE-2.0
   12541     *
   12542     * Unless required by applicable law or agreed to in writing, software
   12543     * distributed under the License is distributed on an "AS IS" BASIS,
   12544     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12545     * See the License for the specific language governing permissions and
   12546     * limitations under the License.
   12547     */
   12548 
   12549    /*
   12550     * File: binopF2addr.S
   12551     *
   12552     * Code: Generic 32-bit "/2addr" binary operation.  Provides an
   12553     *       "instr" line to specify an instruction that performs
   12554     *       "%xmm0 = %xmm0 op %xmm1".
   12555     *
   12556     * For: add-float/2addr, mul-float/2addr, sub-float/2addr
   12557     *
   12558     * Description: Perform a binary operation on two sources registers
   12559     *              and store the result in the first source register
   12560     *
   12561     * Format: B|A|op (12x)
   12562     *
   12563     * Syntax: op vA, vB
   12564     */
   12565 
   12566     movl        rINST, %ecx             # %ecx<- BA
   12567     andl        $15, %ecx              # %ecx<- A
   12568     shr         $4, rINST              # rINST<- B
   12569     FFETCH_ADV  1, %edx                 # %ecx<- next instruction hi; fetch, advance
   12570     movss       (rFP, %ecx, 4), %xmm0   # %xmm0<- vA
   12571     movss       (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12572     mulss %xmm1, %xmm0                              # %xmm0<- vA op vB
   12573     movss       %xmm0, (rFP, %ecx, 4)   # vA<- %xmm0; result
   12574     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   12575 
   12576 
   12577 /* ------------------------------ */
   12578     .balign 64
   12579 .L_OP_DIV_FLOAT_2ADDR: /* 0xc9 */
   12580 /* File: x86-atom/OP_DIV_FLOAT_2ADDR.S */
   12581    /* Copyright (C) 2008 The Android Open Source Project
   12582     *
   12583     * Licensed under the Apache License, Version 2.0 (the "License");
   12584     * you may not use this file except in compliance with the License.
   12585     * You may obtain a copy of the License at
   12586     *
   12587     * http://www.apache.org/licenses/LICENSE-2.0
   12588     *
   12589     * Unless required by applicable law or agreed to in writing, software
   12590     * distributed under the License is distributed on an "AS IS" BASIS,
   12591     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12592     * See the License for the specific language governing permissions and
   12593     * limitations under the License.
   12594     */
   12595 
   12596    /*
   12597     * File: OP_DIV_FLOAT_2ADDR.S
   12598     *
   12599     * Code: Divides floats. Uses no substitutions.
   12600     *
   12601     * For: div-float/2addr
   12602     *
   12603     * Description: Divide operation on two source registers, storing
   12604     *              the result in the first source reigster
   12605     *
   12606     * Format: B|A|op (12x)
   12607     *
   12608     * Syntax: op vA, vB
   12609     */
   12610 
   12611     movl        rINST, %ecx             # %ecx<- BA
   12612     andl        $15, %ecx              # %ecx<- A
   12613     shr         $4, rINST              # rINST<- B
   12614     flds        (rFP, %ecx, 4)          # %xmm0<- vA
   12615     fdivs       (rFP, rINST, 4)         # divide double; vA/vB
   12616     fstps       (rFP, %ecx, 4)          # vAA<- result
   12617     FINISH      1                       # jump to next instruction
   12618 
   12619 /* ------------------------------ */
   12620     .balign 64
   12621 .L_OP_REM_FLOAT_2ADDR: /* 0xca */
   12622 /* File: x86-atom/OP_REM_FLOAT_2ADDR.S */
   12623    /* Copyright (C) 2008 The Android Open Source Project
   12624     *
   12625     * Licensed under the Apache License, Version 2.0 (the "License");
   12626     * you may not use this file except in compliance with the License.
   12627     * You may obtain a copy of the License at
   12628     *
   12629     * http://www.apache.org/licenses/LICENSE-2.0
   12630     *
   12631     * Unless required by applicable law or agreed to in writing, software
   12632     * distributed under the License is distributed on an "AS IS" BASIS,
   12633     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12634     * See the License for the specific language governing permissions and
   12635     * limitations under the License.
   12636     */
   12637 
   12638    /*
   12639     * File: OP_REM_FLOAT_2ADDR.S
   12640     *
   12641     * Code: Computes the remainder of a division. Performs no substitutions.
   12642     *
   12643     * For: rem-float/2addr
   12644     *
   12645     * Description: Calls fmod to compute the remainder of the result of dividing a
   12646     *              source register by a second, and stores the result in the first
   12647     *              source register.
   12648     *
   12649     * Format: B|A|op (12x)
   12650     *
   12651     * Syntax: op vA, vB
   12652     */
   12653 
   12654     movl        rINST, %edx             # %edx<- BA
   12655     shr         $4, %edx               # %edx<- B
   12656     andl        $15, rINST             # rINST<- A
   12657     GET_VREG    %edx                    # %edx<- vB
   12658     movl        (rFP, rINST, 4), %ecx   # %ecx<- vA
   12659     movl        %ecx, -8(%esp)          # push parameter vA
   12660     movl        %edx, -4(%esp)          # push parameter vB
   12661     lea         -8(%esp), %esp
   12662     call        fmodf                   # call: (float x, float y)
   12663                                         # return: float
   12664     lea         8(%esp), %esp
   12665     fstps       (rFP, rINST, 4)
   12666     FINISH      1                       # jump to next instruction
   12667 
   12668 /* ------------------------------ */
   12669     .balign 64
   12670 .L_OP_ADD_DOUBLE_2ADDR: /* 0xcb */
   12671 /* File: x86-atom/OP_ADD_DOUBLE_2ADDR.S */
   12672    /* Copyright (C) 2008 The Android Open Source Project
   12673     *
   12674     * Licensed under the Apache License, Version 2.0 (the "License");
   12675     * you may not use this file except in compliance with the License.
   12676     * You may obtain a copy of the License at
   12677     *
   12678     * http://www.apache.org/licenses/LICENSE-2.0
   12679     *
   12680     * Unless required by applicable law or agreed to in writing, software
   12681     * distributed under the License is distributed on an "AS IS" BASIS,
   12682     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12683     * See the License for the specific language governing permissions and
   12684     * limitations under the License.
   12685     */
   12686 
   12687    /*
   12688     * File: OP_ADD_DOUBLE_2ADDR.S
   12689     */
   12690 
   12691 /* File: x86-atom/binopWide2addr.S */
   12692    /* Copyright (C) 2008 The Android Open Source Project
   12693     *
   12694     * Licensed under the Apache License, Version 2.0 (the "License");
   12695     * you may not use this file except in compliance with the License.
   12696     * You may obtain a copy of the License at
   12697     *
   12698     * http://www.apache.org/licenses/LICENSE-2.0
   12699     *
   12700     * Unless required by applicable law or agreed to in writing, software
   12701     * distributed under the License is distributed on an "AS IS" BASIS,
   12702     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12703     * See the License for the specific language governing permissions and
   12704     * limitations under the License.
   12705     */
   12706 
   12707    /*
   12708     * File: binopWide2addr.S
   12709     *
   12710     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   12711     *       "instr" line to specify an instruction that performs
   12712     *       "%xmm0= %xmm0 op %xmm1".
   12713     *
   12714     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   12715     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   12716     *
   12717     * Description: Perform a binary operation on two sources registers
   12718     *              and store the result in the first source register
   12719     *
   12720     * Format: B|A|op (12x)
   12721     *
   12722     * Syntax: op vA, vB
   12723     */
   12724 
   12725     movl        rINST, %edx             # %edx<- BA
   12726     shr         $4, rINST              # rINST<- B
   12727     andl        $15, %edx              # %edx<- A
   12728     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12729     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   12730     addsd   %xmm1, %xmm0                              # %xmm0<- vA op vB
   12731     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   12732     FINISH      1                       # jump to next instruction
   12733 
   12734 
   12735 /* ------------------------------ */
   12736     .balign 64
   12737 .L_OP_SUB_DOUBLE_2ADDR: /* 0xcc */
   12738 /* File: x86-atom/OP_SUB_DOUBLE_2ADDR.S */
   12739    /* Copyright (C) 2008 The Android Open Source Project
   12740     *
   12741     * Licensed under the Apache License, Version 2.0 (the "License");
   12742     * you may not use this file except in compliance with the License.
   12743     * You may obtain a copy of the License at
   12744     *
   12745     * http://www.apache.org/licenses/LICENSE-2.0
   12746     *
   12747     * Unless required by applicable law or agreed to in writing, software
   12748     * distributed under the License is distributed on an "AS IS" BASIS,
   12749     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12750     * See the License for the specific language governing permissions and
   12751     * limitations under the License.
   12752     */
   12753 
   12754    /*
   12755     * File: OP_SUB_DOUBLE_2ADDR.S
   12756     */
   12757 
   12758 /* File: x86-atom/binopWide2addr.S */
   12759    /* Copyright (C) 2008 The Android Open Source Project
   12760     *
   12761     * Licensed under the Apache License, Version 2.0 (the "License");
   12762     * you may not use this file except in compliance with the License.
   12763     * You may obtain a copy of the License at
   12764     *
   12765     * http://www.apache.org/licenses/LICENSE-2.0
   12766     *
   12767     * Unless required by applicable law or agreed to in writing, software
   12768     * distributed under the License is distributed on an "AS IS" BASIS,
   12769     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12770     * See the License for the specific language governing permissions and
   12771     * limitations under the License.
   12772     */
   12773 
   12774    /*
   12775     * File: binopWide2addr.S
   12776     *
   12777     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   12778     *       "instr" line to specify an instruction that performs
   12779     *       "%xmm0= %xmm0 op %xmm1".
   12780     *
   12781     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   12782     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   12783     *
   12784     * Description: Perform a binary operation on two sources registers
   12785     *              and store the result in the first source register
   12786     *
   12787     * Format: B|A|op (12x)
   12788     *
   12789     * Syntax: op vA, vB
   12790     */
   12791 
   12792     movl        rINST, %edx             # %edx<- BA
   12793     shr         $4, rINST              # rINST<- B
   12794     andl        $15, %edx              # %edx<- A
   12795     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12796     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   12797     subsd   %xmm1, %xmm0                              # %xmm0<- vA op vB
   12798     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   12799     FINISH      1                       # jump to next instruction
   12800 
   12801 
   12802 /* ------------------------------ */
   12803     .balign 64
   12804 .L_OP_MUL_DOUBLE_2ADDR: /* 0xcd */
   12805 /* File: x86-atom/OP_MUL_DOUBLE_2ADDR.S */
   12806    /* Copyright (C) 2008 The Android Open Source Project
   12807     *
   12808     * Licensed under the Apache License, Version 2.0 (the "License");
   12809     * you may not use this file except in compliance with the License.
   12810     * You may obtain a copy of the License at
   12811     *
   12812     * http://www.apache.org/licenses/LICENSE-2.0
   12813     *
   12814     * Unless required by applicable law or agreed to in writing, software
   12815     * distributed under the License is distributed on an "AS IS" BASIS,
   12816     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12817     * See the License for the specific language governing permissions and
   12818     * limitations under the License.
   12819     */
   12820 
   12821    /*
   12822     * File: OP_MUL_DOUBLE_2ADDR.S
   12823     */
   12824 
   12825 /* File: x86-atom/binopWide2addr.S */
   12826    /* Copyright (C) 2008 The Android Open Source Project
   12827     *
   12828     * Licensed under the Apache License, Version 2.0 (the "License");
   12829     * you may not use this file except in compliance with the License.
   12830     * You may obtain a copy of the License at
   12831     *
   12832     * http://www.apache.org/licenses/LICENSE-2.0
   12833     *
   12834     * Unless required by applicable law or agreed to in writing, software
   12835     * distributed under the License is distributed on an "AS IS" BASIS,
   12836     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12837     * See the License for the specific language governing permissions and
   12838     * limitations under the License.
   12839     */
   12840 
   12841    /*
   12842     * File: binopWide2addr.S
   12843     *
   12844     * Code: Generic 64-bit "/2addr" binary operation.  Provides an
   12845     *       "instr" line to specify an instruction that performs
   12846     *       "%xmm0= %xmm0 op %xmm1".
   12847     *
   12848     * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
   12849     *      or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
   12850     *
   12851     * Description: Perform a binary operation on two sources registers
   12852     *              and store the result in the first source register
   12853     *
   12854     * Format: B|A|op (12x)
   12855     *
   12856     * Syntax: op vA, vB
   12857     */
   12858 
   12859     movl        rINST, %edx             # %edx<- BA
   12860     shr         $4, rINST              # rINST<- B
   12861     andl        $15, %edx              # %edx<- A
   12862     movq        (rFP, rINST, 4), %xmm1  # %xmm1<- vB
   12863     movq        (rFP, %edx, 4), %xmm0   # %xmm0<- vA
   12864     mulsd   %xmm1, %xmm0                              # %xmm0<- vA op vB
   12865     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; result
   12866     FINISH      1                       # jump to next instruction
   12867 
   12868 
   12869 /* ------------------------------ */
   12870     .balign 64
   12871 .L_OP_DIV_DOUBLE_2ADDR: /* 0xce */
   12872 /* File: x86-atom/OP_DIV_DOUBLE_2ADDR.S */
   12873    /* Copyright (C) 2008 The Android Open Source Project
   12874     *
   12875     * Licensed under the Apache License, Version 2.0 (the "License");
   12876     * you may not use this file except in compliance with the License.
   12877     * You may obtain a copy of the License at
   12878     *
   12879     * http://www.apache.org/licenses/LICENSE-2.0
   12880     *
   12881     * Unless required by applicable law or agreed to in writing, software
   12882     * distributed under the License is distributed on an "AS IS" BASIS,
   12883     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12884     * See the License for the specific language governing permissions and
   12885     * limitations under the License.
   12886     */
   12887 
   12888    /*
   12889     * File: OP_DIV_DOUBLE_2ADDR.S
   12890     *
   12891     * Code: Divides doubles. Uses no substitutions.
   12892     *
   12893     * For: div-double/2addr
   12894     *
   12895     * Description: Divide operation on two source registers, storing
   12896     *              the result in the first source reigster
   12897     *
   12898     * Format: B|A|op (12x)
   12899     *
   12900     * Syntax: op vA, vB
   12901     */
   12902 
   12903     movl        rINST, %edx             # %edx<- BA
   12904     andl        $15, %edx              # %edx<- A
   12905     shr         $4, rINST              # rINST<- B
   12906     fldl        (rFP, %edx, 4)          # %xmm0<- vA
   12907     fdivl       (rFP, rINST, 4)         # divide double; vA/vB
   12908     fstpl       (rFP, %edx, 4)          # vAA<- result
   12909     FINISH      1                       # jump to next instruction
   12910 
   12911 /* ------------------------------ */
   12912     .balign 64
   12913 .L_OP_REM_DOUBLE_2ADDR: /* 0xcf */
   12914 /* File: x86-atom/OP_REM_DOUBLE_2ADDR.S */
   12915    /* Copyright (C) 2008 The Android Open Source Project
   12916     *
   12917     * Licensed under the Apache License, Version 2.0 (the "License");
   12918     * you may not use this file except in compliance with the License.
   12919     * You may obtain a copy of the License at
   12920     *
   12921     * http://www.apache.org/licenses/LICENSE-2.0
   12922     *
   12923     * Unless required by applicable law or agreed to in writing, software
   12924     * distributed under the License is distributed on an "AS IS" BASIS,
   12925     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12926     * See the License for the specific language governing permissions and
   12927     * limitations under the License.
   12928     */
   12929 
   12930    /*
   12931     * File: OP_REM_DOUBLE_2ADDR.S
   12932     *
   12933     * Code: Computes the remainder of a division. Performs no substitutions.
   12934     *
   12935     * For: rem-double/2addr
   12936     *
   12937     * Description: Calls fmod to compute the remainder of the result of dividing a
   12938     *              source register by a second, and stores the result in the first
   12939     *              source register.
   12940     *
   12941     * Format: B|A|op (12x)
   12942     *
   12943     * Syntax: op vA, vB
   12944     */
   12945 
   12946     movl        rINST, %edx             # %edx<- BA
   12947     and         $15, rINST             # rINST<- A
   12948     shr         $4, %edx               # %edx<- B
   12949     movl        (rFP, rINST, 4), %eax   # %eax<- vAlo
   12950     movl        %eax, -20(%esp)         # push parameter vAAlo
   12951     movl        4(rFP, rINST, 4), %eax  # %eax<- vAhi
   12952     movl        %eax, -16(%esp)         # push parameter vAAhi
   12953     movl        (rFP, %edx, 4), %eax    # %eax<- vBlo
   12954     movl        %eax, -12(%esp)         # push parameter vBBlo
   12955     movl        4(rFP, %edx, 4), %eax   # %eax<- vBhi
   12956     movl        %eax, -8(%esp)          # push parameter vBBhi
   12957     lea         -20(%esp), %esp
   12958     jmp         .LOP_REM_DOUBLE_2ADDR_break
   12959 
   12960 /* ------------------------------ */
   12961     .balign 64
   12962 .L_OP_ADD_INT_LIT16: /* 0xd0 */
   12963 /* File: x86-atom/OP_ADD_INT_LIT16.S */
   12964    /* Copyright (C) 2008 The Android Open Source Project
   12965     *
   12966     * Licensed under the Apache License, Version 2.0 (the "License");
   12967     * you may not use this file except in compliance with the License.
   12968     * You may obtain a copy of the License at
   12969     *
   12970     * http://www.apache.org/licenses/LICENSE-2.0
   12971     *
   12972     * Unless required by applicable law or agreed to in writing, software
   12973     * distributed under the License is distributed on an "AS IS" BASIS,
   12974     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12975     * See the License for the specific language governing permissions and
   12976     * limitations under the License.
   12977     */
   12978 
   12979    /*
   12980     * File: OP_ADD_INT_LIT16.S
   12981     */
   12982 
   12983 /* File: x86-atom/binopLit16.S */
   12984    /* Copyright (C) 2008 The Android Open Source Project
   12985     *
   12986     * Licensed under the Apache License, Version 2.0 (the "License");
   12987     * you may not use this file except in compliance with the License.
   12988     * You may obtain a copy of the License at
   12989     *
   12990     * http://www.apache.org/licenses/LICENSE-2.0
   12991     *
   12992     * Unless required by applicable law or agreed to in writing, software
   12993     * distributed under the License is distributed on an "AS IS" BASIS,
   12994     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12995     * See the License for the specific language governing permissions and
   12996     * limitations under the License.
   12997     */
   12998 
   12999    /*
   13000     * File: binopLit16.S
   13001     *
   13002     * Code: 32-bit "lit16" operation. Provides an "instr" line to
   13003     *       specify an instruction that performs "%ecx = %ecx op %edx"
   13004     *
   13005     *
   13006     * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
   13007     *      xor-int/lit16
   13008     *
   13009     * Description: Perform a binary operation on a register and a
   13010     *              sign extended 16-bit literal value and store the
   13011     *              result in a destination register.
   13012     *
   13013     * Format: B|A|op CCCC (22s)
   13014     *
   13015     * Syntax: op vA, vB, #+CCCC
   13016     */
   13017 
   13018     movl        rINST, %ecx             # %ecx<- BA
   13019     shr         $4, %ecx               # %ecx<- B
   13020     andl        $15, rINST             # rINST<- A
   13021     FETCHs      1, %edx                 # %edx<- +CCCC, sign-extended literal
   13022     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13023     GET_VREG    %ecx                    # %ecx<- vB
   13024     addl     %edx, %ecx                              # %ecx<- vA op vB
   13025     SET_VREG    %ecx, rINST             # vA<- %ecx; result
   13026     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13027 
   13028 
   13029 /* ------------------------------ */
   13030     .balign 64
   13031 .L_OP_RSUB_INT: /* 0xd1 */
   13032 /* File: x86-atom/OP_RSUB_INT.S */
   13033    /* Copyright (C) 2008 The Android Open Source Project
   13034     *
   13035     * Licensed under the Apache License, Version 2.0 (the "License");
   13036     * you may not use this file except in compliance with the License.
   13037     * You may obtain a copy of the License at
   13038     *
   13039     * http://www.apache.org/licenses/LICENSE-2.0
   13040     *
   13041     * Unless required by applicable law or agreed to in writing, software
   13042     * distributed under the License is distributed on an "AS IS" BASIS,
   13043     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13044     * See the License for the specific language governing permissions and
   13045     * limitations under the License.
   13046     */
   13047 
   13048    /*
   13049     * File: OP_RSUB_INT.S
   13050     *
   13051     * Code: 32-bit reverse-subtraction. Uses no substitutions.
   13052     *
   13053     * For: rsub-int
   13054     *
   13055     * Description: Perform a reverse subtraction on a register and a
   13056     *              signed extended 16-bit literal value and store the
   13057     *              result in a destination register.
   13058     *
   13059     * Format: B|A|op CCCC (22s)
   13060     *
   13061     * Syntax: op vA, vB, #+CCCC
   13062     */
   13063 
   13064     movl        rINST, %ecx             # %ecx<- BA
   13065     shr         $4, %ecx               # %ecx<- B
   13066     andl        $15, rINST             # rINST<- A
   13067     FETCHs      1, %edx                 # %edx<- +CCCC, sign-extended literal
   13068     GET_VREG    %ecx                    # %ecx<- vB
   13069     subl        %ecx, %edx              # %edx<- +CCCC sub vB
   13070     SET_VREG    %edx, rINST             # vA<- %edx; result
   13071     FINISH      2                       # jump to next instruction
   13072 
   13073 /* ------------------------------ */
   13074     .balign 64
   13075 .L_OP_MUL_INT_LIT16: /* 0xd2 */
   13076 /* File: x86-atom/OP_MUL_INT_LIT16.S */
   13077    /* Copyright (C) 2008 The Android Open Source Project
   13078     *
   13079     * Licensed under the Apache License, Version 2.0 (the "License");
   13080     * you may not use this file except in compliance with the License.
   13081     * You may obtain a copy of the License at
   13082     *
   13083     * http://www.apache.org/licenses/LICENSE-2.0
   13084     *
   13085     * Unless required by applicable law or agreed to in writing, software
   13086     * distributed under the License is distributed on an "AS IS" BASIS,
   13087     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13088     * See the License for the specific language governing permissions and
   13089     * limitations under the License.
   13090     */
   13091 
   13092    /*
   13093     * File: OP_MUL_INT_LIT16.S
   13094     */
   13095 
   13096 /* File: x86-atom/binopLit16.S */
   13097    /* Copyright (C) 2008 The Android Open Source Project
   13098     *
   13099     * Licensed under the Apache License, Version 2.0 (the "License");
   13100     * you may not use this file except in compliance with the License.
   13101     * You may obtain a copy of the License at
   13102     *
   13103     * http://www.apache.org/licenses/LICENSE-2.0
   13104     *
   13105     * Unless required by applicable law or agreed to in writing, software
   13106     * distributed under the License is distributed on an "AS IS" BASIS,
   13107     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13108     * See the License for the specific language governing permissions and
   13109     * limitations under the License.
   13110     */
   13111 
   13112    /*
   13113     * File: binopLit16.S
   13114     *
   13115     * Code: 32-bit "lit16" operation. Provides an "instr" line to
   13116     *       specify an instruction that performs "%ecx = %ecx op %edx"
   13117     *
   13118     *
   13119     * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
   13120     *      xor-int/lit16
   13121     *
   13122     * Description: Perform a binary operation on a register and a
   13123     *              sign extended 16-bit literal value and store the
   13124     *              result in a destination register.
   13125     *
   13126     * Format: B|A|op CCCC (22s)
   13127     *
   13128     * Syntax: op vA, vB, #+CCCC
   13129     */
   13130 
   13131     movl        rINST, %ecx             # %ecx<- BA
   13132     shr         $4, %ecx               # %ecx<- B
   13133     andl        $15, rINST             # rINST<- A
   13134     FETCHs      1, %edx                 # %edx<- +CCCC, sign-extended literal
   13135     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13136     GET_VREG    %ecx                    # %ecx<- vB
   13137     imul     %edx, %ecx                              # %ecx<- vA op vB
   13138     SET_VREG    %ecx, rINST             # vA<- %ecx; result
   13139     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13140 
   13141 
   13142 /* ------------------------------ */
   13143     .balign 64
   13144 .L_OP_DIV_INT_LIT16: /* 0xd3 */
   13145 /* File: x86-atom/OP_DIV_INT_LIT16.S */
   13146    /* Copyright (C) 2008 The Android Open Source Project
   13147     *
   13148     * Licensed under the Apache License, Version 2.0 (the "License");
   13149     * you may not use this file except in compliance with the License.
   13150     * You may obtain a copy of the License at
   13151     *
   13152     * http://www.apache.org/licenses/LICENSE-2.0
   13153     *
   13154     * Unless required by applicable law or agreed to in writing, software
   13155     * distributed under the License is distributed on an "AS IS" BASIS,
   13156     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13157     * See the License for the specific language governing permissions and
   13158     * limitations under the License.
   13159     */
   13160 
   13161    /*
   13162     * File: OP_DIV_INT_LIT16.S
   13163     */
   13164 
   13165 /* File: x86-atom/binopDLit16.S */
   13166    /* Copyright (C) 2008 The Android Open Source Project
   13167     *
   13168     * Licensed under the Apache License, Version 2.0 (the "License");
   13169     * you may not use this file except in compliance with the License.
   13170     * You may obtain a copy of the License at
   13171     *
   13172     * http://www.apache.org/licenses/LICENSE-2.0
   13173     *
   13174     * Unless required by applicable law or agreed to in writing, software
   13175     * distributed under the License is distributed on an "AS IS" BASIS,
   13176     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13177     * See the License for the specific language governing permissions and
   13178     * limitations under the License.
   13179     */
   13180 
   13181    /*
   13182     * File: binopDLit16.S
   13183     *
   13184     * Code: 32-bit "lit16" divide operation. If "div" is set, the code
   13185     *       returns the quotient, else it returns the remainder.
   13186     *       Also, a divide-by-zero check is done.
   13187     *
   13188     * For: div-int/lit16, rem-int/lit16
   13189     *
   13190     * Description: Perform a binary operation on a register and a
   13191     *              sign extended 16-bit literal value
   13192     *
   13193     * Format: B|A|op CCCC (22s)
   13194     *
   13195     * Syntax: op vA, vB, #+CCCC
   13196     */
   13197 
   13198 
   13199     movl        rINST, %eax             # %eax<- BA
   13200     shr         $4, %eax               # %eax<- B
   13201     FETCHs      1, %ecx                 # %ecx<- +CCCC, sign-extended literal
   13202     cmp         $0, %ecx               # check for divide by zero
   13203     GET_VREG    %eax                    # %eax<- vB
   13204     je          common_errDivideByZero  # handle divide by zero
   13205     andl        $15, rINST             # rINST<- A
   13206     cmpl        $-1, %ecx              # handle -1 special case divide error
   13207     jne         .LOP_DIV_INT_LIT16_noerror
   13208     cmpl        $0x80000000,%eax       # handle min int special case divide error
   13209     je         .LOP_DIV_INT_LIT16_break
   13210 .LOP_DIV_INT_LIT16_noerror:
   13211     cdq                                 # sign-extend %eax to %edx
   13212     idiv        %ecx                    # divide %edx:%eax by %ecx
   13213     #FFETCH_ADV 2, %ecx                 # %ecx<- next instruction hi; fetch, advance
   13214     .if  1
   13215     SET_VREG    %eax rINST              # vA<- %eax (quotient)
   13216     .else
   13217     SET_VREG    %edx rINST              # vA<- %edx (remainder)
   13218     .endif
   13219     jmp         .LOP_DIV_INT_LIT16_break2
   13220 
   13221 
   13222 
   13223 /* ------------------------------ */
   13224     .balign 64
   13225 .L_OP_REM_INT_LIT16: /* 0xd4 */
   13226 /* File: x86-atom/OP_REM_INT_LIT16.S */
   13227    /* Copyright (C) 2008 The Android Open Source Project
   13228     *
   13229     * Licensed under the Apache License, Version 2.0 (the "License");
   13230     * you may not use this file except in compliance with the License.
   13231     * You may obtain a copy of the License at
   13232     *
   13233     * http://www.apache.org/licenses/LICENSE-2.0
   13234     *
   13235     * Unless required by applicable law or agreed to in writing, software
   13236     * distributed under the License is distributed on an "AS IS" BASIS,
   13237     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13238     * See the License for the specific language governing permissions and
   13239     * limitations under the License.
   13240     */
   13241 
   13242    /*
   13243     * File: OP_REM_INT_LIT16.S
   13244     */
   13245 
   13246 /* File: x86-atom/binopDLit16.S */
   13247    /* Copyright (C) 2008 The Android Open Source Project
   13248     *
   13249     * Licensed under the Apache License, Version 2.0 (the "License");
   13250     * you may not use this file except in compliance with the License.
   13251     * You may obtain a copy of the License at
   13252     *
   13253     * http://www.apache.org/licenses/LICENSE-2.0
   13254     *
   13255     * Unless required by applicable law or agreed to in writing, software
   13256     * distributed under the License is distributed on an "AS IS" BASIS,
   13257     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13258     * See the License for the specific language governing permissions and
   13259     * limitations under the License.
   13260     */
   13261 
   13262    /*
   13263     * File: binopDLit16.S
   13264     *
   13265     * Code: 32-bit "lit16" divide operation. If "div" is set, the code
   13266     *       returns the quotient, else it returns the remainder.
   13267     *       Also, a divide-by-zero check is done.
   13268     *
   13269     * For: div-int/lit16, rem-int/lit16
   13270     *
   13271     * Description: Perform a binary operation on a register and a
   13272     *              sign extended 16-bit literal value
   13273     *
   13274     * Format: B|A|op CCCC (22s)
   13275     *
   13276     * Syntax: op vA, vB, #+CCCC
   13277     */
   13278 
   13279 
   13280     movl        rINST, %eax             # %eax<- BA
   13281     shr         $4, %eax               # %eax<- B
   13282     FETCHs      1, %ecx                 # %ecx<- +CCCC, sign-extended literal
   13283     cmp         $0, %ecx               # check for divide by zero
   13284     GET_VREG    %eax                    # %eax<- vB
   13285     je          common_errDivideByZero  # handle divide by zero
   13286     andl        $15, rINST             # rINST<- A
   13287     cmpl        $-1, %ecx              # handle -1 special case divide error
   13288     jne         .LOP_REM_INT_LIT16_noerror
   13289     cmpl        $0x80000000,%eax       # handle min int special case divide error
   13290     je         .LOP_REM_INT_LIT16_break
   13291 .LOP_REM_INT_LIT16_noerror:
   13292     cdq                                 # sign-extend %eax to %edx
   13293     idiv        %ecx                    # divide %edx:%eax by %ecx
   13294     #FFETCH_ADV 2, %ecx                 # %ecx<- next instruction hi; fetch, advance
   13295     .if  0
   13296     SET_VREG    %eax rINST              # vA<- %eax (quotient)
   13297     .else
   13298     SET_VREG    %edx rINST              # vA<- %edx (remainder)
   13299     .endif
   13300     jmp         .LOP_REM_INT_LIT16_break2
   13301 
   13302 
   13303 
   13304 /* ------------------------------ */
   13305     .balign 64
   13306 .L_OP_AND_INT_LIT16: /* 0xd5 */
   13307 /* File: x86-atom/OP_AND_INT_LIT16.S */
   13308    /* Copyright (C) 2008 The Android Open Source Project
   13309     *
   13310     * Licensed under the Apache License, Version 2.0 (the "License");
   13311     * you may not use this file except in compliance with the License.
   13312     * You may obtain a copy of the License at
   13313     *
   13314     * http://www.apache.org/licenses/LICENSE-2.0
   13315     *
   13316     * Unless required by applicable law or agreed to in writing, software
   13317     * distributed under the License is distributed on an "AS IS" BASIS,
   13318     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13319     * See the License for the specific language governing permissions and
   13320     * limitations under the License.
   13321     */
   13322 
   13323    /*
   13324     * File: OP_AND_INT_LIT16.S
   13325     */
   13326 
   13327 /* File: x86-atom/binopLit16.S */
   13328    /* Copyright (C) 2008 The Android Open Source Project
   13329     *
   13330     * Licensed under the Apache License, Version 2.0 (the "License");
   13331     * you may not use this file except in compliance with the License.
   13332     * You may obtain a copy of the License at
   13333     *
   13334     * http://www.apache.org/licenses/LICENSE-2.0
   13335     *
   13336     * Unless required by applicable law or agreed to in writing, software
   13337     * distributed under the License is distributed on an "AS IS" BASIS,
   13338     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13339     * See the License for the specific language governing permissions and
   13340     * limitations under the License.
   13341     */
   13342 
   13343    /*
   13344     * File: binopLit16.S
   13345     *
   13346     * Code: 32-bit "lit16" operation. Provides an "instr" line to
   13347     *       specify an instruction that performs "%ecx = %ecx op %edx"
   13348     *
   13349     *
   13350     * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
   13351     *      xor-int/lit16
   13352     *
   13353     * Description: Perform a binary operation on a register and a
   13354     *              sign extended 16-bit literal value and store the
   13355     *              result in a destination register.
   13356     *
   13357     * Format: B|A|op CCCC (22s)
   13358     *
   13359     * Syntax: op vA, vB, #+CCCC
   13360     */
   13361 
   13362     movl        rINST, %ecx             # %ecx<- BA
   13363     shr         $4, %ecx               # %ecx<- B
   13364     andl        $15, rINST             # rINST<- A
   13365     FETCHs      1, %edx                 # %edx<- +CCCC, sign-extended literal
   13366     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13367     GET_VREG    %ecx                    # %ecx<- vB
   13368     andl     %edx, %ecx                              # %ecx<- vA op vB
   13369     SET_VREG    %ecx, rINST             # vA<- %ecx; result
   13370     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13371 
   13372 
   13373 /* ------------------------------ */
   13374     .balign 64
   13375 .L_OP_OR_INT_LIT16: /* 0xd6 */
   13376 /* File: x86-atom/OP_OR_INT_LIT16.S */
   13377    /* Copyright (C) 2008 The Android Open Source Project
   13378     *
   13379     * Licensed under the Apache License, Version 2.0 (the "License");
   13380     * you may not use this file except in compliance with the License.
   13381     * You may obtain a copy of the License at
   13382     *
   13383     * http://www.apache.org/licenses/LICENSE-2.0
   13384     *
   13385     * Unless required by applicable law or agreed to in writing, software
   13386     * distributed under the License is distributed on an "AS IS" BASIS,
   13387     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13388     * See the License for the specific language governing permissions and
   13389     * limitations under the License.
   13390     */
   13391 
   13392    /*
   13393     * File: OP_OR_INT_LIT16.S
   13394     */
   13395 
   13396 /* File: x86-atom/binopLit16.S */
   13397    /* Copyright (C) 2008 The Android Open Source Project
   13398     *
   13399     * Licensed under the Apache License, Version 2.0 (the "License");
   13400     * you may not use this file except in compliance with the License.
   13401     * You may obtain a copy of the License at
   13402     *
   13403     * http://www.apache.org/licenses/LICENSE-2.0
   13404     *
   13405     * Unless required by applicable law or agreed to in writing, software
   13406     * distributed under the License is distributed on an "AS IS" BASIS,
   13407     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13408     * See the License for the specific language governing permissions and
   13409     * limitations under the License.
   13410     */
   13411 
   13412    /*
   13413     * File: binopLit16.S
   13414     *
   13415     * Code: 32-bit "lit16" operation. Provides an "instr" line to
   13416     *       specify an instruction that performs "%ecx = %ecx op %edx"
   13417     *
   13418     *
   13419     * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
   13420     *      xor-int/lit16
   13421     *
   13422     * Description: Perform a binary operation on a register and a
   13423     *              sign extended 16-bit literal value and store the
   13424     *              result in a destination register.
   13425     *
   13426     * Format: B|A|op CCCC (22s)
   13427     *
   13428     * Syntax: op vA, vB, #+CCCC
   13429     */
   13430 
   13431     movl        rINST, %ecx             # %ecx<- BA
   13432     shr         $4, %ecx               # %ecx<- B
   13433     andl        $15, rINST             # rINST<- A
   13434     FETCHs      1, %edx                 # %edx<- +CCCC, sign-extended literal
   13435     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13436     GET_VREG    %ecx                    # %ecx<- vB
   13437     or %edx, %ecx                              # %ecx<- vA op vB
   13438     SET_VREG    %ecx, rINST             # vA<- %ecx; result
   13439     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13440 
   13441 
   13442 /* ------------------------------ */
   13443     .balign 64
   13444 .L_OP_XOR_INT_LIT16: /* 0xd7 */
   13445 /* File: x86-atom/OP_XOR_INT_LIT16.S */
   13446    /* Copyright (C) 2008 The Android Open Source Project
   13447     *
   13448     * Licensed under the Apache License, Version 2.0 (the "License");
   13449     * you may not use this file except in compliance with the License.
   13450     * You may obtain a copy of the License at
   13451     *
   13452     * http://www.apache.org/licenses/LICENSE-2.0
   13453     *
   13454     * Unless required by applicable law or agreed to in writing, software
   13455     * distributed under the License is distributed on an "AS IS" BASIS,
   13456     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13457     * See the License for the specific language governing permissions and
   13458     * limitations under the License.
   13459     */
   13460 
   13461    /*
   13462     * File: OP_XOR_INT_LIT16.S
   13463     */
   13464 
   13465 /* File: x86-atom/binopLit16.S */
   13466    /* Copyright (C) 2008 The Android Open Source Project
   13467     *
   13468     * Licensed under the Apache License, Version 2.0 (the "License");
   13469     * you may not use this file except in compliance with the License.
   13470     * You may obtain a copy of the License at
   13471     *
   13472     * http://www.apache.org/licenses/LICENSE-2.0
   13473     *
   13474     * Unless required by applicable law or agreed to in writing, software
   13475     * distributed under the License is distributed on an "AS IS" BASIS,
   13476     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13477     * See the License for the specific language governing permissions and
   13478     * limitations under the License.
   13479     */
   13480 
   13481    /*
   13482     * File: binopLit16.S
   13483     *
   13484     * Code: 32-bit "lit16" operation. Provides an "instr" line to
   13485     *       specify an instruction that performs "%ecx = %ecx op %edx"
   13486     *
   13487     *
   13488     * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
   13489     *      xor-int/lit16
   13490     *
   13491     * Description: Perform a binary operation on a register and a
   13492     *              sign extended 16-bit literal value and store the
   13493     *              result in a destination register.
   13494     *
   13495     * Format: B|A|op CCCC (22s)
   13496     *
   13497     * Syntax: op vA, vB, #+CCCC
   13498     */
   13499 
   13500     movl        rINST, %ecx             # %ecx<- BA
   13501     shr         $4, %ecx               # %ecx<- B
   13502     andl        $15, rINST             # rINST<- A
   13503     FETCHs      1, %edx                 # %edx<- +CCCC, sign-extended literal
   13504     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13505     GET_VREG    %ecx                    # %ecx<- vB
   13506     xor     %edx, %ecx                              # %ecx<- vA op vB
   13507     SET_VREG    %ecx, rINST             # vA<- %ecx; result
   13508     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13509 
   13510 
   13511 /* ------------------------------ */
   13512     .balign 64
   13513 .L_OP_ADD_INT_LIT8: /* 0xd8 */
   13514 /* File: x86-atom/OP_ADD_INT_LIT8.S */
   13515    /* Copyright (C) 2008 The Android Open Source Project
   13516     *
   13517     * Licensed under the Apache License, Version 2.0 (the "License");
   13518     * you may not use this file except in compliance with the License.
   13519     * You may obtain a copy of the License at
   13520     *
   13521     * http://www.apache.org/licenses/LICENSE-2.0
   13522     *
   13523     * Unless required by applicable law or agreed to in writing, software
   13524     * distributed under the License is distributed on an "AS IS" BASIS,
   13525     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13526     * See the License for the specific language governing permissions and
   13527     * limitations under the License.
   13528     */
   13529 
   13530    /*
   13531     * File: OP_ADD_INT_LIT8.S
   13532     */
   13533 
   13534 /* File: x86-atom/binopLit8.S */
   13535    /* Copyright (C) 2008 The Android Open Source Project
   13536     *
   13537     * Licensed under the Apache License, Version 2.0 (the "License");
   13538     * you may not use this file except in compliance with the License.
   13539     * You may obtain a copy of the License at
   13540     *
   13541     * http://www.apache.org/licenses/LICENSE-2.0
   13542     *
   13543     * Unless required by applicable law or agreed to in writing, software
   13544     * distributed under the License is distributed on an "AS IS" BASIS,
   13545     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13546     * See the License for the specific language governing permissions and
   13547     * limitations under the License.
   13548     */
   13549 
   13550    /*
   13551     * File: binopLit8.S
   13552     *
   13553     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   13554     *       to specify an instruction that performs  "%ecx = %ecx op %edx"
   13555     *
   13556     *
   13557     * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
   13558     *      xor-int/lit8
   13559     *
   13560     * Description: Perform a binary operation on a register and a
   13561     *              signed extended 8-bit literal value
   13562     *
   13563     * Format: AA|op CC|BB (22b)
   13564     *
   13565     * Syntax: op vAA, vBB, #+CC
   13566     */
   13567 
   13568     FETCH_BB    1, %ecx                 # %ecx<- BB
   13569     FETCH_CCs   1, %edx                 # %edx<- +CC, sign-extended literal
   13570     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13571     GET_VREG    %ecx                    # %ecx<- vBB
   13572     addl     %edx, %ecx                              # %ecx<- vBB op +CC
   13573     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   13574     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13575 
   13576 
   13577 /* ------------------------------ */
   13578     .balign 64
   13579 .L_OP_RSUB_INT_LIT8: /* 0xd9 */
   13580 /* File: x86-atom/OP_RSUB_INT_LIT8.S */
   13581    /* Copyright (C) 2008 The Android Open Source Project
   13582     *
   13583     * Licensed under the Apache License, Version 2.0 (the "License");
   13584     * you may not use this file except in compliance with the License.
   13585     * You may obtain a copy of the License at
   13586     *
   13587     * http://www.apache.org/licenses/LICENSE-2.0
   13588     *
   13589     * Unless required by applicable law or agreed to in writing, software
   13590     * distributed under the License is distributed on an "AS IS" BASIS,
   13591     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13592     * See the License for the specific language governing permissions and
   13593     * limitations under the License.
   13594     */
   13595 
   13596    /*
   13597     * File: OP_RSUB_INT_LIT8.S
   13598     *
   13599     * Code: 32-bit reverse-subtraction. Uses no substitutions.
   13600     *
   13601     * For: rsub-int/lit8
   13602     *
   13603     * Description: Perform a reverse subtraction on a register and a
   13604     *              signed extended 8-bit literal value.
   13605     *
   13606     * Format: AA|op CC|BB (22b)
   13607     *
   13608     * Syntax: op vAA, vBB, #+CC
   13609     */
   13610 
   13611     FETCH_BB    1, %ecx                 # %ecx<- BB
   13612     FETCH_CCs   1, %edx                 # %edx<- +CC, sign-extended literal
   13613     GET_VREG    %ecx                    # %ecx<- vBB
   13614     sub         %ecx, %edx              # %edx<- +CC sub vBB
   13615     SET_VREG    %edx, rINST             # vAA<- %edx; result
   13616     FINISH      2                       # jump to next instruction
   13617 
   13618 /* ------------------------------ */
   13619     .balign 64
   13620 .L_OP_MUL_INT_LIT8: /* 0xda */
   13621 /* File: x86-atom/OP_MUL_INT_LIT8.S */
   13622    /* Copyright (C) 2008 The Android Open Source Project
   13623     *
   13624     * Licensed under the Apache License, Version 2.0 (the "License");
   13625     * you may not use this file except in compliance with the License.
   13626     * You may obtain a copy of the License at
   13627     *
   13628     * http://www.apache.org/licenses/LICENSE-2.0
   13629     *
   13630     * Unless required by applicable law or agreed to in writing, software
   13631     * distributed under the License is distributed on an "AS IS" BASIS,
   13632     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13633     * See the License for the specific language governing permissions and
   13634     * limitations under the License.
   13635     */
   13636 
   13637    /*
   13638     * File: OP_MUL_INT_LIT8.S
   13639     */
   13640 
   13641 /* File: x86-atom/binopLit8.S */
   13642    /* Copyright (C) 2008 The Android Open Source Project
   13643     *
   13644     * Licensed under the Apache License, Version 2.0 (the "License");
   13645     * you may not use this file except in compliance with the License.
   13646     * You may obtain a copy of the License at
   13647     *
   13648     * http://www.apache.org/licenses/LICENSE-2.0
   13649     *
   13650     * Unless required by applicable law or agreed to in writing, software
   13651     * distributed under the License is distributed on an "AS IS" BASIS,
   13652     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13653     * See the License for the specific language governing permissions and
   13654     * limitations under the License.
   13655     */
   13656 
   13657    /*
   13658     * File: binopLit8.S
   13659     *
   13660     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   13661     *       to specify an instruction that performs  "%ecx = %ecx op %edx"
   13662     *
   13663     *
   13664     * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
   13665     *      xor-int/lit8
   13666     *
   13667     * Description: Perform a binary operation on a register and a
   13668     *              signed extended 8-bit literal value
   13669     *
   13670     * Format: AA|op CC|BB (22b)
   13671     *
   13672     * Syntax: op vAA, vBB, #+CC
   13673     */
   13674 
   13675     FETCH_BB    1, %ecx                 # %ecx<- BB
   13676     FETCH_CCs   1, %edx                 # %edx<- +CC, sign-extended literal
   13677     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13678     GET_VREG    %ecx                    # %ecx<- vBB
   13679     imul     %edx, %ecx                              # %ecx<- vBB op +CC
   13680     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   13681     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13682 
   13683 
   13684 /* ------------------------------ */
   13685     .balign 64
   13686 .L_OP_DIV_INT_LIT8: /* 0xdb */
   13687 /* File: x86-atom/OP_DIV_INT_LIT8.S */
   13688    /* Copyright (C) 2008 The Android Open Source Project
   13689     *
   13690     * Licensed under the Apache License, Version 2.0 (the "License");
   13691     * you may not use this file except in compliance with the License.
   13692     * You may obtain a copy of the License at
   13693     *
   13694     * http://www.apache.org/licenses/LICENSE-2.0
   13695     *
   13696     * Unless required by applicable law or agreed to in writing, software
   13697     * distributed under the License is distributed on an "AS IS" BASIS,
   13698     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13699     * See the License for the specific language governing permissions and
   13700     * limitations under the License.
   13701     */
   13702 
   13703    /*
   13704     * File: OP_DIV_INT_LIT8.S
   13705     */
   13706 
   13707 /* File: x86-atom/binopDLit8.S */
   13708    /* Copyright (C) 2008 The Android Open Source Project
   13709     *
   13710     * Licensed under the Apache License, Version 2.0 (the "License");
   13711     * you may not use this file except in compliance with the License.
   13712     * You may obtain a copy of the License at
   13713     *
   13714     * http://www.apache.org/licenses/LICENSE-2.0
   13715     *
   13716     * Unless required by applicable law or agreed to in writing, software
   13717     * distributed under the License is distributed on an "AS IS" BASIS,
   13718     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13719     * See the License for the specific language governing permissions and
   13720     * limitations under the License.
   13721     */
   13722 
   13723    /*
   13724     * File: binopDLit8.S
   13725     *
   13726     * Code: 32-bit "lit8" divide operation. If "div" is set, the code
   13727     *       returns the quotient, else it returns the remainder.
   13728     *       Also, a divide-by-zero check is done.
   13729     *
   13730     * For: div-int/lit8, rem-int/lit8
   13731     *
   13732     * Description: Perform a binary operation on a register and a
   13733     *              signe extended 8-bit literal value
   13734     *
   13735     * Format: AA|op CC|BB (22b)
   13736     *
   13737     * Syntax: op vAA, vBB, #+CC
   13738     */
   13739 
   13740 
   13741     FETCH_BB    1, %eax                 # %eax<- BB
   13742     FETCH_CCs   1, %ecx                 # %ecx<- +CC, sign-extended literal
   13743     cmp         $0, %ecx               # check for divide by zero
   13744     GET_VREG    %eax                    # %eax<- vBB
   13745     je          common_errDivideByZero  # handle divide by zero
   13746 
   13747     cmpl        $-1, %ecx              # handle -1 special case divide error
   13748     jne         .LOP_DIV_INT_LIT8_noerror
   13749     cmpl        $0x80000000,%eax       # handle min int special case divide error
   13750     je         .LOP_DIV_INT_LIT8_break
   13751 .LOP_DIV_INT_LIT8_noerror:
   13752     cdq                                 # sign-extend %eax to %edx
   13753     idiv        %ecx                    # divide %edx:%eax by %ecx
   13754     #FFETCH_ADV 2, %ecx                 # %ecx<- next instruction hi; fetch, advance
   13755     .if  1
   13756     SET_VREG    %eax rINST              # vAA<- %eax (quotient)
   13757     .else
   13758     SET_VREG    %edx rINST              # vAA<- %edx (remainder)
   13759     .endif
   13760     jmp         .LOP_DIV_INT_LIT8_break2
   13761 
   13762 
   13763 /* ------------------------------ */
   13764     .balign 64
   13765 .L_OP_REM_INT_LIT8: /* 0xdc */
   13766 /* File: x86-atom/OP_REM_INT_LIT8.S */
   13767    /* Copyright (C) 2008 The Android Open Source Project
   13768     *
   13769     * Licensed under the Apache License, Version 2.0 (the "License");
   13770     * you may not use this file except in compliance with the License.
   13771     * You may obtain a copy of the License at
   13772     *
   13773     * http://www.apache.org/licenses/LICENSE-2.0
   13774     *
   13775     * Unless required by applicable law or agreed to in writing, software
   13776     * distributed under the License is distributed on an "AS IS" BASIS,
   13777     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13778     * See the License for the specific language governing permissions and
   13779     * limitations under the License.
   13780     */
   13781 
   13782    /*
   13783     * File: OP_REM_INT_LIT8.S
   13784     */
   13785 
   13786 /* File: x86-atom/binopDLit8.S */
   13787    /* Copyright (C) 2008 The Android Open Source Project
   13788     *
   13789     * Licensed under the Apache License, Version 2.0 (the "License");
   13790     * you may not use this file except in compliance with the License.
   13791     * You may obtain a copy of the License at
   13792     *
   13793     * http://www.apache.org/licenses/LICENSE-2.0
   13794     *
   13795     * Unless required by applicable law or agreed to in writing, software
   13796     * distributed under the License is distributed on an "AS IS" BASIS,
   13797     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13798     * See the License for the specific language governing permissions and
   13799     * limitations under the License.
   13800     */
   13801 
   13802    /*
   13803     * File: binopDLit8.S
   13804     *
   13805     * Code: 32-bit "lit8" divide operation. If "div" is set, the code
   13806     *       returns the quotient, else it returns the remainder.
   13807     *       Also, a divide-by-zero check is done.
   13808     *
   13809     * For: div-int/lit8, rem-int/lit8
   13810     *
   13811     * Description: Perform a binary operation on a register and a
   13812     *              signe extended 8-bit literal value
   13813     *
   13814     * Format: AA|op CC|BB (22b)
   13815     *
   13816     * Syntax: op vAA, vBB, #+CC
   13817     */
   13818 
   13819 
   13820     FETCH_BB    1, %eax                 # %eax<- BB
   13821     FETCH_CCs   1, %ecx                 # %ecx<- +CC, sign-extended literal
   13822     cmp         $0, %ecx               # check for divide by zero
   13823     GET_VREG    %eax                    # %eax<- vBB
   13824     je          common_errDivideByZero  # handle divide by zero
   13825 
   13826     cmpl        $-1, %ecx              # handle -1 special case divide error
   13827     jne         .LOP_REM_INT_LIT8_noerror
   13828     cmpl        $0x80000000,%eax       # handle min int special case divide error
   13829     je         .LOP_REM_INT_LIT8_break
   13830 .LOP_REM_INT_LIT8_noerror:
   13831     cdq                                 # sign-extend %eax to %edx
   13832     idiv        %ecx                    # divide %edx:%eax by %ecx
   13833     #FFETCH_ADV 2, %ecx                 # %ecx<- next instruction hi; fetch, advance
   13834     .if  0
   13835     SET_VREG    %eax rINST              # vAA<- %eax (quotient)
   13836     .else
   13837     SET_VREG    %edx rINST              # vAA<- %edx (remainder)
   13838     .endif
   13839     jmp         .LOP_REM_INT_LIT8_break2
   13840 
   13841 
   13842 /* ------------------------------ */
   13843     .balign 64
   13844 .L_OP_AND_INT_LIT8: /* 0xdd */
   13845 /* File: x86-atom/OP_AND_INT_LIT8.S */
   13846    /* Copyright (C) 2008 The Android Open Source Project
   13847     *
   13848     * Licensed under the Apache License, Version 2.0 (the "License");
   13849     * you may not use this file except in compliance with the License.
   13850     * You may obtain a copy of the License at
   13851     *
   13852     * http://www.apache.org/licenses/LICENSE-2.0
   13853     *
   13854     * Unless required by applicable law or agreed to in writing, software
   13855     * distributed under the License is distributed on an "AS IS" BASIS,
   13856     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13857     * See the License for the specific language governing permissions and
   13858     * limitations under the License.
   13859     */
   13860 
   13861    /*
   13862     * File: OP_AND_INT_LIT8.S
   13863     */
   13864 
   13865 /* File: x86-atom/binopLit8.S */
   13866    /* Copyright (C) 2008 The Android Open Source Project
   13867     *
   13868     * Licensed under the Apache License, Version 2.0 (the "License");
   13869     * you may not use this file except in compliance with the License.
   13870     * You may obtain a copy of the License at
   13871     *
   13872     * http://www.apache.org/licenses/LICENSE-2.0
   13873     *
   13874     * Unless required by applicable law or agreed to in writing, software
   13875     * distributed under the License is distributed on an "AS IS" BASIS,
   13876     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13877     * See the License for the specific language governing permissions and
   13878     * limitations under the License.
   13879     */
   13880 
   13881    /*
   13882     * File: binopLit8.S
   13883     *
   13884     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   13885     *       to specify an instruction that performs  "%ecx = %ecx op %edx"
   13886     *
   13887     *
   13888     * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
   13889     *      xor-int/lit8
   13890     *
   13891     * Description: Perform a binary operation on a register and a
   13892     *              signed extended 8-bit literal value
   13893     *
   13894     * Format: AA|op CC|BB (22b)
   13895     *
   13896     * Syntax: op vAA, vBB, #+CC
   13897     */
   13898 
   13899     FETCH_BB    1, %ecx                 # %ecx<- BB
   13900     FETCH_CCs   1, %edx                 # %edx<- +CC, sign-extended literal
   13901     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13902     GET_VREG    %ecx                    # %ecx<- vBB
   13903     andl     %edx, %ecx                              # %ecx<- vBB op +CC
   13904     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   13905     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13906 
   13907 
   13908 /* ------------------------------ */
   13909     .balign 64
   13910 .L_OP_OR_INT_LIT8: /* 0xde */
   13911 /* File: x86-atom/OP_OR_INT_LIT8.S */
   13912    /* Copyright (C) 2008 The Android Open Source Project
   13913     *
   13914     * Licensed under the Apache License, Version 2.0 (the "License");
   13915     * you may not use this file except in compliance with the License.
   13916     * You may obtain a copy of the License at
   13917     *
   13918     * http://www.apache.org/licenses/LICENSE-2.0
   13919     *
   13920     * Unless required by applicable law or agreed to in writing, software
   13921     * distributed under the License is distributed on an "AS IS" BASIS,
   13922     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13923     * See the License for the specific language governing permissions and
   13924     * limitations under the License.
   13925     */
   13926 
   13927    /*
   13928     * File: OP_OR_INT_LIT8.S
   13929     */
   13930 
   13931 /* File: x86-atom/binopLit8.S */
   13932    /* Copyright (C) 2008 The Android Open Source Project
   13933     *
   13934     * Licensed under the Apache License, Version 2.0 (the "License");
   13935     * you may not use this file except in compliance with the License.
   13936     * You may obtain a copy of the License at
   13937     *
   13938     * http://www.apache.org/licenses/LICENSE-2.0
   13939     *
   13940     * Unless required by applicable law or agreed to in writing, software
   13941     * distributed under the License is distributed on an "AS IS" BASIS,
   13942     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13943     * See the License for the specific language governing permissions and
   13944     * limitations under the License.
   13945     */
   13946 
   13947    /*
   13948     * File: binopLit8.S
   13949     *
   13950     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   13951     *       to specify an instruction that performs  "%ecx = %ecx op %edx"
   13952     *
   13953     *
   13954     * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
   13955     *      xor-int/lit8
   13956     *
   13957     * Description: Perform a binary operation on a register and a
   13958     *              signed extended 8-bit literal value
   13959     *
   13960     * Format: AA|op CC|BB (22b)
   13961     *
   13962     * Syntax: op vAA, vBB, #+CC
   13963     */
   13964 
   13965     FETCH_BB    1, %ecx                 # %ecx<- BB
   13966     FETCH_CCs   1, %edx                 # %edx<- +CC, sign-extended literal
   13967     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   13968     GET_VREG    %ecx                    # %ecx<- vBB
   13969     or %edx, %ecx                              # %ecx<- vBB op +CC
   13970     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   13971     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   13972 
   13973 
   13974 /* ------------------------------ */
   13975     .balign 64
   13976 .L_OP_XOR_INT_LIT8: /* 0xdf */
   13977 /* File: x86-atom/OP_XOR_INT_LIT8.S */
   13978    /* Copyright (C) 2008 The Android Open Source Project
   13979     *
   13980     * Licensed under the Apache License, Version 2.0 (the "License");
   13981     * you may not use this file except in compliance with the License.
   13982     * You may obtain a copy of the License at
   13983     *
   13984     * http://www.apache.org/licenses/LICENSE-2.0
   13985     *
   13986     * Unless required by applicable law or agreed to in writing, software
   13987     * distributed under the License is distributed on an "AS IS" BASIS,
   13988     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13989     * See the License for the specific language governing permissions and
   13990     * limitations under the License.
   13991     */
   13992 
   13993    /*
   13994     * File: OP_XOR_INT_LIT8.S
   13995     */
   13996 
   13997 /* File: x86-atom/binopLit8.S */
   13998    /* Copyright (C) 2008 The Android Open Source Project
   13999     *
   14000     * Licensed under the Apache License, Version 2.0 (the "License");
   14001     * you may not use this file except in compliance with the License.
   14002     * You may obtain a copy of the License at
   14003     *
   14004     * http://www.apache.org/licenses/LICENSE-2.0
   14005     *
   14006     * Unless required by applicable law or agreed to in writing, software
   14007     * distributed under the License is distributed on an "AS IS" BASIS,
   14008     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14009     * See the License for the specific language governing permissions and
   14010     * limitations under the License.
   14011     */
   14012 
   14013    /*
   14014     * File: binopLit8.S
   14015     *
   14016     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   14017     *       to specify an instruction that performs  "%ecx = %ecx op %edx"
   14018     *
   14019     *
   14020     * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
   14021     *      xor-int/lit8
   14022     *
   14023     * Description: Perform a binary operation on a register and a
   14024     *              signed extended 8-bit literal value
   14025     *
   14026     * Format: AA|op CC|BB (22b)
   14027     *
   14028     * Syntax: op vAA, vBB, #+CC
   14029     */
   14030 
   14031     FETCH_BB    1, %ecx                 # %ecx<- BB
   14032     FETCH_CCs   1, %edx                 # %edx<- +CC, sign-extended literal
   14033     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   14034     GET_VREG    %ecx                    # %ecx<- vBB
   14035     xor     %edx, %ecx                              # %ecx<- vBB op +CC
   14036     SET_VREG    %ecx, rINST             # vAA<- %ecx; result
   14037     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   14038 
   14039 
   14040 /* ------------------------------ */
   14041     .balign 64
   14042 .L_OP_SHL_INT_LIT8: /* 0xe0 */
   14043 /* File: x86-atom/OP_SHL_INT_LIT8.S */
   14044    /* Copyright (C) 2008 The Android Open Source Project
   14045     *
   14046     * Licensed under the Apache License, Version 2.0 (the "License");
   14047     * you may not use this file except in compliance with the License.
   14048     * You may obtain a copy of the License at
   14049     *
   14050     * http://www.apache.org/licenses/LICENSE-2.0
   14051     *
   14052     * Unless required by applicable law or agreed to in writing, software
   14053     * distributed under the License is distributed on an "AS IS" BASIS,
   14054     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14055     * See the License for the specific language governing permissions and
   14056     * limitations under the License.
   14057     */
   14058 
   14059    /*
   14060     * File: OP_SHL_INT_LIT8.S
   14061     */
   14062 
   14063 /* File: x86-atom/binopLit8S.S */
   14064    /* Copyright (C) 2008 The Android Open Source Project
   14065     *
   14066     * Licensed under the Apache License, Version 2.0 (the "License");
   14067     * you may not use this file except in compliance with the License.
   14068     * You may obtain a copy of the License at
   14069     *
   14070     * http://www.apache.org/licenses/LICENSE-2.0
   14071     *
   14072     * Unless required by applicable law or agreed to in writing, software
   14073     * distributed under the License is distributed on an "AS IS" BASIS,
   14074     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14075     * See the License for the specific language governing permissions and
   14076     * limitations under the License.
   14077     */
   14078 
   14079    /*
   14080     * File: binopLit8S.S
   14081     *
   14082     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   14083     *       to specify an instruction that performs "%edx = %edx op %cl"
   14084     *
   14085     *
   14086     * For: shl-int/lit8, shr-int/lit8, ushr-int/lit8
   14087     *
   14088     *
   14089     * Description: Perform a binary operation on a register and a
   14090     *              signed extended 8-bit literal value
   14091     *
   14092     * Format: AA|op CC|BB (22b)
   14093     *
   14094     * Syntax: op vAA, vBB, #+CC
   14095     */
   14096 
   14097     FETCH_BB    1, %edx                 # %edx<- BB
   14098     FETCH_CCs   1, %ecx                 # %ecx<- +CC, sign-extended literal
   14099     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   14100     GET_VREG    %edx                    # %edx<- vBB
   14101     sal     %cl, %edx                              # %edx<- vBB op +CC
   14102     SET_VREG    %edx, rINST             # vAA<- %edx; result
   14103     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   14104 
   14105 
   14106 /* ------------------------------ */
   14107     .balign 64
   14108 .L_OP_SHR_INT_LIT8: /* 0xe1 */
   14109 /* File: x86-atom/OP_SHR_INT_LIT8.S */
   14110    /* Copyright (C) 2008 The Android Open Source Project
   14111     *
   14112     * Licensed under the Apache License, Version 2.0 (the "License");
   14113     * you may not use this file except in compliance with the License.
   14114     * You may obtain a copy of the License at
   14115     *
   14116     * http://www.apache.org/licenses/LICENSE-2.0
   14117     *
   14118     * Unless required by applicable law or agreed to in writing, software
   14119     * distributed under the License is distributed on an "AS IS" BASIS,
   14120     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14121     * See the License for the specific language governing permissions and
   14122     * limitations under the License.
   14123     */
   14124 
   14125    /*
   14126     * File: OP_SHR_INT_LIT8.S
   14127     */
   14128 
   14129 /* File: x86-atom/binopLit8S.S */
   14130    /* Copyright (C) 2008 The Android Open Source Project
   14131     *
   14132     * Licensed under the Apache License, Version 2.0 (the "License");
   14133     * you may not use this file except in compliance with the License.
   14134     * You may obtain a copy of the License at
   14135     *
   14136     * http://www.apache.org/licenses/LICENSE-2.0
   14137     *
   14138     * Unless required by applicable law or agreed to in writing, software
   14139     * distributed under the License is distributed on an "AS IS" BASIS,
   14140     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14141     * See the License for the specific language governing permissions and
   14142     * limitations under the License.
   14143     */
   14144 
   14145    /*
   14146     * File: binopLit8S.S
   14147     *
   14148     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   14149     *       to specify an instruction that performs "%edx = %edx op %cl"
   14150     *
   14151     *
   14152     * For: shl-int/lit8, shr-int/lit8, ushr-int/lit8
   14153     *
   14154     *
   14155     * Description: Perform a binary operation on a register and a
   14156     *              signed extended 8-bit literal value
   14157     *
   14158     * Format: AA|op CC|BB (22b)
   14159     *
   14160     * Syntax: op vAA, vBB, #+CC
   14161     */
   14162 
   14163     FETCH_BB    1, %edx                 # %edx<- BB
   14164     FETCH_CCs   1, %ecx                 # %ecx<- +CC, sign-extended literal
   14165     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   14166     GET_VREG    %edx                    # %edx<- vBB
   14167     sar     %cl, %edx                              # %edx<- vBB op +CC
   14168     SET_VREG    %edx, rINST             # vAA<- %edx; result
   14169     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   14170 
   14171 
   14172 /* ------------------------------ */
   14173     .balign 64
   14174 .L_OP_USHR_INT_LIT8: /* 0xe2 */
   14175 /* File: x86-atom/OP_USHR_INT_LIT8.S */
   14176    /* Copyright (C) 2008 The Android Open Source Project
   14177     *
   14178     * Licensed under the Apache License, Version 2.0 (the "License");
   14179     * you may not use this file except in compliance with the License.
   14180     * You may obtain a copy of the License at
   14181     *
   14182     * http://www.apache.org/licenses/LICENSE-2.0
   14183     *
   14184     * Unless required by applicable law or agreed to in writing, software
   14185     * distributed under the License is distributed on an "AS IS" BASIS,
   14186     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14187     * See the License for the specific language governing permissions and
   14188     * limitations under the License.
   14189     */
   14190 
   14191    /*
   14192     * File: OP_USHR_INT_LIT8.S
   14193     */
   14194 
   14195 /* File: x86-atom/binopLit8S.S */
   14196    /* Copyright (C) 2008 The Android Open Source Project
   14197     *
   14198     * Licensed under the Apache License, Version 2.0 (the "License");
   14199     * you may not use this file except in compliance with the License.
   14200     * You may obtain a copy of the License at
   14201     *
   14202     * http://www.apache.org/licenses/LICENSE-2.0
   14203     *
   14204     * Unless required by applicable law or agreed to in writing, software
   14205     * distributed under the License is distributed on an "AS IS" BASIS,
   14206     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14207     * See the License for the specific language governing permissions and
   14208     * limitations under the License.
   14209     */
   14210 
   14211    /*
   14212     * File: binopLit8S.S
   14213     *
   14214     * Code: 32-bit "lit8" divide operation. Provides an "instr" line
   14215     *       to specify an instruction that performs "%edx = %edx op %cl"
   14216     *
   14217     *
   14218     * For: shl-int/lit8, shr-int/lit8, ushr-int/lit8
   14219     *
   14220     *
   14221     * Description: Perform a binary operation on a register and a
   14222     *              signed extended 8-bit literal value
   14223     *
   14224     * Format: AA|op CC|BB (22b)
   14225     *
   14226     * Syntax: op vAA, vBB, #+CC
   14227     */
   14228 
   14229     FETCH_BB    1, %edx                 # %edx<- BB
   14230     FETCH_CCs   1, %ecx                 # %ecx<- +CC, sign-extended literal
   14231     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   14232     GET_VREG    %edx                    # %edx<- vBB
   14233     shr     %cl, %edx                              # %edx<- vBB op +CC
   14234     SET_VREG    %edx, rINST             # vAA<- %edx; result
   14235     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   14236 
   14237 
   14238 /* ------------------------------ */
   14239     .balign 64
   14240 .L_OP_IGET_VOLATILE: /* 0xe3 */
   14241    /* Copyright (C) 2008 The Android Open Source Project
   14242     *
   14243     * Licensed under the Apache License, Version 2.0 (the "License");
   14244     * you may not use this file except in compliance with the License.
   14245     * You may obtain a copy of the License at
   14246     *
   14247     * http://www.apache.org/licenses/LICENSE-2.0
   14248     *
   14249     * Unless required by applicable law or agreed to in writing, software
   14250     * distributed under the License is distributed on an "AS IS" BASIS,
   14251     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14252     * See the License for the specific language governing permissions and
   14253     * limitations under the License.
   14254     */
   14255 
   14256    /*
   14257     * File: stub.S
   14258     */
   14259 
   14260     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14261     pushl       rGLUE                   # push parameter glue
   14262     call        dvmMterp_OP_IGET_VOLATILE      # call c-based implementation
   14263     lea         4(%esp), %esp
   14264     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14265     FINISH_A                            # jump to next instruction
   14266 /* ------------------------------ */
   14267     .balign 64
   14268 .L_OP_IPUT_VOLATILE: /* 0xe4 */
   14269    /* Copyright (C) 2008 The Android Open Source Project
   14270     *
   14271     * Licensed under the Apache License, Version 2.0 (the "License");
   14272     * you may not use this file except in compliance with the License.
   14273     * You may obtain a copy of the License at
   14274     *
   14275     * http://www.apache.org/licenses/LICENSE-2.0
   14276     *
   14277     * Unless required by applicable law or agreed to in writing, software
   14278     * distributed under the License is distributed on an "AS IS" BASIS,
   14279     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14280     * See the License for the specific language governing permissions and
   14281     * limitations under the License.
   14282     */
   14283 
   14284    /*
   14285     * File: stub.S
   14286     */
   14287 
   14288     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14289     pushl       rGLUE                   # push parameter glue
   14290     call        dvmMterp_OP_IPUT_VOLATILE      # call c-based implementation
   14291     lea         4(%esp), %esp
   14292     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14293     FINISH_A                            # jump to next instruction
   14294 /* ------------------------------ */
   14295     .balign 64
   14296 .L_OP_SGET_VOLATILE: /* 0xe5 */
   14297    /* Copyright (C) 2008 The Android Open Source Project
   14298     *
   14299     * Licensed under the Apache License, Version 2.0 (the "License");
   14300     * you may not use this file except in compliance with the License.
   14301     * You may obtain a copy of the License at
   14302     *
   14303     * http://www.apache.org/licenses/LICENSE-2.0
   14304     *
   14305     * Unless required by applicable law or agreed to in writing, software
   14306     * distributed under the License is distributed on an "AS IS" BASIS,
   14307     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14308     * See the License for the specific language governing permissions and
   14309     * limitations under the License.
   14310     */
   14311 
   14312    /*
   14313     * File: stub.S
   14314     */
   14315 
   14316     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14317     pushl       rGLUE                   # push parameter glue
   14318     call        dvmMterp_OP_SGET_VOLATILE      # call c-based implementation
   14319     lea         4(%esp), %esp
   14320     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14321     FINISH_A                            # jump to next instruction
   14322 /* ------------------------------ */
   14323     .balign 64
   14324 .L_OP_SPUT_VOLATILE: /* 0xe6 */
   14325    /* Copyright (C) 2008 The Android Open Source Project
   14326     *
   14327     * Licensed under the Apache License, Version 2.0 (the "License");
   14328     * you may not use this file except in compliance with the License.
   14329     * You may obtain a copy of the License at
   14330     *
   14331     * http://www.apache.org/licenses/LICENSE-2.0
   14332     *
   14333     * Unless required by applicable law or agreed to in writing, software
   14334     * distributed under the License is distributed on an "AS IS" BASIS,
   14335     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14336     * See the License for the specific language governing permissions and
   14337     * limitations under the License.
   14338     */
   14339 
   14340    /*
   14341     * File: stub.S
   14342     */
   14343 
   14344     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14345     pushl       rGLUE                   # push parameter glue
   14346     call        dvmMterp_OP_SPUT_VOLATILE      # call c-based implementation
   14347     lea         4(%esp), %esp
   14348     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14349     FINISH_A                            # jump to next instruction
   14350 /* ------------------------------ */
   14351     .balign 64
   14352 .L_OP_IGET_OBJECT_VOLATILE: /* 0xe7 */
   14353    /* Copyright (C) 2008 The Android Open Source Project
   14354     *
   14355     * Licensed under the Apache License, Version 2.0 (the "License");
   14356     * you may not use this file except in compliance with the License.
   14357     * You may obtain a copy of the License at
   14358     *
   14359     * http://www.apache.org/licenses/LICENSE-2.0
   14360     *
   14361     * Unless required by applicable law or agreed to in writing, software
   14362     * distributed under the License is distributed on an "AS IS" BASIS,
   14363     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14364     * See the License for the specific language governing permissions and
   14365     * limitations under the License.
   14366     */
   14367 
   14368    /*
   14369     * File: stub.S
   14370     */
   14371 
   14372     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14373     pushl       rGLUE                   # push parameter glue
   14374     call        dvmMterp_OP_IGET_OBJECT_VOLATILE      # call c-based implementation
   14375     lea         4(%esp), %esp
   14376     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14377     FINISH_A                            # jump to next instruction
   14378 /* ------------------------------ */
   14379     .balign 64
   14380 .L_OP_IGET_WIDE_VOLATILE: /* 0xe8 */
   14381    /* Copyright (C) 2008 The Android Open Source Project
   14382     *
   14383     * Licensed under the Apache License, Version 2.0 (the "License");
   14384     * you may not use this file except in compliance with the License.
   14385     * You may obtain a copy of the License at
   14386     *
   14387     * http://www.apache.org/licenses/LICENSE-2.0
   14388     *
   14389     * Unless required by applicable law or agreed to in writing, software
   14390     * distributed under the License is distributed on an "AS IS" BASIS,
   14391     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14392     * See the License for the specific language governing permissions and
   14393     * limitations under the License.
   14394     */
   14395 
   14396    /*
   14397     * File: stub.S
   14398     */
   14399 
   14400     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14401     pushl       rGLUE                   # push parameter glue
   14402     call        dvmMterp_OP_IGET_WIDE_VOLATILE      # call c-based implementation
   14403     lea         4(%esp), %esp
   14404     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14405     FINISH_A                            # jump to next instruction
   14406 /* ------------------------------ */
   14407     .balign 64
   14408 .L_OP_IPUT_WIDE_VOLATILE: /* 0xe9 */
   14409    /* Copyright (C) 2008 The Android Open Source Project
   14410     *
   14411     * Licensed under the Apache License, Version 2.0 (the "License");
   14412     * you may not use this file except in compliance with the License.
   14413     * You may obtain a copy of the License at
   14414     *
   14415     * http://www.apache.org/licenses/LICENSE-2.0
   14416     *
   14417     * Unless required by applicable law or agreed to in writing, software
   14418     * distributed under the License is distributed on an "AS IS" BASIS,
   14419     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14420     * See the License for the specific language governing permissions and
   14421     * limitations under the License.
   14422     */
   14423 
   14424    /*
   14425     * File: stub.S
   14426     */
   14427 
   14428     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14429     pushl       rGLUE                   # push parameter glue
   14430     call        dvmMterp_OP_IPUT_WIDE_VOLATILE      # call c-based implementation
   14431     lea         4(%esp), %esp
   14432     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14433     FINISH_A                            # jump to next instruction
   14434 /* ------------------------------ */
   14435     .balign 64
   14436 .L_OP_SGET_WIDE_VOLATILE: /* 0xea */
   14437    /* Copyright (C) 2008 The Android Open Source Project
   14438     *
   14439     * Licensed under the Apache License, Version 2.0 (the "License");
   14440     * you may not use this file except in compliance with the License.
   14441     * You may obtain a copy of the License at
   14442     *
   14443     * http://www.apache.org/licenses/LICENSE-2.0
   14444     *
   14445     * Unless required by applicable law or agreed to in writing, software
   14446     * distributed under the License is distributed on an "AS IS" BASIS,
   14447     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14448     * See the License for the specific language governing permissions and
   14449     * limitations under the License.
   14450     */
   14451 
   14452    /*
   14453     * File: stub.S
   14454     */
   14455 
   14456     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14457     pushl       rGLUE                   # push parameter glue
   14458     call        dvmMterp_OP_SGET_WIDE_VOLATILE      # call c-based implementation
   14459     lea         4(%esp), %esp
   14460     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14461     FINISH_A                            # jump to next instruction
   14462 /* ------------------------------ */
   14463     .balign 64
   14464 .L_OP_SPUT_WIDE_VOLATILE: /* 0xeb */
   14465    /* Copyright (C) 2008 The Android Open Source Project
   14466     *
   14467     * Licensed under the Apache License, Version 2.0 (the "License");
   14468     * you may not use this file except in compliance with the License.
   14469     * You may obtain a copy of the License at
   14470     *
   14471     * http://www.apache.org/licenses/LICENSE-2.0
   14472     *
   14473     * Unless required by applicable law or agreed to in writing, software
   14474     * distributed under the License is distributed on an "AS IS" BASIS,
   14475     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14476     * See the License for the specific language governing permissions and
   14477     * limitations under the License.
   14478     */
   14479 
   14480    /*
   14481     * File: stub.S
   14482     */
   14483 
   14484     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14485     pushl       rGLUE                   # push parameter glue
   14486     call        dvmMterp_OP_SPUT_WIDE_VOLATILE      # call c-based implementation
   14487     lea         4(%esp), %esp
   14488     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14489     FINISH_A                            # jump to next instruction
   14490 /* ------------------------------ */
   14491     .balign 64
   14492 .L_OP_BREAKPOINT: /* 0xec */
   14493    /* Copyright (C) 2008 The Android Open Source Project
   14494     *
   14495     * Licensed under the Apache License, Version 2.0 (the "License");
   14496     * you may not use this file except in compliance with the License.
   14497     * You may obtain a copy of the License at
   14498     *
   14499     * http://www.apache.org/licenses/LICENSE-2.0
   14500     *
   14501     * Unless required by applicable law or agreed to in writing, software
   14502     * distributed under the License is distributed on an "AS IS" BASIS,
   14503     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14504     * See the License for the specific language governing permissions and
   14505     * limitations under the License.
   14506     */
   14507 
   14508    /*
   14509     * File: stub.S
   14510     */
   14511 
   14512     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14513     pushl       rGLUE                   # push parameter glue
   14514     call        dvmMterp_OP_BREAKPOINT      # call c-based implementation
   14515     lea         4(%esp), %esp
   14516     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14517     FINISH_A                            # jump to next instruction
   14518 /* ------------------------------ */
   14519     .balign 64
   14520 .L_OP_THROW_VERIFICATION_ERROR: /* 0xed */
   14521 /* File: x86-atom/OP_THROW_VERIFICATION_ERROR.S */
   14522    /* Copyright (C) 2009 The Android Open Source Project
   14523     *
   14524     * Licensed under the Apache License, Version 2.0 (the "License");
   14525     * you may not use this file except in compliance with the License.
   14526     * You may obtain a copy of the License at
   14527     *
   14528     * http://www.apache.org/licenses/LICENSE-2.0
   14529     *
   14530     * Unless required by applicable law or agreed to in writing, software
   14531     * distributed under the License is distributed on an "AS IS" BASIS,
   14532     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14533     * See the License for the specific language governing permissions and
   14534     * limitations under the License.
   14535     */
   14536 
   14537    /*
   14538     * File: OP_THROW_VERIFICATION_ERROR.S
   14539     *
   14540     * Code:
   14541     *
   14542     * For: throw-verification-error
   14543     *
   14544     * Description: Throws an exception for an error discovered during verification.
   14545     *              The exception is indicated by AA with details provided by BBBB.
   14546     *
   14547     * Format: AA|op BBBB (21c)
   14548     *
   14549     * Syntax: op vAA, ref@BBBB
   14550     */
   14551 
   14552     movl        rGLUE, %edx                  # %edx<- pMterpGlue
   14553     movl        offGlue_method(%edx), %ecx   # %ecx<- glue->method
   14554     EXPORT_PC                                # in case an exception is thrown
   14555     FETCH       1, %eax                      # %eax<- BBBB
   14556     movl        %eax, -4(%esp)               # push parameter BBBB; ref
   14557     movl        rINST, -8(%esp)              # push parameter AA
   14558     movl        %ecx, -12(%esp)              # push parameter glue->method
   14559     lea         -12(%esp), %esp
   14560     call        dvmThrowVerificationError    # call: (const Method* method, int kind, int ref)
   14561     jmp         common_exceptionThrown       # failed; handle exception
   14562 
   14563 /* ------------------------------ */
   14564     .balign 64
   14565 .L_OP_EXECUTE_INLINE: /* 0xee */
   14566 /* File: x86-atom/OP_EXECUTE_INLINE.S */
   14567    /* Copyright (C) 2008 The Android Open Source Project
   14568     *
   14569     * Licensed under the Apache License, Version 2.0 (the "License");
   14570     * you may not use this file except in compliance with the License.
   14571     * You may obtain a copy of the License at
   14572     *
   14573     * http://www.apache.org/licenses/LICENSE-2.0
   14574     *
   14575     * Unless required by applicable law or agreed to in writing, software
   14576     * distributed under the License is distributed on an "AS IS" BASIS,
   14577     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14578     * See the License for the specific language governing permissions and
   14579     * limitations under the License.
   14580     */
   14581 
   14582    /*
   14583     * File: OP_EXECUTE_INLINE.S
   14584     *
   14585     * Code: Executes a "native inline" instruction. Uses no substitutions.
   14586     *
   14587     * For: execute-inline
   14588     *
   14589     * Description: Executes a "native inline" instruction. This instruction
   14590     *              is generated by the optimizer.
   14591     *
   14592     * Format:
   14593     *
   14594     * Syntax: vAA, {vC, vD, vE, vF}, inline@BBBB
   14595     */
   14596 
   14597     FETCH       1, %ecx                 # %ecx<- BBBB
   14598     movl        rGLUE, %eax             # %eax<- MterpGlue pointer
   14599     addl        $offGlue_retval, %eax  # %eax<- &glue->retval
   14600     EXPORT_PC
   14601     shr         $4, rINST              # rINST<- B
   14602     movl        %eax, -8(%esp)          # push parameter glue->retval
   14603     lea         -24(%esp), %esp
   14604     jmp         .LOP_EXECUTE_INLINE_continue
   14605 
   14606 /* ------------------------------ */
   14607     .balign 64
   14608 .L_OP_EXECUTE_INLINE_RANGE: /* 0xef */
   14609    /* Copyright (C) 2008 The Android Open Source Project
   14610     *
   14611     * Licensed under the Apache License, Version 2.0 (the "License");
   14612     * you may not use this file except in compliance with the License.
   14613     * You may obtain a copy of the License at
   14614     *
   14615     * http://www.apache.org/licenses/LICENSE-2.0
   14616     *
   14617     * Unless required by applicable law or agreed to in writing, software
   14618     * distributed under the License is distributed on an "AS IS" BASIS,
   14619     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14620     * See the License for the specific language governing permissions and
   14621     * limitations under the License.
   14622     */
   14623 
   14624    /*
   14625     * File: stub.S
   14626     */
   14627 
   14628     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14629     pushl       rGLUE                   # push parameter glue
   14630     call        dvmMterp_OP_EXECUTE_INLINE_RANGE      # call c-based implementation
   14631     lea         4(%esp), %esp
   14632     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14633     FINISH_A                            # jump to next instruction
   14634 /* ------------------------------ */
   14635     .balign 64
   14636 .L_OP_INVOKE_OBJECT_INIT_RANGE: /* 0xf0 */
   14637    /* Copyright (C) 2008 The Android Open Source Project
   14638     *
   14639     * Licensed under the Apache License, Version 2.0 (the "License");
   14640     * you may not use this file except in compliance with the License.
   14641     * You may obtain a copy of the License at
   14642     *
   14643     * http://www.apache.org/licenses/LICENSE-2.0
   14644     *
   14645     * Unless required by applicable law or agreed to in writing, software
   14646     * distributed under the License is distributed on an "AS IS" BASIS,
   14647     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14648     * See the License for the specific language governing permissions and
   14649     * limitations under the License.
   14650     */
   14651 
   14652    /*
   14653     * File: stub.S
   14654     */
   14655 
   14656     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14657     pushl       rGLUE                   # push parameter glue
   14658     call        dvmMterp_OP_INVOKE_OBJECT_INIT_RANGE      # call c-based implementation
   14659     lea         4(%esp), %esp
   14660     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14661     FINISH_A                            # jump to next instruction
   14662 /* ------------------------------ */
   14663     .balign 64
   14664 .L_OP_RETURN_VOID_BARRIER: /* 0xf1 */
   14665    /* Copyright (C) 2008 The Android Open Source Project
   14666     *
   14667     * Licensed under the Apache License, Version 2.0 (the "License");
   14668     * you may not use this file except in compliance with the License.
   14669     * You may obtain a copy of the License at
   14670     *
   14671     * http://www.apache.org/licenses/LICENSE-2.0
   14672     *
   14673     * Unless required by applicable law or agreed to in writing, software
   14674     * distributed under the License is distributed on an "AS IS" BASIS,
   14675     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14676     * See the License for the specific language governing permissions and
   14677     * limitations under the License.
   14678     */
   14679 
   14680    /*
   14681     * File: stub.S
   14682     */
   14683 
   14684     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   14685     pushl       rGLUE                   # push parameter glue
   14686     call        dvmMterp_OP_RETURN_VOID_BARRIER      # call c-based implementation
   14687     lea         4(%esp), %esp
   14688     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   14689     FINISH_A                            # jump to next instruction
   14690 /* ------------------------------ */
   14691     .balign 64
   14692 .L_OP_IGET_QUICK: /* 0xf2 */
   14693 /* File: x86-atom/OP_IGET_QUICK.S */
   14694    /* Copyright (C) 2008 The Android Open Source Project
   14695     *
   14696     * Licensed under the Apache License, Version 2.0 (the "License");
   14697     * you may not use this file except in compliance with the License.
   14698     * You may obtain a copy of the License at
   14699     *
   14700     * http://www.apache.org/licenses/LICENSE-2.0
   14701     *
   14702     * Unless required by applicable law or agreed to in writing, software
   14703     * distributed under the License is distributed on an "AS IS" BASIS,
   14704     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14705     * See the License for the specific language governing permissions and
   14706     * limitations under the License.
   14707     */
   14708 
   14709    /*
   14710     * File: OP_IGET_QUICK.S
   14711     *
   14712     * Code: Optimization for iget
   14713     *
   14714     * For: iget-quick
   14715     *
   14716     * Format: B|A|op CCCC (22c)
   14717     *
   14718     * Syntax: op vA, vB, offset@CCCC
   14719     */
   14720 
   14721     movl        rINST, %eax             # %eax<- BA
   14722     shr         $4, %eax               # %eax<- B
   14723     and         $15, rINST             # rINST<- A
   14724     GET_VREG    %eax                    # %eax<- vB; object to operate on
   14725     FETCH       1, %ecx                 # %ecx<- CCCC; field byte offset
   14726     cmp         $0, %eax               # check if object is null
   14727     je          common_errNullObject    # handle null object
   14728     FFETCH_ADV  2, %edx                 # %eax<- next instruction hi; fetch, advance
   14729     movl        (%ecx, %eax), %eax      # %eax<- object field
   14730     SET_VREG    %eax, rINST             # fp[A]<- %eax
   14731     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   14732 
   14733 /* ------------------------------ */
   14734     .balign 64
   14735 .L_OP_IGET_WIDE_QUICK: /* 0xf3 */
   14736 /* File: x86-atom/OP_IGET_WIDE_QUICK.S */
   14737    /* Copyright (C) 2008 The Android Open Source Project
   14738     *
   14739     * Licensed under the Apache License, Version 2.0 (the "License");
   14740     * you may not use this file except in compliance with the License.
   14741     * You may obtain a copy of the License at
   14742     *
   14743     * http://www.apache.org/licenses/LICENSE-2.0
   14744     *
   14745     * Unless required by applicable law or agreed to in writing, software
   14746     * distributed under the License is distributed on an "AS IS" BASIS,
   14747     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14748     * See the License for the specific language governing permissions and
   14749     * limitations under the License.
   14750     */
   14751 
   14752    /*
   14753     * File: OP_IGET_WIDE_QUICK.S
   14754     *
   14755     * Code: Optimization for iget
   14756     *
   14757     * For: iget/wide-quick
   14758     *
   14759     * Format: B|A|op CCCC (22c)
   14760     *
   14761     * Syntax: op vA, vB, offset@CCCC
   14762     */
   14763 
   14764     movl        rINST, %edx             # %edx<- BA
   14765     shr         $4, %edx               # %edx<- B
   14766     andl        $15, rINST             # rINST<- A
   14767     GET_VREG    %edx                    # %edx<- vB; object to operate on
   14768     cmp         $0, %edx               # check if object is null
   14769     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   14770     je          common_errNullObject    # handle null object
   14771     FETCH       1, %ecx                 # %ecx<- CCCC; field byte offset
   14772     movq        (%ecx, %edx), %xmm0     # %xmm0<- object field
   14773     movq        %xmm0, (rFP, rINST, 4)  # fp[A]<- %xmm0
   14774     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   14775 
   14776 /* ------------------------------ */
   14777     .balign 64
   14778 .L_OP_IGET_OBJECT_QUICK: /* 0xf4 */
   14779 /* File: x86-atom/OP_IGET_OBJECT_QUICK.S */
   14780    /* Copyright (C) 2008 The Android Open Source Project
   14781     *
   14782     * Licensed under the Apache License, Version 2.0 (the "License");
   14783     * you may not use this file except in compliance with the License.
   14784     * You may obtain a copy of the License at
   14785     *
   14786     * http://www.apache.org/licenses/LICENSE-2.0
   14787     *
   14788     * Unless required by applicable law or agreed to in writing, software
   14789     * distributed under the License is distributed on an "AS IS" BASIS,
   14790     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14791     * See the License for the specific language governing permissions and
   14792     * limitations under the License.
   14793     */
   14794 
   14795    /*
   14796     * File: OP_IGET_OBJECT_QUICK.S
   14797     */
   14798 
   14799 /* File: x86-atom/OP_IGET_QUICK.S */
   14800    /* Copyright (C) 2008 The Android Open Source Project
   14801     *
   14802     * Licensed under the Apache License, Version 2.0 (the "License");
   14803     * you may not use this file except in compliance with the License.
   14804     * You may obtain a copy of the License at
   14805     *
   14806     * http://www.apache.org/licenses/LICENSE-2.0
   14807     *
   14808     * Unless required by applicable law or agreed to in writing, software
   14809     * distributed under the License is distributed on an "AS IS" BASIS,
   14810     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14811     * See the License for the specific language governing permissions and
   14812     * limitations under the License.
   14813     */
   14814 
   14815    /*
   14816     * File: OP_IGET_QUICK.S
   14817     *
   14818     * Code: Optimization for iget
   14819     *
   14820     * For: iget-quick
   14821     *
   14822     * Format: B|A|op CCCC (22c)
   14823     *
   14824     * Syntax: op vA, vB, offset@CCCC
   14825     */
   14826 
   14827     movl        rINST, %eax             # %eax<- BA
   14828     shr         $4, %eax               # %eax<- B
   14829     and         $15, rINST             # rINST<- A
   14830     GET_VREG    %eax                    # %eax<- vB; object to operate on
   14831     FETCH       1, %ecx                 # %ecx<- CCCC; field byte offset
   14832     cmp         $0, %eax               # check if object is null
   14833     je          common_errNullObject    # handle null object
   14834     FFETCH_ADV  2, %edx                 # %eax<- next instruction hi; fetch, advance
   14835     movl        (%ecx, %eax), %eax      # %eax<- object field
   14836     SET_VREG    %eax, rINST             # fp[A]<- %eax
   14837     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   14838 
   14839 
   14840 /* ------------------------------ */
   14841     .balign 64
   14842 .L_OP_IPUT_QUICK: /* 0xf5 */
   14843 /* File: x86-atom/OP_IPUT_QUICK.S */
   14844    /* Copyright (C) 2008 The Android Open Source Project
   14845     *
   14846     * Licensed under the Apache License, Version 2.0 (the "License");
   14847     * you may not use this file except in compliance with the License.
   14848     * You may obtain a copy of the License at
   14849     *
   14850     * http://www.apache.org/licenses/LICENSE-2.0
   14851     *
   14852     * Unless required by applicable law or agreed to in writing, software
   14853     * distributed under the License is distributed on an "AS IS" BASIS,
   14854     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14855     * See the License for the specific language governing permissions and
   14856     * limitations under the License.
   14857     */
   14858 
   14859    /*
   14860     * File: OP_IPUT_QUICK.S
   14861     * Code: Optimization for iput
   14862     *
   14863     * For: iput-quick
   14864     *
   14865     * Format: B|A|op CCCC (22c)
   14866     *
   14867     * Syntax: op vA, vB, offset@CCCC
   14868     */
   14869 
   14870     movl        rINST, %eax             # %eax<- BA
   14871     shr         $4, %eax               # %eax<- B
   14872     and         $15, rINST             # rINST<- A
   14873     GET_VREG    %eax                    # %eax<- vB; object to operate on
   14874     FETCH       1, %ecx                 # %ecx<- CCCC; field byte offset
   14875     cmp         $0, %eax               # check if object is null
   14876     je          common_errNullObject    # handle null object
   14877     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   14878     GET_VREG    rINST                   # rINST<- vA
   14879     movl        rINST, (%eax, %ecx)     # object field<- vA
   14880     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   14881 
   14882 /* ------------------------------ */
   14883     .balign 64
   14884 .L_OP_IPUT_WIDE_QUICK: /* 0xf6 */
   14885 /* File: x86-atom/OP_IPUT_WIDE_QUICK.S */
   14886    /* Copyright (C) 2008 The Android Open Source Project
   14887     *
   14888     * Licensed under the Apache License, Version 2.0 (the "License");
   14889     * you may not use this file except in compliance with the License.
   14890     * You may obtain a copy of the License at
   14891     *
   14892     * http://www.apache.org/licenses/LICENSE-2.0
   14893     *
   14894     * Unless required by applicable law or agreed to in writing, software
   14895     * distributed under the License is distributed on an "AS IS" BASIS,
   14896     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14897     * See the License for the specific language governing permissions and
   14898     * limitations under the License.
   14899     */
   14900 
   14901    /*
   14902     * File: OP_IPUT_WIDE_QUICK.S
   14903     *
   14904     * Code: Optimization for iput
   14905     *
   14906     * For: iput/wide-quick
   14907     *
   14908     * Format: B|A|op CCCC (22c)
   14909     *
   14910     * Syntax: op vA, vB, offset@CCCC
   14911     */
   14912 
   14913     movl        rINST, %edx             # %edx<- BA
   14914     shr         $4, %edx               # %edx<- B
   14915     andl        $15, rINST             # rINST<- A
   14916     GET_VREG    %edx                    # %edx<- vB; object to operate on
   14917     cmp         $0, %edx               # check if object is null
   14918     FETCH       1, %ecx                 # %ecx<- CCCC; field byte offset
   14919     je          common_errNullObject    # handle null object
   14920     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   14921     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- fp[A]
   14922     movq        %xmm0, (%edx, %ecx)     # object field<- %xmm0; fp[A]
   14923     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   14924 
   14925 /* ------------------------------ */
   14926     .balign 64
   14927 .L_OP_IPUT_OBJECT_QUICK: /* 0xf7 */
   14928 /* File: x86-atom/OP_IPUT_OBJECT_QUICK.S */
   14929    /* Copyright (C) 2008 The Android Open Source Project
   14930     *
   14931     * Licensed under the Apache License, Version 2.0 (the "License");
   14932     * you may not use this file except in compliance with the License.
   14933     * You may obtain a copy of the License at
   14934     *
   14935     * http://www.apache.org/licenses/LICENSE-2.0
   14936     *
   14937     * Unless required by applicable law or agreed to in writing, software
   14938     * distributed under the License is distributed on an "AS IS" BASIS,
   14939     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14940     * See the License for the specific language governing permissions and
   14941     * limitations under the License.
   14942     */
   14943 
   14944    /*
   14945     * File: OP_IPUT_QUICK.S
   14946     * Code: Optimization for iput
   14947     *
   14948     * For: iput-quick
   14949     *
   14950     * Format: B|A|op CCCC (22c)
   14951     *
   14952     * Syntax: op vA, vB, offset@CCCC
   14953     */
   14954 
   14955     movl        rINST, %eax             # %eax<- BA
   14956     shr         $4, %eax               # %eax<- B
   14957     and         $15, rINST             # rINST<- A
   14958     GET_VREG    %eax                    # %eax<- vB; object to operate on
   14959     FETCH       1, %ecx                 # %ecx<- CCCC; field byte offset
   14960     cmp         $0, %eax               # check if object is null
   14961     je          common_errNullObject    # handle null object
   14962     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   14963     GET_VREG    rINST                   # rINST<- vA
   14964     movl        rINST, (%eax, %ecx)     # object field<- vA
   14965     testl       rINST, rINST            # did we write a null object
   14966     je          1f
   14967     movl        rGLUE, %ecx             # get glue
   14968     movl        offGlue_cardTable(%ecx), %ecx # get card table base
   14969     shrl        $GC_CARD_SHIFT, %eax   # get gc card index
   14970     movb        %cl, (%eax, %ecx)       # mark gc card in table
   14971 1:
   14972     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   14973 
   14974 /* ------------------------------ */
   14975     .balign 64
   14976 .L_OP_INVOKE_VIRTUAL_QUICK: /* 0xf8 */
   14977 /* File: x86-atom/OP_INVOKE_VIRTUAL_QUICK.S */
   14978    /* Copyright (C) 2008 The Android Open Source Project
   14979     *
   14980     * Licensed under the Apache License, Version 2.0 (the "License");
   14981     * you may not use this file except in compliance with the License.
   14982     * You may obtain a copy of the License at
   14983     *
   14984     * http://www.apache.org/licenses/LICENSE-2.0
   14985     *
   14986     * Unless required by applicable law or agreed to in writing, software
   14987     * distributed under the License is distributed on an "AS IS" BASIS,
   14988     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14989     * See the License for the specific language governing permissions and
   14990     * limitations under the License.
   14991     */
   14992 
   14993    /*
   14994     * File: OP_INVOKE_VIRTUAL_QUICK.S
   14995     *
   14996     * Code: Optimization for invoke-virtual and invoke-virtual/range
   14997     *
   14998     * For: invoke-virtual/quick, invoke-virtual/quick-range
   14999     */
   15000 
   15001 
   15002     FETCH       2, %edx                 # %edx<- GFED or CCCC
   15003     .if (!0)
   15004     and         $15, %edx              # %edx<- D if not range
   15005     .endif
   15006     FETCH       1, %ecx                 # %ecx<- method index
   15007     GET_VREG    %edx                    # %edx<- "this" ptr
   15008     cmp         $0, %edx               # %edx<- check for null "this"
   15009     EXPORT_PC                           # must export pc for invoke
   15010     je          common_errNullObject
   15011     movl        offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
   15012     movl        offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
   15013     movl        (%edx, %ecx, 4), %ecx   # %ecx<- vtable[methodIndex]
   15014     jmp         common_invokeMethodNoRange # invoke method common code
   15015 
   15016 /* ------------------------------ */
   15017     .balign 64
   15018 .L_OP_INVOKE_VIRTUAL_QUICK_RANGE: /* 0xf9 */
   15019 /* File: x86-atom/OP_INVOKE_VIRTUAL_QUICK_RANGE.S */
   15020    /* Copyright (C) 2008 The Android Open Source Project
   15021     *
   15022     * Licensed under the Apache License, Version 2.0 (the "License");
   15023     * you may not use this file except in compliance with the License.
   15024     * You may obtain a copy of the License at
   15025     *
   15026     * http://www.apache.org/licenses/LICENSE-2.0
   15027     *
   15028     * Unless required by applicable law or agreed to in writing, software
   15029     * distributed under the License is distributed on an "AS IS" BASIS,
   15030     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15031     * See the License for the specific language governing permissions and
   15032     * limitations under the License.
   15033     */
   15034 
   15035    /*
   15036     * File: OP_INVOKE_VIRTUAL_QUICK_RANGE.S
   15037     */
   15038 
   15039 /* File: x86-atom/OP_INVOKE_VIRTUAL_QUICK.S */
   15040    /* Copyright (C) 2008 The Android Open Source Project
   15041     *
   15042     * Licensed under the Apache License, Version 2.0 (the "License");
   15043     * you may not use this file except in compliance with the License.
   15044     * You may obtain a copy of the License at
   15045     *
   15046     * http://www.apache.org/licenses/LICENSE-2.0
   15047     *
   15048     * Unless required by applicable law or agreed to in writing, software
   15049     * distributed under the License is distributed on an "AS IS" BASIS,
   15050     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15051     * See the License for the specific language governing permissions and
   15052     * limitations under the License.
   15053     */
   15054 
   15055    /*
   15056     * File: OP_INVOKE_VIRTUAL_QUICK.S
   15057     *
   15058     * Code: Optimization for invoke-virtual and invoke-virtual/range
   15059     *
   15060     * For: invoke-virtual/quick, invoke-virtual/quick-range
   15061     */
   15062 
   15063 
   15064     FETCH       2, %edx                 # %edx<- GFED or CCCC
   15065     .if (!1)
   15066     and         $15, %edx              # %edx<- D if not range
   15067     .endif
   15068     FETCH       1, %ecx                 # %ecx<- method index
   15069     GET_VREG    %edx                    # %edx<- "this" ptr
   15070     cmp         $0, %edx               # %edx<- check for null "this"
   15071     EXPORT_PC                           # must export pc for invoke
   15072     je          common_errNullObject
   15073     movl        offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
   15074     movl        offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
   15075     movl        (%edx, %ecx, 4), %ecx   # %ecx<- vtable[methodIndex]
   15076     jmp         common_invokeMethodRange # invoke method common code
   15077 
   15078 
   15079 /* ------------------------------ */
   15080     .balign 64
   15081 .L_OP_INVOKE_SUPER_QUICK: /* 0xfa */
   15082 /* File: x86-atom/OP_INVOKE_SUPER_QUICK.S */
   15083    /* Copyright (C) 2008 The Android Open Source Project
   15084     *
   15085     * Licensed under the Apache License, Version 2.0 (the "License");
   15086     * you may not use this file except in compliance with the License.
   15087     * You may obtain a copy of the License at
   15088     *
   15089     * http://www.apache.org/licenses/LICENSE-2.0
   15090     *
   15091     * Unless required by applicable law or agreed to in writing, software
   15092     * distributed under the License is distributed on an "AS IS" BASIS,
   15093     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15094     * See the License for the specific language governing permissions and
   15095     * limitations under the License.
   15096     */
   15097 
   15098    /*
   15099     * File: OP_INVOKE_SUPER_QUICK.S
   15100     *
   15101     * Code: Optimization for invoke-super and invoke-super/range
   15102     *
   15103     * For: invoke-super/quick, invoke-super/quick-range
   15104     */
   15105 
   15106 
   15107     FETCH       2, %edx                 # %edx<- GFED or CCCC
   15108     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   15109     movl        offGlue_method(%ecx), %eax # %eax<- glue->method
   15110     .if         (!0)
   15111     and         $15, %edx              #  %edx<- D if not range
   15112     .endif
   15113     FETCH       1, %ecx                 # %ecx<- method index
   15114     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   15115     movl        offClassObject_super(%eax), %eax # %eax<- glue->method->clazz->super
   15116     EXPORT_PC                           # must export for invoke
   15117     movl        offClassObject_vtable(%eax), %eax # %edx<- glue->method->clazz->super->vtable
   15118     cmp         $0, (rFP, %edx, 4)     # check for null object
   15119     movl        (%eax, %ecx, 4), %ecx   # %ecx<- vtable[methodIndex]
   15120     je          common_errNullObject    # handle null object
   15121     jmp         common_invokeMethodNoRange # invoke method common code
   15122 
   15123 /* ------------------------------ */
   15124     .balign 64
   15125 .L_OP_INVOKE_SUPER_QUICK_RANGE: /* 0xfb */
   15126 /* File: x86-atom/OP_INVOKE_SUPER_QUICK_RANGE.S */
   15127    /* Copyright (C) 2008 The Android Open Source Project
   15128     *
   15129     * Licensed under the Apache License, Version 2.0 (the "License");
   15130     * you may not use this file except in compliance with the License.
   15131     * You may obtain a copy of the License at
   15132     *
   15133     * http://www.apache.org/licenses/LICENSE-2.0
   15134     *
   15135     * Unless required by applicable law or agreed to in writing, software
   15136     * distributed under the License is distributed on an "AS IS" BASIS,
   15137     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15138     * See the License for the specific language governing permissions and
   15139     * limitations under the License.
   15140     */
   15141 
   15142    /*
   15143     * File: OP_INVOKE_SUPER_QUICK_RANGE.S
   15144     */
   15145 
   15146 /* File: x86-atom/OP_INVOKE_SUPER_QUICK.S */
   15147    /* Copyright (C) 2008 The Android Open Source Project
   15148     *
   15149     * Licensed under the Apache License, Version 2.0 (the "License");
   15150     * you may not use this file except in compliance with the License.
   15151     * You may obtain a copy of the License at
   15152     *
   15153     * http://www.apache.org/licenses/LICENSE-2.0
   15154     *
   15155     * Unless required by applicable law or agreed to in writing, software
   15156     * distributed under the License is distributed on an "AS IS" BASIS,
   15157     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15158     * See the License for the specific language governing permissions and
   15159     * limitations under the License.
   15160     */
   15161 
   15162    /*
   15163     * File: OP_INVOKE_SUPER_QUICK.S
   15164     *
   15165     * Code: Optimization for invoke-super and invoke-super/range
   15166     *
   15167     * For: invoke-super/quick, invoke-super/quick-range
   15168     */
   15169 
   15170 
   15171     FETCH       2, %edx                 # %edx<- GFED or CCCC
   15172     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   15173     movl        offGlue_method(%ecx), %eax # %eax<- glue->method
   15174     .if         (!1)
   15175     and         $15, %edx              #  %edx<- D if not range
   15176     .endif
   15177     FETCH       1, %ecx                 # %ecx<- method index
   15178     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   15179     movl        offClassObject_super(%eax), %eax # %eax<- glue->method->clazz->super
   15180     EXPORT_PC                           # must export for invoke
   15181     movl        offClassObject_vtable(%eax), %eax # %edx<- glue->method->clazz->super->vtable
   15182     cmp         $0, (rFP, %edx, 4)     # check for null object
   15183     movl        (%eax, %ecx, 4), %ecx   # %ecx<- vtable[methodIndex]
   15184     je          common_errNullObject    # handle null object
   15185     jmp         common_invokeMethodRange # invoke method common code
   15186 
   15187 
   15188 /* ------------------------------ */
   15189     .balign 64
   15190 .L_OP_IPUT_OBJECT_VOLATILE: /* 0xfc */
   15191    /* Copyright (C) 2008 The Android Open Source Project
   15192     *
   15193     * Licensed under the Apache License, Version 2.0 (the "License");
   15194     * you may not use this file except in compliance with the License.
   15195     * You may obtain a copy of the License at
   15196     *
   15197     * http://www.apache.org/licenses/LICENSE-2.0
   15198     *
   15199     * Unless required by applicable law or agreed to in writing, software
   15200     * distributed under the License is distributed on an "AS IS" BASIS,
   15201     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15202     * See the License for the specific language governing permissions and
   15203     * limitations under the License.
   15204     */
   15205 
   15206    /*
   15207     * File: stub.S
   15208     */
   15209 
   15210     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   15211     pushl       rGLUE                   # push parameter glue
   15212     call        dvmMterp_OP_IPUT_OBJECT_VOLATILE      # call c-based implementation
   15213     lea         4(%esp), %esp
   15214     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   15215     FINISH_A                            # jump to next instruction
   15216 /* ------------------------------ */
   15217     .balign 64
   15218 .L_OP_SGET_OBJECT_VOLATILE: /* 0xfd */
   15219    /* Copyright (C) 2008 The Android Open Source Project
   15220     *
   15221     * Licensed under the Apache License, Version 2.0 (the "License");
   15222     * you may not use this file except in compliance with the License.
   15223     * You may obtain a copy of the License at
   15224     *
   15225     * http://www.apache.org/licenses/LICENSE-2.0
   15226     *
   15227     * Unless required by applicable law or agreed to in writing, software
   15228     * distributed under the License is distributed on an "AS IS" BASIS,
   15229     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15230     * See the License for the specific language governing permissions and
   15231     * limitations under the License.
   15232     */
   15233 
   15234    /*
   15235     * File: stub.S
   15236     */
   15237 
   15238     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   15239     pushl       rGLUE                   # push parameter glue
   15240     call        dvmMterp_OP_SGET_OBJECT_VOLATILE      # call c-based implementation
   15241     lea         4(%esp), %esp
   15242     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   15243     FINISH_A                            # jump to next instruction
   15244 /* ------------------------------ */
   15245     .balign 64
   15246 .L_OP_SPUT_OBJECT_VOLATILE: /* 0xfe */
   15247    /* Copyright (C) 2008 The Android Open Source Project
   15248     *
   15249     * Licensed under the Apache License, Version 2.0 (the "License");
   15250     * you may not use this file except in compliance with the License.
   15251     * You may obtain a copy of the License at
   15252     *
   15253     * http://www.apache.org/licenses/LICENSE-2.0
   15254     *
   15255     * Unless required by applicable law or agreed to in writing, software
   15256     * distributed under the License is distributed on an "AS IS" BASIS,
   15257     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15258     * See the License for the specific language governing permissions and
   15259     * limitations under the License.
   15260     */
   15261 
   15262    /*
   15263     * File: stub.S
   15264     */
   15265 
   15266     SAVE_PC_FP_TO_GLUE %edx             # save program counter and frame pointer
   15267     pushl       rGLUE                   # push parameter glue
   15268     call        dvmMterp_OP_SPUT_OBJECT_VOLATILE      # call c-based implementation
   15269     lea         4(%esp), %esp
   15270     LOAD_PC_FP_FROM_GLUE                # restore program counter and frame pointer
   15271     FINISH_A                            # jump to next instruction
   15272 /* ------------------------------ */
   15273     .balign 64
   15274 .L_OP_UNUSED_FF: /* 0xff */
   15275 /* File: x86-atom/OP_UNUSED_FF.S */
   15276    /* Copyright (C) 2008 The Android Open Source Project
   15277     *
   15278     * Licensed under the Apache License, Version 2.0 (the "License");
   15279     * you may not use this file except in compliance with the License.
   15280     * You may obtain a copy of the License at
   15281     *
   15282     * http://www.apache.org/licenses/LICENSE-2.0
   15283     *
   15284     * Unless required by applicable law or agreed to in writing, software
   15285     * distributed under the License is distributed on an "AS IS" BASIS,
   15286     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15287     * See the License for the specific language governing permissions and
   15288     * limitations under the License.
   15289     */
   15290 
   15291 /* File: x86-atom/unused.S */
   15292    /* Copyright (C) 2008 The Android Open Source Project
   15293     *
   15294     * Licensed under the Apache License, Version 2.0 (the "License");
   15295     * you may not use this file except in compliance with the License.
   15296     * You may obtain a copy of the License at
   15297     *
   15298     * http://www.apache.org/licenses/LICENSE-2.0
   15299     *
   15300     * Unless required by applicable law or agreed to in writing, software
   15301     * distributed under the License is distributed on an "AS IS" BASIS,
   15302     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15303     * See the License for the specific language governing permissions and
   15304     * limitations under the License.
   15305     */
   15306 
   15307    /*
   15308     * File: unused.S
   15309     *
   15310     * Code: Common code for unused bytecodes. Uses no subtitutions.
   15311     *
   15312     * For: all unused bytecodes
   15313     *
   15314     * Description: aborts if executed.
   15315     *
   15316     * Format: |op (10x)
   15317     *
   15318     * Syntax: op
   15319     */
   15320 
   15321     call        common_abort
   15322 
   15323 
   15324     .balign 64
   15325     .size   dvmAsmInstructionStart, .-dvmAsmInstructionStart
   15326     .global dvmAsmInstructionEnd
   15327 dvmAsmInstructionEnd:
   15328 
   15329 /*
   15330  * ===========================================================================
   15331  *  Sister implementations
   15332  * ===========================================================================
   15333  */
   15334     .global dvmAsmSisterStart
   15335     .type   dvmAsmSisterStart, %function
   15336     .text
   15337     .balign 4
   15338 dvmAsmSisterStart:
   15339 
   15340 /* continuation for OP_CONST_STRING */
   15341 
   15342 
   15343    /*
   15344     * Continuation if the Class has not yet been resolved.
   15345     *  %ecx: BBBB (Class ref)
   15346     *  need: target register
   15347     */
   15348 
   15349 .LOP_CONST_STRING_resolve:
   15350     EXPORT_PC
   15351     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   15352     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   15353     movl        %ecx, -4(%esp)          # push parameter class ref
   15354     movl        %edx, -8(%esp)          # push parameter glue->method->clazz
   15355     lea         -8(%esp), %esp
   15356     call        dvmResolveString        # resolve string reference
   15357                                         # call: (const ClassObject* referrer, u4 stringIdx)
   15358                                         # return: StringObject*
   15359     lea         8(%esp), %esp
   15360     cmp         $0, %eax               # check if resolved string failed
   15361     je          common_exceptionThrown  # resolve failed; exception thrown
   15362     SET_VREG    %eax, rINST             # vAA<- %eax; pResString[BBBB]
   15363     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   15364     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   15365 
   15366 /* continuation for OP_CONST_STRING_JUMBO */
   15367 
   15368 
   15369    /*
   15370     * Continuation if the Class has not yet been resolved.
   15371     *  %ecx: BBBB (Class ref)
   15372     *  need: target register
   15373     */
   15374 .LOP_CONST_STRING_JUMBO_resolve:
   15375     EXPORT_PC
   15376     movl        rGLUE, %edx             # get MterpGlue pointer
   15377     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   15378     movl        offMethod_clazz(%edx), %edx # %edx <- glue->method->clazz
   15379     movl        %ecx, -4(%esp)          # push parameter class ref
   15380     movl        %edx, -8(%esp)          # push parameter glue->method->clazz
   15381     lea         -8(%esp), %esp
   15382     call        dvmResolveString        # resolve string reference
   15383                                         # call: (const ClassObject* referrer, u4 stringIdx)
   15384                                         # return: StringObject*
   15385     lea         8(%esp), %esp
   15386     cmp         $0, %eax               # check if resolved string failed
   15387     je          common_exceptionThrown  # resolve failed; exception thrown
   15388     SET_VREG    %eax, rINST             # vAA<- %eax; pResString[BBBB]
   15389     FINISH      3                       # jump to next instruction
   15390 
   15391 /* continuation for OP_CONST_CLASS */
   15392 
   15393    /*
   15394     * Continuation if the Class has not yet been resolved.
   15395     *  %ecx: BBBB (Class ref)
   15396     *  need: target register
   15397     */
   15398 
   15399 .LOP_CONST_CLASS_resolve:
   15400     EXPORT_PC
   15401     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   15402     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   15403     movl        $1, -4(%esp)           # push parameter true
   15404     movl        %ecx, -8(%esp)          # push parameter
   15405     movl        %edx, -12(%esp)         # push parameter glue->method->clazz
   15406     lea         -12(%esp), %esp
   15407     call        dvmResolveClass         # resolve ClassObject pointer
   15408                                         # class: (const ClassObject* referrer, u4 classIdx,
   15409                                         #         bool fromUnverifiedConstant)
   15410                                         # return: ClassObject*
   15411     lea         12(%esp), %esp
   15412     cmp         $0, %eax               # check for null pointer
   15413     je          common_exceptionThrown  # handle exception
   15414     SET_VREG    %eax, rINST             # vAA<- resolved class
   15415     FINISH      2                       # jump to next instruction
   15416 
   15417 /* continuation for OP_CHECK_CAST */
   15418 
   15419 .LOP_CHECK_CAST_resolved:
   15420     cmp         %ecx, offObject_clazz(rINST) # check for same class
   15421     jne         .LOP_CHECK_CAST_fullcheck   # not same class; do full check
   15422 
   15423 .LOP_CHECK_CAST_okay:
   15424     FINISH      2                       # jump to next instruction
   15425 
   15426    /*
   15427     *  Trivial test failed, need to perform full check.
   15428     *  offObject_clazz(rINST) holds obj->clazz
   15429     *  %ecx holds class resolved from BBBB
   15430     *  rINST holds object
   15431     */
   15432 
   15433 .LOP_CHECK_CAST_fullcheck:
   15434     movl        offObject_clazz(rINST), %eax  # %eax<- obj->clazz
   15435     movl        %eax, -12(%esp)         # push parameter obj->clazz
   15436     movl        %ecx, -8(%esp)          # push parameter # push parameter resolved class
   15437     lea         -12(%esp), %esp
   15438     call        dvmInstanceofNonTrivial # call: (ClassObject* instance, ClassObject* clazz)
   15439                                         # return: int
   15440     lea         12(%esp), %esp
   15441     cmp         $0, %eax               # failed?
   15442     jne         .LOP_CHECK_CAST_okay        # success
   15443 
   15444    /*
   15445     * A cast has failed.  We need to throw a ClassCastException with the
   15446     * class of the object that failed to be cast.
   15447     */
   15448 
   15449     EXPORT_PC                           # we will throw an exception
   15450 #error BIT ROT!!!
   15451     /*
   15452      * TODO: Code here needs to call dvmThrowClassCastException with two
   15453      * arguments.
   15454      */
   15455 #if 0
   15456     /* old obsolete code that called dvmThrowExceptionWithClassMessage */
   15457     movl        $.LstrClassCastExceptionPtr, -8(%esp) # push parameter message
   15458     movl        offObject_clazz(rINST), rINST # rINST<- obj->clazz
   15459     movl        offClassObject_descriptor(rINST), rINST # rINST<- obj->clazz->descriptor
   15460     movl        rINST, -4(%esp)         # push parameter obj->clazz->descriptor
   15461     lea         -8(%esp), %esp
   15462     call        dvmThrowExceptionWithClassMessage # call: (const char* exceptionDescriptor,
   15463                                                   #       const char* messageDescriptor, Object* cause)
   15464                                                   # return: void
   15465 #endif
   15466     lea         8(%esp), %esp
   15467     jmp         common_exceptionThrown
   15468 
   15469    /*
   15470     * Resolution required.  This is the least-likely path.
   15471     *
   15472     *  rINST holds object
   15473     */
   15474 
   15475 .LOP_CHECK_CAST_resolve:
   15476     movl        offGlue_method(%edx), %eax # %eax<- glue->method
   15477     FETCH       1, %ecx                 # %ecx holds BBBB
   15478     EXPORT_PC                           # in case we throw an exception
   15479     movl        $0, -8(%esp)           # push parameter false
   15480     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   15481     movl        %ecx, -12(%esp)         # push parameter BBBB
   15482     movl        %eax, -16(%esp)         # push parameter glue->method>clazz
   15483     lea         -16(%esp), %esp
   15484     call        dvmResolveClass         # resolve ClassObject pointer
   15485                                         # call: (const ClassObject* referrer, u4 classIdx,
   15486                                         #        bool fromUnverifiedConstant)
   15487                                         # return ClassObject*
   15488     lea         16(%esp), %esp
   15489     cmp         $0, %eax               # check for null pointer
   15490     je          common_exceptionThrown  # handle excpetion
   15491     movl        %eax, %ecx              # %ecx<- resolved class
   15492     jmp         .LOP_CHECK_CAST_resolved
   15493 
   15494 /* continuation for OP_INSTANCE_OF */
   15495 
   15496 .LOP_INSTANCE_OF_break:
   15497     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   15498     movl        offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
   15499     FETCH       1, %eax                 # %eax<- CCCC
   15500     movl        offDvmDex_pResClasses(%ecx), %ecx # %ecx<- pDvmDex->pResClasses
   15501     movl        (%ecx, %eax, 4), %ecx   # %ecx<- resolved class
   15502     movl        offObject_clazz(%edx), %edx # %edx<- obj->clazz
   15503     cmp         $0, %ecx               # check if already resovled
   15504     je          .LOP_INSTANCE_OF_resolve     # not resolved before, so resolve now
   15505 
   15506 .LOP_INSTANCE_OF_resolved:
   15507     cmp         %ecx, %edx              # check if same class
   15508     je          .LOP_INSTANCE_OF_trivial     # yes, finish
   15509     jmp         .LOP_INSTANCE_OF_fullcheck   # no, do full check
   15510 
   15511    /*
   15512     * The trivial test failed, we need to perform a full check.
   15513     * %edx holds obj->clazz
   15514     * %ecx holds class resolved from BBBB
   15515     */
   15516 
   15517 .LOP_INSTANCE_OF_fullcheck:
   15518     movl        %edx, -8(%esp)          # push parameter obj->clazz
   15519     movl        %ecx, -4(%esp)          # push parameter resolved class
   15520     lea         -8(%esp), %esp
   15521     call        dvmInstanceofNonTrivial # perform full check
   15522                                         # call: (ClassObject* instance, ClassObject* clazz)
   15523                                         # return: int
   15524     andl        $15, rINST             # rINST<- A
   15525     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   15526     lea         8(%esp), %esp
   15527     SET_VREG    %eax, rINST             # vA<- r0
   15528     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   15529 
   15530    /*
   15531     * %edx holds boolean result
   15532     */
   15533 
   15534 .LOP_INSTANCE_OF_store:
   15535     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   15536     andl        $15, rINST             # rINST<- A
   15537     SET_VREG    %edx, rINST             # vA<- r0
   15538     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15539 
   15540    /*
   15541     * Trivial test succeeded, save and bail.
   15542     */
   15543 
   15544 .LOP_INSTANCE_OF_trivial:
   15545     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   15546     andl        $15, rINST             # rINST<- A
   15547     SET_VREG    $1, rINST              # vA<- r0
   15548     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15549 
   15550    /*
   15551     * Resolution required.  This is the least-likely path.
   15552     * %eax holds BBBB
   15553     */
   15554 
   15555 .LOP_INSTANCE_OF_resolve:
   15556 
   15557     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   15558     EXPORT_PC
   15559     movl        offGlue_method(%ecx), %ecx # %ecx<- glue->method
   15560     movl        offMethod_clazz(%ecx), %ecx # %ecx<- glue->method->clazz
   15561     movl        %ecx, -12(%esp)         # push parameter glue->method->clazz
   15562     movl        %eax, -8(%esp)          # push parameter CCCC; type index
   15563     movl        $1, -4(%esp)           # push parameter true
   15564     lea         -12(%esp), %esp
   15565     call        dvmResolveClass         # call: (const ClassObject* referrer, u4 classIdx,
   15566                                         #        bool fromUnverifiedConstant)
   15567                                         # return: ClassObject*
   15568     lea         12(%esp), %esp
   15569     cmp         $0, %eax               # check for null
   15570     je          common_exceptionThrown  # handle exception
   15571     movl        rINST, %edx             # %edx<- BA+
   15572     shr         $4, %edx               # %edx<- B
   15573     movl        %eax, %ecx              # need class in %ecx
   15574     GET_VREG    %edx                    # %edx<- vB
   15575     movl        offObject_clazz(%edx), %edx # %edx<- obj->clazz
   15576     jmp         .LOP_INSTANCE_OF_resolved    # clazz resolved, continue
   15577 
   15578 /* continuation for OP_NEW_INSTANCE */
   15579 .balign 32
   15580 .LOP_NEW_INSTANCE_finish:
   15581     movl        %edx, -8(%esp)          # push parameter object
   15582     movl        %eax, -4(%esp)          # push parameter flags
   15583     lea         -8(%esp), %esp
   15584     call        dvmAllocObject          # call: (ClassObject* clazz, int flags)
   15585                                         # return: Object*
   15586     cmp         $0, %eax               # check for failure
   15587     lea         8(%esp), %esp
   15588     je          common_exceptionThrown  # handle exception
   15589     SET_VREG    %eax, rINST             # vAA<- pObject
   15590     FINISH      2                       # jump to next instruction
   15591 
   15592    /*
   15593     * Class initialization required.
   15594     *
   15595     *  %edx holds class object
   15596     */
   15597 
   15598 .LOP_NEW_INSTANCE_needinit:
   15599     movl        %edx, -4(%esp)          # push parameter object
   15600     lea         -4(%esp), %esp
   15601     call        dvmInitClass            # call: (ClassObject* clazz)
   15602                                         # return: bool
   15603     lea         4(%esp), %esp
   15604     cmp         $0, %eax               # check for failure
   15605     movl        -4(%esp), %edx          # %edx<- object
   15606     je          common_exceptionThrown  # handle exception
   15607     testl       $(ACC_INTERFACE|ACC_ABSTRACT), offClassObject_accessFlags(%edx)
   15608     mov         $ALLOC_DONT_TRACK, %eax # %eax<- flag for alloc call
   15609     je          .LOP_NEW_INSTANCE_finish      # continue
   15610     jmp         .LOP_NEW_INSTANCE_abstract    # handle abstract or interface
   15611 
   15612    /*
   15613     * Resolution required.  This is the least-likely path.
   15614     *
   15615     *  BBBB in %eax
   15616     */
   15617 
   15618 .LOP_NEW_INSTANCE_resolve:
   15619 
   15620 
   15621     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   15622     FETCH       1, %eax                 # %eax<- BBBB
   15623     movl        offGlue_method(%ecx), %ecx # %ecx<- glue->method
   15624     movl        offMethod_clazz(%ecx), %ecx # %ecx<- glue->method->clazz
   15625     movl        %ecx, -12(%esp)         # push parameter clazz
   15626     movl        $0, -4(%esp)           # push parameter false
   15627     movl        %eax, -8(%esp)          # push parameter BBBB
   15628     lea         -12(%esp), %esp
   15629     call        dvmResolveClass         # call: (const ClassObject* referrer,
   15630                                         #       u4 classIdx, bool fromUnverifiedConstant)
   15631                                         # return: ClassObject*
   15632     lea         12(%esp), %esp
   15633     movl        %eax, %edx              # %edx<- pObject
   15634     cmp         $0, %edx               # check for failure
   15635     jne         .LOP_NEW_INSTANCE_resolved    # continue
   15636     jmp         common_exceptionThrown  # handle exception
   15637 
   15638    /*
   15639     * We can't instantiate an abstract class or interface, so throw an
   15640     * InstantiationError with the class descriptor as the message.
   15641     *
   15642     *  %edx holds class object
   15643     */
   15644 
   15645 .LOP_NEW_INSTANCE_abstract:
   15646     movl        offClassObject_descriptor(%edx), %ecx # %ecx<- descriptor
   15647     movl        %ecx, -4(%esp)          # push parameter descriptor
   15648     movl        $.LstrInstantiationErrorPtr, -8(%esp) # push parameter message
   15649     lea         -8(%esp), %esp
   15650     call        dvmThrowExceptionWithClassMessage # call: (const char* exceptionDescriptor,
   15651                                                   #        const char* messageDescriptor)
   15652                                                   # return: void
   15653     jmp         common_exceptionThrown  # handle exception
   15654 
   15655 .LstrInstantiationErrorPtr:
   15656 .asciz      "Ljava/lang/InstantiationError;"
   15657 
   15658 /* continuation for OP_NEW_ARRAY */
   15659 
   15660    /*
   15661     * Resolve class.  (This is an uncommon case.)
   15662     *
   15663     *  %edx holds array length
   15664     *  %ecx holds class ref CCCC
   15665     */
   15666 
   15667 .LOP_NEW_ARRAY_resolve:
   15668     movl        rGLUE, %eax             # %eax<- pMterpGlue
   15669     movl        offGlue_method(%eax), %eax # %eax<- glue->method
   15670     movl        %edx, -4(%esp)          # save length
   15671     movl        $0, -8(%esp)           # push parameter false
   15672     movl        %ecx, -12(%esp)         # push parameter class ref
   15673     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   15674     movl        %eax, -16(%esp)         # push parameter clazz
   15675     lea         -16(%esp), %esp
   15676     call        dvmResolveClass         # call: (const ClassObject* referrer,
   15677                                         #       u4 classIdx, bool fromUnverifiedConstant)
   15678                                         # return: ClassObject*
   15679     cmp         $0, %eax               # check for failure
   15680     lea         16(%esp), %esp
   15681     je          common_exceptionThrown  # handle exception
   15682     movl        -4(%esp), %edx          # %edx<- length
   15683 
   15684    /*
   15685     * Finish allocation.
   15686     *
   15687     *  %eax holds class
   15688     *  %edx holds array length
   15689     */
   15690 
   15691 .LOP_NEW_ARRAY_finish:
   15692     movl        %eax, -12(%esp)         # push parameter class
   15693     movl        %edx, -8(%esp)          # push parameter length
   15694     movl        $ALLOC_DONT_TRACK, -4(%esp)
   15695     lea         -12(%esp), %esp
   15696     call        dvmAllocArrayByClass    # call: (ClassObject* arrayClass,
   15697                                         # size_t length, int allocFlags)
   15698                                         # return: ArrayObject*
   15699     and         $15, rINST             # rINST<- A
   15700     cmp         $0, %eax               # check for allocation failure
   15701     lea         12(%esp), %esp
   15702     je          common_exceptionThrown  # handle exception
   15703     SET_VREG    %eax, rINST             # vA<- pArray
   15704     FINISH      2                       # jump to next instruction
   15705 
   15706 /* continuation for OP_FILLED_NEW_ARRAY */
   15707 
   15708 .LOP_FILLED_NEW_ARRAY_break:
   15709     movl        $0, -8(%esp)           # push parameter false
   15710     movl        %ecx, -12(%esp)         # push parameter BBBB
   15711     movl        rGLUE, %edx             # %edx<- MterpGlue pointer
   15712     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   15713     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   15714     movl        %edx, -16(%esp)         # push parameter glue->method->clazz
   15715     lea         -16(%esp), %esp
   15716     call        dvmResolveClass         # call: (const ClassObject* referrer, u4 classIdx,
   15717                                         #        bool fromUnverifiedConstant)
   15718                                         # return: ClassObject*
   15719     lea         16(%esp), %esp
   15720     cmp         $0, %eax               # check for null return
   15721     je          common_exceptionThrown  # handle exception
   15722 
   15723    /*
   15724     * On entry:
   15725     *  %eax holds array class
   15726     *  rINST holds BA or AA
   15727     */
   15728 
   15729 .LOP_FILLED_NEW_ARRAY_continue:
   15730     movl        offClassObject_descriptor(%eax), %eax # %eax<- arrayClass->descriptor
   15731     movzbl      1(%eax), %eax           # %eax<- descriptor[1]
   15732     cmpb        $'I', %al             # check if array of ints
   15733     je          1f
   15734     cmpb        $'L', %al
   15735     je          1f
   15736     cmpb        $'[', %al
   15737     jne         .LOP_FILLED_NEW_ARRAY_notimpl     # jump to not implemented
   15738 1:
   15739     movl        %eax, sReg0             # save type
   15740     movl        rINST, -12(%esp)        # push parameter length
   15741     movl        %eax, -16(%esp)         # push parameter descriptor[1]
   15742     movl        $ALLOC_DONT_TRACK, -8(%esp) # push parameter to allocate flags
   15743     .if         (!0)
   15744     shrl        $4, -12(%esp)          # parameter length is B
   15745     .endif
   15746     lea         -16(%esp), %esp
   15747     call        dvmAllocPrimitiveArray  # call: (char type, size_t length, int allocFlags)
   15748                                         # return: ArrayObject*
   15749     lea         16(%esp), %esp
   15750     cmp         $0, %eax               # check for null return
   15751     je          common_exceptionThrown  # handle exception
   15752 
   15753     FETCH       2, %edx                 # %edx<- FEDC or CCCC
   15754     movl        rGLUE, %ecx             # %ecx<- MterpGlue pointer
   15755     movl        %eax, offGlue_retval(%ecx) # retval<- new array
   15756     lea         offArrayObject_contents(%eax), %eax # %eax<- newArray->contents
   15757     subl        $1, -12(%esp)          # length--; check for negative
   15758     js          2f                      # if length was zero, finish
   15759 
   15760    /*
   15761     * copy values from registers into the array
   15762     * %eax=array, %edx=CCCC/FEDC, -12(%esp)=length (from AA or B), rINST=AA/BA
   15763     */
   15764 
   15765     .if         0
   15766     lea         (rFP, %edx, 4), %ecx    # %ecx<- &fpp[CCCC]
   15767 1:
   15768     movl        (%ecx), %edx            # %edx<- %ecx++
   15769     lea         4(%ecx), %ecx           # %ecx++
   15770     movl        %edx, (%eax)            # *contents<- vX
   15771     lea         4(%eax), %eax           # %eax++; contents++
   15772     subl        $1, -12(%esp)          # length--
   15773     jns         1b                      # or continue at 2
   15774     .else
   15775     cmp         $4, -12(%esp)          # check length
   15776     jne         1f                      # has four args
   15777     and         $15, rINST             # rINST<- A
   15778     GET_VREG    rINST                   # rINST<- vA
   15779     subl        $1, -12(%esp)          # count--
   15780     movl        rINST, 16(%eax)         # contents[4]<- vA
   15781 1:
   15782     movl        %edx, %ecx              # %ecx<- %edx; ecx for temp
   15783     andl        $15, %ecx              # %ecx<- G/F/E/D
   15784     GET_VREG    %ecx                    # %ecx<- vG/vF/vE/vD
   15785     shr         $4, %edx               # %edx<- put next reg in low 4
   15786     subl        $1, -12(%esp)          # count--
   15787     movl        %ecx, (%eax)            # *contents<- vX
   15788     lea         4(%eax), %eax           # %eax++; contents++
   15789     jns         1b                      # or continue at 2
   15790     .endif
   15791 2:
   15792     cmpb        $'I', sReg0            # check for int array
   15793     je          3f
   15794     movl        rGLUE, %ecx             # %ecx<- MterpGlue pointer
   15795     movl        offGlue_retval(%ecx), %eax # Object head
   15796     movl        offGlue_cardTable(%ecx), %ecx # card table base
   15797     shrl        $GC_CARD_SHIFT, %eax   # convert to card num
   15798     movb        %cl,(%ecx, %eax)        # mark card based on object head
   15799 3:
   15800     FINISH      3                       # jump to next instruction
   15801 
   15802    /*
   15803     * Throw an exception to indicate this mode of filled-new-array
   15804     * has not been implemented.
   15805     */
   15806 
   15807 .LOP_FILLED_NEW_ARRAY_notimpl:
   15808     movl        $.LstrInternalError, -8(%esp)
   15809     movl        $.LstrFilledNewArrayNotImpl, -4(%esp)
   15810     lea         -8(%esp), %esp
   15811     call        dvmThrowException # call: (const char* exceptionDescriptor,
   15812                                   #        const char* msg)
   15813                                   # return: void
   15814     lea         8(%esp), %esp
   15815     jmp         common_exceptionThrown
   15816 
   15817 .if         (!0)                 # define in one or the other, not both
   15818 .LstrFilledNewArrayNotImpl:
   15819 .asciz      "filled-new-array only implemented for 'int'"
   15820 .LstrInternalError:
   15821 .asciz  "Ljava/lang/InternalError;"
   15822 .endif
   15823 
   15824 /* continuation for OP_FILLED_NEW_ARRAY_RANGE */
   15825 
   15826 .LOP_FILLED_NEW_ARRAY_RANGE_break:
   15827     movl        $0, -8(%esp)           # push parameter false
   15828     movl        %ecx, -12(%esp)         # push parameter BBBB
   15829     movl        rGLUE, %edx             # %edx<- MterpGlue pointer
   15830     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   15831     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   15832     movl        %edx, -16(%esp)         # push parameter glue->method->clazz
   15833     lea         -16(%esp), %esp
   15834     call        dvmResolveClass         # call: (const ClassObject* referrer, u4 classIdx,
   15835                                         #        bool fromUnverifiedConstant)
   15836                                         # return: ClassObject*
   15837     lea         16(%esp), %esp
   15838     cmp         $0, %eax               # check for null return
   15839     je          common_exceptionThrown  # handle exception
   15840 
   15841    /*
   15842     * On entry:
   15843     *  %eax holds array class
   15844     *  rINST holds BA or AA
   15845     */
   15846 
   15847 .LOP_FILLED_NEW_ARRAY_RANGE_continue:
   15848     movl        offClassObject_descriptor(%eax), %eax # %eax<- arrayClass->descriptor
   15849     movzbl      1(%eax), %eax           # %eax<- descriptor[1]
   15850     cmpb        $'I', %al             # check if array of ints
   15851     je          1f
   15852     cmpb        $'L', %al
   15853     je          1f
   15854     cmpb        $'[', %al
   15855     jne         .LOP_FILLED_NEW_ARRAY_RANGE_notimpl     # jump to not implemented
   15856 1:
   15857     movl        %eax, sReg0             # save type
   15858     movl        rINST, -12(%esp)        # push parameter length
   15859     movl        %eax, -16(%esp)         # push parameter descriptor[1]
   15860     movl        $ALLOC_DONT_TRACK, -8(%esp) # push parameter to allocate flags
   15861     .if         (!1)
   15862     shrl        $4, -12(%esp)          # parameter length is B
   15863     .endif
   15864     lea         -16(%esp), %esp
   15865     call        dvmAllocPrimitiveArray  # call: (char type, size_t length, int allocFlags)
   15866                                         # return: ArrayObject*
   15867     lea         16(%esp), %esp
   15868     cmp         $0, %eax               # check for null return
   15869     je          common_exceptionThrown  # handle exception
   15870 
   15871     FETCH       2, %edx                 # %edx<- FEDC or CCCC
   15872     movl        rGLUE, %ecx             # %ecx<- MterpGlue pointer
   15873     movl        %eax, offGlue_retval(%ecx) # retval<- new array
   15874     lea         offArrayObject_contents(%eax), %eax # %eax<- newArray->contents
   15875     subl        $1, -12(%esp)          # length--; check for negative
   15876     js          2f                      # if length was zero, finish
   15877 
   15878    /*
   15879     * copy values from registers into the array
   15880     * %eax=array, %edx=CCCC/FEDC, -12(%esp)=length (from AA or B), rINST=AA/BA
   15881     */
   15882 
   15883     .if         1
   15884     lea         (rFP, %edx, 4), %ecx    # %ecx<- &fpp[CCCC]
   15885 1:
   15886     movl        (%ecx), %edx            # %edx<- %ecx++
   15887     lea         4(%ecx), %ecx           # %ecx++
   15888     movl        %edx, (%eax)            # *contents<- vX
   15889     lea         4(%eax), %eax           # %eax++; contents++
   15890     subl        $1, -12(%esp)          # length--
   15891     jns         1b                      # or continue at 2
   15892     .else
   15893     cmp         $4, -12(%esp)          # check length
   15894     jne         1f                      # has four args
   15895     and         $15, rINST             # rINST<- A
   15896     GET_VREG    rINST                   # rINST<- vA
   15897     subl        $1, -12(%esp)          # count--
   15898     movl        rINST, 16(%eax)         # contents[4]<- vA
   15899 1:
   15900     movl        %edx, %ecx              # %ecx<- %edx; ecx for temp
   15901     andl        $15, %ecx              # %ecx<- G/F/E/D
   15902     GET_VREG    %ecx                    # %ecx<- vG/vF/vE/vD
   15903     shr         $4, %edx               # %edx<- put next reg in low 4
   15904     subl        $1, -12(%esp)          # count--
   15905     movl        %ecx, (%eax)            # *contents<- vX
   15906     lea         4(%eax), %eax           # %eax++; contents++
   15907     jns         1b                      # or continue at 2
   15908     .endif
   15909 2:
   15910     cmpb        $'I', sReg0            # check for int array
   15911     je          3f
   15912     movl        rGLUE, %ecx             # %ecx<- MterpGlue pointer
   15913     movl        offGlue_retval(%ecx), %eax # Object head
   15914     movl        offGlue_cardTable(%ecx), %ecx # card table base
   15915     shrl        $GC_CARD_SHIFT, %eax   # convert to card num
   15916     movb        %cl,(%ecx, %eax)        # mark card based on object head
   15917 3:
   15918     FINISH      3                       # jump to next instruction
   15919 
   15920    /*
   15921     * Throw an exception to indicate this mode of filled-new-array
   15922     * has not been implemented.
   15923     */
   15924 
   15925 .LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
   15926     movl        $.LstrInternalError, -8(%esp)
   15927     movl        $.LstrFilledNewArrayNotImpl, -4(%esp)
   15928     lea         -8(%esp), %esp
   15929     call        dvmThrowException # call: (const char* exceptionDescriptor,
   15930                                   #        const char* msg)
   15931                                   # return: void
   15932     lea         8(%esp), %esp
   15933     jmp         common_exceptionThrown
   15934 
   15935 .if         (!1)                 # define in one or the other, not both
   15936 .LstrFilledNewArrayNotImpl:
   15937 .asciz      "filled-new-array only implemented for 'int'"
   15938 .LstrInternalError:
   15939 .asciz  "Ljava/lang/InternalError;"
   15940 .endif
   15941 
   15942 /* continuation for OP_PACKED_SWITCH */
   15943 .LOP_PACKED_SWITCH_finish:
   15944     FINISH_RB   %edx, %ecx              # jump to next instruction
   15945 
   15946 /* continuation for OP_SPARSE_SWITCH */
   15947 .LOP_SPARSE_SWITCH_finish:
   15948     FINISH_RB   %edx, %ecx              # jump to next instruction
   15949 
   15950 /* continuation for OP_CMPL_FLOAT */
   15951 .LOP_CMPL_FLOAT_greater:
   15952     movl        $0x1, (rFP, rINST, 4)  # vAA<- greater than
   15953     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15954 
   15955 .LOP_CMPL_FLOAT_final:
   15956     movl        $0x0, (rFP, rINST, 4)  # vAA<- equal
   15957     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15958 
   15959 .LOP_CMPL_FLOAT_finalNan:
   15960     movl        $0xFFFFFFFF, (rFP, rINST, 4)   # vAA<- NaN
   15961     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15962 
   15963 /* continuation for OP_CMPG_FLOAT */
   15964 .LOP_CMPG_FLOAT_greater:
   15965     movl        $0x1, (rFP, rINST, 4)  # vAA<- greater than
   15966     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15967 
   15968 .LOP_CMPG_FLOAT_final:
   15969     movl        $0x0, (rFP, rINST, 4)  # vAA<- equal
   15970     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15971 
   15972 .LOP_CMPG_FLOAT_finalNan:
   15973     movl        $0x1, (rFP, rINST, 4)   # vAA<- NaN
   15974     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15975 
   15976 /* continuation for OP_CMPL_DOUBLE */
   15977 .LOP_CMPL_DOUBLE_greater:
   15978     movl        $0x1, (rFP, rINST, 4)  # vAA<- greater than
   15979     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15980 
   15981 .LOP_CMPL_DOUBLE_final:
   15982     movl        $0x0, (rFP, rINST, 4)  # vAA<- equal
   15983     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15984 
   15985 .LOP_CMPL_DOUBLE_finalNan:
   15986     movl        $0xFFFFFFFF, (rFP, rINST, 4)   # vAA<- NaN
   15987     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15988 
   15989 /* continuation for OP_CMPG_DOUBLE */
   15990 .LOP_CMPG_DOUBLE_greater:
   15991     movl        $0x1, (rFP, rINST, 4)  # vAA<- greater than
   15992     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15993 
   15994 .LOP_CMPG_DOUBLE_final:
   15995     movl        $0x0, (rFP, rINST, 4)  # vAA<- equal
   15996     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   15997 
   15998 .LOP_CMPG_DOUBLE_finalNan:
   15999     movl        $0x1, (rFP, rINST, 4)   # vAA<- NaN
   16000     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16001 
   16002 /* continuation for OP_CMP_LONG */
   16003 
   16004 .LOP_CMP_LONG_final:
   16005     movl        $0x0, (rFP, rINST, 4)  # vAA<- equal
   16006     FINISH      2                       # jump to next instruction
   16007 
   16008 .LOP_CMP_LONG_less:
   16009     movl        $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
   16010     FINISH      2                       # jump to next instruction
   16011 
   16012 .LOP_CMP_LONG_greater:
   16013     movl        $0x1, (rFP, rINST, 4)  # vAA<- greater than
   16014     FINISH      2                       # jump to next instruction
   16015 
   16016 /* continuation for OP_APUT_OBJECT */
   16017 
   16018 .LOP_APUT_OBJECT_finish:
   16019     movl        %edx, sReg0             # save &vBB[vCC]
   16020     movl        %eax, sReg1             # save object head
   16021     movl        offObject_clazz(rINST), %edx # %edx<- obj->clazz
   16022     movl        %edx, -8(%esp)          # push parameter obj->clazz
   16023     movl        offObject_clazz(%eax), %eax # %eax<- arrayObj->clazz
   16024     movl        %eax, -4(%esp)          # push parameter arrayObj->clazz
   16025     lea         -8(%esp), %esp
   16026     call        dvmCanPutArrayElement   # test object type vs. array type
   16027                                         # call: ClassObject* elemClass, ClassObject* arrayClass)
   16028                                         # return: bool
   16029     lea         8(%esp), %esp
   16030     testl       %eax, %eax              # check for invalid array value
   16031     je          common_errArrayStore    # handle invalid array value
   16032     movl        sReg0, %edx             # restore &vBB[vCC]
   16033     movl        rINST, offArrayObject_contents(%edx)
   16034     movl        rGLUE, %eax
   16035     FFETCH_ADV  2, %ecx                 # %ecx<- next instruction hi; fetch, advance
   16036     movl        offGlue_cardTable(%eax), %eax # get card table base
   16037     movl        sReg1, %edx             # restore object head
   16038     shrl        $GC_CARD_SHIFT, %edx   # object head to card number
   16039     movb        %al, (%eax, %edx)       # mark card using object head
   16040     FGETOP_JMP  2, %ecx                 # jump to next instruction; getop, jmp
   16041 .LOP_APUT_OBJECT_skip_check:
   16042     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16043     movl        rINST, offArrayObject_contents(%edx)
   16044     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16045 
   16046 /* continuation for OP_IGET */
   16047 
   16048 .LOP_IGET_finish:
   16049     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16050                                         # return: InstField*
   16051     cmp         $0, %eax               # check if resolved
   16052     lea         8(%esp), %esp
   16053     je          common_exceptionThrown  # not resolved; handle exception
   16054 
   16055     /*
   16056      *  %eax holds resolved field
   16057      */
   16058 
   16059 .LOP_IGET_finish2:
   16060     movl        rINST, %ecx             # %ecx<- BA
   16061     shr         $4, %ecx               # %ecx<- B
   16062     and         $15, rINST             # rINST<- A
   16063 
   16064     GET_VREG    %ecx                    # %ecx<- vB
   16065     cmp         $0, %ecx               # check for null object
   16066     je          common_errNullObject    # handle null object
   16067     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16068     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16069     movl     (%ecx, %edx), %edx      # %edx<- object field
   16070     SET_VREG    %edx, rINST             # vA<- %edx; object field
   16071     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16072 
   16073 /* continuation for OP_IGET_WIDE */
   16074 
   16075 .LOP_IGET_WIDE_finish2:
   16076     lea         -8(%esp), %esp
   16077     call        dvmResolveInstField     # resolve InstField ptr
   16078                                         # call: (const ClassObject* referrer, u4 ifieldIdx)
   16079                                         # return: InstField*
   16080     cmp         $0, %eax               # check if resolved
   16081     lea         8(%esp), %esp
   16082     movl        %eax, %ecx              # %ecx<- %eax; %ecx expected to hold field
   16083     je          common_exceptionThrown
   16084 
   16085    /*
   16086     *  %ecx holds resolved field
   16087     */
   16088 
   16089 .LOP_IGET_WIDE_finish:
   16090 
   16091     movl        rINST, %edx             # %edx<- BA
   16092     shr         $4, %edx               # %edx<- B
   16093     andl        $15, rINST             # rINST<- A
   16094     GET_VREG    %edx                    # %edx<- vB
   16095     cmp         $0, %edx               # check for null object
   16096     je          common_errNullObject
   16097     movl        offInstField_byteOffset(%ecx), %ecx # %ecx<- field offset
   16098     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16099     movq        (%ecx, %edx), %xmm0     # %xmm0<- object field
   16100     movq        %xmm0, (rFP, rINST, 4)  # vA<- %xmm0; object field
   16101     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16102 
   16103 /* continuation for OP_IGET_OBJECT */
   16104 
   16105 .LOP_IGET_OBJECT_finish:
   16106     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16107                                         # return: InstField*
   16108     cmp         $0, %eax               # check if resolved
   16109     lea         8(%esp), %esp
   16110     je          common_exceptionThrown  # not resolved; handle exception
   16111 
   16112     /*
   16113      *  %eax holds resolved field
   16114      */
   16115 
   16116 .LOP_IGET_OBJECT_finish2:
   16117     movl        rINST, %ecx             # %ecx<- BA
   16118     shr         $4, %ecx               # %ecx<- B
   16119     and         $15, rINST             # rINST<- A
   16120 
   16121     GET_VREG    %ecx                    # %ecx<- vB
   16122     cmp         $0, %ecx               # check for null object
   16123     je          common_errNullObject    # handle null object
   16124     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16125     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16126     movl     (%ecx, %edx), %edx      # %edx<- object field
   16127     SET_VREG    %edx, rINST             # vA<- %edx; object field
   16128     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16129 
   16130 /* continuation for OP_IGET_BOOLEAN */
   16131 
   16132 .LOP_IGET_BOOLEAN_finish:
   16133     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16134                                         # return: InstField*
   16135     cmp         $0, %eax               # check if resolved
   16136     lea         8(%esp), %esp
   16137     je          common_exceptionThrown  # not resolved; handle exception
   16138 
   16139     /*
   16140      *  %eax holds resolved field
   16141      */
   16142 
   16143 .LOP_IGET_BOOLEAN_finish2:
   16144     movl        rINST, %ecx             # %ecx<- BA
   16145     shr         $4, %ecx               # %ecx<- B
   16146     and         $15, rINST             # rINST<- A
   16147 
   16148     GET_VREG    %ecx                    # %ecx<- vB
   16149     cmp         $0, %ecx               # check for null object
   16150     je          common_errNullObject    # handle null object
   16151     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16152     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16153     movl     (%ecx, %edx), %edx      # %edx<- object field
   16154     SET_VREG    %edx, rINST             # vA<- %edx; object field
   16155     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16156 
   16157 /* continuation for OP_IGET_BYTE */
   16158 
   16159 .LOP_IGET_BYTE_finish:
   16160     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16161                                         # return: InstField*
   16162     cmp         $0, %eax               # check if resolved
   16163     lea         8(%esp), %esp
   16164     je          common_exceptionThrown  # not resolved; handle exception
   16165 
   16166     /*
   16167      *  %eax holds resolved field
   16168      */
   16169 
   16170 .LOP_IGET_BYTE_finish2:
   16171     movl        rINST, %ecx             # %ecx<- BA
   16172     shr         $4, %ecx               # %ecx<- B
   16173     and         $15, rINST             # rINST<- A
   16174 
   16175     GET_VREG    %ecx                    # %ecx<- vB
   16176     cmp         $0, %ecx               # check for null object
   16177     je          common_errNullObject    # handle null object
   16178     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16179     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16180     movl     (%ecx, %edx), %edx      # %edx<- object field
   16181     SET_VREG    %edx, rINST             # vA<- %edx; object field
   16182     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16183 
   16184 /* continuation for OP_IGET_CHAR */
   16185 
   16186 .LOP_IGET_CHAR_finish:
   16187     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16188                                         # return: InstField*
   16189     cmp         $0, %eax               # check if resolved
   16190     lea         8(%esp), %esp
   16191     je          common_exceptionThrown  # not resolved; handle exception
   16192 
   16193     /*
   16194      *  %eax holds resolved field
   16195      */
   16196 
   16197 .LOP_IGET_CHAR_finish2:
   16198     movl        rINST, %ecx             # %ecx<- BA
   16199     shr         $4, %ecx               # %ecx<- B
   16200     and         $15, rINST             # rINST<- A
   16201 
   16202     GET_VREG    %ecx                    # %ecx<- vB
   16203     cmp         $0, %ecx               # check for null object
   16204     je          common_errNullObject    # handle null object
   16205     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16206     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16207     movl     (%ecx, %edx), %edx      # %edx<- object field
   16208     SET_VREG    %edx, rINST             # vA<- %edx; object field
   16209     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16210 
   16211 /* continuation for OP_IGET_SHORT */
   16212 
   16213 .LOP_IGET_SHORT_finish:
   16214     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16215                                         # return: InstField*
   16216     cmp         $0, %eax               # check if resolved
   16217     lea         8(%esp), %esp
   16218     je          common_exceptionThrown  # not resolved; handle exception
   16219 
   16220     /*
   16221      *  %eax holds resolved field
   16222      */
   16223 
   16224 .LOP_IGET_SHORT_finish2:
   16225     movl        rINST, %ecx             # %ecx<- BA
   16226     shr         $4, %ecx               # %ecx<- B
   16227     and         $15, rINST             # rINST<- A
   16228 
   16229     GET_VREG    %ecx                    # %ecx<- vB
   16230     cmp         $0, %ecx               # check for null object
   16231     je          common_errNullObject    # handle null object
   16232     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16233     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16234     movl     (%ecx, %edx), %edx      # %edx<- object field
   16235     SET_VREG    %edx, rINST             # vA<- %edx; object field
   16236     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16237 
   16238 /* continuation for OP_IPUT */
   16239 
   16240 .LOP_IPUT_finish:
   16241     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16242     EXPORT_PC                           # in case an exception is thrown
   16243     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   16244     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16245     lea         -8(%esp), %esp
   16246     movl        %edx, (%esp)            # push parameter method->clazz
   16247     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16248                                         # return: InstField*
   16249     lea         8(%esp), %esp
   16250     cmp         $0, %eax               # check if resolved
   16251     jne         .LOP_IPUT_finish2
   16252     jmp         common_exceptionThrown  # not resolved; handle exception
   16253 
   16254 .LOP_IPUT_finish2:
   16255     movl        rINST, %ecx             # %ecx<- BA+
   16256     shr         $4, %ecx               # %ecx<- B
   16257     and         $15, rINST             # rINST<- A
   16258     GET_VREG    %ecx                    # %ecx<- vB
   16259     cmp         $0, %ecx               # check for null object
   16260     je          common_errNullObject    # handle null object
   16261     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16262     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16263     GET_VREG    rINST                   # rINST<- vA
   16264     movl     rINST, (%edx, %ecx)     # object field<- vA
   16265     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16266 
   16267 /* continuation for OP_IPUT_WIDE */
   16268 
   16269 .LOP_IPUT_WIDE_finish2:
   16270     lea         -8(%esp), %esp
   16271     call        dvmResolveInstField     # resolve InstField ptr
   16272     cmp         $0, %eax               # check if resolved
   16273     lea         8(%esp), %esp
   16274     movl        %eax, %ecx              # %ecx<- %eax; %ecx expected to hold field
   16275     jne         .LOP_IPUT_WIDE_finish
   16276     jmp         common_exceptionThrown
   16277 
   16278    /*
   16279     * Currently:
   16280     *  %ecx holds resolved field
   16281     *  %edx does not hold object yet
   16282     */
   16283 
   16284 .LOP_IPUT_WIDE_finish:
   16285     movl        rINST, %edx             # %edx<- BA
   16286     shr         $4, %edx               # %edx<- B
   16287     andl        $15, rINST             # rINST<- A
   16288     GET_VREG    %edx                    # %edx<- vB
   16289     cmp         $0, %edx               # check for null object
   16290     je          common_errNullObject
   16291     movl        offInstField_byteOffset(%ecx), %ecx # %ecx<- field offset
   16292     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16293     movq        (rFP, rINST, 4), %xmm0  # %xmm0<- vA
   16294     movq        %xmm0, (%ecx, %edx)     # object field<- %xmm0; vA
   16295     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16296 
   16297 /* continuation for OP_IPUT_OBJECT */
   16298 
   16299 .LOP_IPUT_OBJECT_finish:
   16300     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16301     EXPORT_PC                           # in case an exception is thrown
   16302     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   16303     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16304     lea         -8(%esp), %esp
   16305     movl        %edx, (%esp)            # push parameter method->clazz
   16306     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16307                                         # return: InstField*
   16308     lea         8(%esp), %esp
   16309     cmp         $0, %eax               # check if resolved
   16310     jne         .LOP_IPUT_OBJECT_finish2
   16311     jmp         common_exceptionThrown  # not resolved; handle exception
   16312 
   16313 .LOP_IPUT_OBJECT_finish2:
   16314     movl        rINST, %ecx             # %ecx<- BA+
   16315     shr         $4, %ecx               # %ecx<- B
   16316     and         $15, rINST             # rINST<- A
   16317     GET_VREG    %ecx                    # %ecx<- vB
   16318     cmp         $0, %ecx               # check for null object
   16319     je          common_errNullObject    # handle null object
   16320     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16321     GET_VREG    rINST                   # rINST<- vA
   16322     movl        rINST, (%edx, %ecx)     # object field<- vA
   16323     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16324     movl     rGLUE, %eax             # get glue
   16325     movl        offGlue_cardTable(%eax), %eax # get card table base
   16326     testl       rINST, rINST            # test if we stored a null value
   16327     je          1f                     # skip card mark if null stored
   16328     shrl        $GC_CARD_SHIFT, %ecx   # set obeject head to card number
   16329     movb        %al, (%eax, %ecx)
   16330 1:
   16331     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16332 
   16333 /* continuation for OP_IPUT_BOOLEAN */
   16334 
   16335 .LOP_IPUT_BOOLEAN_finish:
   16336     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16337     EXPORT_PC                           # in case an exception is thrown
   16338     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   16339     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16340     lea         -8(%esp), %esp
   16341     movl        %edx, (%esp)            # push parameter method->clazz
   16342     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16343                                         # return: InstField*
   16344     lea         8(%esp), %esp
   16345     cmp         $0, %eax               # check if resolved
   16346     jne         .LOP_IPUT_BOOLEAN_finish2
   16347     jmp         common_exceptionThrown  # not resolved; handle exception
   16348 
   16349 .LOP_IPUT_BOOLEAN_finish2:
   16350     movl        rINST, %ecx             # %ecx<- BA+
   16351     shr         $4, %ecx               # %ecx<- B
   16352     and         $15, rINST             # rINST<- A
   16353     GET_VREG    %ecx                    # %ecx<- vB
   16354     cmp         $0, %ecx               # check for null object
   16355     je          common_errNullObject    # handle null object
   16356     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16357     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16358     GET_VREG    rINST                   # rINST<- vA
   16359     movl     rINST, (%edx, %ecx)     # object field<- vA
   16360     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16361 
   16362 /* continuation for OP_IPUT_BYTE */
   16363 
   16364 .LOP_IPUT_BYTE_finish:
   16365     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16366     EXPORT_PC                           # in case an exception is thrown
   16367     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   16368     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16369     lea         -8(%esp), %esp
   16370     movl        %edx, (%esp)            # push parameter method->clazz
   16371     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16372                                         # return: InstField*
   16373     lea         8(%esp), %esp
   16374     cmp         $0, %eax               # check if resolved
   16375     jne         .LOP_IPUT_BYTE_finish2
   16376     jmp         common_exceptionThrown  # not resolved; handle exception
   16377 
   16378 .LOP_IPUT_BYTE_finish2:
   16379     movl        rINST, %ecx             # %ecx<- BA+
   16380     shr         $4, %ecx               # %ecx<- B
   16381     and         $15, rINST             # rINST<- A
   16382     GET_VREG    %ecx                    # %ecx<- vB
   16383     cmp         $0, %ecx               # check for null object
   16384     je          common_errNullObject    # handle null object
   16385     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16386     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16387     GET_VREG    rINST                   # rINST<- vA
   16388     movl     rINST, (%edx, %ecx)     # object field<- vA
   16389     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16390 
   16391 /* continuation for OP_IPUT_CHAR */
   16392 
   16393 .LOP_IPUT_CHAR_finish:
   16394     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16395     EXPORT_PC                           # in case an exception is thrown
   16396     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   16397     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16398     lea         -8(%esp), %esp
   16399     movl        %edx, (%esp)            # push parameter method->clazz
   16400     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16401                                         # return: InstField*
   16402     lea         8(%esp), %esp
   16403     cmp         $0, %eax               # check if resolved
   16404     jne         .LOP_IPUT_CHAR_finish2
   16405     jmp         common_exceptionThrown  # not resolved; handle exception
   16406 
   16407 .LOP_IPUT_CHAR_finish2:
   16408     movl        rINST, %ecx             # %ecx<- BA+
   16409     shr         $4, %ecx               # %ecx<- B
   16410     and         $15, rINST             # rINST<- A
   16411     GET_VREG    %ecx                    # %ecx<- vB
   16412     cmp         $0, %ecx               # check for null object
   16413     je          common_errNullObject    # handle null object
   16414     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16415     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16416     GET_VREG    rINST                   # rINST<- vA
   16417     movl     rINST, (%edx, %ecx)     # object field<- vA
   16418     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16419 
   16420 /* continuation for OP_IPUT_SHORT */
   16421 
   16422 .LOP_IPUT_SHORT_finish:
   16423     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16424     EXPORT_PC                           # in case an exception is thrown
   16425     movl        %ecx, -4(%esp)          # push parameter CCCC; field ref
   16426     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16427     lea         -8(%esp), %esp
   16428     movl        %edx, (%esp)            # push parameter method->clazz
   16429     call        dvmResolveInstField     # call: (const ClassObject* referrer, u4 ifieldIdx)
   16430                                         # return: InstField*
   16431     lea         8(%esp), %esp
   16432     cmp         $0, %eax               # check if resolved
   16433     jne         .LOP_IPUT_SHORT_finish2
   16434     jmp         common_exceptionThrown  # not resolved; handle exception
   16435 
   16436 .LOP_IPUT_SHORT_finish2:
   16437     movl        rINST, %ecx             # %ecx<- BA+
   16438     shr         $4, %ecx               # %ecx<- B
   16439     and         $15, rINST             # rINST<- A
   16440     GET_VREG    %ecx                    # %ecx<- vB
   16441     cmp         $0, %ecx               # check for null object
   16442     je          common_errNullObject    # handle null object
   16443     movl        offInstField_byteOffset(%eax), %edx # %edx<- field offset
   16444     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16445     GET_VREG    rINST                   # rINST<- vA
   16446     movl     rINST, (%edx, %ecx)     # object field<- vA
   16447     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16448 
   16449 /* continuation for OP_SGET */
   16450 
   16451 .LOP_SGET_resolve:
   16452     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16453     EXPORT_PC                           # in case an exception is thrown
   16454     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16455     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16456     movl        %edx, -8(%esp)          # push parameter method->clazz
   16457     lea         -8(%esp), %esp
   16458     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16459                                         # return: StaticField*
   16460     cmp         $0, %eax               # check if initalization failed
   16461     lea         8(%esp), %esp
   16462     je          common_exceptionThrown  # failed; handle exception
   16463     mov         %eax, %ecx              # %ecx<- result
   16464 
   16465 .LOP_SGET_finish:
   16466     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16467     movl offStaticField_value(%ecx), %eax # %eax<- field value
   16468     SET_VREG    %eax, rINST             # vAA<- field value
   16469     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16470 
   16471 /* continuation for OP_SGET_WIDE */
   16472 
   16473    /*
   16474     * Continuation if the field has not yet been resolved.
   16475     *  %edx: BBBB field ref
   16476     */
   16477 
   16478 .LOP_SGET_WIDE_resolve:
   16479     movl        offGlue_method(%eax), %eax # %eax <- glue->method
   16480     EXPORT_PC                           # in case an exception is thrown
   16481     movl        %edx, -4(%esp)          # push parameter CCCC; field ref
   16482     movl        offMethod_clazz(%eax), %eax # %eax<- method->clazz
   16483     movl        %eax, -8(%esp)          # push parameter method->clazz
   16484     lea         -8(%esp), %esp
   16485     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16486                                         # return: StaticField*
   16487     lea         8(%esp), %esp
   16488     cmp         $0, %eax               # check if initalization failed
   16489     movl        %eax, %ecx              # %ecx<- result
   16490     jne         .LOP_SGET_WIDE_finish      # success, continue
   16491     jmp         common_exceptionThrown  # failed; handle exception
   16492 
   16493 /* continuation for OP_SGET_OBJECT */
   16494 
   16495 .LOP_SGET_OBJECT_resolve:
   16496     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16497     EXPORT_PC                           # in case an exception is thrown
   16498     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16499     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16500     movl        %edx, -8(%esp)          # push parameter method->clazz
   16501     lea         -8(%esp), %esp
   16502     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16503                                         # return: StaticField*
   16504     cmp         $0, %eax               # check if initalization failed
   16505     lea         8(%esp), %esp
   16506     je          common_exceptionThrown  # failed; handle exception
   16507     mov         %eax, %ecx              # %ecx<- result
   16508 
   16509 .LOP_SGET_OBJECT_finish:
   16510     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16511     movl offStaticField_value(%ecx), %eax # %eax<- field value
   16512     SET_VREG    %eax, rINST             # vAA<- field value
   16513     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16514 
   16515 /* continuation for OP_SGET_BOOLEAN */
   16516 
   16517 .LOP_SGET_BOOLEAN_resolve:
   16518     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16519     EXPORT_PC                           # in case an exception is thrown
   16520     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16521     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16522     movl        %edx, -8(%esp)          # push parameter method->clazz
   16523     lea         -8(%esp), %esp
   16524     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16525                                         # return: StaticField*
   16526     cmp         $0, %eax               # check if initalization failed
   16527     lea         8(%esp), %esp
   16528     je          common_exceptionThrown  # failed; handle exception
   16529     mov         %eax, %ecx              # %ecx<- result
   16530 
   16531 .LOP_SGET_BOOLEAN_finish:
   16532     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16533     movl offStaticField_value(%ecx), %eax # %eax<- field value
   16534     SET_VREG    %eax, rINST             # vAA<- field value
   16535     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16536 
   16537 /* continuation for OP_SGET_BYTE */
   16538 
   16539 .LOP_SGET_BYTE_resolve:
   16540     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16541     EXPORT_PC                           # in case an exception is thrown
   16542     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16543     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16544     movl        %edx, -8(%esp)          # push parameter method->clazz
   16545     lea         -8(%esp), %esp
   16546     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16547                                         # return: StaticField*
   16548     cmp         $0, %eax               # check if initalization failed
   16549     lea         8(%esp), %esp
   16550     je          common_exceptionThrown  # failed; handle exception
   16551     mov         %eax, %ecx              # %ecx<- result
   16552 
   16553 .LOP_SGET_BYTE_finish:
   16554     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16555     movl offStaticField_value(%ecx), %eax # %eax<- field value
   16556     SET_VREG    %eax, rINST             # vAA<- field value
   16557     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16558 
   16559 /* continuation for OP_SGET_CHAR */
   16560 
   16561 .LOP_SGET_CHAR_resolve:
   16562     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16563     EXPORT_PC                           # in case an exception is thrown
   16564     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16565     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16566     movl        %edx, -8(%esp)          # push parameter method->clazz
   16567     lea         -8(%esp), %esp
   16568     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16569                                         # return: StaticField*
   16570     cmp         $0, %eax               # check if initalization failed
   16571     lea         8(%esp), %esp
   16572     je          common_exceptionThrown  # failed; handle exception
   16573     mov         %eax, %ecx              # %ecx<- result
   16574 
   16575 .LOP_SGET_CHAR_finish:
   16576     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16577     movl offStaticField_value(%ecx), %eax # %eax<- field value
   16578     SET_VREG    %eax, rINST             # vAA<- field value
   16579     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16580 
   16581 /* continuation for OP_SGET_SHORT */
   16582 
   16583 .LOP_SGET_SHORT_resolve:
   16584     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16585     EXPORT_PC                           # in case an exception is thrown
   16586     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16587     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16588     movl        %edx, -8(%esp)          # push parameter method->clazz
   16589     lea         -8(%esp), %esp
   16590     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16591                                         # return: StaticField*
   16592     cmp         $0, %eax               # check if initalization failed
   16593     lea         8(%esp), %esp
   16594     je          common_exceptionThrown  # failed; handle exception
   16595     mov         %eax, %ecx              # %ecx<- result
   16596 
   16597 .LOP_SGET_SHORT_finish:
   16598     FFETCH_ADV  2, %edx                 # %edx<- next instruction hi; fetch, advance
   16599     movl offStaticField_value(%ecx), %eax # %eax<- field value
   16600     SET_VREG    %eax, rINST             # vAA<- field value
   16601     FGETOP_JMP  2, %edx                 # jump to next instruction; getop, jmp
   16602 
   16603 /* continuation for OP_SPUT */
   16604 
   16605 .LOP_SPUT_resolve:
   16606     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16607     EXPORT_PC                           # in case an exception is thrown
   16608     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16609     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16610     movl        %edx, -8(%esp)          # push parameter method->clazz
   16611     lea         -8(%esp), %esp
   16612     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16613                                         # return: StaticField*
   16614     cmp         $0, %eax               # check if initalization failed
   16615     lea         8(%esp), %esp
   16616     je          common_exceptionThrown  # failed; handle exception
   16617     movl        %eax, %ecx              # %ecx<- result
   16618 
   16619 .LOP_SPUT_finish:
   16620     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16621     GET_VREG    rINST                   # rINST<- vAA
   16622     movl        rINST, offStaticField_value(%ecx) # field value<- vAA
   16623     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16624 
   16625 /* continuation for OP_SPUT_WIDE */
   16626 
   16627    /*
   16628     * Continuation if the field has not yet been resolved.
   16629     *  %edx: BBBB field ref
   16630     */
   16631 
   16632 .LOP_SPUT_WIDE_resolve:
   16633     movl        offGlue_method(%eax), %eax # %eax <- glue->method
   16634     EXPORT_PC                           # in case an exception is thrown
   16635     movl        %edx, -4(%esp)          # push parameter CCCC; field ref
   16636     movl        offMethod_clazz(%eax), %eax # %eax<- method->clazz
   16637     movl        %eax, -8(%esp)
   16638     lea         -8(%esp), %esp
   16639     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16640                                         # return: StaticField*
   16641     lea         8(%esp), %esp
   16642     cmp         $0, %eax               # check if initalization failed
   16643     movl        %eax, %ecx              # %ecx<- result
   16644     jne         .LOP_SPUT_WIDE_finish      # success, continue
   16645     jmp         common_exceptionThrown  # failed; handle exception
   16646 
   16647 /* continuation for OP_SPUT_OBJECT */
   16648 
   16649 .LOP_SPUT_OBJECT_resolve:
   16650     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16651     EXPORT_PC                           # in case an exception is thrown
   16652     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16653     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16654     movl        %edx, -8(%esp)          # push parameter method->clazz
   16655     lea         -8(%esp), %esp
   16656     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16657                                         # return: StaticField*
   16658     cmp         $0, %eax               # check if initalization failed
   16659     lea         8(%esp), %esp
   16660     je          common_exceptionThrown  # failed; handle exception
   16661     movl        %eax, %ecx              # %ecx<- result
   16662 
   16663 .LOP_SPUT_OBJECT_finish:
   16664     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16665     GET_VREG    rINST                   # rINST<- vAA
   16666 
   16667 
   16668     movl        rINST, offStaticField_value(%ecx) # field value<- vAA
   16669     testl       rINST, rINST            # stored null object ptr?
   16670     je          1f
   16671     movl        rGLUE, %edx             # get glue
   16672     movl        offField_clazz(%ecx), %ecx # ecx<- field->clazz
   16673     movl        offGlue_cardTable(%edx), %edx # get card table base
   16674     shrl        $GC_CARD_SHIFT, %ecx   # head to card number
   16675     movb        %dl, (%edx, %ecx)       # mark card
   16676 1:
   16677     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16678 
   16679 /* continuation for OP_SPUT_BOOLEAN */
   16680 
   16681 .LOP_SPUT_BOOLEAN_resolve:
   16682     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16683     EXPORT_PC                           # in case an exception is thrown
   16684     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16685     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16686     movl        %edx, -8(%esp)          # push parameter method->clazz
   16687     lea         -8(%esp), %esp
   16688     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16689                                         # return: StaticField*
   16690     cmp         $0, %eax               # check if initalization failed
   16691     lea         8(%esp), %esp
   16692     je          common_exceptionThrown  # failed; handle exception
   16693     movl        %eax, %ecx              # %ecx<- result
   16694 
   16695 .LOP_SPUT_BOOLEAN_finish:
   16696     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16697     GET_VREG    rINST                   # rINST<- vAA
   16698     movl        rINST, offStaticField_value(%ecx) # field value<- vAA
   16699     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16700 
   16701 /* continuation for OP_SPUT_BYTE */
   16702 
   16703 .LOP_SPUT_BYTE_resolve:
   16704     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16705     EXPORT_PC                           # in case an exception is thrown
   16706     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16707     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16708     movl        %edx, -8(%esp)          # push parameter method->clazz
   16709     lea         -8(%esp), %esp
   16710     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16711                                         # return: StaticField*
   16712     cmp         $0, %eax               # check if initalization failed
   16713     lea         8(%esp), %esp
   16714     je          common_exceptionThrown  # failed; handle exception
   16715     movl        %eax, %ecx              # %ecx<- result
   16716 
   16717 .LOP_SPUT_BYTE_finish:
   16718     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16719     GET_VREG    rINST                   # rINST<- vAA
   16720     movl        rINST, offStaticField_value(%ecx) # field value<- vAA
   16721     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16722 
   16723 /* continuation for OP_SPUT_CHAR */
   16724 
   16725 .LOP_SPUT_CHAR_resolve:
   16726     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16727     EXPORT_PC                           # in case an exception is thrown
   16728     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16729     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16730     movl        %edx, -8(%esp)          # push parameter method->clazz
   16731     lea         -8(%esp), %esp
   16732     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16733                                         # return: StaticField*
   16734     cmp         $0, %eax               # check if initalization failed
   16735     lea         8(%esp), %esp
   16736     je          common_exceptionThrown  # failed; handle exception
   16737     movl        %eax, %ecx              # %ecx<- result
   16738 
   16739 .LOP_SPUT_CHAR_finish:
   16740     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16741     GET_VREG    rINST                   # rINST<- vAA
   16742     movl        rINST, offStaticField_value(%ecx) # field value<- vAA
   16743     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16744 
   16745 /* continuation for OP_SPUT_SHORT */
   16746 
   16747 .LOP_SPUT_SHORT_resolve:
   16748     movl        offGlue_method(%edx), %edx # %edx <- glue->method
   16749     EXPORT_PC                           # in case an exception is thrown
   16750     movl        %eax, -4(%esp)          # push parameter CCCC; field ref
   16751     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   16752     movl        %edx, -8(%esp)          # push parameter method->clazz
   16753     lea         -8(%esp), %esp
   16754     call        dvmResolveStaticField   # call: (const ClassObject* referrer, u4 ifieldIdx)
   16755                                         # return: StaticField*
   16756     cmp         $0, %eax               # check if initalization failed
   16757     lea         8(%esp), %esp
   16758     je          common_exceptionThrown  # failed; handle exception
   16759     movl        %eax, %ecx              # %ecx<- result
   16760 
   16761 .LOP_SPUT_SHORT_finish:
   16762     FFETCH_ADV  2, %eax                 # %eax<- next instruction hi; fetch, advance
   16763     GET_VREG    rINST                   # rINST<- vAA
   16764     movl        rINST, offStaticField_value(%ecx) # field value<- vAA
   16765     FGETOP_JMP  2, %eax                 # jump to next instruction; getop, jmp
   16766 
   16767 /* continuation for OP_INVOKE_VIRTUAL */
   16768 
   16769 .LOP_INVOKE_VIRTUAL_break:
   16770     movl        rGLUE, %eax             # %eax<- pMterpGlue
   16771     movl        %edx, -4(%esp)          # save "this" pointer register
   16772     movl        offGlue_method(%eax), %eax # %eax<- glue->method
   16773     movl        $METHOD_VIRTUAL, -8(%esp) # push parameter method type
   16774     movl        %ecx, -12(%esp)         # push paramter method index
   16775     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   16776     lea         -16(%esp), %esp
   16777     movl        %eax, (%esp)            # push parameter clazz
   16778     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   16779                                         #       u4 methodIdx, MethodType methodType)
   16780                                         # return: Method*
   16781     lea         16(%esp), %esp
   16782     cmp         $0, %eax               # check for null method return
   16783     movl        -4(%esp), %edx          # get "this" pointer register
   16784     jne         .LOP_INVOKE_VIRTUAL_continue
   16785     jmp         common_exceptionThrown  # null pointer; handle exception
   16786 
   16787    /*
   16788     * At this point:
   16789     *  %eax = resolved base method
   16790     *  %edx = D or CCCC (index of first arg, which is the "this" ptr)
   16791     */
   16792 
   16793 .LOP_INVOKE_VIRTUAL_continue:
   16794     GET_VREG    %edx                    # %edx<- "this" ptr
   16795     movzwl      offMethod_methodIndex(%eax), %eax # %eax<- baseMethod->methodIndex
   16796     cmp         $0, %edx               # %edx<- check for null "this"
   16797     je          common_errNullObject    # handle null object
   16798     movl        offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
   16799     movl        offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
   16800     movl        (%edx, %eax, 4), %ecx   # %ecx<- vtable[methodIndex]
   16801     jmp         common_invokeMethodNoRange # invoke method common code
   16802 
   16803 /* continuation for OP_INVOKE_SUPER */
   16804 
   16805 .LOP_INVOKE_SUPER_continue2:
   16806     movl        rGLUE, %eax             # %eax<- pMterpGlue
   16807     movl        offGlue_method(%eax), %eax # %eax<- glue->method
   16808     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   16809     EXPORT_PC                           # must export for invoke
   16810     cmp         $0, %ecx               # check if already resolved
   16811     jne         .LOP_INVOKE_SUPER_continue
   16812     jmp         .LOP_INVOKE_SUPER_resolve     # handle resolve
   16813 
   16814    /*
   16815     *  %ecx = resolved base method
   16816     *  %eax = method->clazz
   16817     */
   16818 
   16819 .LOP_INVOKE_SUPER_continue:
   16820     movl        offClassObject_super(%eax), %edx # %edx<- glue->method->clazz->super
   16821     movzwl      offMethod_methodIndex(%ecx), %ecx # %ecx<-  baseMethod->methodIndex
   16822     cmp          offClassObject_vtableCount(%edx), %ecx # compare vtableCount with methodIndex
   16823     EXPORT_PC                           # must export for invoke
   16824     jnc         .LOP_INVOKE_SUPER_nsm         # handle method not present
   16825     movl        offClassObject_vtable(%edx), %edx # %edx<- glue->method->clazz->super->vtable
   16826     movl        (%edx, %ecx, 4), %ecx   # %ecx<- vtable[methodIndex]
   16827     jmp         common_invokeMethodNoRange # invoke method common code
   16828 
   16829 .LOP_INVOKE_SUPER_resolve:
   16830     movl        %eax, -12(%esp)         # push parameter clazz
   16831     movl        %edx, -8(%esp)          # push parameter method index
   16832     movl        $METHOD_VIRTUAL, -4(%esp) # push parameter method type
   16833     lea         -12(%esp), %esp
   16834     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   16835                                         #       u4 methodIdx, MethodType methodType)
   16836                                         # return: Method*
   16837     lea         12(%esp), %esp
   16838     movl        %eax, %ecx              # %ecx<- method
   16839     cmp         $0, %ecx               # check for null method return
   16840     movl        -12(%esp), %eax         # %eax<- glue->method->clazz
   16841     jne         .LOP_INVOKE_SUPER_continue
   16842     jmp         common_exceptionThrown  # null pointer; handle exception
   16843 
   16844    /*
   16845     * Throw a NoSuchMethodError with the method name as the message.
   16846     * %ecx = resolved base method
   16847     */
   16848 
   16849 .LOP_INVOKE_SUPER_nsm:
   16850     movl        offMethod_name(%ecx), %edx # %edx<- method name
   16851     jmp         common_errNoSuchMethod
   16852 
   16853 /* continuation for OP_INVOKE_DIRECT */
   16854 
   16855    /*
   16856     * %eax = reference (BBBB or CCCC)
   16857     * -4(%esp) = "this" register
   16858     */
   16859 
   16860 .LOP_INVOKE_DIRECT_resolve:
   16861     movl        rGLUE, %edx             # %edx<- pMterpGlue
   16862     movl        $METHOD_DIRECT, -8(%esp) # push parameter method type
   16863     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16864     movl        %eax, -12(%esp)         # push parameter reference
   16865     lea         -16(%esp), %esp
   16866     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   16867     movl        %edx, (%esp)            # push parameter clazz
   16868     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   16869                                         #       u4 methodIdx, MethodType methodType)
   16870                                         # return: Method*
   16871     lea         16(%esp), %esp
   16872     cmp         $0, %eax               # check for null method return
   16873     movl        -4(%esp), %edx          # get "this" pointer register
   16874     GET_VREG    %edx                    # get "this" pointer
   16875     je          common_exceptionThrown  # null pointer; handle exception
   16876     cmp         $0, %edx               # check for null "this"
   16877     movl        %eax, %ecx              # %ecx<- method
   16878     jne         common_invokeMethodNoRange # invoke method common code
   16879     jmp         common_errNullObject    # handle null object
   16880 
   16881 /* continuation for OP_INVOKE_STATIC */
   16882 
   16883 .LOP_INVOKE_STATIC_break:
   16884     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   16885     movl        $METHOD_STATIC, -4(%esp) # resolver method type
   16886     movl        %eax, -8(%esp)          # push parameter method index
   16887     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   16888     movl        %edx, -12(%esp)         # push parameter method
   16889     lea         -12(%esp), %esp
   16890     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   16891                                         #       u4 methodIdx, MethodType methodType)
   16892                                         # return: Method*
   16893     lea         12(%esp), %esp
   16894     cmp         $0, %eax               # check for null method
   16895     je          common_exceptionThrown
   16896     movl        %eax, %ecx              # %ecx<- method
   16897     jmp         common_invokeMethodNoRange # invoke method common code
   16898 
   16899 /* continuation for OP_INVOKE_INTERFACE */
   16900 .LOP_INVOKE_INTERFACE_break:
   16901     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   16902     movl        offGlue_method(%ecx), %ecx # %ecx<- glue->method
   16903     movl        %ecx, -8(%esp)          # push parameter method
   16904     movl        offObject_clazz(%edx), %edx # %edx<- glue->method->clazz
   16905     movl        %edx, -16(%esp)         # push parameter
   16906     lea         -16(%esp), %esp
   16907     call        dvmFindInterfaceMethodInCache # call: (ClassObject* thisClass, u4 methodIdx,
   16908                                               #       const Method* method, DvmDex* methodClassDex)
   16909                                               # return: Method*
   16910     lea         16(%esp), %esp
   16911     cmp         $0, %eax               # check if find failed
   16912     je          common_exceptionThrown  # handle exception
   16913     movl        %eax, %ecx              # %ecx<- method
   16914     jmp         common_invokeMethodNoRange # invoke method common code
   16915 
   16916 /* continuation for OP_INVOKE_VIRTUAL_RANGE */
   16917 
   16918 .LOP_INVOKE_VIRTUAL_RANGE_break:
   16919     movl        rGLUE, %eax             # %eax<- pMterpGlue
   16920     movl        %edx, -4(%esp)          # save "this" pointer register
   16921     movl        offGlue_method(%eax), %eax # %eax<- glue->method
   16922     movl        $METHOD_VIRTUAL, -8(%esp) # push parameter method type
   16923     movl        %ecx, -12(%esp)         # push paramter method index
   16924     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   16925     lea         -16(%esp), %esp
   16926     movl        %eax, (%esp)            # push parameter clazz
   16927     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   16928                                         #       u4 methodIdx, MethodType methodType)
   16929                                         # return: Method*
   16930     lea         16(%esp), %esp
   16931     cmp         $0, %eax               # check for null method return
   16932     movl        -4(%esp), %edx          # get "this" pointer register
   16933     jne         .LOP_INVOKE_VIRTUAL_RANGE_continue
   16934     jmp         common_exceptionThrown  # null pointer; handle exception
   16935 
   16936    /*
   16937     * At this point:
   16938     *  %eax = resolved base method
   16939     *  %edx = D or CCCC (index of first arg, which is the "this" ptr)
   16940     */
   16941 
   16942 .LOP_INVOKE_VIRTUAL_RANGE_continue:
   16943     GET_VREG    %edx                    # %edx<- "this" ptr
   16944     movzwl      offMethod_methodIndex(%eax), %eax # %eax<- baseMethod->methodIndex
   16945     cmp         $0, %edx               # %edx<- check for null "this"
   16946     je          common_errNullObject    # handle null object
   16947     movl        offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
   16948     movl        offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
   16949     movl        (%edx, %eax, 4), %ecx   # %ecx<- vtable[methodIndex]
   16950     jmp         common_invokeMethodRange # invoke method common code
   16951 
   16952 /* continuation for OP_INVOKE_SUPER_RANGE */
   16953 
   16954 .LOP_INVOKE_SUPER_RANGE_continue2:
   16955     movl        rGLUE, %eax             # %eax<- pMterpGlue
   16956     movl        offGlue_method(%eax), %eax # %eax<- glue->method
   16957     movl        offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
   16958     EXPORT_PC                           # must export for invoke
   16959     cmp         $0, %ecx               # check if already resolved
   16960     jne         .LOP_INVOKE_SUPER_RANGE_continue
   16961     jmp         .LOP_INVOKE_SUPER_RANGE_resolve     # handle resolve
   16962 
   16963    /*
   16964     *  %ecx = resolved base method
   16965     *  %eax = method->clazz
   16966     */
   16967 
   16968 .LOP_INVOKE_SUPER_RANGE_continue:
   16969     movl        offClassObject_super(%eax), %edx # %edx<- glue->method->clazz->super
   16970     movzwl      offMethod_methodIndex(%ecx), %ecx # %ecx<-  baseMethod->methodIndex
   16971     cmp          offClassObject_vtableCount(%edx), %ecx # compare vtableCount with methodIndex
   16972     EXPORT_PC                           # must export for invoke
   16973     jnc         .LOP_INVOKE_SUPER_RANGE_nsm         # handle method not present
   16974     movl        offClassObject_vtable(%edx), %edx # %edx<- glue->method->clazz->super->vtable
   16975     movl        (%edx, %ecx, 4), %ecx   # %ecx<- vtable[methodIndex]
   16976     jmp         common_invokeMethodRange # invoke method common code
   16977 
   16978 .LOP_INVOKE_SUPER_RANGE_resolve:
   16979     movl        %eax, -12(%esp)         # push parameter clazz
   16980     movl        %edx, -8(%esp)          # push parameter method index
   16981     movl        $METHOD_VIRTUAL, -4(%esp) # push parameter method type
   16982     lea         -12(%esp), %esp
   16983     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   16984                                         #       u4 methodIdx, MethodType methodType)
   16985                                         # return: Method*
   16986     lea         12(%esp), %esp
   16987     movl        %eax, %ecx              # %ecx<- method
   16988     cmp         $0, %ecx               # check for null method return
   16989     movl        -12(%esp), %eax         # %eax<- glue->method->clazz
   16990     jne         .LOP_INVOKE_SUPER_RANGE_continue
   16991     jmp         common_exceptionThrown  # null pointer; handle exception
   16992 
   16993    /*
   16994     * Throw a NoSuchMethodError with the method name as the message.
   16995     * %ecx = resolved base method
   16996     */
   16997 
   16998 .LOP_INVOKE_SUPER_RANGE_nsm:
   16999     movl        offMethod_name(%ecx), %edx # %edx<- method name
   17000     jmp         common_errNoSuchMethod
   17001 
   17002 /* continuation for OP_INVOKE_DIRECT_RANGE */
   17003 
   17004    /*
   17005     * %eax = reference (BBBB or CCCC)
   17006     * -4(%esp) = "this" register
   17007     */
   17008 
   17009 .LOP_INVOKE_DIRECT_RANGE_resolve:
   17010     movl        rGLUE, %edx             # %edx<- pMterpGlue
   17011     movl        $METHOD_DIRECT, -8(%esp) # push parameter method type
   17012     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   17013     movl        %eax, -12(%esp)         # push parameter reference
   17014     lea         -16(%esp), %esp
   17015     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   17016     movl        %edx, (%esp)            # push parameter clazz
   17017     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   17018                                         #       u4 methodIdx, MethodType methodType)
   17019                                         # return: Method*
   17020     lea         16(%esp), %esp
   17021     cmp         $0, %eax               # check for null method return
   17022     movl        -4(%esp), %edx          # get "this" pointer register
   17023     GET_VREG    %edx                    # get "this" pointer
   17024     je          common_exceptionThrown  # null pointer; handle exception
   17025     cmp         $0, %edx               # check for null "this"
   17026     movl        %eax, %ecx              # %ecx<- method
   17027     jne         common_invokeMethodRange # invoke method common code
   17028     jmp         common_errNullObject    # handle null object
   17029 
   17030 /* continuation for OP_INVOKE_STATIC_RANGE */
   17031 
   17032 .LOP_INVOKE_STATIC_RANGE_break:
   17033     movl        offGlue_method(%edx), %edx # %edx<- glue->method
   17034     movl        $METHOD_STATIC, -4(%esp) # resolver method type
   17035     movl        %eax, -8(%esp)          # push parameter method index
   17036     movl        offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
   17037     movl        %edx, -12(%esp)         # push parameter method
   17038     lea         -12(%esp), %esp
   17039     call        dvmResolveMethod        # call: (const ClassObject* referrer,
   17040                                         #       u4 methodIdx, MethodType methodType)
   17041                                         # return: Method*
   17042     lea         12(%esp), %esp
   17043     cmp         $0, %eax               # check for null method
   17044     je          common_exceptionThrown
   17045     movl        %eax, %ecx              # %ecx<- method
   17046     jmp         common_invokeMethodRange # invoke method common code
   17047 
   17048 /* continuation for OP_INVOKE_INTERFACE_RANGE */
   17049 .LOP_INVOKE_INTERFACE_RANGE_break:
   17050     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   17051     movl        offGlue_method(%ecx), %ecx # %ecx<- glue->method
   17052     movl        %ecx, -8(%esp)          # push parameter method
   17053     movl        offObject_clazz(%edx), %edx # %edx<- glue->method->clazz
   17054     movl        %edx, -16(%esp)         # push parameter
   17055     lea         -16(%esp), %esp
   17056     call        dvmFindInterfaceMethodInCache # call: (ClassObject* thisClass, u4 methodIdx,
   17057                                               #       const Method* method, DvmDex* methodClassDex)
   17058                                               # return: Method*
   17059     lea         16(%esp), %esp
   17060     cmp         $0, %eax               # check if find failed
   17061     je          common_exceptionThrown  # handle exception
   17062     movl        %eax, %ecx              # %ecx<- method
   17063     jmp         common_invokeMethodRange # invoke method common code
   17064 
   17065 /* continuation for OP_FLOAT_TO_INT */
   17066 
   17067 .LOP_FLOAT_TO_INT_break:
   17068     fnstcw      -2(%esp)                # save control word
   17069     orl         $0xc00, -2(%esp)       # reset control
   17070     fldcw       -2(%esp)                # load control word
   17071     xorl        $0xc00, -2(%esp)       # reset control
   17072     fistpl      (rFP, %edx, 4)          # move converted int
   17073     fldcw       -2(%esp)                # load saved control word
   17074     FINISH      1                       # jump to next instruction
   17075 
   17076 .LOP_FLOAT_TO_INT_nanInf:
   17077     jnp         .LOP_FLOAT_TO_INT_posInf      # handle posInf
   17078     fstps       (rFP, %edx, 4)          # pop floating point stack
   17079     movl        $0x00000000,  (rFP, %edx, 4) # vA<- NaN
   17080     FINISH      1                       # jump to next instruction
   17081 
   17082 .LOP_FLOAT_TO_INT_posInf:
   17083     fstps       (rFP, %edx, 4)          # pop floating point stack
   17084     movl        $0x7FFFFFFF,  (rFP, %edx, 4) # vA<- posInf
   17085     FINISH      1                       # jump to next instruction
   17086 
   17087 .LOP_FLOAT_TO_INT_negInf:
   17088     fstps       (rFP, %edx, 4)          # pop floating point stack
   17089     fstps       (rFP, %edx, 4)          # pop floating point stack
   17090     movl        $0x80000000, (rFP, %edx, 4) # vA<- negInf
   17091     FINISH      1                       # jump to next instruction
   17092 
   17093 /* continuation for OP_FLOAT_TO_LONG */
   17094 
   17095 .LOP_FLOAT_TO_LONG_break:
   17096     fnstcw      -2(%esp)                # save control word
   17097     orl         $0xc00, -2(%esp)       # update control
   17098     fldcw       -2(%esp)                # load control word
   17099     xorl        $0xc00, -2(%esp)       # reset control
   17100     fistpll     (rFP, %edx, 4)          # move converted int
   17101     fldcw       -2(%esp)                # load saved control word
   17102     FINISH      1                       # jump to next instruction
   17103 
   17104 .LOP_FLOAT_TO_LONG_nanInf:
   17105     jnp         .LOP_FLOAT_TO_LONG_posInf
   17106     fstpl       (rFP, %edx, 4)          # move converted int
   17107     movq        .LvalueNanLong, %xmm0   # %xmm0<- NaN
   17108     movq        %xmm0,  (rFP, %edx, 4)  # vA<- %xmm0; NaN
   17109     FINISH      1                       # jump to next instruction
   17110 
   17111 .LOP_FLOAT_TO_LONG_posInf:
   17112     fstpl       (rFP, %edx, 4)          # move converted int
   17113     movq        .LvaluePosInfLong, %xmm0 # %xmm0<- posInf
   17114     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; posInf
   17115     FINISH      1                       # jump to next instruction
   17116 
   17117 .LOP_FLOAT_TO_LONG_negInf:
   17118     fstpl       (rFP, %edx, 4)          # move converted int
   17119     movq        .LvalueNegInfLong, %xmm0 # %xmm0<- negInf
   17120     fstpl       (rFP, %edx, 4)          # move converted int
   17121     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; negInf
   17122     FINISH      1                       # jump to next instruction
   17123 
   17124 /* continuation for OP_DOUBLE_TO_INT */
   17125 
   17126 .LOP_DOUBLE_TO_INT_break:
   17127     fnstcw      -2(%esp)                # save control word
   17128     orl         $0xc00, -2(%esp)       # reset control
   17129     fldcw       -2(%esp)                # load control word
   17130     xorl        $0xc00, -2(%esp)       # reset control
   17131     fistpl      (rFP, %edx, 4)          # move converted int
   17132     fldcw       -2(%esp)                # load saved control word
   17133     FINISH      1                       # jump to next instruction
   17134 
   17135 .LOP_DOUBLE_TO_INT_nanInf:
   17136     jnp         .LOP_DOUBLE_TO_INT_posInf
   17137     fstps       (rFP, %edx, 4)
   17138     movl        $0x00000000,  (rFP, %edx, 4) # vA<- NaN
   17139     FINISH      1                       # jump to next instruction
   17140 
   17141 .LOP_DOUBLE_TO_INT_posInf:
   17142     fstps       (rFP, %edx, 4)
   17143     movl        $0x7FFFFFFF,  (rFP, %edx, 4) # vA<- posInf
   17144     FINISH      1                       # jump to next instruction
   17145 
   17146 .LOP_DOUBLE_TO_INT_negInf:
   17147     fstps       (rFP, %edx, 4)
   17148     fstps       (rFP, %edx, 4)
   17149     movl        $0x80000000,  (rFP, %edx, 4) # vA<- negInf
   17150     FINISH      1                       # jump to next instruction
   17151 
   17152 /* continuation for OP_DOUBLE_TO_LONG */
   17153 
   17154 .LOP_DOUBLE_TO_LONG_break:
   17155     fnstcw      -2(%esp)                # save control word
   17156     orl         $0xc00, -2(%esp)       # reset control
   17157     fldcw       -2(%esp)                # load control word
   17158     xorl        $0xc00, -2(%esp)       # reset control
   17159     fistpll     (rFP, %edx, 4)          # move converted int
   17160     fldcw       -2(%esp)                # load saved control word
   17161     FINISH      1                       # jump to next instruction
   17162 
   17163 .LOP_DOUBLE_TO_LONG_nanInf:
   17164     jnp         .LOP_DOUBLE_TO_LONG_posInf
   17165     fstpl       (rFP, %edx, 4)          # move converted int
   17166     movq        .LvalueNanLong, %xmm0   # %xmm0<- NaN
   17167     movq        %xmm0,  (rFP, %edx, 4)  # vA<- %xmm0; NaN
   17168     FINISH      1                       # jump to next instruction
   17169 
   17170 .LOP_DOUBLE_TO_LONG_posInf:
   17171     fstpl       (rFP, %edx, 4)          # move converted int
   17172     movq        .LvaluePosInfLong, %xmm0 # %xmm0<- posInf
   17173     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; posInf
   17174     FINISH      1                       # jump to next instruction
   17175 
   17176 .LOP_DOUBLE_TO_LONG_negInf:
   17177     fstpl       (rFP, %edx, 4)          # move converted int
   17178     movq        .LvalueNegInfLong, %xmm0 # %xmm0<- negInf
   17179     fstpl       (rFP, %edx, 4)          # move converted int
   17180     movq        %xmm0, (rFP, %edx, 4)   # vA<- %xmm0; negInf
   17181     FINISH      1                       # jump to next instruction
   17182 
   17183 /* continuation for OP_DIV_INT */
   17184 .LOP_DIV_INT_break:
   17185     .if  1
   17186     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17187     .else
   17188     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17189     .endif
   17190 .LOP_DIV_INT_break2:
   17191     FINISH      2                       # jump to next instruction
   17192 
   17193 /* continuation for OP_REM_INT */
   17194 .LOP_REM_INT_break:
   17195     .if  0
   17196     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17197     .else
   17198     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17199     .endif
   17200 .LOP_REM_INT_break2:
   17201     FINISH      2                       # jump to next instruction
   17202 
   17203 /* continuation for OP_MUL_LONG */
   17204 
   17205    /*
   17206     * X = (rFP, rINST, 4)
   17207     * W = 4(rFP, rINST, 4)
   17208     * Z = (rFP, %edx, 4)
   17209     * Y = 4(rFP, %edx, 4)
   17210     */
   17211 
   17212 .LOP_MUL_LONG_finish:
   17213     movl        4(rFP, rINST, 4), %ecx  # %ecx<- W
   17214     imull       (rFP, %edx, 4),  %ecx   # %ecx<- WxZ
   17215     mov         4(rFP, %edx, 4), %eax   # %ecx<- Y
   17216     imull       (rFP, rINST, 4), %eax   # %eax<- XxY
   17217     addl        %eax, %ecx              # %ecx<- (WZ + XY)
   17218     movl        (rFP, %edx, 4), %eax    # %eax<- Z
   17219     mull        (rFP, rINST, 4)         # %edx:eax<- XZ
   17220     movzbl      -4(%esp), rINST         # rINST<- AA
   17221     addl        %edx, %ecx              # %ecx<- carry + (WZ + XY)
   17222     movl        %ecx, 4(rFP, rINST, 4)  # vAA+1<- results hi
   17223     movl        %eax, (rFP, rINST, 4)   # vAA<- results lo
   17224     FINISH      2                       # jump to next instruction
   17225 
   17226 /* continuation for OP_DIV_LONG */
   17227 .LOP_DIV_LONG_finish:
   17228     movq        %xmm0, -16(%esp)        # push arg vBB,vBB+1
   17229     lea         -16(%esp), %esp
   17230     call        __divdi3                   # call func
   17231     lea         16(%esp), %esp
   17232     movl        %eax, (rFP, rINST, 4)   # vAA<- return low
   17233     movl        %edx, 4(rFP, rINST, 4)  # vAA+1<- return high
   17234     FINISH      2                       # jump to next instruction
   17235 
   17236 /* continuation for OP_REM_LONG */
   17237 .LOP_REM_LONG_finish:
   17238     movq        %xmm0, -16(%esp)        # push arg vBB,vBB+1
   17239     lea         -16(%esp), %esp
   17240     call        __moddi3                   # call func
   17241     lea         16(%esp), %esp
   17242     movl        %eax, (rFP, rINST, 4)   # vAA<- return low
   17243     movl        %edx, 4(rFP, rINST, 4)  # vAA+1<- return high
   17244     FINISH      2                       # jump to next instruction
   17245 
   17246 /* continuation for OP_SHR_LONG */
   17247 
   17248 .LOP_SHR_LONG_finish:
   17249     movq        .Lvalue64, %xmm3        # %xmm3<- 64
   17250     psubq       %xmm0, %xmm3            # %xmm3<- 64 - shift amount
   17251     movq        .L64bits, %xmm4         # %xmm4<- lower 64 bits set
   17252     psllq       %xmm3, %xmm4            # %xmm4<- correct mask for sign bits
   17253     por         %xmm4, %xmm1            # %xmm1<- signed and shifted vBB
   17254 
   17255 .LOP_SHR_LONG_final:
   17256     movq        %xmm1, (rFP, rINST, 4)  # vAA<- shifted vBB
   17257     FINISH      2                       # jump to next instruction
   17258 
   17259 /* continuation for OP_REM_DOUBLE */
   17260 
   17261 .LOP_REM_DOUBLE_break:
   17262     call        fmod                    # call: (long double x, long double y)
   17263                                         # return: double
   17264     lea         16(%esp), %esp
   17265     fstpl       (rFP, rINST, 4)         # vAA<- remainder; return of fmod
   17266     FINISH      2                       # jump to next instruction
   17267 
   17268 /* continuation for OP_DIV_INT_2ADDR */
   17269 .LOP_DIV_INT_2ADDR_break:
   17270     .if  1
   17271     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17272     .else
   17273     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17274     .endif
   17275 .LOP_DIV_INT_2ADDR_break2:
   17276     FFETCH_ADV  1, %edx                 # %ecx<- next instruction hi; fetch, advance
   17277     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   17278 
   17279 
   17280 /* continuation for OP_REM_INT_2ADDR */
   17281 .LOP_REM_INT_2ADDR_break:
   17282     .if  0
   17283     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17284     .else
   17285     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17286     .endif
   17287 .LOP_REM_INT_2ADDR_break2:
   17288     FFETCH_ADV  1, %edx                 # %ecx<- next instruction hi; fetch, advance
   17289     FGETOP_JMP  1, %edx                 # jump to next instruction; getop, jmp
   17290 
   17291 
   17292 /* continuation for OP_MUL_LONG_2ADDR */
   17293 
   17294    /*
   17295     * X = (rFP, rINST, 4)
   17296     * W = 4(rFP, rINST, 4)
   17297     * Z = (rFP, %edx, 4)
   17298     * Y = 4(rFP, %edx, 4)
   17299     */
   17300 
   17301 .LOP_MUL_LONG_2ADDR_finish:
   17302     movl        4(rFP, rINST, 4), %ecx  # %ecx<- W
   17303     imull       (rFP, %edx, 4), %ecx    # %ecx<- WxZ
   17304     movl                4(rFP, %edx, 4), %eax   # %eax<- Y
   17305     imull       (rFP, rINST, 4), %eax   # %eax<- X*Y
   17306     addl        %eax, %ecx              # %ecx<- (WZ + XY)
   17307     movl        (rFP, %edx, 4), %eax    # %eax<- Z
   17308     mull        (rFP, rINST, 4)         # %edx:eax<- XZ
   17309     addl        %edx, %ecx              # %ecx<- carry + (WZ + XY)
   17310     movl        sReg0, %edx             # %edx<- A
   17311     movl        %ecx, 4(rFP, %edx, 4)   # vA+1<- results hi
   17312     movl        %eax, (rFP, %edx, 4)    # vA<- results lo
   17313     FINISH      1                       # jump to next instruction
   17314 
   17315 /* continuation for OP_DIV_LONG_2ADDR */
   17316 .LOP_DIV_LONG_2ADDR_break:
   17317     movq        %xmm0, -20(%esp)        # push arg vA, vA+1
   17318     lea         -20(%esp), %esp
   17319     call        __divdi3                   # call func
   17320     lea         20(%esp), %esp
   17321     movl        %eax, (rFP, rINST, 4)   # vA<- return low
   17322     movl        %edx, 4(rFP, rINST, 4)  # vA<- return high
   17323     FFETCH_ADV  1, %ecx                 # %ecx<- next instruction hi; fetch, advance
   17324     FGETOP_JMP 1, %ecx                  # jump to next instruction; getop, jmp
   17325 
   17326 /* continuation for OP_REM_LONG_2ADDR */
   17327 .LOP_REM_LONG_2ADDR_break:
   17328     movq        %xmm0, -20(%esp)        # push arg vA, vA+1
   17329     lea         -20(%esp), %esp
   17330     call        __moddi3                   # call func
   17331     lea         20(%esp), %esp
   17332     movl        %eax, (rFP, rINST, 4)   # vA<- return low
   17333     movl        %edx, 4(rFP, rINST, 4)  # vA<- return high
   17334     FFETCH_ADV  1, %ecx                 # %ecx<- next instruction hi; fetch, advance
   17335     FGETOP_JMP 1, %ecx                  # jump to next instruction; getop, jmp
   17336 
   17337 /* continuation for OP_SHR_LONG_2ADDR */
   17338 
   17339 .LOP_SHR_LONG_2ADDR_finish:
   17340     movq        .Lvalue64, %xmm3        # %xmm3<- 64
   17341     psubq       %xmm0, %xmm3            # %xmm3<- 64 - shift amount
   17342     movq        .L64bits, %xmm4         # %xmm4<- lower 64 bits set
   17343     psllq       %xmm3, %xmm4            # %xmm4<- correct mask for sign bits
   17344     por         %xmm4, %xmm1            # %xmm1<- signed and shifted vBB
   17345 
   17346 .LOP_SHR_LONG_2ADDR_final:
   17347     movq        %xmm1, (rFP, rINST, 4)  # vAA<- shifted vBB
   17348     FINISH      1                       # jump to next instruction
   17349 
   17350 /* continuation for OP_REM_DOUBLE_2ADDR */
   17351 
   17352 .LOP_REM_DOUBLE_2ADDR_break:
   17353     call        fmod                    # call: (long double x, long double y)
   17354                                         # return: double
   17355     lea         20(%esp), %esp
   17356     fstpl       (rFP, rINST, 4)         # vAA<- remainder; return of fmod
   17357     FINISH      1                       # jump to next instruction
   17358 
   17359 /* continuation for OP_DIV_INT_LIT16 */
   17360 .LOP_DIV_INT_LIT16_break:
   17361     .if  1
   17362     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17363     .else
   17364     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17365     .endif
   17366 .LOP_DIV_INT_LIT16_break2:
   17367 
   17368     FINISH      2                       # jump to next instruction
   17369 
   17370 /* continuation for OP_REM_INT_LIT16 */
   17371 .LOP_REM_INT_LIT16_break:
   17372     .if  0
   17373     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17374     .else
   17375     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17376     .endif
   17377 .LOP_REM_INT_LIT16_break2:
   17378 
   17379     FINISH      2                       # jump to next instruction
   17380 
   17381 /* continuation for OP_DIV_INT_LIT8 */
   17382 .LOP_DIV_INT_LIT8_break:
   17383     .if  1
   17384     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17385     .else
   17386     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17387     .endif
   17388 
   17389 .LOP_DIV_INT_LIT8_break2:
   17390     FINISH      2                       # jump to next instruction
   17391     #FGETOP_JMP 2, %ecx                 # jump to next instruction; getop, jmp
   17392 
   17393 /* continuation for OP_REM_INT_LIT8 */
   17394 .LOP_REM_INT_LIT8_break:
   17395     .if  0
   17396     movl        $0x80000000, (rFP, rINST, 4) # vAA<- min int
   17397     .else
   17398     movl        $0, (rFP, rINST, 4)    # vAA<- 0
   17399     .endif
   17400 
   17401 .LOP_REM_INT_LIT8_break2:
   17402     FINISH      2                       # jump to next instruction
   17403     #FGETOP_JMP 2, %ecx                 # jump to next instruction; getop, jmp
   17404 
   17405 /* continuation for OP_EXECUTE_INLINE */
   17406 
   17407    /*
   17408     * Extract args, call function.
   17409     *  rINST = #of args (0-4)
   17410     *  %ecx = call index
   17411     */
   17412 
   17413 .LOP_EXECUTE_INLINE_continue:
   17414     FETCH       2, %edx                 # %edx<- FEDC
   17415     cmp         $1, rINST              # determine number of arguments
   17416     jl          0f                      # handle zero args
   17417     je          1f                      # handle one arg
   17418     cmp         $3, rINST
   17419     jl          2f                      # handle two args
   17420     je          3f                      # handle three args
   17421 4:
   17422     movl        %edx, rINST             # rINST<- FEDC
   17423     and         $0xf000, rINST         # isolate F
   17424     shr         $10, rINST
   17425     movl        (rFP, rINST), rINST     # rINST<- vF
   17426     movl        rINST, 12(%esp)         # push parameter vF
   17427 3:
   17428     movl        %edx, rINST             # rINST<- FEDC
   17429     and         $0x0f00, rINST         # isolate E
   17430     shr         $6, rINST
   17431     movl        (rFP, rINST), rINST     # rINST<- vE
   17432     movl        rINST, 8(%esp)          # push parameter E
   17433 2:
   17434     movl        %edx, rINST             # rINST<- FEDC
   17435     and         $0x00f0, rINST         # isolate D
   17436     shr         $2, rINST
   17437     movl        (rFP, rINST), rINST     # rINST<- vD
   17438     movl        rINST, 4(%esp)          # push parameter D
   17439 1:
   17440     and         $0x000f, %edx          # isolate C
   17441     movl        (rFP, %edx, 4), %edx    # rINST<- vC
   17442     movl        %edx, (%esp)            # push parameter C
   17443 0:
   17444     shl         $4, %ecx
   17445     movl        $gDvmInlineOpsTable, %eax # %eax<- address for table of inline operations
   17446     call        *(%eax, %ecx)           # call function
   17447 
   17448     cmp         $0, %eax               # check boolean result of inline
   17449     FFETCH_ADV  3, %eax                 # %eax<- next instruction hi; fetch, advance
   17450     lea         24(%esp), %esp          # update stack pointer
   17451     je          common_exceptionThrown  # handle exception
   17452     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
   17453 
   17454     .size   dvmAsmSisterStart, .-dvmAsmSisterStart
   17455     .global dvmAsmSisterEnd
   17456 dvmAsmSisterEnd:
   17457 
   17458 /* File: x86-atom/entry.S */
   17459    /* Copyright (C) 2008 The Android Open Source Project
   17460     *
   17461     * Licensed under the Apache License, Version 2.0 (the "License");
   17462     * you may not use this file except in compliance with the License.
   17463     * You may obtain a copy of the License at
   17464     *
   17465     * http://www.apache.org/licenses/LICENSE-2.0
   17466     *
   17467     * Unless required by applicable law or agreed to in writing, software
   17468     * distributed under the License is distributed on an "AS IS" BASIS,
   17469     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   17470     * See the License for the specific language governing permissions and
   17471     * limitations under the License.
   17472     */
   17473 
   17474    /*
   17475     * File: entry.S
   17476     */
   17477 
   17478 #define ASSIST_DEBUGGER 1
   17479     .text
   17480     .align      2
   17481     .global     dvmMterpStdRun
   17482     .type       dvmMterpStdRun, %function
   17483 
   17484    /*
   17485     * Save registers, initialize sp and fp.
   17486     * On entry:
   17487     *     bool MterpGlue(glue *)
   17488     */
   17489 
   17490     .macro      MTERP_ENTRY
   17491     movl        4(%esp), %ecx           # get first argument
   17492     movl        %ebp, -4(%esp)          # save caller base pointer
   17493     movl        %ebx, -8(%esp)          # save %ebx
   17494     movl        %esi, -12(%esp)         # save %esi
   17495     movl        %edi, -16(%esp)         # save %edi
   17496     lea         -40(%esp), %ebp         # set callee base pointer
   17497     lea         -40(%esp), %esp         # set callee stack pointer
   17498     .endm
   17499 
   17500    /*
   17501     * Restore registers.
   17502     * This function returns a boolean "changeInterp" value.
   17503     * The return value is from dvmMterpStdBail().
   17504     */
   17505 
   17506     .macro      MTERP_EXIT
   17507     lea         40(%esp), %esp          # correct stack pointer
   17508     movl        -16(%esp), %edi         # restore %edi
   17509     movl        -12(%esp), %esi         # restore %esi
   17510     movl        -8(%esp), %ebx          # restore %ebx
   17511     movl        -4(%esp), %ebp          # restore caller base pointer
   17512     ret                                 # return
   17513     .endm
   17514 
   17515    /*
   17516     * DvmMterpStdRun entry point: save stack pointer, setup memory locations, get
   17517     * entry point, start executing instructions.
   17518     */
   17519 
   17520 dvmMterpStdRun:
   17521     MTERP_ENTRY
   17522     movl        %ecx, rGLUE             # save value for pMterpGlue
   17523     movl        offGlue_pc(%ecx), rPC   # get program counter
   17524     cmp         $kInterpEntryInstr, offGlue_entryPoint(%ecx) # check instruction
   17525     movl        offGlue_fp(%ecx), rFP   # get frame pointer
   17526     movl        %esp, offGlue_bailPtr(%ecx) # save SP for eventual return
   17527     FFETCH      %edx                    # %edx<- opcode
   17528     jne         .Lnot_instr             # no, handle it
   17529     FGETOP_JMPa %edx                    # start executing the instruction at rPC
   17530 
   17531    /*
   17532     * Not an instruction. Are we returning from a method?
   17533     */
   17534 
   17535 .Lnot_instr:
   17536     cmpl        $kInterpEntryReturn, offGlue_entryPoint(%ecx)
   17537     je          common_returnFromMethod
   17538 
   17539    /*
   17540     * No, are we throwing an exception?
   17541     */
   17542 
   17543 .Lnot_return:
   17544     cmpl        $kInterpEntryThrow, offGlue_entryPoint(%ecx)
   17545     je          common_exceptionThrown
   17546 
   17547    /*
   17548     * No, then we must abort.
   17549     */
   17550 
   17551 .Lbad_arg:
   17552     pushl       offGlue_entryPoint(%ecx)
   17553     movl        $.LstrBadEntryPoint, -4(%esp)
   17554     lea         -4(%esp), %esp
   17555     call        printf
   17556     lea         8(%esp), %esp
   17557     call        dvmAbort                # call (void)
   17558 
   17559    /*
   17560     * Restore the stack pointer and PC from the save point established on entry and
   17561     * return to whoever called dvmMterpStdRun.
   17562     *
   17563     * On entry:
   17564     *  4(%esp) MterpGlue* glue
   17565     *  8(%esp) bool changeInterp
   17566     */
   17567 
   17568     .global     dvmMterpStdBail
   17569     .type       dvmMterpStdBail, %function
   17570 
   17571 dvmMterpStdBail:
   17572     movl        4(%esp), %ecx           # get first argument
   17573     movl        8(%esp), %eax           # get second argument
   17574     movl        offGlue_bailPtr(%ecx), %esp # sp <- saved SP
   17575     MTERP_EXIT
   17576 
   17577    /*
   17578     * String references.
   17579     */
   17580 
   17581 .LstrBadEntryPoint:
   17582     .asciz "Bad entry point %d\n"
   17583 
   17584 
   17585 dvmAsmInstructionJmpTable = .LdvmAsmInstructionJmpTable
   17586 .LdvmAsmInstructionJmpTable:
   17587 .long .L_OP_NOP
   17588 .long .L_OP_MOVE
   17589 .long .L_OP_MOVE_FROM16
   17590 .long .L_OP_MOVE_16
   17591 .long .L_OP_MOVE_WIDE
   17592 .long .L_OP_MOVE_WIDE_FROM16
   17593 .long .L_OP_MOVE_WIDE_16
   17594 .long .L_OP_MOVE_OBJECT
   17595 .long .L_OP_MOVE_OBJECT_FROM16
   17596 .long .L_OP_MOVE_OBJECT_16
   17597 .long .L_OP_MOVE_RESULT
   17598 .long .L_OP_MOVE_RESULT_WIDE
   17599 .long .L_OP_MOVE_RESULT_OBJECT
   17600 .long .L_OP_MOVE_EXCEPTION
   17601 .long .L_OP_RETURN_VOID
   17602 .long .L_OP_RETURN
   17603 .long .L_OP_RETURN_WIDE
   17604 .long .L_OP_RETURN_OBJECT
   17605 .long .L_OP_CONST_4
   17606 .long .L_OP_CONST_16
   17607 .long .L_OP_CONST
   17608 .long .L_OP_CONST_HIGH16
   17609 .long .L_OP_CONST_WIDE_16
   17610 .long .L_OP_CONST_WIDE_32
   17611 .long .L_OP_CONST_WIDE
   17612 .long .L_OP_CONST_WIDE_HIGH16
   17613 .long .L_OP_CONST_STRING
   17614 .long .L_OP_CONST_STRING_JUMBO
   17615 .long .L_OP_CONST_CLASS
   17616 .long .L_OP_MONITOR_ENTER
   17617 .long .L_OP_MONITOR_EXIT
   17618 .long .L_OP_CHECK_CAST
   17619 .long .L_OP_INSTANCE_OF
   17620 .long .L_OP_ARRAY_LENGTH
   17621 .long .L_OP_NEW_INSTANCE
   17622 .long .L_OP_NEW_ARRAY
   17623 .long .L_OP_FILLED_NEW_ARRAY
   17624 .long .L_OP_FILLED_NEW_ARRAY_RANGE
   17625 .long .L_OP_FILL_ARRAY_DATA
   17626 .long .L_OP_THROW
   17627 .long .L_OP_GOTO
   17628 .long .L_OP_GOTO_16
   17629 .long .L_OP_GOTO_32
   17630 .long .L_OP_PACKED_SWITCH
   17631 .long .L_OP_SPARSE_SWITCH
   17632 .long .L_OP_CMPL_FLOAT
   17633 .long .L_OP_CMPG_FLOAT
   17634 .long .L_OP_CMPL_DOUBLE
   17635 .long .L_OP_CMPG_DOUBLE
   17636 .long .L_OP_CMP_LONG
   17637 .long .L_OP_IF_EQ
   17638 .long .L_OP_IF_NE
   17639 .long .L_OP_IF_LT
   17640 .long .L_OP_IF_GE
   17641 .long .L_OP_IF_GT
   17642 .long .L_OP_IF_LE
   17643 .long .L_OP_IF_EQZ
   17644 .long .L_OP_IF_NEZ
   17645 .long .L_OP_IF_LTZ
   17646 .long .L_OP_IF_GEZ
   17647 .long .L_OP_IF_GTZ
   17648 .long .L_OP_IF_LEZ
   17649 .long .L_OP_UNUSED_3E
   17650 .long .L_OP_UNUSED_3F
   17651 .long .L_OP_UNUSED_40
   17652 .long .L_OP_UNUSED_41
   17653 .long .L_OP_UNUSED_42
   17654 .long .L_OP_UNUSED_43
   17655 .long .L_OP_AGET
   17656 .long .L_OP_AGET_WIDE
   17657 .long .L_OP_AGET_OBJECT
   17658 .long .L_OP_AGET_BOOLEAN
   17659 .long .L_OP_AGET_BYTE
   17660 .long .L_OP_AGET_CHAR
   17661 .long .L_OP_AGET_SHORT
   17662 .long .L_OP_APUT
   17663 .long .L_OP_APUT_WIDE
   17664 .long .L_OP_APUT_OBJECT
   17665 .long .L_OP_APUT_BOOLEAN
   17666 .long .L_OP_APUT_BYTE
   17667 .long .L_OP_APUT_CHAR
   17668 .long .L_OP_APUT_SHORT
   17669 .long .L_OP_IGET
   17670 .long .L_OP_IGET_WIDE
   17671 .long .L_OP_IGET_OBJECT
   17672 .long .L_OP_IGET_BOOLEAN
   17673 .long .L_OP_IGET_BYTE
   17674 .long .L_OP_IGET_CHAR
   17675 .long .L_OP_IGET_SHORT
   17676 .long .L_OP_IPUT
   17677 .long .L_OP_IPUT_WIDE
   17678 .long .L_OP_IPUT_OBJECT
   17679 .long .L_OP_IPUT_BOOLEAN
   17680 .long .L_OP_IPUT_BYTE
   17681 .long .L_OP_IPUT_CHAR
   17682 .long .L_OP_IPUT_SHORT
   17683 .long .L_OP_SGET
   17684 .long .L_OP_SGET_WIDE
   17685 .long .L_OP_SGET_OBJECT
   17686 .long .L_OP_SGET_BOOLEAN
   17687 .long .L_OP_SGET_BYTE
   17688 .long .L_OP_SGET_CHAR
   17689 .long .L_OP_SGET_SHORT
   17690 .long .L_OP_SPUT
   17691 .long .L_OP_SPUT_WIDE
   17692 .long .L_OP_SPUT_OBJECT
   17693 .long .L_OP_SPUT_BOOLEAN
   17694 .long .L_OP_SPUT_BYTE
   17695 .long .L_OP_SPUT_CHAR
   17696 .long .L_OP_SPUT_SHORT
   17697 .long .L_OP_INVOKE_VIRTUAL
   17698 .long .L_OP_INVOKE_SUPER
   17699 .long .L_OP_INVOKE_DIRECT
   17700 .long .L_OP_INVOKE_STATIC
   17701 .long .L_OP_INVOKE_INTERFACE
   17702 .long .L_OP_UNUSED_73
   17703 .long .L_OP_INVOKE_VIRTUAL_RANGE
   17704 .long .L_OP_INVOKE_SUPER_RANGE
   17705 .long .L_OP_INVOKE_DIRECT_RANGE
   17706 .long .L_OP_INVOKE_STATIC_RANGE
   17707 .long .L_OP_INVOKE_INTERFACE_RANGE
   17708 .long .L_OP_UNUSED_79
   17709 .long .L_OP_UNUSED_7A
   17710 .long .L_OP_NEG_INT
   17711 .long .L_OP_NOT_INT
   17712 .long .L_OP_NEG_LONG
   17713 .long .L_OP_NOT_LONG
   17714 .long .L_OP_NEG_FLOAT
   17715 .long .L_OP_NEG_DOUBLE
   17716 .long .L_OP_INT_TO_LONG
   17717 .long .L_OP_INT_TO_FLOAT
   17718 .long .L_OP_INT_TO_DOUBLE
   17719 .long .L_OP_LONG_TO_INT
   17720 .long .L_OP_LONG_TO_FLOAT
   17721 .long .L_OP_LONG_TO_DOUBLE
   17722 .long .L_OP_FLOAT_TO_INT
   17723 .long .L_OP_FLOAT_TO_LONG
   17724 .long .L_OP_FLOAT_TO_DOUBLE
   17725 .long .L_OP_DOUBLE_TO_INT
   17726 .long .L_OP_DOUBLE_TO_LONG
   17727 .long .L_OP_DOUBLE_TO_FLOAT
   17728 .long .L_OP_INT_TO_BYTE
   17729 .long .L_OP_INT_TO_CHAR
   17730 .long .L_OP_INT_TO_SHORT
   17731 .long .L_OP_ADD_INT
   17732 .long .L_OP_SUB_INT
   17733 .long .L_OP_MUL_INT
   17734 .long .L_OP_DIV_INT
   17735 .long .L_OP_REM_INT
   17736 .long .L_OP_AND_INT
   17737 .long .L_OP_OR_INT
   17738 .long .L_OP_XOR_INT
   17739 .long .L_OP_SHL_INT
   17740 .long .L_OP_SHR_INT
   17741 .long .L_OP_USHR_INT
   17742 .long .L_OP_ADD_LONG
   17743 .long .L_OP_SUB_LONG
   17744 .long .L_OP_MUL_LONG
   17745 .long .L_OP_DIV_LONG
   17746 .long .L_OP_REM_LONG
   17747 .long .L_OP_AND_LONG
   17748 .long .L_OP_OR_LONG
   17749 .long .L_OP_XOR_LONG
   17750 .long .L_OP_SHL_LONG
   17751 .long .L_OP_SHR_LONG
   17752 .long .L_OP_USHR_LONG
   17753 .long .L_OP_ADD_FLOAT
   17754 .long .L_OP_SUB_FLOAT
   17755 .long .L_OP_MUL_FLOAT
   17756 .long .L_OP_DIV_FLOAT
   17757 .long .L_OP_REM_FLOAT
   17758 .long .L_OP_ADD_DOUBLE
   17759 .long .L_OP_SUB_DOUBLE
   17760 .long .L_OP_MUL_DOUBLE
   17761 .long .L_OP_DIV_DOUBLE
   17762 .long .L_OP_REM_DOUBLE
   17763 .long .L_OP_ADD_INT_2ADDR
   17764 .long .L_OP_SUB_INT_2ADDR
   17765 .long .L_OP_MUL_INT_2ADDR
   17766 .long .L_OP_DIV_INT_2ADDR
   17767 .long .L_OP_REM_INT_2ADDR
   17768 .long .L_OP_AND_INT_2ADDR
   17769 .long .L_OP_OR_INT_2ADDR
   17770 .long .L_OP_XOR_INT_2ADDR
   17771 .long .L_OP_SHL_INT_2ADDR
   17772 .long .L_OP_SHR_INT_2ADDR
   17773 .long .L_OP_USHR_INT_2ADDR
   17774 .long .L_OP_ADD_LONG_2ADDR
   17775 .long .L_OP_SUB_LONG_2ADDR
   17776 .long .L_OP_MUL_LONG_2ADDR
   17777 .long .L_OP_DIV_LONG_2ADDR
   17778 .long .L_OP_REM_LONG_2ADDR
   17779 .long .L_OP_AND_LONG_2ADDR
   17780 .long .L_OP_OR_LONG_2ADDR
   17781 .long .L_OP_XOR_LONG_2ADDR
   17782 .long .L_OP_SHL_LONG_2ADDR
   17783 .long .L_OP_SHR_LONG_2ADDR
   17784 .long .L_OP_USHR_LONG_2ADDR
   17785 .long .L_OP_ADD_FLOAT_2ADDR
   17786 .long .L_OP_SUB_FLOAT_2ADDR
   17787 .long .L_OP_MUL_FLOAT_2ADDR
   17788 .long .L_OP_DIV_FLOAT_2ADDR
   17789 .long .L_OP_REM_FLOAT_2ADDR
   17790 .long .L_OP_ADD_DOUBLE_2ADDR
   17791 .long .L_OP_SUB_DOUBLE_2ADDR
   17792 .long .L_OP_MUL_DOUBLE_2ADDR
   17793 .long .L_OP_DIV_DOUBLE_2ADDR
   17794 .long .L_OP_REM_DOUBLE_2ADDR
   17795 .long .L_OP_ADD_INT_LIT16
   17796 .long .L_OP_RSUB_INT
   17797 .long .L_OP_MUL_INT_LIT16
   17798 .long .L_OP_DIV_INT_LIT16
   17799 .long .L_OP_REM_INT_LIT16
   17800 .long .L_OP_AND_INT_LIT16
   17801 .long .L_OP_OR_INT_LIT16
   17802 .long .L_OP_XOR_INT_LIT16
   17803 .long .L_OP_ADD_INT_LIT8
   17804 .long .L_OP_RSUB_INT_LIT8
   17805 .long .L_OP_MUL_INT_LIT8
   17806 .long .L_OP_DIV_INT_LIT8
   17807 .long .L_OP_REM_INT_LIT8
   17808 .long .L_OP_AND_INT_LIT8
   17809 .long .L_OP_OR_INT_LIT8
   17810 .long .L_OP_XOR_INT_LIT8
   17811 .long .L_OP_SHL_INT_LIT8
   17812 .long .L_OP_SHR_INT_LIT8
   17813 .long .L_OP_USHR_INT_LIT8
   17814 .long .L_OP_IGET_VOLATILE
   17815 .long .L_OP_IPUT_VOLATILE
   17816 .long .L_OP_SGET_VOLATILE
   17817 .long .L_OP_SPUT_VOLATILE
   17818 .long .L_OP_IGET_OBJECT_VOLATILE
   17819 .long .L_OP_IGET_WIDE_VOLATILE
   17820 .long .L_OP_IPUT_WIDE_VOLATILE
   17821 .long .L_OP_SGET_WIDE_VOLATILE
   17822 .long .L_OP_SPUT_WIDE_VOLATILE
   17823 .long .L_OP_BREAKPOINT
   17824 .long .L_OP_THROW_VERIFICATION_ERROR
   17825 .long .L_OP_EXECUTE_INLINE
   17826 .long .L_OP_EXECUTE_INLINE_RANGE
   17827 .long .L_OP_INVOKE_OBJECT_INIT_RANGE
   17828 .long .L_OP_RETURN_VOID_BARRIER
   17829 .long .L_OP_IGET_QUICK
   17830 .long .L_OP_IGET_WIDE_QUICK
   17831 .long .L_OP_IGET_OBJECT_QUICK
   17832 .long .L_OP_IPUT_QUICK
   17833 .long .L_OP_IPUT_WIDE_QUICK
   17834 .long .L_OP_IPUT_OBJECT_QUICK
   17835 .long .L_OP_INVOKE_VIRTUAL_QUICK
   17836 .long .L_OP_INVOKE_VIRTUAL_QUICK_RANGE
   17837 .long .L_OP_INVOKE_SUPER_QUICK
   17838 .long .L_OP_INVOKE_SUPER_QUICK_RANGE
   17839 .long .L_OP_IPUT_OBJECT_VOLATILE
   17840 .long .L_OP_SGET_OBJECT_VOLATILE
   17841 .long .L_OP_SPUT_OBJECT_VOLATILE
   17842 .long .L_OP_UNUSED_FF
   17843 
   17844 /* File: x86-atom/footer.S */
   17845    /* Copyright (C) 2008 The Android Open Source Project
   17846     *
   17847     * Licensed under the Apache License, Version 2.0 (the "License");
   17848     * you may not use this file except in compliance with the License.
   17849     * You may obtain a copy of the License at
   17850     *
   17851     * http://www.apache.org/licenses/LICENSE-2.0
   17852     *
   17853     * Unless required by applicable law or agreed to in writing, software
   17854     * distributed under the License is distributed on an "AS IS" BASIS,
   17855     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   17856     * See the License for the specific language governing permissions and
   17857     * limitations under the License.
   17858     */
   17859 
   17860    /*
   17861     * File: footer.S
   17862     */
   17863 
   17864     .text
   17865     .align      2
   17866 
   17867    /*
   17868     * Check to see if the thread needs to be suspended or debugger/profiler
   17869     * activity has begun.
   17870     *
   17871     * On entry:
   17872     *  %ecx is reentry type, e.g. kInterpEntryInstr
   17873     *  %edx is PC adjustment in bytes
   17874     */
   17875 
   17876 common_periodicChecks:
   17877     movl        %edx, -8(%esp)          # save pc adjustments
   17878     movl        rGLUE, %edx             # %edx<- pMterpGlue
   17879     movl        %ebx, -4(%esp)          # save %ebx to the stack
   17880     movl        offGlue_pSelfSuspendCount(%edx), %ebx # %ebx<- pSuspendCount (int)
   17881 4:
   17882     movl        offGlue_pDebuggerActive(%edx), %eax # %eax<- pDebuggerActive
   17883     testl       %eax, %eax
   17884     je          5f
   17885     movzbl        (%eax), %eax            # %eax<- get debuggerActive (boolean)
   17886 5:
   17887     cmp         $0, (%ebx)             # check if suspend is pending
   17888     jne         2f                      # handle suspend
   17889     movl        offGlue_pActiveProfilers(%edx), %ebx # %ebx<- activeProfilers (int)
   17890     orl         (%ebx), %eax            # %eax<- merge activeProfilers and debuggerActive
   17891     movl        -8(%esp), %edx          # %edx<- restore %edx
   17892     jne         3f                      # debugger or profiler active; switch interp
   17893     movl        -4(%esp), %ebx          # %ebx<- restore %ebx
   17894     ret                                 # return
   17895 2:                                      # check suspended
   17896     EXPORT_PC
   17897     movl        offGlue_self(%edx), %eax # %eax<- glue->self
   17898     movl        %eax, -12(%esp)         # push parameter boolean
   17899     lea         -12(%esp), %esp
   17900     call        dvmCheckSuspendPending  # call: (Thread* self)
   17901                                         # return: bool
   17902     movl        4(%esp), %edx           # %edx<- restore %edx
   17903     movl        8(%esp), %ebx           # %ebx<- restore %ebx
   17904     lea         12(%esp), %esp
   17905     ret
   17906 3:                                      # debugger/profiler enabled, bail out
   17907     leal        (rPC, %edx, 2), rPC     # adjust pc to show target
   17908     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   17909     movb        $kInterpEntryInstr, offGlue_entryPoint(%ecx)
   17910     movl        $1, %edx               # switch interpreter
   17911     jmp         common_gotoBail         # bail
   17912 
   17913    /*
   17914     * Check to see if the thread needs to be suspended or debugger/profiler
   17915     * activity has begun. With this variant, the reentry type is hard coded
   17916     * as kInterpEntryInstr.
   17917     *
   17918     * On entry:
   17919     *  %edx is PC adjustment in bytes
   17920     */
   17921 
   17922 common_periodicChecks_backwardBranch:
   17923     EXPORT_PC
   17924     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   17925     movl        offGlue_pSelfSuspendCount(%ecx), rINST # %ebx<- pSuspendCount (int)
   17926 4:
   17927     movl        offGlue_pDebuggerActive(%ecx), %eax # %eax<- pDebuggerActive
   17928     testl       %eax, %eax              # test for NULL pointer
   17929     je          5f
   17930     movzbl      (%eax), %eax            # %eax<- get debuggerActive count
   17931 5:
   17932     cmp         $0, (rINST)            # check if suspend is pending
   17933     jne         2f                      # handle suspend
   17934     movl        offGlue_pActiveProfilers(%ecx), rINST # %edx<- activeProfilers (int)
   17935     orl          (rINST), %eax           # %eax<- merge activeProfilers and debuggerActive
   17936     jne         3f                      # debugger or profiler active; switch interp
   17937     FINISH_RB   %edx, %ecx              # jump to next instruction
   17938 2:                                      # check suspended
   17939     movl        offGlue_self(%ecx), %eax# %eax<- glue->self
   17940     movl        %edx, rINST
   17941     movl        %eax, -12(%esp)         # push parameter boolean
   17942     lea         -12(%esp), %esp
   17943     call        dvmCheckSuspendPending  # call: (Thread* self)
   17944                                         # return: bool
   17945     movl        rINST, %edx             # %edx<- restore %edx
   17946     lea         12(%esp), %esp
   17947     FINISH_RB   %edx, %ecx
   17948 3:                                      # debugger/profiler enabled, bail out
   17949     leal        (rPC, %edx, 2), rPC     # adjust pc to show target
   17950     movb        $kInterpEntryInstr, offGlue_entryPoint(%ecx)
   17951     movl        $1, %edx               # switch interpreter
   17952     jmp         common_gotoBail         # bail
   17953 
   17954    /*
   17955     * The equivalent of "goto bail", this calls through the "bail handler".
   17956     * State registers will be saved to the "glue" area before bailing.
   17957     *
   17958     * On entry:
   17959     *  %edx is "bool changeInterp", indicating if we want to switch to the
   17960     *     other interpreter or just bail all the way out
   17961     */
   17962 
   17963 common_gotoBail:
   17964     SAVE_PC_FP_TO_GLUE %ecx             # save program counter and frame pointer
   17965 
   17966    /*
   17967     * Inlined dvmMterpStdBail
   17968     */
   17969 
   17970     lea         40(%ebp), %esp
   17971     movl        %edx, %eax
   17972     movl        24(%ebp), %edi
   17973     movl        28(%ebp), %esi
   17974     movl        32(%ebp), %ebx
   17975     movl        36(%ebp), %ebp
   17976     ret
   17977 
   17978    /*
   17979     * Common code for method invocation with range.
   17980     *
   17981     * On entry:
   17982     *  %ecx is "Method* methodToCall", the method we're trying to call
   17983     */
   17984 
   17985 common_invokeMethodRange:
   17986 .LinvokeNewRange:
   17987 
   17988    /*
   17989     * prepare to copy args to "outs" area of current frame
   17990     */
   17991 
   17992     SAVEAREA_FROM_FP %eax               # %eax<- &outs; &StackSaveArea
   17993     test        rINST, rINST            # test for no args
   17994     movl        rINST, sReg0            # sReg0<- AA
   17995     jz          .LinvokeArgsDone        # no args; jump to args done
   17996     FETCH       2, %edx                 # %edx<- CCCC
   17997 
   17998    /*
   17999     * %ecx=methodToCall, %edx=CCCC, sReg0=count, %eax=&outs (&stackSaveArea)
   18000     * (very few methods have > 10 args; could unroll for common cases)
   18001     */
   18002 
   18003     movl        %ebx, sReg1             # sReg1<- save %ebx
   18004     lea         (rFP, %edx, 4), %edx    # %edx<- &vCCCC
   18005     shll        $2, sReg0              # sReg0<- offset
   18006     subl        sReg0, %eax             # %eax<- update &outs
   18007     shrl        $2, sReg0              # sReg0<- offset
   18008 1:
   18009     movl        (%edx), %ebx            # %ebx<- vCCCC
   18010     lea         4(%edx), %edx           # %edx<- &vCCCC++
   18011     subl        $1, sReg0              # sReg<- sReg--
   18012     movl        %ebx, (%eax)            # *outs<- vCCCC
   18013     lea         4(%eax), %eax           # outs++
   18014     jne         1b                      # loop if count (sReg0) not zero
   18015     movl        sReg1, %ebx             # %ebx<- restore %ebx
   18016     jmp         .LinvokeArgsDone        # continue
   18017 
   18018    /*
   18019     * %ecx is "Method* methodToCall", the method we're trying to call
   18020     * prepare to copy args to "outs" area of current frame
   18021     */
   18022 
   18023 common_invokeMethodNoRange:
   18024 .LinvokeNewNoRange:
   18025     movl        rINST, sReg0            # sReg0<- BA
   18026     shrl        $4, sReg0              # sReg0<- B
   18027     je          .LinvokeArgsDone        # no args; jump to args done
   18028     SAVEAREA_FROM_FP %eax               # %eax<- &outs; &StackSaveArea
   18029     FETCH       2, %edx                 # %edx<- GFED
   18030 
   18031    /*
   18032     * %ecx=methodToCall, %edx=GFED, sReg0=count, %eax=outs
   18033     */
   18034 
   18035 .LinvokeNonRange:
   18036     cmp         $2, sReg0              # compare sReg0 to 2
   18037     movl        %edx, sReg1             # sReg1<- GFED
   18038     jl          1f                      # handle 1 arg
   18039     je          2f                      # handle 2 args
   18040     cmp         $4, sReg0              # compare sReg0 to 4
   18041     jl          3f                      # handle 3 args
   18042     je          4f                      # handle 4 args
   18043 5:
   18044     andl        $15, rINST             # rINST<- A
   18045     lea         -4(%eax), %eax          # %eax<- update &outs; &outs--
   18046     movl        (rFP, rINST, 4), %edx   # %edx<- vA
   18047     movl        %edx, (%eax)            # *outs<- vA
   18048     movl        sReg1, %edx             # %edx<- GFED
   18049 4:
   18050     shr         $12, %edx              # %edx<- G
   18051     lea         -4(%eax), %eax          # %eax<- update &outs; &outs--
   18052     movl        (rFP, %edx, 4), %edx    # %edx<- vG
   18053     movl        %edx, (%eax)            # *outs<- vG
   18054     movl        sReg1, %edx             # %edx<- GFED
   18055 3:
   18056     and         $0x0f00, %edx          # %edx<- 0F00
   18057     shr         $6, %edx               # %edx<- F at correct offset
   18058     lea         -4(%eax), %eax          # %eax<- update &outs; &outs--
   18059     movl        (rFP, %edx), %edx       # %edx<- vF
   18060     movl        %edx, (%eax)            # *outs<- vF
   18061     movl        sReg1, %edx             # %edx<- GFED
   18062 2:
   18063     and         $0x00f0, %edx          # %edx<- 00E0
   18064     shr         $2, %edx               # %edx<- E at correct offset
   18065     lea         -4(%eax), %eax          # %eax<- update &outs; &outs--
   18066     movl        (rFP, %edx), %edx       # %edx<- vE
   18067     movl        %edx, (%eax)            # *outs<- vE
   18068     movl        sReg1, %edx             # %edx<- GFED
   18069 1:
   18070     and         $0x000f, %edx          # %edx<- 000D
   18071     movl        (rFP, %edx, 4), %edx    # %edx<- vD
   18072     movl        %edx, -4(%eax)          # *--outs<- vD
   18073 0:
   18074 
   18075    /*
   18076     * %ecx is "Method* methodToCall", the method we're trying to call
   18077     * find space for the new stack frame, check for overflow
   18078     */
   18079 
   18080 .LinvokeArgsDone:
   18081     movzwl      offMethod_registersSize(%ecx), %eax # %eax<- methodToCall->regsSize
   18082     movzwl      offMethod_outsSize(%ecx), %edx # %edx<- methodToCall->outsSize
   18083     movl        %ecx, sReg0             # sReg<- methodToCall
   18084     shl         $2, %eax               # %eax<- update offset
   18085     SAVEAREA_FROM_FP %ecx               # %ecx<- &outs; &StackSaveArea
   18086     subl        %eax, %ecx              # %ecx<- newFP; (old savearea - regsSize)
   18087     movl        rGLUE, %eax             # %eax<- pMterpGlue
   18088     movl        %ecx, sReg1             # sReg1<- &outs
   18089     subl        $sizeofStackSaveArea, %ecx # %ecx<- newSaveArea (stack save area using newFP)
   18090     movl        offGlue_interpStackEnd(%eax), %eax # %eax<- glue->interpStackEnd
   18091     movl        %eax, sReg2             # sReg2<- glue->interpStackEnd
   18092     shl         $2, %edx               # %edx<- update offset for outsSize
   18093     movl        %ecx, %eax              # %eax<- newSaveArea
   18094     sub         %edx, %ecx              # %ecx<- bottom; (newSaveArea - outsSize)
   18095     cmp         sReg2, %ecx             # compare interpStackEnd and bottom
   18096     movl        sReg0, %ecx             # %ecx<- restore methodToCall
   18097     jl          .LstackOverflow         # handle frame overflow
   18098 
   18099    /*
   18100     * set up newSaveArea
   18101     */
   18102 
   18103 #ifdef EASY_GDB
   18104     SAVEAREA_FROM_FP %edx               # %edx<- &outs; &StackSaveArea
   18105     movl        %edx, offStackSaveArea_prevSave(%eax) # newSaveArea->prevSave<- &outs
   18106 #endif
   18107     movl        rFP, offStackSaveArea_prevFrame(%eax) # newSaveArea->prevFrame<- rFP
   18108     movl        rPC, offStackSaveArea_savedPc(%eax) # newSaveArea->savedPc<- rPC
   18109     testl       $ACC_NATIVE, offMethod_accessFlags(%ecx) # check for native call
   18110     movl        %ecx, offStackSaveArea_method(%eax) # newSaveArea->method<- method to call
   18111     jne         .LinvokeNative          # handle native call
   18112 
   18113    /*
   18114     * Update "glue" values for the new method
   18115     * %ecx=methodToCall, sReg1=newFp
   18116     */
   18117 
   18118     movl        offMethod_clazz(%ecx), %edx # %edx<- method->clazz
   18119     movl        rGLUE, %eax             # %eax<- pMterpGlue
   18120     movl        %ecx, offGlue_method(%eax) # glue->method<- methodToCall
   18121     movl        offClassObject_pDvmDex(%edx), %edx # %edx<- method->clazz->pDvmDex
   18122     movl        offMethod_insns(%ecx), rPC # rPC<- methodToCall->insns
   18123     movl        %edx, offGlue_methodClassDex(%eax) # glue->methodClassDex<- method->clazz->pDvmDex
   18124     movl        offGlue_self(%eax), %ecx # %ecx<- glue->self
   18125     movl        sReg1, rFP              # rFP<- newFP
   18126     movl        rFP, offThread_curFrame(%ecx) # glue->self->curFrame<- newFP
   18127     FINISH_A                            # jump to methodToCall->insns
   18128 
   18129    /*
   18130     * Prep for the native call
   18131     * %ecx=methodToCall, sReg1=newFP, %eax=newSaveArea
   18132     */
   18133 
   18134 .LinvokeNative:
   18135     movl        rGLUE, %edx             # %edx<- pMterpGlue
   18136     movl        %ecx, -20(%esp)         # push parameter methodToCall
   18137     movl        offGlue_self(%edx), %edx # %edx<- glue->self
   18138     movl        offThread_jniLocal_topCookie(%edx), %ecx # %ecx<- glue->self->thread->refNext
   18139     movl        %ecx, offStackSaveArea_localRefCookie(%eax) # newSaveArea->localRefCookie<- refNext
   18140     movl        %eax, -4(%esp)          # save newSaveArea
   18141     movl        sReg1, %eax             # %eax<- newFP
   18142     movl        %eax, offThread_curFrame(%edx) # glue->self->curFrame<- newFP
   18143     movl        %edx, -8(%esp)          # save glue->self
   18144     movl        %edx, -16(%esp)         # push parameter glue->self
   18145     movl        rGLUE, %edx             # %edx<- pMterpGlue
   18146     movl        -20(%esp), %ecx         # %ecx<- methodToCall
   18147     lea         offGlue_retval(%edx), %edx # %edx<- &retval
   18148     movl        %edx, -24(%esp)         # push parameter pMterpGlue
   18149     movl        %eax, -28(%esp)         # push parameter newFP
   18150     lea         -28(%esp), %esp
   18151 
   18152 #ifdef ASSIST_DEBUGGER
   18153     jmp         .Lskip
   18154     .type       dalvik_mterp, %function
   18155 dalvik_mterp:
   18156     MTERP_ENTRY
   18157 .Lskip:
   18158 #endif
   18159     call        *offMethod_nativeFunc(%ecx) # call methodToCall->nativeFunc
   18160     lea         28(%esp), %esp
   18161     movl        -4(%esp), %edx          # %edx<- newSaveArea
   18162     movl        -8(%esp), %ecx          # %ecx<- glue->self
   18163     movl        offStackSaveArea_localRefCookie(%edx), %eax  # %eax<- newSaveArea->localRefCookie
   18164     FFETCH_ADV  3, %edx                 # %edx<- next instruction hi; fetch, advance
   18165     cmp         $0, offThread_exception(%ecx) # check for exception
   18166     movl        rFP, offThread_curFrame(%ecx) # glue->self->curFrame<- rFP
   18167     movl        %eax, offThread_jniLocal_topCookie(%ecx) # glue->self<- newSaveArea->localRefCookie
   18168     jne         common_exceptionThrown  # handle exception
   18169     FGETOP_JMP  3, %edx                 # jump to next instruction; getop, jmp
   18170 
   18171 .LstackOverflow:
   18172     movl        %ecx, -4(%esp)          # push method to call
   18173     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   18174     movl        offGlue_self(%ecx), %ecx # %ecx<- glue->self
   18175     movl        %ecx, -8(%esp)          # push parameter self
   18176     lea         -8(%esp), %esp
   18177     call        dvmHandleStackOverflow  # call: (Thread* self, Method *meth)
   18178                                         # return: void
   18179     lea         8(%esp), %esp
   18180     jmp         common_exceptionThrown  # handle exception
   18181 #ifdef ASSIST_DEBUGGER
   18182 #endif
   18183 
   18184    /*
   18185     * Common code for handling a return instruction.
   18186     *
   18187     * This does not return.
   18188     */
   18189 
   18190 common_returnFromMethod:
   18191 .LreturnNew:
   18192 
   18193    /*
   18194     * Inline common periodic checks
   18195     */
   18196 
   18197     movl        rGLUE, rINST            # %ecx<- pMterpGlue
   18198     movl        offGlue_pSelfSuspendCount(rINST), %edx # %ebx<- pSuspendCount (int)
   18199     movl        offGlue_pDebuggerActive(rINST), %eax # %eax<- pDebuggerActive
   18200     movl        (%eax), %eax            # %eax<- get debuggerActive (boolean)
   18201     and         $7, %eax               # %eax<- mask for boolean (just how many bits does it take?)
   18202     cmp         $0, (%edx)             # check if suspend is pending
   18203     jne         2f                      # handle suspend
   18204     movl        offGlue_pActiveProfilers(rINST), %edx # %edx<- activeProfilers (int)
   18205     or          (%edx), %eax            # %eax<- merge activeProfilers and debuggerActive
   18206     cmp         $0, %eax               # check for debuggerActive
   18207     jne         3f                      # debugger or profiler active; switch interp
   18208     jmp         4f
   18209 2:                                      # check suspended
   18210     movl        offGlue_self(rINST), %eax# %eax<- glue->self
   18211     movl        %eax, -12(%esp)         # push parameter boolean
   18212     lea         -12(%esp), %esp
   18213     call        dvmCheckSuspendPending  # call: (Thread* self)
   18214                                         # return: bool
   18215     lea         12(%esp), %esp
   18216     jmp         4f
   18217 3:                                      # debugger/profiler enabled, bail out
   18218     movl        $kInterpEntryInstr, offGlue_entryPoint(rINST) # glue->entryPoint<- reentry type
   18219     movl        $1, %edx               # switch to interp<- true
   18220     jmp         common_gotoBail         # bail
   18221 
   18222 
   18223    /*
   18224     * Get save area; rGLUE is %ebx, rFP is %eax
   18225     */
   18226 4:
   18227     SAVEAREA_FROM_FP %ecx               # %ecx<- saveArea(old)
   18228     movl        offStackSaveArea_prevFrame(%ecx), rFP # rFP<- saveArea->PrevFrame
   18229     movl        (offStackSaveArea_method - sizeofStackSaveArea)(rFP), %edx # %edx<- method we are returning to
   18230     cmpl        $0, %edx               # check for break frame
   18231     je          common_gotoBail         # bail if break frame
   18232     movl        offStackSaveArea_savedPc(%ecx), rPC # rPC<- saveAreaOld->savedPc
   18233     movl        offGlue_self(rINST), %ecx # %eax<- glue->self
   18234     movl        %edx, offGlue_method(rINST) # glue->method<- newSave->method
   18235     movl        offMethod_clazz(%edx), %edx # %edx<- method->clazz
   18236     FFETCH_ADV  3, %eax                 # %ecx<- next instruction hi; fetch, advance
   18237     movl        rFP, offThread_curFrame(%ecx) # glue->self->curFrame<- rFP
   18238     movl        offClassObject_pDvmDex(%edx), %edx # %edx<- method->clazz->pDvmDex
   18239     movl        %edx, offGlue_methodClassDex(rINST) # glue->pDvmDex<- method->clazz->pDvmDex
   18240     FGETOP_JMP  3, %eax                 # jump to next instruction; getop, jmp
   18241 
   18242    /*
   18243     * Handle thrown an exception. If the exception processing code
   18244     * returns to us (instead of falling out of the interpreter),
   18245     * continue with whatever the next instruction now happens to be.
   18246     * This does not return.
   18247     */
   18248 
   18249 common_exceptionThrown:
   18250 .LexceptionNew:
   18251     movl        $kInterpEntryThrow, %ecx # %ecx<- reentry type
   18252     movl        $0, %edx               # %edx<- pc adjustment
   18253     call        common_periodicChecks
   18254     movl        rGLUE, %eax             # %eax<- pMterpGlue
   18255     movl        offGlue_self(%eax), %edx # %edx<- glue->self
   18256     movl        offThread_exception(%edx), %ecx # %ecx<- pMterpGlue->self->exception
   18257     movl        %edx, -4(%esp)          # push parameter self
   18258     movl        %ecx, -8(%esp)          # push parameter obj
   18259     lea         -8(%esp), %esp
   18260     call        dvmAddTrackedAlloc      # don't allow the exception to be GC'd
   18261                                         # call: (Object* obj, Thread* self)
   18262                                         # return: void
   18263     movl        4(%esp), %edx           # %edx<- glue->self
   18264     movl        $0, offThread_exception(%edx) # glue->self->exception<- NULL
   18265 
   18266    /*
   18267     * set up args and a local for &fp
   18268     */
   18269 
   18270     movl        rFP, -4(%esp)           # move fp to stack
   18271     lea         -4(%esp), %esp          # update %esp
   18272     movl        %esp, -4(%esp)          # push parameter 4<- &fp
   18273     movl        $0, -8(%esp)           # push parameter 3<- false
   18274     movl        4(%esp), %edx
   18275     movl        %edx, -12(%esp)         # push parameter 2<- glue->self->exception
   18276     movl        rGLUE, %eax             # %eax<- pMterpGlue
   18277     movl        offGlue_method(%eax), %edx # %edx<- glue->method
   18278     movl        offMethod_insns(%edx), %edx # %edx<- glue->method->insns
   18279     movl        rPC, %ecx               # %ecx<- rPC
   18280     subl        %edx, %ecx              # %ecx<- pc - glue->method->insns
   18281     sar         $1, %ecx               # %ecx<- adjust %ecx for offset
   18282     movl        %ecx, -16(%esp)         # push parameter 1<- glue->method->insns
   18283     movl        8(%esp), %edx
   18284     movl        %edx, -20(%esp)         # push parameter 0<- glue->self
   18285     lea         -20(%esp), %esp
   18286 
   18287    /*
   18288     * call dvmFindCatchBlock, %eax gets catchRelPc (a code-unit offset)
   18289     */
   18290 
   18291     call        dvmFindCatchBlock       # call: (Thread* self, int relPc, Object* exception,
   18292                                         #      bool doUnroll, void** newFrame)
   18293                                         # return: int
   18294     lea         32(%esp), %esp
   18295     movl        -12(%esp), rFP          # rFP<- updated rFP
   18296     cmp         $0, %eax               # check for catchRelPc < 0
   18297     jl          .LnotCaughtLocally      # handle not caught locally
   18298 
   18299    /*
   18300     * fix stack overflow if necessary
   18301     */
   18302 
   18303     movl        -4(%esp), %ecx          # %ecx<- glue->self
   18304     cmp         $0, offThread_stackOverflowed(%ecx)
   18305     je          1f
   18306     movl        %eax, -4(%esp)          # save %eax for later
   18307     movl        %ecx, -12(%esp)         # push parameter 2 glue->self
   18308     lea         -12(%esp), %esp
   18309     call        dvmCleanupStackOverflow # call: (Thread* self, Object* exception)
   18310                                         # return: void
   18311     lea         12(%esp), %esp
   18312     movl        -4(%esp), %eax          # %eax<- restore %eax
   18313     jmp         2f
   18314 1:
   18315     movl        %ecx, -12(%esp)         # push parameter 2 glue->self
   18316 2:
   18317 
   18318    /*
   18319     * adjust locals to match self->curFrame and updated PC
   18320     *
   18321     */
   18322 
   18323     SAVEAREA_FROM_FP %edx               # %edx<- get newSaveArea
   18324     movl        rGLUE, %ecx             # %ecx<- pMterpGlue
   18325     movl        offStackSaveArea_method(%edx), rPC # rPC<- newMethod
   18326     movl        rPC, offGlue_method(%ecx) # glue->method<- newMethod
   18327     movl        offMethod_clazz(rPC), %edx # %edx<- method->clazz
   18328     movl        offMethod_insns(rPC), rPC # rPC<- method->insns
   18329     movl        offClassObject_pDvmDex(%edx), %edx # %edx<- method->clazz->pDvmDex
   18330     lea         (rPC, %eax, 2), rPC     # rPC<- method->insns + catchRelPc
   18331     movl        %edx, offGlue_methodClassDex(%ecx) # glue->pDvmDex<- method->clazz->pDvmDex
   18332     movl        -8(%esp), %eax
   18333     movl        %eax, -16(%esp)         # push parameter 1 obj
   18334     lea         -16(%esp), %esp
   18335     call        dvmReleaseTrackedAlloc  # call: (Object* obj, Thread* self)
   18336                                         # return: void
   18337     lea         16(%esp), %esp
   18338     FINISH_FETCH %eax
   18339     cmp         $OP_MOVE_EXCEPTION, %eax # is it a move exception
   18340     jne         1f
   18341     movl        -12(%esp), %edx         # %edx<- glue->self
   18342     movl        -8(%esp), %ecx          # %ecx<- exception
   18343     movl        %ecx, offThread_exception(%edx) # restore the exception
   18344 1:
   18345     FINISH_JMP  %eax
   18346 
   18347    /*
   18348     * -8(%esp) = exception, -4(%esp) = self
   18349     */
   18350 
   18351 .LnotCaughtLocally:
   18352     movl        -4(%esp), %edx          # %edx<- glue->self
   18353     movzb       offThread_stackOverflowed(%edx), %eax # %eax<- self->stackOverflowed
   18354     cmp         $0, %eax               # check for stack overflow;
   18355                                         # maybe should use cmpb
   18356     je          1f                      #
   18357     movl        %edx, -12(%esp)         # push parameter 1 glue->self
   18358     lea         -12(%esp), %esp
   18359     call        dvmCleanupStackOverflow # call: (Thread* self, Object* exception)
   18360                                         # return: void
   18361     lea         12(%esp), %esp
   18362 
   18363    /*
   18364     * Release the exception
   18365     * -8(%esp) = exception, -4(%esp) = self
   18366     */
   18367 1:
   18368     movl        -8(%esp), %ecx          # %ecx<- exception
   18369     movl        -4(%esp), %edx          # %edx<- glue->self
   18370     movl        %ecx, offThread_exception(%edx) # glue->self<- exception
   18371     lea         -8(%esp), %esp
   18372     call        dvmReleaseTrackedAlloc  # call: (Object* obj, Thread* self)
   18373                                         # return: void
   18374     lea         8(%esp), %esp
   18375     movl        $0, %edx               # switch to interp<- false
   18376     jmp         common_gotoBail         # bail
   18377 
   18378    /*
   18379     * After returning from a "glued" function, pull out the updated
   18380     * values and start executing at the next instruction.
   18381     */
   18382 
   18383 common_resumeAfterGlueCall:
   18384     LOAD_PC_FP_FROM_GLUE                # pull rPC and rFP out of glue
   18385     FINISH_A                            # jump to next instruction
   18386 
   18387    /*
   18388     * For debugging, cause an immediate fault.
   18389     */
   18390 
   18391 common_abort:
   18392     jmp         .LdeadFood
   18393 
   18394 .LdeadFood:
   18395 .int 0xdeadf00d
   18396 
   18397    /*
   18398     * Invalid array index.
   18399     */
   18400 
   18401 common_errArrayIndex:
   18402     EXPORT_PC
   18403     movl        $.LstrArrayIndexException, -8(%esp) # push parameter description
   18404     movl        $0, -4(%esp)           # push parameter msg paramter
   18405     lea         -8(%esp), %esp
   18406     call        dvmThrowException       # call: (const char* exceptionDescriptor, const char* msg)
   18407                                         # return: void
   18408     lea         8(%esp), %esp
   18409     jmp         common_exceptionThrown  # handle exception
   18410 
   18411    /*
   18412     * Invalid array value.
   18413     */
   18414 
   18415 common_errArrayStore:
   18416     EXPORT_PC
   18417     movl        $.LstrArrayStoreException, -8(%esp) # push parameter description
   18418     movl        $0, -4(%esp)           # push parameter msg paramter
   18419     lea         -8(%esp), %esp
   18420     call        dvmThrowException       # call: (const char* exceptionDescriptor, const char* msg)
   18421                                         # return: void
   18422     lea         8(%esp), %esp
   18423     jmp         common_exceptionThrown  # handle exception
   18424 
   18425    /*
   18426     * Integer divide or mod by zero.
   18427     */
   18428 
   18429 common_errDivideByZero:
   18430     EXPORT_PC
   18431     movl        $.LstrArithmeticException, -8(%esp) # push parameter description
   18432     movl        $.LstrDivideByZero, -4(%esp) # push parameter msg paramter
   18433     lea         -8(%esp), %esp
   18434     call        dvmThrowException       # call: (const char* exceptionDescriptor, const char* msg)
   18435                                         # return: void
   18436     lea         8(%esp), %esp
   18437     jmp         common_exceptionThrown  # handle exception
   18438 
   18439    /*
   18440     * Attempt to allocate an array with a negative size.
   18441     */
   18442 
   18443 common_errNegativeArraySize:
   18444     EXPORT_PC
   18445     movl        $.LstrNegativeArraySizeException, -8(%esp) # push parameter description
   18446     movl        $0, -4(%esp)           # push parameter msg paramter
   18447     lea         -8(%esp), %esp
   18448     call        dvmThrowException       # call: (const char* exceptionDescriptor, const char* msg)
   18449                                         # return: void
   18450     lea         8(%esp), %esp
   18451     jmp         common_exceptionThrown  # handle exception
   18452 
   18453    /*
   18454     * Invocation of a non-existent method.
   18455     */
   18456 
   18457 common_errNoSuchMethod:
   18458     EXPORT_PC
   18459     movl        $.LstrNoSuchMethodError, -8(%esp) # push parameter description
   18460     movl        $0, -4(%esp)           # push parameter msg paramter
   18461     lea         -8(%esp), %esp
   18462     call        dvmThrowException       # call: (const char* exceptionDescriptor, const char* msg)
   18463                                         # return: void
   18464     lea         8(%esp), %esp
   18465     jmp         common_exceptionThrown  # handle exception
   18466 
   18467    /*
   18468     * Unexpected null object.
   18469     */
   18470 
   18471 common_errNullObject:
   18472     EXPORT_PC
   18473     movl        $.LstrNullPointerException, -8(%esp) # push parameter description
   18474     movl        $0, -4(%esp)           # push parameter msg paramter
   18475     lea         -8(%esp), %esp
   18476     call        dvmThrowException       # call: (const char* exceptionDescriptor, const char* msg)
   18477                                         # return: void
   18478     lea         8(%esp), %esp
   18479     jmp         common_exceptionThrown  # handle exception
   18480 
   18481    /*
   18482     * String references
   18483     */
   18484 
   18485     .align 4
   18486     .section .rodata
   18487 .LstrArithmeticException:
   18488     .asciz "Ljava/lang/ArithmeticException;"
   18489 .LstrArrayIndexException:
   18490     .asciz "Ljava/lang/ArrayIndexOutOfBoundsException;"
   18491 .LstrArrayStoreException:
   18492     .asciz "Ljava/lang/ArrayStoreException;"
   18493 .LstrDivideByZero:
   18494     .asciz "divide by zero"
   18495 .LstrInstantiationError:
   18496     .asciz "Ljava/lang/InstantiationError;"
   18497 .LstrNegativeArraySizeException:
   18498     .asciz "Ljava/lang/NegativeArraySizeException;"
   18499 .LstrNoSuchMethodError:
   18500     .asciz "Ljava/lang/NoSuchMethodError;"
   18501 .LstrNullPointerException:
   18502     .asciz "Ljava/lang/NullPointerException;"
   18503 .LstrExceptionNotCaughtLocally:
   18504     .asciz "Exception %s from %s:%d not caught locally\n"
   18505 
   18506