2 * This file was generated automatically by gen-mterp.py for 'x86-atom'.
7 /* File: x86-atom/header.S */
8 /* Copyright (C) 2008 The Android Open Source Project
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
14 * http://www.apache.org/licenses/LICENSE-2.0
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.
28 * IA32 calling convention and general notes:
30 * EAX, ECX, EDX - general purpose scratch registers (caller-saved);
32 * The stack (%esp) - used to pass arguments to functions
34 * EAX - holds the first 4 bytes of a return
35 * EDX - holds the second 4 bytes of a return
37 * EBX, ESI, EDI, EBP - are callee saved
39 * CS, DS, SS - are segment registers
40 * ES, FS, GS - are segment registers. We will try to avoid using these registers
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).
47 * Mterp and IA32 notes
50 * (%ebp) rGLUE InterpState base pointer (A.K.A. MterpGlue Pointer)
51 * %esi rPC interpreted program counter, used for fetching
53 * %ebx rINST first 16-bit code unit of current instruction
54 * %edi rFP interpreted frame pointer, used for accessing
62 #include "../common/asm-constants.h"
77 * Temporary register used when finishing an opcode
83 * Stack locations used for temporary data. For convenience.
88 #define sReg2 12(%ebp)
89 #define sReg3 16(%ebp)
92 * Save the PC and FP to the glue struct
95 .macro SAVE_PC_FP_TO_GLUE _reg
97 movl rPC, offGlue_pc(\_reg)
98 movl rFP, offGlue_fp(\_reg)
102 * Restore the PC and FP from the glue struct
105 .macro LOAD_PC_FP_FROM_GLUE
107 movl offGlue_pc(rFP), rPC
108 movl offGlue_fp(rFP), rFP
112 * "Export" the PC to the stack frame, f/b/o future exception objects. This must
113 * be done *before* something calls dvmThrowException.
115 * In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
116 * fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
118 * It's okay to do this more than once.
122 movl rPC, (-sizeofStackSaveArea + offStackSaveArea_currentPc)(rFP)
126 * Given a frame pointer, find the stack save area.
127 * In C this is "((StackSaveArea*)(_fp) -1)".
130 .macro SAVEAREA_FROM_FP _reg
131 lea -sizeofStackSaveArea(rFP), \_reg
135 * Get the 32-bit value from a dalvik register.
138 .macro GET_VREG _vreg
139 movl (rFP,\_vreg, 4), \_vreg
143 * Set the 32-bit value from a dalvik register.
146 .macro SET_VREG _reg _vreg
147 movl \_reg, (rFP,\_vreg, 4)
151 * Fetch the next instruction from rPC into rINST. Does not advance rPC.
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.
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
167 .macro FETCH_ADVANCE_INST _count
168 add $(\_count*2), rPC
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.
178 .macro FETCH_ADVANCE_INST_RB _reg
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
190 .macro FETCH _count _reg
191 movzwl (\_count*2)(rPC), \_reg
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.
200 .macro FETCHs _count _reg
201 movswl (\_count*2)(rPC), \_reg
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
211 .macro FETCH_BB _count _reg
212 movzbl (\_count*2)(rPC), \_reg
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
222 .macro FETCH_CC _count _reg
223 movzbl (\_count*2 + 1)(rPC), \_reg
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.
232 .macro FETCH_CCs _count _reg
233 movsbl (\_count*2 + 1)(rPC), \_reg
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).
243 .macro FETCH_B _reg _count _byte
244 movzbl (\_count*2+\_byte)(rPC), \_reg
248 * Put the instruction's opcode field into the specified register.
251 .macro GET_INST_OPCODE _reg
252 movzbl rINSTbl, \_reg
256 * Begin executing the opcode in _reg.
259 .macro GOTO_OPCODE _reg
261 addl $dvmAsmInstructionStart,\_reg
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
273 .macro FFETCH _rFinish
274 movzbl (rPC), \_rFinish
277 .macro FGETOP_JMPa _rFinish
279 jmp *dvmAsmInstructionJmpTable(,\_rFinish, 4)
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
288 .macro FFETCH_ADV _count _rFinish
289 movzbl (\_count*2)(rPC), \_rFinish
292 .macro FGETOP_JMP _count _rFinish
293 movzbl (\_count*2 + 1)(rPC), rINST
294 addl $(\_count*2), rPC
295 jmp *dvmAsmInstructionJmpTable(,\_rFinish, 4)
298 .macro FGETOP_JMP2 _rFinish
300 jmp *dvmAsmInstructionJmpTable(,\_rFinish, 4)
303 .macro OLD_JMP_1 _count _rFinish
304 movzbl (\_count*2)(rPC), \_rFinish
308 .macro OLD_JMP_2 _rFinish
309 addl $dvmAsmInstructionStart,\_rFinish
312 .macro OLD_JMP_3 _count
313 addl $(\_count*2), rPC
316 .macro OLD_JMP_4 _rFinish
321 .macro OLD_JMP_A_1 _reg _rFinish
322 movzbl (rPC, \_reg), \_rFinish
326 .macro OLD_JMP_A_2 _rFinish
327 addl $dvmAsmInstructionStart,\_rFinish
330 .macro OLD_JMP_A_3 _reg _rFinish
332 movzbl 1(rPC, \_reg), rINST
337 * Macro pair attempts to speed up FETCH_INST, GET_INST_OPCODE and GOTO_OPCODE
338 * by using a jump table. _rFinish and _reg should must be the same register for
342 .macro FFETCH_ADV_RB _reg _rFinish
343 movzbl (\_reg, rPC), \_rFinish
346 .macro FGETOP_RB_JMP _reg _rFinish
347 movzbl 1(\_reg, rPC), rINST
349 jmp *dvmAsmInstructionJmpTable(,\_rFinish, 4)
353 * Attempts to speed up FETCH_INST, GET_INST_OPCODE using
354 * a jump table. This macro should be called before FINISH_JMP where
355 * rFinish should be the same register containing the opcode value.
356 * This is an attempt to split up FINISH in order to reduce or remove
357 * potential stalls due to the wait for rFINISH.
360 .macro FINISH_FETCH _rFinish
361 movzbl (rPC), \_rFinish
367 * Attempts to speed up FETCH_ADVANCE_INST, GET_INST_OPCODE using
368 * a jump table. This macro should be called before FINISH_JMP where
369 * rFinish should be the same register containing the opcode value.
370 * This is an attempt to split up FINISH in order to reduce or remove
371 * potential stalls due to the wait for rFINISH.
374 .macro FINISH_FETCH_ADVANCE _count _rFinish
375 movzbl (\_count*2)(rPC), \_rFinish
376 movzbl (\_count*2 + 1)(rPC), rINST
377 addl $(\_count*2), rPC
381 * Attempts to speed up FETCH_ADVANCE_INST_RB, GET_INST_OPCODE using
382 * a jump table. This macro should be called before FINISH_JMP where
383 * rFinish should be the same register containing the opcode value.
384 * This is an attempt to split up FINISH in order to reduce or remove
385 * potential stalls due to the wait for rFINISH.
388 .macro FINISH_FETCH_ADVANCE_RB _reg _rFinish
389 movzbl (\_reg, rPC), \_rFinish
390 movzbl 1(\_reg, rPC), rINST
395 * Attempts to speed up GOTO_OPCODE using a jump table. This macro should
396 * be called after a FINISH_FETCH* instruction where rFinish should be the
397 * same register containing the opcode value. This is an attempt to split up
398 * FINISH in order to reduce or remove potential stalls due to the wait for rFINISH.
401 .macro FINISH_JMP _rFinish
402 jmp *dvmAsmInstructionJmpTable(,\_rFinish, 4)
406 * Attempts to speed up FETCH_INST, GET_INST_OPCODE, GOTO_OPCODE by using
407 * a jump table. Uses a single macro - but it should be faster if we
408 * split up the fetch for rFinish and the jump using rFinish.
412 movzbl (rPC), rFinish
414 jmp *dvmAsmInstructionJmpTable(,rFinish, 4)
418 * Attempts to speed up FETCH_ADVANCE_INST, GET_INST_OPCODE,
419 * GOTO_OPCODE by using a jump table. Uses a single macro -
420 * but it should be faster if we split up the fetch for rFinish
421 * and the jump using rFinish.
425 movzbl (\_count*2)(rPC), rFinish
426 movzbl (\_count*2 + 1)(rPC), rINST
427 addl $(\_count*2), rPC
428 jmp *dvmAsmInstructionJmpTable(,rFinish, 4)
432 * Attempts to speed up FETCH_ADVANCE_INST_RB, GET_INST_OPCODE,
433 * GOTO_OPCODE by using a jump table. Uses a single macro -
434 * but it should be faster if we split up the fetch for rFinish
435 * and the jump using rFinish.
438 .macro FINISH_RB _reg _rFinish
439 movzbl (\_reg, rPC), \_rFinish
440 movzbl 1(\_reg, rPC), rINST
442 jmp *dvmAsmInstructionJmpTable(,\_rFinish, 4)
446 * Hard coded helper values.
452 .quad 0x8000000000000000
455 .quad 0xFFFFFFFFFFFFFFFF
458 .quad 0x0000000000000000
460 .quad 0x000000000000003F
463 .quad 0x0000000000000040
466 .quad 0x7FFFFFFFFFFFFFFF
469 .quad 0x8000000000000000
472 .quad 0x0000000000000000
481 .global dvmAsmInstructionStart
482 .type dvmAsmInstructionStart, %function
483 dvmAsmInstructionStart = .L_OP_NOP
486 /* ------------------------------ */
488 .L_OP_NOP: /* 0x00 */
489 /* File: x86-atom/OP_NOP.S */
490 /* Copyright (C) 2008 The Android Open Source Project
492 * Licensed under the Apache License, Version 2.0 (the "License");
493 * you may not use this file except in compliance with the License.
494 * You may obtain a copy of the License at
496 * http://www.apache.org/licenses/LICENSE-2.0
498 * Unless required by applicable law or agreed to in writing, software
499 * distributed under the License is distributed on an "AS IS" BASIS,
500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
501 * See the License for the specific language governing permissions and
502 * limitations under the License.
508 * Code: Use a cycle. Uses no substitutions.
512 * Description: No operation. Use a cycle
514 * Format: ØØ|op (10x)
519 FINISH 1 # jump to next instruction
521 #ifdef ASSIST_DEBUGGER
524 * insert fake function header to help gdb find the stack frame
527 .type dalvik_inst, %function
532 /* ------------------------------ */
534 .L_OP_MOVE: /* 0x01 */
535 /* File: x86-atom/OP_MOVE.S */
536 /* Copyright (C) 2008 The Android Open Source Project
538 * Licensed under the Apache License, Version 2.0 (the "License");
539 * you may not use this file except in compliance with the License.
540 * You may obtain a copy of the License at
542 * http://www.apache.org/licenses/LICENSE-2.0
544 * Unless required by applicable law or agreed to in writing, software
545 * distributed under the License is distributed on an "AS IS" BASIS,
546 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
547 * See the License for the specific language governing permissions and
548 * limitations under the License.
554 * Code: Copies contents from one register to another. Uses no
557 * For: move, move-object, long-to-int
559 * Description: Copies contents from one non-object register to another.
560 * vA<- vB; fp[A]<- fp[B]
562 * Format: B|A|op (12x)
567 movl rINST, %ecx # %ecx<- BA
568 shr $4, rINST # rINST<- B
569 and $15, %ecx # %ecx<- A
570 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
571 GET_VREG rINST # rINST<- vB
572 SET_VREG rINST, %ecx # vA<- vB; %edx
573 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
574 /* ------------------------------ */
576 .L_OP_MOVE_FROM16: /* 0x02 */
577 /* File: x86-atom/OP_MOVE_FROM16.S */
578 /* Copyright (C) 2008 The Android Open Source Project
580 * Licensed under the Apache License, Version 2.0 (the "License");
581 * you may not use this file except in compliance with the License.
582 * You may obtain a copy of the License at
584 * http://www.apache.org/licenses/LICENSE-2.0
586 * Unless required by applicable law or agreed to in writing, software
587 * distributed under the License is distributed on an "AS IS" BASIS,
588 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
589 * See the License for the specific language governing permissions and
590 * limitations under the License.
594 * File: OP_MOVE_FROM16.S
596 * Code: Copies contents from one register to another
598 * For: move/from16, move-object/from16
600 * Description: Copies contents from one non-object register to another.
601 * vA<- vB; fp[A]<- fp[B]
603 * Format: AA|op BBBB (22x)
605 * Syntax: op vAA, vBBBB
608 FETCH 1, %edx # %edx<- BBBB
609 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
610 GET_VREG %edx # %edx<- vB
611 SET_VREG %edx, rINST # vA<- vB; %edx
612 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
614 /* ------------------------------ */
616 .L_OP_MOVE_16: /* 0x03 */
617 /* File: x86-atom/OP_MOVE_16.S */
618 /* Copyright (C) 2008 The Android Open Source Project
620 * Licensed under the Apache License, Version 2.0 (the "License");
621 * you may not use this file except in compliance with the License.
622 * You may obtain a copy of the License at
624 * http://www.apache.org/licenses/LICENSE-2.0
626 * Unless required by applicable law or agreed to in writing, software
627 * distributed under the License is distributed on an "AS IS" BASIS,
628 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
629 * See the License for the specific language governing permissions and
630 * limitations under the License.
636 * Code: Copies contents from one register to another
638 * For: move/16, move-object/16
640 * Description: Copies contents from one non-object register to another.
643 * Format: ØØ|op AAAA BBBB (32x)
645 * Syntax: op vAAAA, vBBBB
648 FETCH 2, %edx # %edx<- BBBB
649 FETCH 1, %ecx # %ecx<- AAAA
650 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
651 GET_VREG %edx # %edx<- vB
652 SET_VREG %edx, %ecx # vA<- vB; %edx
653 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
655 /* ------------------------------ */
657 .L_OP_MOVE_WIDE: /* 0x04 */
658 /* File: x86-atom/OP_MOVE_WIDE.S */
659 /* Copyright (C) 2008 The Android Open Source Project
661 * Licensed under the Apache License, Version 2.0 (the "License");
662 * you may not use this file except in compliance with the License.
663 * You may obtain a copy of the License at
665 * http://www.apache.org/licenses/LICENSE-2.0
667 * Unless required by applicable law or agreed to in writing, software
668 * distributed under the License is distributed on an "AS IS" BASIS,
669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
670 * See the License for the specific language governing permissions and
671 * limitations under the License.
675 * File: OP_MOVE_WIDE.S
677 * Code: Copies contents from one register to another. Uses no
682 * Description: Copies contents from one non-object register to another.
684 * Format: B|A|op (12x)
689 movl rINST, %edx # %edx<- BA+
690 shr $4, %edx # %edx<- B
691 and $15, rINST # rINST<- A
692 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
693 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vB
694 movq %xmm0, (rFP, rINST, 4) # vA<- vB
695 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
696 /* ------------------------------ */
698 .L_OP_MOVE_WIDE_FROM16: /* 0x05 */
699 /* File: x86-atom/OP_MOVE_WIDE_FROM16.S */
700 /* Copyright (C) 2008 The Android Open Source Project
702 * Licensed under the Apache License, Version 2.0 (the "License");
703 * you may not use this file except in compliance with the License.
704 * You may obtain a copy of the License at
706 * http://www.apache.org/licenses/LICENSE-2.0
708 * Unless required by applicable law or agreed to in writing, software
709 * distributed under the License is distributed on an "AS IS" BASIS,
710 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
711 * See the License for the specific language governing permissions and
712 * limitations under the License.
716 * File: OP_MOVE_WIDE_FROM16.S
718 * Code: Copies contents from one register to another
720 * For: move-wide/from16
722 * Description: Copies contents from one non-object register to another.
724 * Format: AA|op BBBB (22x)
726 * Syntax: op vAA, vBBBB
729 FETCH 1, %edx # %edx<- BBBB
730 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
731 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vB
732 movq %xmm0, (rFP, rINST, 4) # vA<- vB
733 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
735 /* ------------------------------ */
737 .L_OP_MOVE_WIDE_16: /* 0x06 */
738 /* File: x86-atom/OP_MOVE_WIDE_16.S */
739 /* Copyright (C) 2008 The Android Open Source Project
741 * Licensed under the Apache License, Version 2.0 (the "License");
742 * you may not use this file except in compliance with the License.
743 * You may obtain a copy of the License at
745 * http://www.apache.org/licenses/LICENSE-2.0
747 * Unless required by applicable law or agreed to in writing, software
748 * distributed under the License is distributed on an "AS IS" BASIS,
749 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
750 * See the License for the specific language governing permissions and
751 * limitations under the License.
755 * File: OP_MOVE_WIDE_16.S
757 * Code: Copies contents from one register to another. Uses no
762 * Description: Copies contents from one non-object register to another.
764 * Format: ØØ|op AAAA BBBB (32x)
766 * Syntax: op vAAAA, vBBBB
769 FETCH 2, %edx # %edx<- BBBB
770 FETCH 1, %ecx # %ecx<- AAAA
771 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
772 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vB
773 movq %xmm0, (rFP, %ecx, 4) # vA<- vB; %xmm0
774 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
776 /* ------------------------------ */
778 .L_OP_MOVE_OBJECT: /* 0x07 */
779 /* File: x86-atom/OP_MOVE_OBJECT.S */
780 /* Copyright (C) 2008 The Android Open Source Project
782 * Licensed under the Apache License, Version 2.0 (the "License");
783 * you may not use this file except in compliance with the License.
784 * You may obtain a copy of the License at
786 * http://www.apache.org/licenses/LICENSE-2.0
788 * Unless required by applicable law or agreed to in writing, software
789 * distributed under the License is distributed on an "AS IS" BASIS,
790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
791 * See the License for the specific language governing permissions and
792 * limitations under the License.
796 * File: OP_MOVE_OBJECT.S
799 /* File: x86-atom/OP_MOVE.S */
800 /* Copyright (C) 2008 The Android Open Source Project
802 * Licensed under the Apache License, Version 2.0 (the "License");
803 * you may not use this file except in compliance with the License.
804 * You may obtain a copy of the License at
806 * http://www.apache.org/licenses/LICENSE-2.0
808 * Unless required by applicable law or agreed to in writing, software
809 * distributed under the License is distributed on an "AS IS" BASIS,
810 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
811 * See the License for the specific language governing permissions and
812 * limitations under the License.
818 * Code: Copies contents from one register to another. Uses no
821 * For: move, move-object, long-to-int
823 * Description: Copies contents from one non-object register to another.
824 * vA<- vB; fp[A]<- fp[B]
826 * Format: B|A|op (12x)
831 movl rINST, %ecx # %ecx<- BA
832 shr $4, rINST # rINST<- B
833 and $15, %ecx # %ecx<- A
834 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
835 GET_VREG rINST # rINST<- vB
836 SET_VREG rINST, %ecx # vA<- vB; %edx
837 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
839 /* ------------------------------ */
841 .L_OP_MOVE_OBJECT_FROM16: /* 0x08 */
842 /* File: x86-atom/OP_MOVE_OBJECT_FROM16.S */
843 /* Copyright (C) 2008 The Android Open Source Project
845 * Licensed under the Apache License, Version 2.0 (the "License");
846 * you may not use this file except in compliance with the License.
847 * You may obtain a copy of the License at
849 * http://www.apache.org/licenses/LICENSE-2.0
851 * Unless required by applicable law or agreed to in writing, software
852 * distributed under the License is distributed on an "AS IS" BASIS,
853 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854 * See the License for the specific language governing permissions and
855 * limitations under the License.
859 * File: OP_MOVE_OBJECT_FROM16.S
862 /* File: x86-atom/OP_MOVE_FROM16.S */
863 /* Copyright (C) 2008 The Android Open Source Project
865 * Licensed under the Apache License, Version 2.0 (the "License");
866 * you may not use this file except in compliance with the License.
867 * You may obtain a copy of the License at
869 * http://www.apache.org/licenses/LICENSE-2.0
871 * Unless required by applicable law or agreed to in writing, software
872 * distributed under the License is distributed on an "AS IS" BASIS,
873 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
874 * See the License for the specific language governing permissions and
875 * limitations under the License.
879 * File: OP_MOVE_FROM16.S
881 * Code: Copies contents from one register to another
883 * For: move/from16, move-object/from16
885 * Description: Copies contents from one non-object register to another.
886 * vA<- vB; fp[A]<- fp[B]
888 * Format: AA|op BBBB (22x)
890 * Syntax: op vAA, vBBBB
893 FETCH 1, %edx # %edx<- BBBB
894 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
895 GET_VREG %edx # %edx<- vB
896 SET_VREG %edx, rINST # vA<- vB; %edx
897 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
900 /* ------------------------------ */
902 .L_OP_MOVE_OBJECT_16: /* 0x09 */
903 /* File: x86-atom/OP_MOVE_OBJECT_16.S */
904 /* Copyright (C) 2008 The Android Open Source Project
906 * Licensed under the Apache License, Version 2.0 (the "License");
907 * you may not use this file except in compliance with the License.
908 * You may obtain a copy of the License at
910 * http://www.apache.org/licenses/LICENSE-2.0
912 * Unless required by applicable law or agreed to in writing, software
913 * distributed under the License is distributed on an "AS IS" BASIS,
914 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
915 * See the License for the specific language governing permissions and
916 * limitations under the License.
920 * File: OP_MOVE_OBJECT_16.S
923 /* File: x86-atom/OP_MOVE_16.S */
924 /* Copyright (C) 2008 The Android Open Source Project
926 * Licensed under the Apache License, Version 2.0 (the "License");
927 * you may not use this file except in compliance with the License.
928 * You may obtain a copy of the License at
930 * http://www.apache.org/licenses/LICENSE-2.0
932 * Unless required by applicable law or agreed to in writing, software
933 * distributed under the License is distributed on an "AS IS" BASIS,
934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
935 * See the License for the specific language governing permissions and
936 * limitations under the License.
942 * Code: Copies contents from one register to another
944 * For: move/16, move-object/16
946 * Description: Copies contents from one non-object register to another.
949 * Format: ØØ|op AAAA BBBB (32x)
951 * Syntax: op vAAAA, vBBBB
954 FETCH 2, %edx # %edx<- BBBB
955 FETCH 1, %ecx # %ecx<- AAAA
956 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
957 GET_VREG %edx # %edx<- vB
958 SET_VREG %edx, %ecx # vA<- vB; %edx
959 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
962 /* ------------------------------ */
964 .L_OP_MOVE_RESULT: /* 0x0a */
965 /* File: x86-atom/OP_MOVE_RESULT.S */
966 /* Copyright (C) 2008 The Android Open Source Project
968 * Licensed under the Apache License, Version 2.0 (the "License");
969 * you may not use this file except in compliance with the License.
970 * You may obtain a copy of the License at
972 * http://www.apache.org/licenses/LICENSE-2.0
974 * Unless required by applicable law or agreed to in writing, software
975 * distributed under the License is distributed on an "AS IS" BASIS,
976 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
977 * See the License for the specific language governing permissions and
978 * limitations under the License.
982 * File: OP_MOVE_RESULT.S
984 * Code: Copies a return value to a register
986 * For: move-result, move-result-object
988 * Description: Move the single-word non-object result of the most
989 * recent method invocation into the indicated register. This
990 * must be done as the instruction immediately after a
991 * method invocation whose (single-word, non-object) result
992 * is not to be ignored; anywhere else is invalid.
994 * Format: AA|op (11x)
999 movl rGLUE, %eax # %eax<- pMterpGlue
1000 FFETCH_ADV 1, %ecx # %ecx<- next instruction hi; fetch, advance
1001 movl offGlue_retval(%eax), %edx # %edx<- glue->retval
1002 SET_VREG %edx, rINST # vA<- glue->retval
1003 FGETOP_JMP 1, %ecx # jump to next instruction; getop, jmp
1005 /* ------------------------------ */
1007 .L_OP_MOVE_RESULT_WIDE: /* 0x0b */
1008 /* File: x86-atom/OP_MOVE_RESULT_WIDE.S */
1009 /* Copyright (C) 2008 The Android Open Source Project
1011 * Licensed under the Apache License, Version 2.0 (the "License");
1012 * you may not use this file except in compliance with the License.
1013 * You may obtain a copy of the License at
1015 * http://www.apache.org/licenses/LICENSE-2.0
1017 * Unless required by applicable law or agreed to in writing, software
1018 * distributed under the License is distributed on an "AS IS" BASIS,
1019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1020 * See the License for the specific language governing permissions and
1021 * limitations under the License.
1025 * File: OP_MOVE_RESULT_WIDE.S
1027 * Code: Copies a return value to a register
1029 * For: move-result-wide
1031 * Description: Move the double-word non-object result of the most
1032 * recent method invocation into the indicated register. This
1033 * must be done as the instruction immediately after a
1034 * method invocation whose (single-word, non-object) result
1035 * is not to be ignored; anywhere else is invalid.
1037 * Format: AA|op (11x)
1042 movl rGLUE, %eax # %eax<- pMterpGlue
1043 movq offGlue_retval(%eax), %xmm0 # %xmm0<- glue->retval
1044 movq %xmm0, (rFP, rINST, 4) # vA<- glue->retval
1045 FFETCH_ADV 1, %edx # %edx<- next instruction hi; fetch, advance
1046 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
1048 /* ------------------------------ */
1050 .L_OP_MOVE_RESULT_OBJECT: /* 0x0c */
1051 /* File: x86-atom/OP_MOVE_RESULT_OBJECT.S */
1052 /* Copyright (C) 2008 The Android Open Source Project
1054 * Licensed under the Apache License, Version 2.0 (the "License");
1055 * you may not use this file except in compliance with the License.
1056 * You may obtain a copy of the License at
1058 * http://www.apache.org/licenses/LICENSE-2.0
1060 * Unless required by applicable law or agreed to in writing, software
1061 * distributed under the License is distributed on an "AS IS" BASIS,
1062 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1063 * See the License for the specific language governing permissions and
1064 * limitations under the License.
1068 * File: OP_MOVE_RESULT_OBJECT.S
1071 /* File: x86-atom/OP_MOVE_RESULT.S */
1072 /* Copyright (C) 2008 The Android Open Source Project
1074 * Licensed under the Apache License, Version 2.0 (the "License");
1075 * you may not use this file except in compliance with the License.
1076 * You may obtain a copy of the License at
1078 * http://www.apache.org/licenses/LICENSE-2.0
1080 * Unless required by applicable law or agreed to in writing, software
1081 * distributed under the License is distributed on an "AS IS" BASIS,
1082 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1083 * See the License for the specific language governing permissions and
1084 * limitations under the License.
1088 * File: OP_MOVE_RESULT.S
1090 * Code: Copies a return value to a register
1092 * For: move-result, move-result-object
1094 * Description: Move the single-word non-object result of the most
1095 * recent method invocation into the indicated register. This
1096 * must be done as the instruction immediately after a
1097 * method invocation whose (single-word, non-object) result
1098 * is not to be ignored; anywhere else is invalid.
1100 * Format: AA|op (11x)
1105 movl rGLUE, %eax # %eax<- pMterpGlue
1106 FFETCH_ADV 1, %ecx # %ecx<- next instruction hi; fetch, advance
1107 movl offGlue_retval(%eax), %edx # %edx<- glue->retval
1108 SET_VREG %edx, rINST # vA<- glue->retval
1109 FGETOP_JMP 1, %ecx # jump to next instruction; getop, jmp
1112 /* ------------------------------ */
1114 .L_OP_MOVE_EXCEPTION: /* 0x0d */
1115 /* File: x86-atom/OP_MOVE_EXCEPTION.S */
1116 /* Copyright (C) 2008 The Android Open Source Project
1118 * Licensed under the Apache License, Version 2.0 (the "License");
1119 * you may not use this file except in compliance with the License.
1120 * You may obtain a copy of the License at
1122 * http://www.apache.org/licenses/LICENSE-2.0
1124 * Unless required by applicable law or agreed to in writing, software
1125 * distributed under the License is distributed on an "AS IS" BASIS,
1126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1127 * See the License for the specific language governing permissions and
1128 * limitations under the License.
1132 * File: OP_MOVE_EXCEPTION.S
1134 * Code: Moves an exception to a register
1136 * For: move-exception
1138 * Description: Save a just-caught exception into the given register. This
1139 * instruction is only valid as the first instruction of an
1140 * exception handler.
1142 * Format: AA|op (11x)
1147 movl rGLUE, %eax # %eax<- pMterpGlue
1148 movl offGlue_self(%eax), %ecx # %ecx<- glue->self
1149 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
1150 movl offThread_exception(%ecx), %edx # %edx<- glue->self->exception
1151 movl $0, offThread_exception(%ecx) # clear exception
1152 SET_VREG %edx, rINST # vAA<- glue->self->exception
1153 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
1155 /* ------------------------------ */
1157 .L_OP_RETURN_VOID: /* 0x0e */
1158 /* File: x86-atom/OP_RETURN_VOID.S */
1159 /* Copyright (C) 2008 The Android Open Source Project
1161 * Licensed under the Apache License, Version 2.0 (the "License");
1162 * you may not use this file except in compliance with the License.
1163 * You may obtain a copy of the License at
1165 * http://www.apache.org/licenses/LICENSE-2.0
1167 * Unless required by applicable law or agreed to in writing, software
1168 * distributed under the License is distributed on an "AS IS" BASIS,
1169 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1170 * See the License for the specific language governing permissions and
1171 * limitations under the License.
1175 * File: OP_RETURN_VOID.S
1178 jmp common_returnFromMethod
1180 /* ------------------------------ */
1182 .L_OP_RETURN: /* 0x0f */
1183 /* File: x86-atom/OP_RETURN.S */
1184 /* Copyright (C) 2008 The Android Open Source Project
1186 * Licensed under the Apache License, Version 2.0 (the "License");
1187 * you may not use this file except in compliance with the License.
1188 * You may obtain a copy of the License at
1190 * http://www.apache.org/licenses/LICENSE-2.0
1192 * Unless required by applicable law or agreed to in writing, software
1193 * distributed under the License is distributed on an "AS IS" BASIS,
1194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1195 * See the License for the specific language governing permissions and
1196 * limitations under the License.
1203 /* File: x86-atom/OP_RETURN_COMMON.S */
1204 /* Copyright (C) 2008 The Android Open Source Project
1206 * Licensed under the Apache License, Version 2.0 (the "License");
1207 * you may not use this file except in compliance with the License.
1208 * You may obtain a copy of the License at
1210 * http://www.apache.org/licenses/LICENSE-2.0
1212 * Unless required by applicable law or agreed to in writing, software
1213 * distributed under the License is distributed on an "AS IS" BASIS,
1214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1215 * See the License for the specific language governing permissions and
1216 * limitations under the License.
1220 * File: OP_RETURN_COMMON.S
1222 * Code: Return a 32-bit value. Uses no substitutions.
1224 * For: return, return-object
1226 * Description: Copies the return value into the "glue"
1227 * structure, then jumps to the return handler.
1229 * Format: AA|op (11x)
1234 movl rGLUE, %edx # %edx<- pMterpGlue
1235 GET_VREG rINST # rINST<- vAA
1236 movl rINST, offGlue_retval(%edx) # glue->retval<- vAA
1237 jmp common_returnFromMethod # jump to common return code
1240 /* ------------------------------ */
1242 .L_OP_RETURN_WIDE: /* 0x10 */
1243 /* File: x86-atom/OP_RETURN_WIDE.S */
1244 /* Copyright (C) 2008 The Android Open Source Project
1246 * Licensed under the Apache License, Version 2.0 (the "License");
1247 * you may not use this file except in compliance with the License.
1248 * You may obtain a copy of the License at
1250 * http://www.apache.org/licenses/LICENSE-2.0
1252 * Unless required by applicable law or agreed to in writing, software
1253 * distributed under the License is distributed on an "AS IS" BASIS,
1254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1255 * See the License for the specific language governing permissions and
1256 * limitations under the License.
1260 * File: OP_RETURN_WIDE.S
1262 * Code: Return a 64-bit value. Uses no substitutions.
1266 * Description: Copies the return value into the "glue"
1267 * structure, then jumps to the return handler.
1269 * Format: AA|op (11x)
1274 movl rGLUE, %edx # %edx<- pMterpGlue
1275 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vAA
1276 movq %xmm0, offGlue_retval(%edx)# glue->retval<- vAA
1277 jmp common_returnFromMethod # jump to common return code
1279 /* ------------------------------ */
1281 .L_OP_RETURN_OBJECT: /* 0x11 */
1282 /* File: x86-atom/OP_RETURN_OBJECT.S */
1283 /* Copyright (C) 2008 The Android Open Source Project
1285 * Licensed under the Apache License, Version 2.0 (the "License");
1286 * you may not use this file except in compliance with the License.
1287 * You may obtain a copy of the License at
1289 * http://www.apache.org/licenses/LICENSE-2.0
1291 * Unless required by applicable law or agreed to in writing, software
1292 * distributed under the License is distributed on an "AS IS" BASIS,
1293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1294 * See the License for the specific language governing permissions and
1295 * limitations under the License.
1299 * File: OP_RETURN_OBJECT.S
1302 /* File: x86-atom/OP_RETURN_COMMON.S */
1303 /* Copyright (C) 2008 The Android Open Source Project
1305 * Licensed under the Apache License, Version 2.0 (the "License");
1306 * you may not use this file except in compliance with the License.
1307 * You may obtain a copy of the License at
1309 * http://www.apache.org/licenses/LICENSE-2.0
1311 * Unless required by applicable law or agreed to in writing, software
1312 * distributed under the License is distributed on an "AS IS" BASIS,
1313 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1314 * See the License for the specific language governing permissions and
1315 * limitations under the License.
1319 * File: OP_RETURN_COMMON.S
1321 * Code: Return a 32-bit value. Uses no substitutions.
1323 * For: return, return-object
1325 * Description: Copies the return value into the "glue"
1326 * structure, then jumps to the return handler.
1328 * Format: AA|op (11x)
1333 movl rGLUE, %edx # %edx<- pMterpGlue
1334 GET_VREG rINST # rINST<- vAA
1335 movl rINST, offGlue_retval(%edx) # glue->retval<- vAA
1336 jmp common_returnFromMethod # jump to common return code
1339 /* ------------------------------ */
1341 .L_OP_CONST_4: /* 0x12 */
1342 /* File: x86-atom/OP_CONST_4.S */
1343 /* Copyright (C) 2008 The Android Open Source Project
1345 * Licensed under the Apache License, Version 2.0 (the "License");
1346 * you may not use this file except in compliance with the License.
1347 * You may obtain a copy of the License at
1349 * http://www.apache.org/licenses/LICENSE-2.0
1351 * Unless required by applicable law or agreed to in writing, software
1352 * distributed under the License is distributed on an "AS IS" BASIS,
1353 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1354 * See the License for the specific language governing permissions and
1355 * limitations under the License.
1359 * File: OP_CONST_4.S
1361 * Code: Moves a literal to a register. Uses no substitutions.
1365 * Description: Move the given literal value (right-sign-extended to 32
1366 * bits) into the specified register.
1368 * Format: B|A|op (11n)
1370 * Syntax: op vA, #+B
1373 movl rINST, %edx # %edx<- BA
1374 andl $15, rINST # rINST<- A
1375 FFETCH_ADV 1, %eax # %eax<- next i nstruction hi; fetch, advance
1376 shl $24, %edx # %edx<- B000
1377 addl $2, rPC # update PC
1378 sar $28, %edx # %edx<- right-zero-extended B
1379 SET_VREG %edx, rINST # vA<- %edx; literal
1380 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
1381 /* ------------------------------ */
1383 .L_OP_CONST_16: /* 0x13 */
1384 /* File: x86-atom/OP_CONST_16.S */
1385 /* Copyright (C) 2008 The Android Open Source Project
1387 * Licensed under the Apache License, Version 2.0 (the "License");
1388 * you may not use this file except in compliance with the License.
1389 * You may obtain a copy of the License at
1391 * http://www.apache.org/licenses/LICENSE-2.0
1393 * Unless required by applicable law or agreed to in writing, software
1394 * distributed under the License is distributed on an "AS IS" BASIS,
1395 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1396 * See the License for the specific language governing permissions and
1397 * limitations under the License.
1401 * File: OP_CONST_16.S
1403 * Code: Moves a literal to a register. Uses no substitutions.
1407 * Description: Move the given literal value (right-zero-extended to 32
1408 * bits) into the specified register
1410 * Format: AA|op BBBB (21s)
1412 * Syntax: op vAA, #+BBBB
1415 FETCHs 1, %edx # %edx<- BBBB
1416 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
1417 SET_VREG %edx rINST # vAA<- BBBB; literal
1418 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
1419 /* ------------------------------ */
1421 .L_OP_CONST: /* 0x14 */
1422 /* File: x86-atom/OP_CONST.S */
1423 /* Copyright (C) 2008 The Android Open Source Project
1425 * Licensed under the Apache License, Version 2.0 (the "License");
1426 * you may not use this file except in compliance with the License.
1427 * You may obtain a copy of the License at
1429 * http://www.apache.org/licenses/LICENSE-2.0
1431 * Unless required by applicable law or agreed to in writing, software
1432 * distributed under the License is distributed on an "AS IS" BASIS,
1433 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1434 * See the License for the specific language governing permissions and
1435 * limitations under the License.
1441 * Code: Move a literal to a register. Uses no substitutions.
1445 * Description: Move the given literal value into the specified register
1447 * Format: AA|op BBBBlo BBBBhi (31i)
1449 * Syntax: op vAA, #+BBBBBBBB
1452 FETCH 2, %edx # %edx<- BBBBhi
1453 FETCH 1, %ecx # %ecx<- BBBBlo
1454 shl $16, %edx # move BBBB to high bits
1455 or %edx, %ecx # %ecx<- #+BBBBBBBB
1456 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
1457 SET_VREG %ecx, rINST # vAA<- %ecx; literal
1458 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
1459 /* ------------------------------ */
1461 .L_OP_CONST_HIGH16: /* 0x15 */
1462 /* File: x86-atom/OP_CONST_HIGH16.S */
1463 /* Copyright (C) 2008 The Android Open Source Project
1465 * Licensed under the Apache License, Version 2.0 (the "License");
1466 * you may not use this file except in compliance with the License.
1467 * You may obtain a copy of the License at
1469 * http://www.apache.org/licenses/LICENSE-2.0
1471 * Unless required by applicable law or agreed to in writing, software
1472 * distributed under the License is distributed on an "AS IS" BASIS,
1473 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1474 * See the License for the specific language governing permissions and
1475 * limitations under the License.
1479 * File: OP_CONST_HIGH16.S
1481 * Code: Move a literal to a register. Uses no substitutions.
1485 * Description: Move the given literal value (right-zero-extended to 32
1486 * bits) into the specified register
1488 * Format: AA|op BBBB (21h)
1490 * Syntax: op vAA, #+BBBB0000
1493 FETCH 1, %ecx # %ecx<- 0000BBBB (zero-extended)
1494 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
1495 shl $16, %ecx # %ecx<- BBBB0000
1496 SET_VREG %ecx, rINST # vAA<- %ecx; BBBB0000
1497 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
1499 /* ------------------------------ */
1501 .L_OP_CONST_WIDE_16: /* 0x16 */
1502 /* File: x86-atom/OP_CONST_WIDE_16.S */
1503 /* Copyright (C) 2008 The Android Open Source Project
1505 * Licensed under the Apache License, Version 2.0 (the "License");
1506 * you may not use this file except in compliance with the License.
1507 * You may obtain a copy of the License at
1509 * http://www.apache.org/licenses/LICENSE-2.0
1511 * Unless required by applicable law or agreed to in writing, software
1512 * distributed under the License is distributed on an "AS IS" BASIS,
1513 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1514 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1519 * File: OP_CONST_WIDE_16.S
1521 * Code: Move a literal to a register. Uses no substitutions.
1523 * For: const-wide/16
1525 * Description: Move the given literal value (sign-extended to 64 bits)
1526 * into the specified register-pair
1528 * Format: AA|op BBBB (21s)
1530 * Syntax: op vAA, #+BBBB
1533 FETCHs 1, %ecx # %ecx<- ssssBBBB (sign-extended)
1534 movl %ecx, %edx # %edx<- ssssBBBB (sign-extended)
1535 sar $31, %ecx # %ecx<- sign bit
1536 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
1537 movl %edx, (rFP, rINST, 4) # vAA<- ssssBBBB
1538 movl %ecx, 4(rFP, rINST, 4) # vAA+1<- ssssssss
1539 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
1540 /* ------------------------------ */
1542 .L_OP_CONST_WIDE_32: /* 0x17 */
1543 /* File: x86-atom/OP_CONST_WIDE_32.S */
1544 /* Copyright (C) 2008 The Android Open Source Project
1546 * Licensed under the Apache License, Version 2.0 (the "License");
1547 * you may not use this file except in compliance with the License.
1548 * You may obtain a copy of the License at
1550 * http://www.apache.org/licenses/LICENSE-2.0
1552 * Unless required by applicable law or agreed to in writing, software
1553 * distributed under the License is distributed on an "AS IS" BASIS,
1554 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1555 * See the License for the specific language governing permissions and
1556 * limitations under the License.
1560 * File: OP_CONST_WIDE_32.S
1562 * Code: Move a literal to a register. Uses no substitutions.
1564 * For: const-wide/32
1566 * Description: Move the given literal value (sign-extended to 64 bits)
1567 * into the specified register-pair
1569 * Format: AA|op BBBBlo BBBBhi (31i)
1571 * Syntax: op vAA, #+BBBBBBBB
1574 FETCH 1, %edx # %edx<- BBBBlo
1575 FETCHs 2, %ecx # %ecx<- BBBBhi
1576 shl $16, %ecx # prepare to create #+BBBBBBBB
1577 or %ecx, %edx # %edx<- %edx<- #+BBBBBBBB
1578 sar $31, %ecx # %ecx<- sign bit
1579 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
1580 movl %edx, (rFP, rINST, 4) # vAA<- BBBBBBBB
1581 movl %ecx, 4(rFP, rINST, 4) # vAA+1<- ssssssss
1582 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
1583 /* ------------------------------ */
1585 .L_OP_CONST_WIDE: /* 0x18 */
1586 /* File: x86-atom/OP_CONST_WIDE.S */
1587 /* Copyright (C) 2008 The Android Open Source Project
1589 * Licensed under the Apache License, Version 2.0 (the "License");
1590 * you may not use this file except in compliance with the License.
1591 * You may obtain a copy of the License at
1593 * http://www.apache.org/licenses/LICENSE-2.0
1595 * Unless required by applicable law or agreed to in writing, software
1596 * distributed under the License is distributed on an "AS IS" BASIS,
1597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1598 * See the License for the specific language governing permissions and
1599 * limitations under the License.
1603 * File: OP_CONST_WIDE.S
1605 * Code: Move a literal to a register. Uses no substitutions.
1609 * Description: Move the given literal value into the specified
1612 * Format: AA|op BBBBlolo BBBBlohi BBBBhilo BBBBhihi (51l)
1614 * Syntax: op vAA, #+BBBBBBBBBBBBBBBB
1617 FETCH 1, %ecx # %ecx<- BBBBlolo
1618 FETCH 2, %edx # %edx<- BBBBlohi
1619 shl $16, %edx # %edx<- prepare to create #+BBBBBBBBlo
1620 or %edx, %ecx # %ecx<- #+BBBBBBBBlo
1621 movl %ecx, (rFP, rINST, 4) # vAA <- #+BBBBBBBBlo
1622 FETCH 3, %ecx # %ecx<- BBBBhilo
1623 FETCH 4, %edx # %edx<- BBBBhihi
1624 FFETCH_ADV 5, %eax # %eax<- next instruction hi; fetch, advance
1625 shl $16, %edx # %edx<- prepare to create #+BBBBBBBBhi
1626 or %edx, %ecx # %ecx<- #+BBBBBBBBhi
1627 movl %ecx, 4(rFP, rINST, 4) # vAA+1 <- #+BBBBBBBBlo
1628 FGETOP_JMP 5, %eax # jump to next instruction; getop, jmp
1630 /* ------------------------------ */
1632 .L_OP_CONST_WIDE_HIGH16: /* 0x19 */
1633 /* File: x86-atom/OP_CONST_WIDE_HIGH16.S */
1634 /* Copyright (C) 2008 The Android Open Source Project
1636 * Licensed under the Apache License, Version 2.0 (the "License");
1637 * you may not use this file except in compliance with the License.
1638 * You may obtain a copy of the License at
1640 * http://www.apache.org/licenses/LICENSE-2.0
1642 * Unless required by applicable law or agreed to in writing, software
1643 * distributed under the License is distributed on an "AS IS" BASIS,
1644 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1645 * See the License for the specific language governing permissions and
1646 * limitations under the License.
1650 * File: OP_CONST_WIDE_HIGH16.S
1652 * Code: Move a literal value to a register. Uses no substitutions.
1654 * For: const-wide/high16
1656 * Description: Move the given literal value (right-zero-extended to 64
1657 * bits) into the specified register
1659 * Format: AA|op BBBB (21h)
1661 * Syntax: op vAA, #+BBBB000000000000
1664 FETCH 1, %ecx # %ecx<- 0000BBBB (zero-extended)
1665 shl $16, %ecx # rINST<- AA
1666 movl $0, (rFP, rINST, 4) # vAAlow<- 00000000
1667 movl %ecx, 4(rFP, rINST, 4) # vAAhigh<- %ecx; BBBB0000
1668 FINISH 2 # jump to next instruction
1670 /* ------------------------------ */
1672 .L_OP_CONST_STRING: /* 0x1a */
1673 /* File: x86-atom/OP_CONST_STRING.S */
1674 /* Copyright (C) 2008 The Android Open Source Project
1676 * Licensed under the Apache License, Version 2.0 (the "License");
1677 * you may not use this file except in compliance with the License.
1678 * You may obtain a copy of the License at
1680 * http://www.apache.org/licenses/LICENSE-2.0
1682 * Unless required by applicable law or agreed to in writing, software
1683 * distributed under the License is distributed on an "AS IS" BASIS,
1684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1685 * See the License for the specific language governing permissions and
1686 * limitations under the License.
1690 * File: OP_CONST_STRING.S
1692 * Code: Move a string reference to a register. Uses no substitutions.
1696 * Description: Move a referece to the string specified by the given
1697 * index into the specified register. vAA <- pResString[BBBB]
1699 * Format: AA|op BBBB (21c)
1701 * Syntax: op vAA, string@BBBB
1704 FETCH 1, %ecx # %ecx<- BBBB
1705 movl rGLUE, %edx # get MterpGlue pointer
1706 movl offGlue_methodClassDex(%edx), %eax # %eax<- glue->methodClassDex
1707 movl offDvmDex_pResStrings(%eax), %eax # %eax<- glue->methodClassDex->pResStrings
1708 movl (%eax, %ecx, 4), %eax # %eax<- pResStrings[BBBB]
1709 cmp $0, %eax # check if string is resolved
1710 je .LOP_CONST_STRING_resolve # resolve string reference
1711 SET_VREG %eax, rINST # vAA<- %eax; pResString[BBBB]
1712 FINISH 2 # jump to next instruction
1715 /* ------------------------------ */
1717 .L_OP_CONST_STRING_JUMBO: /* 0x1b */
1718 /* File: x86-atom/OP_CONST_STRING_JUMBO.S */
1719 /* Copyright (C) 2008 The Android Open Source Project
1721 * Licensed under the Apache License, Version 2.0 (the "License");
1722 * you may not use this file except in compliance with the License.
1723 * You may obtain a copy of the License at
1725 * http://www.apache.org/licenses/LICENSE-2.0
1727 * Unless required by applicable law or agreed to in writing, software
1728 * distributed under the License is distributed on an "AS IS" BASIS,
1729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1730 * See the License for the specific language governing permissions and
1731 * limitations under the License.
1735 * File: OP_CONST_STRING_JUMBO.S
1737 * Code: Move a string reference to a register. Uses no substitutions.
1739 * For: const/string-jumbo
1741 * Description: Move a reference to the string specified by the given
1742 * index into the specified register. vAA <- pResString[BBBB]
1744 * Format: AA|op BBBBlo BBBBhi (31c)
1746 * Syntax: op vAA, string@BBBBBBBB
1749 movl rGLUE, %edx # get MterpGlue pointer
1750 movl offGlue_methodClassDex(%edx), %eax # %eax<- glue->methodClassDex
1751 movl offDvmDex_pResStrings(%eax), %eax # %eax<- glue->methodClassDex->pResStrings
1752 FETCH 1, %ecx # %ecx<- BBBBlo
1753 FETCH 2, %edx # %edx<- BBBBhi
1754 shl $16, %edx # %edx<- prepare to create &BBBBBBBB
1755 or %edx, %ecx # %ecx<- &BBBBBBBB
1756 movl (%eax, %ecx, 4), %eax # %eax<- pResStrings[BBBB]
1757 cmp $0, %eax # check if string is resolved
1758 je .LOP_CONST_STRING_JUMBO_resolve # resolve string reference
1759 SET_VREG %eax, rINST # vAA<- %eax; pResString[BBBB]
1760 FINISH 3 # jump to next instruction
1762 /* ------------------------------ */
1764 .L_OP_CONST_CLASS: /* 0x1c */
1765 /* File: x86-atom/OP_CONST_CLASS.S */
1766 /* Copyright (C) 2008 The Android Open Source Project
1768 * Licensed under the Apache License, Version 2.0 (the "License");
1769 * you may not use this file except in compliance with the License.
1770 * You may obtain a copy of the License at
1772 * http://www.apache.org/licenses/LICENSE-2.0
1774 * Unless required by applicable law or agreed to in writing, software
1775 * distributed under the License is distributed on an "AS IS" BASIS,
1776 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1777 * See the License for the specific language governing permissions and
1778 * limitations under the License.
1782 * File: OP_CONST_CLASS.S
1784 * Code: Move a class reference to a register. Uses no substitutions.
1788 * Description: Move a reference to the class specified
1789 * by the given index into the specified register.
1790 * In the case where the indicated type is primitive,
1791 * this will store a reference to the primitive type's
1794 * Format: AA|op BBBBlo BBBBhi (21c)
1796 * Syntax: op vAA, field@BBBB
1799 movl rGLUE, %edx # get MterpGlue pointer
1800 FETCH 1, %ecx # %ecx<- BBBB
1801 movl offGlue_methodClassDex(%edx), %eax # %eax<- pDvmDex
1802 movl offDvmDex_pResClasses(%eax), %eax # %eax<- pDvmDex->pResClasses
1803 movl (%eax, %ecx, 4), %eax # %eax<- resolved class
1804 cmp $0, %eax # check if classes is resolved before?
1805 je .LOP_CONST_CLASS_resolve # resolve class
1806 SET_VREG %eax, rINST # vAA<- resolved class
1807 FINISH 2 # jump to next instruction
1809 /* ------------------------------ */
1811 .L_OP_MONITOR_ENTER: /* 0x1d */
1812 /* File: x86-atom/OP_MONITOR_ENTER.S */
1813 /* Copyright (C) 2008 The Android Open Source Project
1815 * Licensed under the Apache License, Version 2.0 (the "License");
1816 * you may not use this file except in compliance with the License.
1817 * You may obtain a copy of the License at
1819 * http://www.apache.org/licenses/LICENSE-2.0
1821 * Unless required by applicable law or agreed to in writing, software
1822 * distributed under the License is distributed on an "AS IS" BASIS,
1823 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1824 * See the License for the specific language governing permissions and
1825 * limitations under the License.
1829 * File: OP_MONITOR_ENTER.S
1831 * Code: Aquire a monitor
1833 * For: monitor-enter
1835 * Description: Aquire a monitor for the indicated object.
1839 * Format: AA|op (11x)
1844 movl rGLUE, %eax # %eax<- pMterpGlue
1845 GET_VREG rINST # rINST<- vAA
1846 cmp $0, rINST # check for null object
1847 movl offGlue_self(%eax), %eax # %eax<- glue->self
1848 #ifdef WITH_MONITOR_TRACKING
1849 EXPORT_PC # export PC so we can grab stack trace
1851 je common_errNullObject # handle null object
1852 # jmp .LOP_MONITOR_ENTER_finish
1854 #.LOP_MONITOR_ENTER_finish:
1855 movl rINST, -4(%esp) # push parameter reference
1856 movl %eax, -8(%esp) # push parameter
1858 call dvmLockObject # call: (struct Thread* self,
1859 # struct Object* obj)
1861 FFETCH_ADV 1, %edx # %edx<- next instruction hi; fetch, advance
1863 #ifdef WITH_DEADLOCK_PREDICTION
1864 movl rGLUE, %eax # %eax<- pMterpGlue
1865 movl offGlue_self(%eax), %eax # %eax<- glue->self
1866 movl offThread_exception(%eax), %eax # %eax<- glue->self->exception
1867 cmp $0, %eax # check for exception
1868 jne common_exceptionThrown # handle exception
1870 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
1872 /* ------------------------------ */
1874 .L_OP_MONITOR_EXIT: /* 0x1e */
1875 /* File: x86-atom/OP_MONITOR_EXIT.S */
1876 /* Copyright (C) 2008 The Android Open Source Project
1878 * Licensed under the Apache License, Version 2.0 (the "License");
1879 * you may not use this file except in compliance with the License.
1880 * You may obtain a copy of the License at
1882 * http://www.apache.org/licenses/LICENSE-2.0
1884 * Unless required by applicable law or agreed to in writing, software
1885 * distributed under the License is distributed on an "AS IS" BASIS,
1886 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1887 * See the License for the specific language governing permissions and
1888 * limitations under the License.
1892 * File: OP_MONITOR_EXIT.S
1894 * Code: Release a monitor
1898 * Description: Release a monitor for the indicated object. If this instruction needs
1899 * to throw an execption, it must do so as if the pc has already
1900 * advanced pased the instruction.
1902 * Format: AA|op (11x)
1907 movl rGLUE, %eax # %eax<- pMterpGlue
1908 EXPORT_PC # export the pc
1909 GET_VREG rINST # rINST<- vAA
1910 cmp $0, rINST # rINST<- check for null object
1911 je common_errNullObject # handle null object
1912 push rINST # push parameter object
1913 push offGlue_self(%eax) # push parameter self
1914 call dvmUnlockObject # call: (struct Thread* self,
1915 # struct Object* obj)
1917 FINISH_FETCH_ADVANCE 1, %edx # advance pc before exception
1918 cmp $0, %eax # check for success
1920 je common_exceptionThrown # handle exception
1921 FINISH_JMP %edx # jump to next instruction
1923 /* ------------------------------ */
1925 .L_OP_CHECK_CAST: /* 0x1f */
1926 /* File: x86-atom/OP_CHECK_CAST.S */
1927 /* Copyright (C) 2008 The Android Open Source Project
1929 * Licensed under the Apache License, Version 2.0 (the "License");
1930 * you may not use this file except in compliance with the License.
1931 * You may obtain a copy of the License at
1933 * http://www.apache.org/licenses/LICENSE-2.0
1935 * Unless required by applicable law or agreed to in writing, software
1936 * distributed under the License is distributed on an "AS IS" BASIS,
1937 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1938 * See the License for the specific language governing permissions and
1939 * limitations under the License.
1943 * File: OP_CHECK_CAST.S
1945 * Code: Checks to see if a cast is allowed. Uses no substitutions.
1949 * Description: Throw if the reference in the given register cannot be
1950 * cast to the indicated type. The type must be a reference
1951 * type (not a primitive type).
1953 * Format: AA|op BBBB (21c)
1955 * Syntax: op vAA, type@BBBB
1958 movl rGLUE, %edx # get MterpGlue pointer
1959 movl offGlue_methodClassDex(%edx), %eax # %eax<- pDvmDex
1960 GET_VREG rINST # rINST<- vAA
1961 movl offDvmDex_pResClasses(%eax), %eax # %eax<- pDvmDex->pResClasses
1962 cmp $0, rINST # check for null reference object
1963 je .LOP_CHECK_CAST_okay # can always cast null object
1964 FETCH 1, %ecx # %ecx<- BBBB
1965 movl (%eax, %ecx, 4), %ecx # %ecx<- resolved class
1966 cmp $0, %ecx # check if classes is resolved before?
1967 je .LOP_CHECK_CAST_resolve # resolve class
1968 jmp .LOP_CHECK_CAST_resolved # continue
1970 /* ------------------------------ */
1972 .L_OP_INSTANCE_OF: /* 0x20 */
1973 /* File: x86-atom/OP_INSTANCE_OF.S */
1974 /* Copyright (C) 2008 The Android Open Source Project
1976 * Licensed under the Apache License, Version 2.0 (the "License");
1977 * you may not use this file except in compliance with the License.
1978 * You may obtain a copy of the License at
1980 * http://www.apache.org/licenses/LICENSE-2.0
1982 * Unless required by applicable law or agreed to in writing, software
1983 * distributed under the License is distributed on an "AS IS" BASIS,
1984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1985 * See the License for the specific language governing permissions and
1986 * limitations under the License.
1990 * File: OP_INSTANCE_OF.S
1992 * Code: Checks if object is instance of a class. Uses no substitutions.
1996 * Description: Store in the given destination register 1 if the indicated
1997 * reference is an instance of the given type, or 0 if not.
1998 * The type must be a reference type (not a primitive type).
2000 * Format: B|A|op CCCC (22c)
2002 * Syntax: op vA, vB, type@CCCC
2003 * op vA, vB, field@CCCC
2006 movl rINST, %edx # %edx<- BA
2007 shr $4, %edx # %edx<- B
2008 GET_VREG %edx # %edx<- vB
2009 cmp $0, %edx # check for null object
2010 je .LOP_INSTANCE_OF_store # null object
2011 jmp .LOP_INSTANCE_OF_break
2013 /* ------------------------------ */
2015 .L_OP_ARRAY_LENGTH: /* 0x21 */
2016 /* File: x86-atom/OP_ARRAY_LENGTH.S */
2017 /* Copyright (C) 2008 The Android Open Source Project
2019 * Licensed under the Apache License, Version 2.0 (the "License");
2020 * you may not use this file except in compliance with the License.
2021 * You may obtain a copy of the License at
2023 * http://www.apache.org/licenses/LICENSE-2.0
2025 * Unless required by applicable law or agreed to in writing, software
2026 * distributed under the License is distributed on an "AS IS" BASIS,
2027 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2028 * See the License for the specific language governing permissions and
2029 * limitations under the License.
2033 * File: OP_ARRAY_LENGTH.S
2035 * Code: 32-bit array length operation.
2039 * Description: Store the length of the indicated array in the given
2040 * destination register. vB <- offArrayObject_length(vA)
2042 * Format: B|A|op (12x)
2047 movl rINST, %eax # %eax<- BA
2048 shr $4, %eax # %eax<- B
2049 andl $15, rINST # rINST<- A
2050 FFETCH_ADV 1, %edx # %edx<- next instruction hi; fetch, advance
2051 GET_VREG %eax # %eax<- vB
2052 testl %eax, %eax # check for null array object
2053 je common_errNullObject # handle null array object
2054 movl offArrayObject_length(%eax), %eax # %eax<- array length
2055 movl %eax, (rFP, rINST, 4) # vA<- %eax; array length
2056 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
2058 /* ------------------------------ */
2060 .L_OP_NEW_INSTANCE: /* 0x22 */
2061 /* File: x86-atom/OP_NEW_INSTANCE.S */
2062 /* Copyright (C) 2008 The Android Open Source Project
2064 * Licensed under the Apache License, Version 2.0 (the "License");
2065 * you may not use this file except in compliance with the License.
2066 * You may obtain a copy of the License at
2068 * http://www.apache.org/licenses/LICENSE-2.0
2070 * Unless required by applicable law or agreed to in writing, software
2071 * distributed under the License is distributed on an "AS IS" BASIS,
2072 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2073 * See the License for the specific language governing permissions and
2074 * limitations under the License.
2078 * File: OP_NEW_INSTANCE.S
2080 * Code: Create a new instance of a given type. Uses no substitutions.
2084 * Description: Construct a new instance of the indicated type,
2085 * storing a reference to it in the destination.
2086 * The type must refer to a non-array class.
2090 * Format: AA|op BBBB (21c)
2092 * Syntax: op vAA, type@BBBB
2093 * op vAA, field@BBBB
2094 * op vAA, string@BBBB
2097 movl rGLUE, %ecx # %ecx<- pMterpGlue
2098 movl offGlue_methodClassDex(%ecx), %ecx # %ecx<- glue->pDvmDex
2099 FETCH 1, %edx # %edx<- BBBB
2100 movl offDvmDex_pResClasses(%ecx), %ecx # %ecx<- glue->pDvmDex->pResClasses
2101 movl (%ecx, %edx, 4), %edx # %edx<- vB
2102 EXPORT_PC # required for resolve
2103 cmp $0, %edx # check for null
2104 je .LOP_NEW_INSTANCE_resolve # need to resolve
2107 * %edx holds class object
2110 .LOP_NEW_INSTANCE_resolved:
2111 movzbl offClassObject_status(%edx), %eax # %eax<- class status
2112 cmp $CLASS_INITIALIZED, %eax # check if class is initialized
2113 jne .LOP_NEW_INSTANCE_needinit # initialize class
2116 * %edx holds class object
2119 .LOP_NEW_INSTANCE_initialized:
2120 testl $(ACC_INTERFACE|ACC_ABSTRACT), offClassObject_accessFlags(%edx)
2121 mov $ALLOC_DONT_TRACK, %eax # %eax<- flag for alloc call
2122 je .LOP_NEW_INSTANCE_finish # continue
2123 jmp .LOP_NEW_INSTANCE_abstract # handle abstract or interface
2126 * %edx holds class object
2127 * %eax holds flags for alloc call
2131 /* ------------------------------ */
2133 .L_OP_NEW_ARRAY: /* 0x23 */
2134 /* File: x86-atom/OP_NEW_ARRAY.S */
2135 /* Copyright (C) 2008 The Android Open Source Project
2137 * Licensed under the Apache License, Version 2.0 (the "License");
2138 * you may not use this file except in compliance with the License.
2139 * You may obtain a copy of the License at
2141 * http://www.apache.org/licenses/LICENSE-2.0
2143 * Unless required by applicable law or agreed to in writing, software
2144 * distributed under the License is distributed on an "AS IS" BASIS,
2145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2146 * See the License for the specific language governing permissions and
2147 * limitations under the License.
2151 * File: OP_NEW_ARRAY.S
2153 * Code: Create a new array. Uses no substitutions.
2157 * Description: Construct a new array of the indicated type and size.
2158 * The type must be an array type.
2160 * Format: B|A|op CCCC (22c)
2162 * Syntax: op vA, vB, type@CCCC
2163 * op vA, vB, field@CCCC
2166 movl rGLUE, %eax # %eax<- pMterpGlue
2167 movl rINST, %edx # %edx<- BA
2168 shr $4, %edx # %edx<- B
2169 movl offGlue_methodClassDex(%eax), %eax # %eax<- glue->pDvmDex
2170 FETCH 1, %ecx # %ecx<- CCCC
2171 GET_VREG %edx # %edx<- vB
2172 movl offDvmDex_pResClasses(%eax), %eax # %eax<- glue->pDvmDex->pResClasses
2173 cmp $0, %edx # check for negative length
2174 movl (%eax, %ecx, 4), %eax # %eax<- resolved class
2175 js common_errNegativeArraySize # handle negative array length
2176 cmp $0, %eax # check for null
2177 EXPORT_PC # required for resolve
2178 jne .LOP_NEW_ARRAY_finish # already resovled so continue
2179 jmp .LOP_NEW_ARRAY_resolve # need to resolve
2181 /* ------------------------------ */
2183 .L_OP_FILLED_NEW_ARRAY: /* 0x24 */
2184 /* File: x86-atom/OP_FILLED_NEW_ARRAY.S */
2185 /* Copyright (C) 2008 The Android Open Source Project
2187 * Licensed under the Apache License, Version 2.0 (the "License");
2188 * you may not use this file except in compliance with the License.
2189 * You may obtain a copy of the License at
2191 * http://www.apache.org/licenses/LICENSE-2.0
2193 * Unless required by applicable law or agreed to in writing, software
2194 * distributed under the License is distributed on an "AS IS" BASIS,
2195 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2196 * See the License for the specific language governing permissions and
2197 * limitations under the License.
2201 * File: OP_FILLED_NEW_ARRAY.S
2203 * Code: Constructs and fills an array with the given data. Provides
2207 * Description: Construct an array of the given type and size,
2208 * filling it with the supplied contents. The type
2209 * must be an array type. The array's contents
2210 * must be single-word. The constructed instance
2211 * is stored as a result in the same way that the
2212 * method invocation instructions store their results,
2213 * so the constructed instance must be moved to a
2214 * register with a subsequent move-result-object
2217 * Format: B|A|op CCCC G|F|E|D (35c)
2218 * AA|op BBBB CCCC (3rc) (range)
2220 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, vtaboff@CCCC
2221 * [B=4] op {vD, vE, vF, vG}, vtaboff@CCCC
2222 * [B=3] op {vD, vE, vF}, vtaboff@CCCC
2223 * [B=2] op {vD, vE}, vtaboff@CCCC
2224 * [B=1] op {vD}, vtaboff@CCCC
2226 * op {vCCCC .. vNNNN}, meth@BBBB
2227 * op {vCCCC .. vNNNN}, type@BBBB
2231 movl rGLUE, %edx # %edx<- MterpGlue pointer
2232 movl offGlue_methodClassDex(%edx), %edx # %edx<- glue->methodClassDex
2233 movl offDvmDex_pResClasses(%edx), %edx # %edx<- glue->methodClassDex->pResClasses
2234 FETCH 1, %ecx # %ecx<- BBBB
2236 movl (%edx, %ecx, 4), %eax # %eax<- possibly resolved class
2237 cmp $0, %eax # %eax<- check if already resolved
2238 jne .LOP_FILLED_NEW_ARRAY_continue
2239 jmp .LOP_FILLED_NEW_ARRAY_break
2241 /* ------------------------------ */
2243 .L_OP_FILLED_NEW_ARRAY_RANGE: /* 0x25 */
2244 /* File: x86-atom/OP_FILLED_NEW_ARRAY_RANGE.S */
2245 /* Copyright (C) 2008 The Android Open Source Project
2247 * Licensed under the Apache License, Version 2.0 (the "License");
2248 * you may not use this file except in compliance with the License.
2249 * You may obtain a copy of the License at
2251 * http://www.apache.org/licenses/LICENSE-2.0
2253 * Unless required by applicable law or agreed to in writing, software
2254 * distributed under the License is distributed on an "AS IS" BASIS,
2255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2256 * See the License for the specific language governing permissions and
2257 * limitations under the License.
2261 * File: OP_FILLED_NEW_ARRAY_RANGE.S
2264 /* File: x86-atom/OP_FILLED_NEW_ARRAY.S */
2265 /* Copyright (C) 2008 The Android Open Source Project
2267 * Licensed under the Apache License, Version 2.0 (the "License");
2268 * you may not use this file except in compliance with the License.
2269 * You may obtain a copy of the License at
2271 * http://www.apache.org/licenses/LICENSE-2.0
2273 * Unless required by applicable law or agreed to in writing, software
2274 * distributed under the License is distributed on an "AS IS" BASIS,
2275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2276 * See the License for the specific language governing permissions and
2277 * limitations under the License.
2281 * File: OP_FILLED_NEW_ARRAY.S
2283 * Code: Constructs and fills an array with the given data. Provides
2287 * Description: Construct an array of the given type and size,
2288 * filling it with the supplied contents. The type
2289 * must be an array type. The array's contents
2290 * must be single-word. The constructed instance
2291 * is stored as a result in the same way that the
2292 * method invocation instructions store their results,
2293 * so the constructed instance must be moved to a
2294 * register with a subsequent move-result-object
2297 * Format: B|A|op CCCC G|F|E|D (35c)
2298 * AA|op BBBB CCCC (3rc) (range)
2300 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, vtaboff@CCCC
2301 * [B=4] op {vD, vE, vF, vG}, vtaboff@CCCC
2302 * [B=3] op {vD, vE, vF}, vtaboff@CCCC
2303 * [B=2] op {vD, vE}, vtaboff@CCCC
2304 * [B=1] op {vD}, vtaboff@CCCC
2306 * op {vCCCC .. vNNNN}, meth@BBBB
2307 * op {vCCCC .. vNNNN}, type@BBBB
2311 movl rGLUE, %edx # %edx<- MterpGlue pointer
2312 movl offGlue_methodClassDex(%edx), %edx # %edx<- glue->methodClassDex
2313 movl offDvmDex_pResClasses(%edx), %edx # %edx<- glue->methodClassDex->pResClasses
2314 FETCH 1, %ecx # %ecx<- BBBB
2316 movl (%edx, %ecx, 4), %eax # %eax<- possibly resolved class
2317 cmp $0, %eax # %eax<- check if already resolved
2318 jne .LOP_FILLED_NEW_ARRAY_RANGE_continue
2319 jmp .LOP_FILLED_NEW_ARRAY_RANGE_break
2322 /* ------------------------------ */
2324 .L_OP_FILL_ARRAY_DATA: /* 0x26 */
2325 /* File: x86-atom/OP_FILL_ARRAY_DATA.S */
2326 /* Copyright (C) 2008 The Android Open Source Project
2328 * Licensed under the Apache License, Version 2.0 (the "License");
2329 * you may not use this file except in compliance with the License.
2330 * You may obtain a copy of the License at
2332 * http://www.apache.org/licenses/LICENSE-2.0
2334 * Unless required by applicable law or agreed to in writing, software
2335 * distributed under the License is distributed on an "AS IS" BASIS,
2336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2337 * See the License for the specific language governing permissions and
2338 * limitations under the License.
2342 * File: OP_FILL_ARRAY_DATA.S
2344 * Code: Fills an array with given data. Uses no substitutions.
2346 * For: fill-array-data
2348 * Description: Fill the given array with the idicated data. The reference
2349 * must be an array of primitives, and the data table must
2350 * match it in type and size
2352 * Format: AA|op BBBBlo BBBBhi (31t)
2354 * Syntax: op vAA, +BBBBBBBB
2357 FETCH 1, %ecx # %ecx<- BBBBlo
2358 FETCH 2, %edx # %edx<- BBBBhi
2359 shl $16, %edx # prepare to create +BBBBBBBB
2360 or %ecx, %edx # %edx<- +BBBBBBBB
2361 lea (rPC, %edx, 2), %edx # %edx<- PC + +BBBBBBBB; array data location
2364 push (rFP, rINST, 4)
2365 call dvmInterpHandleFillArrayData # call: (ArrayObject* arrayObject, const u2* arrayData)
2367 FFETCH_ADV 3, %edx # %edx<- next instruction hi; fetch, advance
2370 je common_exceptionThrown
2371 FGETOP_JMP 3, %edx # jump to next instruction; getop, jmp
2373 /* ------------------------------ */
2375 .L_OP_THROW: /* 0x27 */
2376 /* File: x86-atom/OP_THROW.S */
2377 /* Copyright (C) 2008 The Android Open Source Project
2379 * Licensed under the Apache License, Version 2.0 (the "License");
2380 * you may not use this file except in compliance with the License.
2381 * You may obtain a copy of the License at
2383 * http://www.apache.org/licenses/LICENSE-2.0
2385 * Unless required by applicable law or agreed to in writing, software
2386 * distributed under the License is distributed on an "AS IS" BASIS,
2387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2388 * See the License for the specific language governing permissions and
2389 * limitations under the License.
2395 * Code: Throw an exception
2399 * Description: Throw an exception object in the current thread.
2401 * Format: AA|op (11x)
2406 movl rGLUE, %eax # %eax<- pMterpGlue
2407 GET_VREG rINST # rINST<- vAA
2408 cmp $0, rINST # check for null
2409 movl offGlue_self(%eax), %ecx # %ecx<- glue->self
2410 je common_errNullObject # handle null object
2411 movl rINST, offThread_exception(%ecx) # thread->exception<- object
2412 jmp common_exceptionThrown # handle exception
2414 /* ------------------------------ */
2416 .L_OP_GOTO: /* 0x28 */
2417 /* File: x86-atom/OP_GOTO.S */
2418 /* Copyright (C) 2008 The Android Open Source Project
2420 * Licensed under the Apache License, Version 2.0 (the "License");
2421 * you may not use this file except in compliance with the License.
2422 * You may obtain a copy of the License at
2424 * http://www.apache.org/licenses/LICENSE-2.0
2426 * Unless required by applicable law or agreed to in writing, software
2427 * distributed under the License is distributed on an "AS IS" BASIS,
2428 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2429 * See the License for the specific language governing permissions and
2430 * limitations under the License.
2436 * Code: Do an unconditional branch. Uses no substitutions.
2440 * Description: Performs an unconditionally jump to the indicated instruction.
2441 * The branch uses an 8-bit offset that cannot be zero.
2443 * Format: AA|op (10t)
2450 movsbl rINSTbl, %edx # %edx<- +AA
2451 shl $1, %edx # %edx is shifted for byte offset
2452 js common_periodicChecks2 # do check on backwards branch
2453 FINISH_RB %edx, %ecx # jump to next instruction
2455 /* ------------------------------ */
2457 .L_OP_GOTO_16: /* 0x29 */
2458 /* File: x86-atom/OP_GOTO_16.S */
2459 /* Copyright (C) 2008 The Android Open Source Project
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
2465 * http://www.apache.org/licenses/LICENSE-2.0
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.
2475 * File: OP_GOTO_16.S
2477 * Code: Do an unconditional branch. Uses no substitutions.
2481 * Description: Performs an unconditionally jump to the indicated instruction.
2482 * The branch uses a 16-bit offset that cannot be zero.
2484 * Format: ØØ|op AAAA (20t)
2489 FETCHs 1, %edx # %edx<- ssssAAAA (sign-extended)
2490 shl $1, %edx # %edx is doubled to get the byte offset
2491 js common_periodicChecks2 # do check on backwards branch
2492 FINISH_RB %edx, %ecx # jump to next instruction
2494 /* ------------------------------ */
2496 .L_OP_GOTO_32: /* 0x2a */
2497 /* File: x86-atom/OP_GOTO_32.S */
2498 /* Copyright (C) 2008 The Android Open Source Project
2500 * Licensed under the Apache License, Version 2.0 (the "License");
2501 * you may not use this file except in compliance with the License.
2502 * You may obtain a copy of the License at
2504 * http://www.apache.org/licenses/LICENSE-2.0
2506 * Unless required by applicable law or agreed to in writing, software
2507 * distributed under the License is distributed on an "AS IS" BASIS,
2508 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2509 * See the License for the specific language governing permissions and
2510 * limitations under the License.
2514 * File: OP_GOTO_32.S
2516 * Code: Do an unconditional branch. Uses no substitutions.
2520 * Description: Performs an unconditionally jump to the indicated instruction.
2521 * The branch uses a 32-bit offset that can be zero.
2523 * Format: ØØ|op AAAAlo AAAAhi (30t)
2525 * Syntax: op +AAAAAAAA
2528 FETCH 1, %edx # %edx<- AAAAlo
2529 FETCH 2, %ecx # %ecx<- AAAAhi
2530 shl $16, %ecx # prepare to create +AAAAAAAA
2531 or %ecx, %edx # %edx<- +AAAAAAAA
2532 shl $1, %edx # %edx is doubled to get the byte offset
2533 jle common_periodicChecks2 # do check on backwards branch
2534 FINISH_RB %edx, %ecx # jump to next instruction
2536 /* ------------------------------ */
2538 .L_OP_PACKED_SWITCH: /* 0x2b */
2539 /* File: x86-atom/OP_PACKED_SWITCH.S */
2540 /* Copyright (C) 2008 The Android Open Source Project
2542 * Licensed under the Apache License, Version 2.0 (the "License");
2543 * you may not use this file except in compliance with the License.
2544 * You may obtain a copy of the License at
2546 * http://www.apache.org/licenses/LICENSE-2.0
2548 * Unless required by applicable law or agreed to in writing, software
2549 * distributed under the License is distributed on an "AS IS" BASIS,
2550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2551 * See the License for the specific language governing permissions and
2552 * limitations under the License.
2556 * File: OP_PACKED_SWITCH.S
2558 * Code: Jump to a new instruction using a jump table
2560 * For: packed-switch, sparse-switch
2562 * Description: Jump to a new instruction based on the value in the given
2563 * register, using a table of offsets corresponding to each
2564 * value in a particular integral range, or fall through to
2565 * the next instruction if there is no match.
2567 * Format: AA|op BBBBlo BBBBhi (31t)
2569 * Syntax: op vAA, +BBBBBBBB
2573 FETCH 1, %ecx # %ecx<- BBBBlo
2574 FETCH 2, %edx # %edx<- BBBBhi
2575 shl $16, %edx # prepare to create +BBBBBBBB
2576 or %edx, %ecx # %ecx<- +BBBBBBBB
2577 GET_VREG rINST # rINST<- vAA
2578 movl rINST, -4(%esp) # push parameter vAA
2579 lea (rPC, %ecx, 2), %ecx # %ecx<- PC + +BBBBBBBB*2
2580 movl %ecx, -8(%esp) # push parameter PC + +BBBBBBBB*2
2582 call dvmInterpHandlePackedSwitch # call code-unit branch offset
2583 shl $1, %eax # shift for byte offset
2584 movl %eax, %edx # %edx<- offset
2586 jle common_periodicChecks2 # do backward branch
2587 jmp .LOP_PACKED_SWITCH_finish
2589 /* ------------------------------ */
2591 .L_OP_SPARSE_SWITCH: /* 0x2c */
2592 /* File: x86-atom/OP_SPARSE_SWITCH.S */
2593 /* Copyright (C) 2008 The Android Open Source Project
2595 * Licensed under the Apache License, Version 2.0 (the "License");
2596 * you may not use this file except in compliance with the License.
2597 * You may obtain a copy of the License at
2599 * http://www.apache.org/licenses/LICENSE-2.0
2601 * Unless required by applicable law or agreed to in writing, software
2602 * distributed under the License is distributed on an "AS IS" BASIS,
2603 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2604 * See the License for the specific language governing permissions and
2605 * limitations under the License.
2609 * File: OP_SPARSE_SWITCH.S
2612 /* File: x86-atom/OP_PACKED_SWITCH.S */
2613 /* Copyright (C) 2008 The Android Open Source Project
2615 * Licensed under the Apache License, Version 2.0 (the "License");
2616 * you may not use this file except in compliance with the License.
2617 * You may obtain a copy of the License at
2619 * http://www.apache.org/licenses/LICENSE-2.0
2621 * Unless required by applicable law or agreed to in writing, software
2622 * distributed under the License is distributed on an "AS IS" BASIS,
2623 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2624 * See the License for the specific language governing permissions and
2625 * limitations under the License.
2629 * File: OP_PACKED_SWITCH.S
2631 * Code: Jump to a new instruction using a jump table
2633 * For: packed-switch, sparse-switch
2635 * Description: Jump to a new instruction based on the value in the given
2636 * register, using a table of offsets corresponding to each
2637 * value in a particular integral range, or fall through to
2638 * the next instruction if there is no match.
2640 * Format: AA|op BBBBlo BBBBhi (31t)
2642 * Syntax: op vAA, +BBBBBBBB
2646 FETCH 1, %ecx # %ecx<- BBBBlo
2647 FETCH 2, %edx # %edx<- BBBBhi
2648 shl $16, %edx # prepare to create +BBBBBBBB
2649 or %edx, %ecx # %ecx<- +BBBBBBBB
2650 GET_VREG rINST # rINST<- vAA
2651 movl rINST, -4(%esp) # push parameter vAA
2652 lea (rPC, %ecx, 2), %ecx # %ecx<- PC + +BBBBBBBB*2
2653 movl %ecx, -8(%esp) # push parameter PC + +BBBBBBBB*2
2655 call dvmInterpHandleSparseSwitch # call code-unit branch offset
2656 shl $1, %eax # shift for byte offset
2657 movl %eax, %edx # %edx<- offset
2659 jle common_periodicChecks2 # do backward branch
2660 jmp .LOP_SPARSE_SWITCH_finish
2663 /* ------------------------------ */
2665 .L_OP_CMPL_FLOAT: /* 0x2d */
2666 /* File: x86-atom/OP_CMPL_FLOAT.S */
2667 /* Copyright (C) 2008 The Android Open Source Project
2669 * Licensed under the Apache License, Version 2.0 (the "License");
2670 * you may not use this file except in compliance with the License.
2671 * You may obtain a copy of the License at
2673 * http://www.apache.org/licenses/LICENSE-2.0
2675 * Unless required by applicable law or agreed to in writing, software
2676 * distributed under the License is distributed on an "AS IS" BASIS,
2677 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2678 * See the License for the specific language governing permissions and
2679 * limitations under the License.
2683 * File: OP_CMPL_FLOAT.S
2685 * Code: Provides a "nan" variable to specify the return value for
2686 * NaN. Provides a variable "sod" which appends a "s" or a "d"
2687 * to the move and comparison instructions, depending on if we
2688 * are working with a float or a double. For instructions
2689 * cmpx-float and cmpx-double, the x will be eiher a g or a l
2690 * to specify positive or negative bias for NaN.
2692 * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
2694 * Description: Perform the indicated floating point or long comparison,
2695 * storing 0 if the two arguments are equal, 1 if the second
2696 * argument is larger, or -1 if the first argument is larger.
2698 * Format: AA|op CC|BB (23x)
2700 * Syntax: op vAA, vBB, vCC
2704 FETCH_BB 1, %ecx # %ecx<- BB
2705 FETCH_CC 1, %edx # %edx<- CC
2714 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
2715 ja .LOP_CMPL_FLOAT_greater
2716 jp .LOP_CMPL_FLOAT_finalNan
2717 jz .LOP_CMPL_FLOAT_final
2719 .LOP_CMPL_FLOAT_less:
2720 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
2721 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
2724 /* ------------------------------ */
2726 .L_OP_CMPG_FLOAT: /* 0x2e */
2727 /* File: x86-atom/OP_CMPG_FLOAT.S */
2728 /* Copyright (C) 2008 The Android Open Source Project
2730 * Licensed under the Apache License, Version 2.0 (the "License");
2731 * you may not use this file except in compliance with the License.
2732 * You may obtain a copy of the License at
2734 * http://www.apache.org/licenses/LICENSE-2.0
2736 * Unless required by applicable law or agreed to in writing, software
2737 * distributed under the License is distributed on an "AS IS" BASIS,
2738 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2739 * See the License for the specific language governing permissions and
2740 * limitations under the License.
2744 * File: OP_CMPG_FLOAT.S
2747 /* File: x86-atom/OP_CMPL_FLOAT.S */
2748 /* Copyright (C) 2008 The Android Open Source Project
2750 * Licensed under the Apache License, Version 2.0 (the "License");
2751 * you may not use this file except in compliance with the License.
2752 * You may obtain a copy of the License at
2754 * http://www.apache.org/licenses/LICENSE-2.0
2756 * Unless required by applicable law or agreed to in writing, software
2757 * distributed under the License is distributed on an "AS IS" BASIS,
2758 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2759 * See the License for the specific language governing permissions and
2760 * limitations under the License.
2764 * File: OP_CMPL_FLOAT.S
2766 * Code: Provides a "nan" variable to specify the return value for
2767 * NaN. Provides a variable "sod" which appends a "s" or a "d"
2768 * to the move and comparison instructions, depending on if we
2769 * are working with a float or a double. For instructions
2770 * cmpx-float and cmpx-double, the x will be eiher a g or a l
2771 * to specify positive or negative bias for NaN.
2773 * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
2775 * Description: Perform the indicated floating point or long comparison,
2776 * storing 0 if the two arguments are equal, 1 if the second
2777 * argument is larger, or -1 if the first argument is larger.
2779 * Format: AA|op CC|BB (23x)
2781 * Syntax: op vAA, vBB, vCC
2785 FETCH_BB 1, %ecx # %ecx<- BB
2786 FETCH_CC 1, %edx # %edx<- CC
2795 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
2796 ja .LOP_CMPG_FLOAT_greater
2797 jp .LOP_CMPG_FLOAT_finalNan
2798 jz .LOP_CMPG_FLOAT_final
2800 .LOP_CMPG_FLOAT_less:
2801 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
2802 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
2806 /* ------------------------------ */
2808 .L_OP_CMPL_DOUBLE: /* 0x2f */
2809 /* File: x86-atom/OP_CMPL_DOUBLE.S */
2810 /* Copyright (C) 2008 The Android Open Source Project
2812 * Licensed under the Apache License, Version 2.0 (the "License");
2813 * you may not use this file except in compliance with the License.
2814 * You may obtain a copy of the License at
2816 * http://www.apache.org/licenses/LICENSE-2.0
2818 * Unless required by applicable law or agreed to in writing, software
2819 * distributed under the License is distributed on an "AS IS" BASIS,
2820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2821 * See the License for the specific language governing permissions and
2822 * limitations under the License.
2826 * File: OP_CMPL_DOUBLE.S
2829 /* File: x86-atom/OP_CMPL_FLOAT.S */
2830 /* Copyright (C) 2008 The Android Open Source Project
2832 * Licensed under the Apache License, Version 2.0 (the "License");
2833 * you may not use this file except in compliance with the License.
2834 * You may obtain a copy of the License at
2836 * http://www.apache.org/licenses/LICENSE-2.0
2838 * Unless required by applicable law or agreed to in writing, software
2839 * distributed under the License is distributed on an "AS IS" BASIS,
2840 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2841 * See the License for the specific language governing permissions and
2842 * limitations under the License.
2846 * File: OP_CMPL_FLOAT.S
2848 * Code: Provides a "nan" variable to specify the return value for
2849 * NaN. Provides a variable "sod" which appends a "s" or a "d"
2850 * to the move and comparison instructions, depending on if we
2851 * are working with a float or a double. For instructions
2852 * cmpx-float and cmpx-double, the x will be eiher a g or a l
2853 * to specify positive or negative bias for NaN.
2855 * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
2857 * Description: Perform the indicated floating point or long comparison,
2858 * storing 0 if the two arguments are equal, 1 if the second
2859 * argument is larger, or -1 if the first argument is larger.
2861 * Format: AA|op CC|BB (23x)
2863 * Syntax: op vAA, vBB, vCC
2867 FETCH_BB 1, %ecx # %ecx<- BB
2868 FETCH_CC 1, %edx # %edx<- CC
2877 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
2878 ja .LOP_CMPL_DOUBLE_greater
2879 jp .LOP_CMPL_DOUBLE_finalNan
2880 jz .LOP_CMPL_DOUBLE_final
2882 .LOP_CMPL_DOUBLE_less:
2883 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
2884 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
2888 /* ------------------------------ */
2890 .L_OP_CMPG_DOUBLE: /* 0x30 */
2891 /* File: x86-atom/OP_CMPG_DOUBLE.S */
2892 /* Copyright (C) 2008 The Android Open Source Project
2894 * Licensed under the Apache License, Version 2.0 (the "License");
2895 * you may not use this file except in compliance with the License.
2896 * You may obtain a copy of the License at
2898 * http://www.apache.org/licenses/LICENSE-2.0
2900 * Unless required by applicable law or agreed to in writing, software
2901 * distributed under the License is distributed on an "AS IS" BASIS,
2902 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2903 * See the License for the specific language governing permissions and
2904 * limitations under the License.
2908 * File: OP_CMPG_DOUBLE.S
2911 /* File: x86-atom/OP_CMPL_FLOAT.S */
2912 /* Copyright (C) 2008 The Android Open Source Project
2914 * Licensed under the Apache License, Version 2.0 (the "License");
2915 * you may not use this file except in compliance with the License.
2916 * You may obtain a copy of the License at
2918 * http://www.apache.org/licenses/LICENSE-2.0
2920 * Unless required by applicable law or agreed to in writing, software
2921 * distributed under the License is distributed on an "AS IS" BASIS,
2922 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2923 * See the License for the specific language governing permissions and
2924 * limitations under the License.
2928 * File: OP_CMPL_FLOAT.S
2930 * Code: Provides a "nan" variable to specify the return value for
2931 * NaN. Provides a variable "sod" which appends a "s" or a "d"
2932 * to the move and comparison instructions, depending on if we
2933 * are working with a float or a double. For instructions
2934 * cmpx-float and cmpx-double, the x will be eiher a g or a l
2935 * to specify positive or negative bias for NaN.
2937 * For: cmpg-double, dmpg-float, cmpl-double, cmpl-float
2939 * Description: Perform the indicated floating point or long comparison,
2940 * storing 0 if the two arguments are equal, 1 if the second
2941 * argument is larger, or -1 if the first argument is larger.
2943 * Format: AA|op CC|BB (23x)
2945 * Syntax: op vAA, vBB, vCC
2949 FETCH_BB 1, %ecx # %ecx<- BB
2950 FETCH_CC 1, %edx # %edx<- CC
2959 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
2960 ja .LOP_CMPG_DOUBLE_greater
2961 jp .LOP_CMPG_DOUBLE_finalNan
2962 jz .LOP_CMPG_DOUBLE_final
2964 .LOP_CMPG_DOUBLE_less:
2965 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
2966 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
2970 /* ------------------------------ */
2972 .L_OP_CMP_LONG: /* 0x31 */
2973 /* File: x86-atom/OP_CMP_LONG.S */
2974 /* Copyright (C) 2008 The Android Open Source Project
2976 * Licensed under the Apache License, Version 2.0 (the "License");
2977 * you may not use this file except in compliance with the License.
2978 * You may obtain a copy of the License at
2980 * http://www.apache.org/licenses/LICENSE-2.0
2982 * Unless required by applicable law or agreed to in writing, software
2983 * distributed under the License is distributed on an "AS IS" BASIS,
2984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2985 * See the License for the specific language governing permissions and
2986 * limitations under the License.
2990 * File: OP_CMP_LONG.S
2992 * Code: Compare floating point values. Uses no substitutions.
2996 * Description: Perform a long comparison, storing 0 if the two
2997 * arguments are equal, 1 if the second argument is larger
2998 * or -1 if the first argument is larger.
3000 * Format: AA|op CC|BB (23x)
3002 * Syntax: op vAA, vBB, vCC
3005 FETCH_BB 1, %ecx # %ecx<- BB
3006 FETCH_CC 1, %edx # %edx<- CC
3007 movl 4(rFP, %ecx, 4), %eax # %eax<- vBBhi
3008 cmp 4(rFP, %edx, 4), %eax # compare vCChi and vBBhi
3009 jl .LOP_CMP_LONG_less
3010 jg .LOP_CMP_LONG_greater
3011 movl (rFP, %ecx, 4), %eax # %eax<- vBBlo
3012 cmp (rFP, %edx, 4), %eax # compare vCClo and vBBlo
3013 ja .LOP_CMP_LONG_greater
3014 jne .LOP_CMP_LONG_less
3015 jmp .LOP_CMP_LONG_final
3017 /* ------------------------------ */
3019 .L_OP_IF_EQ: /* 0x32 */
3020 /* File: x86-atom/OP_IF_EQ.S */
3021 /* Copyright (C) 2008 The Android Open Source Project
3023 * Licensed under the Apache License, Version 2.0 (the "License");
3024 * you may not use this file except in compliance with the License.
3025 * You may obtain a copy of the License at
3027 * http://www.apache.org/licenses/LICENSE-2.0
3029 * Unless required by applicable law or agreed to in writing, software
3030 * distributed under the License is distributed on an "AS IS" BASIS,
3031 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3032 * See the License for the specific language governing permissions and
3033 * limitations under the License.
3040 /* File: x86-atom/bincmp.S */
3041 /* Copyright (C) 2008 The Android Open Source Project
3043 * Licensed under the Apache License, Version 2.0 (the "License");
3044 * you may not use this file except in compliance with the License.
3045 * You may obtain a copy of the License at
3047 * http://www.apache.org/licenses/LICENSE-2.0
3049 * Unless required by applicable law or agreed to in writing, software
3050 * distributed under the License is distributed on an "AS IS" BASIS,
3051 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3052 * See the License for the specific language governing permissions and
3053 * limitations under the License.
3059 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3060 * variable to specify the reverse comparison to perform.
3062 * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
3064 * Description: Branch to the given destination if the comparison
3065 * test between the given registers values is true.
3067 * Format: B|A|op CCCC (22t)
3069 * Syntax: op vA, vB, +CCCC
3072 movl rINST, %eax # %eax<- BA
3073 andl $15, rINST # rINST<- A
3074 shr $4, %eax # %eax<- B
3075 GET_VREG rINST # rINST<- vA
3076 movl $4, %edx # %edx<- 4
3077 cmp (rFP, %eax, 4), rINST # compare vA and vB
3078 jne 1f # goto next instruction if reverse
3079 # comparison is true
3080 FETCHs 1, %edx # %edx<- +CCCC, Branch offset
3082 js common_periodicChecks2
3084 FINISH_RB %edx, %ecx # jump to next instruction
3087 /* ------------------------------ */
3089 .L_OP_IF_NE: /* 0x33 */
3090 /* File: x86-atom/OP_IF_NE.S */
3091 /* Copyright (C) 2008 The Android Open Source Project
3093 * Licensed under the Apache License, Version 2.0 (the "License");
3094 * you may not use this file except in compliance with the License.
3095 * You may obtain a copy of the License at
3097 * http://www.apache.org/licenses/LICENSE-2.0
3099 * Unless required by applicable law or agreed to in writing, software
3100 * distributed under the License is distributed on an "AS IS" BASIS,
3101 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3102 * See the License for the specific language governing permissions and
3103 * limitations under the License.
3110 /* File: x86-atom/bincmp.S */
3111 /* Copyright (C) 2008 The Android Open Source Project
3113 * Licensed under the Apache License, Version 2.0 (the "License");
3114 * you may not use this file except in compliance with the License.
3115 * You may obtain a copy of the License at
3117 * http://www.apache.org/licenses/LICENSE-2.0
3119 * Unless required by applicable law or agreed to in writing, software
3120 * distributed under the License is distributed on an "AS IS" BASIS,
3121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3122 * See the License for the specific language governing permissions and
3123 * limitations under the License.
3129 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3130 * variable to specify the reverse comparison to perform.
3132 * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
3134 * Description: Branch to the given destination if the comparison
3135 * test between the given registers values is true.
3137 * Format: B|A|op CCCC (22t)
3139 * Syntax: op vA, vB, +CCCC
3142 movl rINST, %eax # %eax<- BA
3143 andl $15, rINST # rINST<- A
3144 shr $4, %eax # %eax<- B
3145 GET_VREG rINST # rINST<- vA
3146 movl $4, %edx # %edx<- 4
3147 cmp (rFP, %eax, 4), rINST # compare vA and vB
3148 je 1f # goto next instruction if reverse
3149 # comparison is true
3150 FETCHs 1, %edx # %edx<- +CCCC, Branch offset
3152 js common_periodicChecks2
3154 FINISH_RB %edx, %ecx # jump to next instruction
3157 /* ------------------------------ */
3159 .L_OP_IF_LT: /* 0x34 */
3160 /* File: x86-atom/OP_IF_LT.S */
3161 /* Copyright (C) 2008 The Android Open Source Project
3163 * Licensed under the Apache License, Version 2.0 (the "License");
3164 * you may not use this file except in compliance with the License.
3165 * You may obtain a copy of the License at
3167 * http://www.apache.org/licenses/LICENSE-2.0
3169 * Unless required by applicable law or agreed to in writing, software
3170 * distributed under the License is distributed on an "AS IS" BASIS,
3171 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3172 * See the License for the specific language governing permissions and
3173 * limitations under the License.
3180 /* File: x86-atom/bincmp.S */
3181 /* Copyright (C) 2008 The Android Open Source Project
3183 * Licensed under the Apache License, Version 2.0 (the "License");
3184 * you may not use this file except in compliance with the License.
3185 * You may obtain a copy of the License at
3187 * http://www.apache.org/licenses/LICENSE-2.0
3189 * Unless required by applicable law or agreed to in writing, software
3190 * distributed under the License is distributed on an "AS IS" BASIS,
3191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3192 * See the License for the specific language governing permissions and
3193 * limitations under the License.
3199 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3200 * variable to specify the reverse comparison to perform.
3202 * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
3204 * Description: Branch to the given destination if the comparison
3205 * test between the given registers values is true.
3207 * Format: B|A|op CCCC (22t)
3209 * Syntax: op vA, vB, +CCCC
3212 movl rINST, %eax # %eax<- BA
3213 andl $15, rINST # rINST<- A
3214 shr $4, %eax # %eax<- B
3215 GET_VREG rINST # rINST<- vA
3216 movl $4, %edx # %edx<- 4
3217 cmp (rFP, %eax, 4), rINST # compare vA and vB
3218 jge 1f # goto next instruction if reverse
3219 # comparison is true
3220 FETCHs 1, %edx # %edx<- +CCCC, Branch offset
3222 js common_periodicChecks2
3224 FINISH_RB %edx, %ecx # jump to next instruction
3227 /* ------------------------------ */
3229 .L_OP_IF_GE: /* 0x35 */
3230 /* File: x86-atom/OP_IF_GE.S */
3231 /* Copyright (C) 2008 The Android Open Source Project
3233 * Licensed under the Apache License, Version 2.0 (the "License");
3234 * you may not use this file except in compliance with the License.
3235 * You may obtain a copy of the License at
3237 * http://www.apache.org/licenses/LICENSE-2.0
3239 * Unless required by applicable law or agreed to in writing, software
3240 * distributed under the License is distributed on an "AS IS" BASIS,
3241 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3242 * See the License for the specific language governing permissions and
3243 * limitations under the License.
3250 /* File: x86-atom/bincmp.S */
3251 /* Copyright (C) 2008 The Android Open Source Project
3253 * Licensed under the Apache License, Version 2.0 (the "License");
3254 * you may not use this file except in compliance with the License.
3255 * You may obtain a copy of the License at
3257 * http://www.apache.org/licenses/LICENSE-2.0
3259 * Unless required by applicable law or agreed to in writing, software
3260 * distributed under the License is distributed on an "AS IS" BASIS,
3261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3262 * See the License for the specific language governing permissions and
3263 * limitations under the License.
3269 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3270 * variable to specify the reverse comparison to perform.
3272 * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
3274 * Description: Branch to the given destination if the comparison
3275 * test between the given registers values is true.
3277 * Format: B|A|op CCCC (22t)
3279 * Syntax: op vA, vB, +CCCC
3282 movl rINST, %eax # %eax<- BA
3283 andl $15, rINST # rINST<- A
3284 shr $4, %eax # %eax<- B
3285 GET_VREG rINST # rINST<- vA
3286 movl $4, %edx # %edx<- 4
3287 cmp (rFP, %eax, 4), rINST # compare vA and vB
3288 jl 1f # goto next instruction if reverse
3289 # comparison is true
3290 FETCHs 1, %edx # %edx<- +CCCC, Branch offset
3292 js common_periodicChecks2
3294 FINISH_RB %edx, %ecx # jump to next instruction
3297 /* ------------------------------ */
3299 .L_OP_IF_GT: /* 0x36 */
3300 /* File: x86-atom/OP_IF_GT.S */
3301 /* Copyright (C) 2008 The Android Open Source Project
3303 * Licensed under the Apache License, Version 2.0 (the "License");
3304 * you may not use this file except in compliance with the License.
3305 * You may obtain a copy of the License at
3307 * http://www.apache.org/licenses/LICENSE-2.0
3309 * Unless required by applicable law or agreed to in writing, software
3310 * distributed under the License is distributed on an "AS IS" BASIS,
3311 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3312 * See the License for the specific language governing permissions and
3313 * limitations under the License.
3320 /* File: x86-atom/bincmp.S */
3321 /* Copyright (C) 2008 The Android Open Source Project
3323 * Licensed under the Apache License, Version 2.0 (the "License");
3324 * you may not use this file except in compliance with the License.
3325 * You may obtain a copy of the License at
3327 * http://www.apache.org/licenses/LICENSE-2.0
3329 * Unless required by applicable law or agreed to in writing, software
3330 * distributed under the License is distributed on an "AS IS" BASIS,
3331 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3332 * See the License for the specific language governing permissions and
3333 * limitations under the License.
3339 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3340 * variable to specify the reverse comparison to perform.
3342 * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
3344 * Description: Branch to the given destination if the comparison
3345 * test between the given registers values is true.
3347 * Format: B|A|op CCCC (22t)
3349 * Syntax: op vA, vB, +CCCC
3352 movl rINST, %eax # %eax<- BA
3353 andl $15, rINST # rINST<- A
3354 shr $4, %eax # %eax<- B
3355 GET_VREG rINST # rINST<- vA
3356 movl $4, %edx # %edx<- 4
3357 cmp (rFP, %eax, 4), rINST # compare vA and vB
3358 jle 1f # goto next instruction if reverse
3359 # comparison is true
3360 FETCHs 1, %edx # %edx<- +CCCC, Branch offset
3362 js common_periodicChecks2
3364 FINISH_RB %edx, %ecx # jump to next instruction
3367 /* ------------------------------ */
3369 .L_OP_IF_LE: /* 0x37 */
3370 /* File: x86-atom/OP_IF_LE.S */
3371 /* Copyright (C) 2008 The Android Open Source Project
3373 * Licensed under the Apache License, Version 2.0 (the "License");
3374 * you may not use this file except in compliance with the License.
3375 * You may obtain a copy of the License at
3377 * http://www.apache.org/licenses/LICENSE-2.0
3379 * Unless required by applicable law or agreed to in writing, software
3380 * distributed under the License is distributed on an "AS IS" BASIS,
3381 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3382 * See the License for the specific language governing permissions and
3383 * limitations under the License.
3390 /* File: x86-atom/bincmp.S */
3391 /* Copyright (C) 2008 The Android Open Source Project
3393 * Licensed under the Apache License, Version 2.0 (the "License");
3394 * you may not use this file except in compliance with the License.
3395 * You may obtain a copy of the License at
3397 * http://www.apache.org/licenses/LICENSE-2.0
3399 * Unless required by applicable law or agreed to in writing, software
3400 * distributed under the License is distributed on an "AS IS" BASIS,
3401 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3402 * See the License for the specific language governing permissions and
3403 * limitations under the License.
3409 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3410 * variable to specify the reverse comparison to perform.
3412 * For: if-eq, if-ge, if-gt, if-le, if-lt, if-ne
3414 * Description: Branch to the given destination if the comparison
3415 * test between the given registers values is true.
3417 * Format: B|A|op CCCC (22t)
3419 * Syntax: op vA, vB, +CCCC
3422 movl rINST, %eax # %eax<- BA
3423 andl $15, rINST # rINST<- A
3424 shr $4, %eax # %eax<- B
3425 GET_VREG rINST # rINST<- vA
3426 movl $4, %edx # %edx<- 4
3427 cmp (rFP, %eax, 4), rINST # compare vA and vB
3428 jg 1f # goto next instruction if reverse
3429 # comparison is true
3430 FETCHs 1, %edx # %edx<- +CCCC, Branch offset
3432 js common_periodicChecks2
3434 FINISH_RB %edx, %ecx # jump to next instruction
3437 /* ------------------------------ */
3439 .L_OP_IF_EQZ: /* 0x38 */
3440 /* File: x86-atom/OP_IF_EQZ.S */
3441 /* Copyright (C) 2008 The Android Open Source Project
3443 * Licensed under the Apache License, Version 2.0 (the "License");
3444 * you may not use this file except in compliance with the License.
3445 * You may obtain a copy of the License at
3447 * http://www.apache.org/licenses/LICENSE-2.0
3449 * Unless required by applicable law or agreed to in writing, software
3450 * distributed under the License is distributed on an "AS IS" BASIS,
3451 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3452 * See the License for the specific language governing permissions and
3453 * limitations under the License.
3460 /* File: x86-atom/zcmp.S */
3461 /* Copyright (C) 2008 The Android Open Source Project
3463 * Licensed under the Apache License, Version 2.0 (the "License");
3464 * you may not use this file except in compliance with the License.
3465 * You may obtain a copy of the License at
3467 * http://www.apache.org/licenses/LICENSE-2.0
3469 * Unless required by applicable law or agreed to in writing, software
3470 * distributed under the License is distributed on an "AS IS" BASIS,
3471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3472 * See the License for the specific language governing permissions and
3473 * limitations under the License.
3479 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3480 * variable to specify the reverse comparison to perform
3482 * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
3484 * Description: Branch to the given destination if the given register's
3485 * value compares with 0 as specified.
3487 * Format: AA|op BBBB (21t)
3489 * Syntax: op vAA, +BBBB
3492 cmp $0, (rFP, rINST, 4) # compare vAA with zero
3493 jne OP_IF_EQZ_2f # goto next instruction or branch
3494 FETCHs 1, %edx # %edx<- BBBB; branch offset
3495 sal $1, %edx # %edx<- adjust byte offset
3498 * Inline common_backwardBranch
3501 js common_periodicChecks2 # jump on backwards branch
3503 FINISH_RB %edx, %ecx # jump to next instruction
3510 movzbl 4(rPC), %edx # grab the next opcode
3511 movzbl 5(rPC), rINST # update the instruction
3512 addl $4, rPC # update the program counter
3513 jmp *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
3516 /* ------------------------------ */
3518 .L_OP_IF_NEZ: /* 0x39 */
3519 /* File: x86-atom/OP_IF_NEZ.S */
3520 /* Copyright (C) 2008 The Android Open Source Project
3522 * Licensed under the Apache License, Version 2.0 (the "License");
3523 * you may not use this file except in compliance with the License.
3524 * You may obtain a copy of the License at
3526 * http://www.apache.org/licenses/LICENSE-2.0
3528 * Unless required by applicable law or agreed to in writing, software
3529 * distributed under the License is distributed on an "AS IS" BASIS,
3530 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3531 * See the License for the specific language governing permissions and
3532 * limitations under the License.
3539 /* File: x86-atom/zcmp.S */
3540 /* Copyright (C) 2008 The Android Open Source Project
3542 * Licensed under the Apache License, Version 2.0 (the "License");
3543 * you may not use this file except in compliance with the License.
3544 * You may obtain a copy of the License at
3546 * http://www.apache.org/licenses/LICENSE-2.0
3548 * Unless required by applicable law or agreed to in writing, software
3549 * distributed under the License is distributed on an "AS IS" BASIS,
3550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3551 * See the License for the specific language governing permissions and
3552 * limitations under the License.
3558 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3559 * variable to specify the reverse comparison to perform
3561 * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
3563 * Description: Branch to the given destination if the given register's
3564 * value compares with 0 as specified.
3566 * Format: AA|op BBBB (21t)
3568 * Syntax: op vAA, +BBBB
3571 cmp $0, (rFP, rINST, 4) # compare vAA with zero
3572 je OP_IF_NEZ_2f # goto next instruction or branch
3573 FETCHs 1, %edx # %edx<- BBBB; branch offset
3574 sal $1, %edx # %edx<- adjust byte offset
3577 * Inline common_backwardBranch
3580 js common_periodicChecks2 # jump on backwards branch
3582 FINISH_RB %edx, %ecx # jump to next instruction
3589 movzbl 4(rPC), %edx # grab the next opcode
3590 movzbl 5(rPC), rINST # update the instruction
3591 addl $4, rPC # update the program counter
3592 jmp *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
3595 /* ------------------------------ */
3597 .L_OP_IF_LTZ: /* 0x3a */
3598 /* File: x86-atom/OP_IF_LTZ.S */
3599 /* Copyright (C) 2008 The Android Open Source Project
3601 * Licensed under the Apache License, Version 2.0 (the "License");
3602 * you may not use this file except in compliance with the License.
3603 * You may obtain a copy of the License at
3605 * http://www.apache.org/licenses/LICENSE-2.0
3607 * Unless required by applicable law or agreed to in writing, software
3608 * distributed under the License is distributed on an "AS IS" BASIS,
3609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3610 * See the License for the specific language governing permissions and
3611 * limitations under the License.
3618 /* File: x86-atom/zcmp.S */
3619 /* Copyright (C) 2008 The Android Open Source Project
3621 * Licensed under the Apache License, Version 2.0 (the "License");
3622 * you may not use this file except in compliance with the License.
3623 * You may obtain a copy of the License at
3625 * http://www.apache.org/licenses/LICENSE-2.0
3627 * Unless required by applicable law or agreed to in writing, software
3628 * distributed under the License is distributed on an "AS IS" BASIS,
3629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3630 * See the License for the specific language governing permissions and
3631 * limitations under the License.
3637 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3638 * variable to specify the reverse comparison to perform
3640 * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
3642 * Description: Branch to the given destination if the given register's
3643 * value compares with 0 as specified.
3645 * Format: AA|op BBBB (21t)
3647 * Syntax: op vAA, +BBBB
3650 cmp $0, (rFP, rINST, 4) # compare vAA with zero
3651 jge OP_IF_LTZ_2f # goto next instruction or branch
3652 FETCHs 1, %edx # %edx<- BBBB; branch offset
3653 sal $1, %edx # %edx<- adjust byte offset
3656 * Inline common_backwardBranch
3659 js common_periodicChecks2 # jump on backwards branch
3661 FINISH_RB %edx, %ecx # jump to next instruction
3668 movzbl 4(rPC), %edx # grab the next opcode
3669 movzbl 5(rPC), rINST # update the instruction
3670 addl $4, rPC # update the program counter
3671 jmp *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
3674 /* ------------------------------ */
3676 .L_OP_IF_GEZ: /* 0x3b */
3677 /* File: x86-atom/OP_IF_GEZ.S */
3678 /* Copyright (C) 2008 The Android Open Source Project
3680 * Licensed under the Apache License, Version 2.0 (the "License");
3681 * you may not use this file except in compliance with the License.
3682 * You may obtain a copy of the License at
3684 * http://www.apache.org/licenses/LICENSE-2.0
3686 * Unless required by applicable law or agreed to in writing, software
3687 * distributed under the License is distributed on an "AS IS" BASIS,
3688 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3689 * See the License for the specific language governing permissions and
3690 * limitations under the License.
3697 /* File: x86-atom/zcmp.S */
3698 /* Copyright (C) 2008 The Android Open Source Project
3700 * Licensed under the Apache License, Version 2.0 (the "License");
3701 * you may not use this file except in compliance with the License.
3702 * You may obtain a copy of the License at
3704 * http://www.apache.org/licenses/LICENSE-2.0
3706 * Unless required by applicable law or agreed to in writing, software
3707 * distributed under the License is distributed on an "AS IS" BASIS,
3708 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3709 * See the License for the specific language governing permissions and
3710 * limitations under the License.
3716 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3717 * variable to specify the reverse comparison to perform
3719 * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
3721 * Description: Branch to the given destination if the given register's
3722 * value compares with 0 as specified.
3724 * Format: AA|op BBBB (21t)
3726 * Syntax: op vAA, +BBBB
3729 cmp $0, (rFP, rINST, 4) # compare vAA with zero
3730 jl OP_IF_GEZ_2f # goto next instruction or branch
3731 FETCHs 1, %edx # %edx<- BBBB; branch offset
3732 sal $1, %edx # %edx<- adjust byte offset
3735 * Inline common_backwardBranch
3738 js common_periodicChecks2 # jump on backwards branch
3740 FINISH_RB %edx, %ecx # jump to next instruction
3747 movzbl 4(rPC), %edx # grab the next opcode
3748 movzbl 5(rPC), rINST # update the instruction
3749 addl $4, rPC # update the program counter
3750 jmp *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
3753 /* ------------------------------ */
3755 .L_OP_IF_GTZ: /* 0x3c */
3756 /* File: x86-atom/OP_IF_GTZ.S */
3757 /* Copyright (C) 2008 The Android Open Source Project
3759 * Licensed under the Apache License, Version 2.0 (the "License");
3760 * you may not use this file except in compliance with the License.
3761 * You may obtain a copy of the License at
3763 * http://www.apache.org/licenses/LICENSE-2.0
3765 * Unless required by applicable law or agreed to in writing, software
3766 * distributed under the License is distributed on an "AS IS" BASIS,
3767 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3768 * See the License for the specific language governing permissions and
3769 * limitations under the License.
3776 /* File: x86-atom/zcmp.S */
3777 /* Copyright (C) 2008 The Android Open Source Project
3779 * Licensed under the Apache License, Version 2.0 (the "License");
3780 * you may not use this file except in compliance with the License.
3781 * You may obtain a copy of the License at
3783 * http://www.apache.org/licenses/LICENSE-2.0
3785 * Unless required by applicable law or agreed to in writing, software
3786 * distributed under the License is distributed on an "AS IS" BASIS,
3787 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3788 * See the License for the specific language governing permissions and
3789 * limitations under the License.
3795 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3796 * variable to specify the reverse comparison to perform
3798 * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
3800 * Description: Branch to the given destination if the given register's
3801 * value compares with 0 as specified.
3803 * Format: AA|op BBBB (21t)
3805 * Syntax: op vAA, +BBBB
3808 cmp $0, (rFP, rINST, 4) # compare vAA with zero
3809 jle OP_IF_GTZ_2f # goto next instruction or branch
3810 FETCHs 1, %edx # %edx<- BBBB; branch offset
3811 sal $1, %edx # %edx<- adjust byte offset
3814 * Inline common_backwardBranch
3817 js common_periodicChecks2 # jump on backwards branch
3819 FINISH_RB %edx, %ecx # jump to next instruction
3826 movzbl 4(rPC), %edx # grab the next opcode
3827 movzbl 5(rPC), rINST # update the instruction
3828 addl $4, rPC # update the program counter
3829 jmp *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
3832 /* ------------------------------ */
3834 .L_OP_IF_LEZ: /* 0x3d */
3835 /* File: x86-atom/OP_IF_LEZ.S */
3836 /* Copyright (C) 2008 The Android Open Source Project
3838 * Licensed under the Apache License, Version 2.0 (the "License");
3839 * you may not use this file except in compliance with the License.
3840 * You may obtain a copy of the License at
3842 * http://www.apache.org/licenses/LICENSE-2.0
3844 * Unless required by applicable law or agreed to in writing, software
3845 * distributed under the License is distributed on an "AS IS" BASIS,
3846 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3847 * See the License for the specific language governing permissions and
3848 * limitations under the License.
3855 /* File: x86-atom/zcmp.S */
3856 /* Copyright (C) 2008 The Android Open Source Project
3858 * Licensed under the Apache License, Version 2.0 (the "License");
3859 * you may not use this file except in compliance with the License.
3860 * You may obtain a copy of the License at
3862 * http://www.apache.org/licenses/LICENSE-2.0
3864 * Unless required by applicable law or agreed to in writing, software
3865 * distributed under the License is distributed on an "AS IS" BASIS,
3866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3867 * See the License for the specific language governing permissions and
3868 * limitations under the License.
3874 * Code: Generic 32-bit comparison operation. Provides a "revcmp"
3875 * variable to specify the reverse comparison to perform
3877 * For: if-eqz, if-gez, if-gtz, if-lez, if-ltz, if-nez
3879 * Description: Branch to the given destination if the given register's
3880 * value compares with 0 as specified.
3882 * Format: AA|op BBBB (21t)
3884 * Syntax: op vAA, +BBBB
3887 cmp $0, (rFP, rINST, 4) # compare vAA with zero
3888 jg OP_IF_LEZ_2f # goto next instruction or branch
3889 FETCHs 1, %edx # %edx<- BBBB; branch offset
3890 sal $1, %edx # %edx<- adjust byte offset
3893 * Inline common_backwardBranch
3896 js common_periodicChecks2 # jump on backwards branch
3898 FINISH_RB %edx, %ecx # jump to next instruction
3905 movzbl 4(rPC), %edx # grab the next opcode
3906 movzbl 5(rPC), rINST # update the instruction
3907 addl $4, rPC # update the program counter
3908 jmp *dvmAsmInstructionJmpTable(, %edx, 4) # jump to next instruction
3911 /* ------------------------------ */
3913 .L_OP_UNUSED_3E: /* 0x3e */
3914 /* File: x86-atom/OP_UNUSED_3E.S */
3915 /* Copyright (C) 2008 The Android Open Source Project
3917 * Licensed under the Apache License, Version 2.0 (the "License");
3918 * you may not use this file except in compliance with the License.
3919 * You may obtain a copy of the License at
3921 * http://www.apache.org/licenses/LICENSE-2.0
3923 * Unless required by applicable law or agreed to in writing, software
3924 * distributed under the License is distributed on an "AS IS" BASIS,
3925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3926 * See the License for the specific language governing permissions and
3927 * limitations under the License.
3931 * File: OP_UNUSED_3E.S
3934 /* File: x86-atom/unused.S */
3935 /* Copyright (C) 2008 The Android Open Source Project
3937 * Licensed under the Apache License, Version 2.0 (the "License");
3938 * you may not use this file except in compliance with the License.
3939 * You may obtain a copy of the License at
3941 * http://www.apache.org/licenses/LICENSE-2.0
3943 * Unless required by applicable law or agreed to in writing, software
3944 * distributed under the License is distributed on an "AS IS" BASIS,
3945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3946 * See the License for the specific language governing permissions and
3947 * limitations under the License.
3953 * Code: Common code for unused bytecodes. Uses no subtitutions.
3955 * For: all unused bytecodes
3957 * Description: aborts if executed.
3959 * Format: ØØ|op (10x)
3967 /* ------------------------------ */
3969 .L_OP_UNUSED_3F: /* 0x3f */
3970 /* File: x86-atom/OP_UNUSED_3F.S */
3971 /* Copyright (C) 2008 The Android Open Source Project
3973 * Licensed under the Apache License, Version 2.0 (the "License");
3974 * you may not use this file except in compliance with the License.
3975 * You may obtain a copy of the License at
3977 * http://www.apache.org/licenses/LICENSE-2.0
3979 * Unless required by applicable law or agreed to in writing, software
3980 * distributed under the License is distributed on an "AS IS" BASIS,
3981 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3982 * See the License for the specific language governing permissions and
3983 * limitations under the License.
3987 * File: OP_UNUSED_3F.S
3990 /* File: x86-atom/unused.S */
3991 /* Copyright (C) 2008 The Android Open Source Project
3993 * Licensed under the Apache License, Version 2.0 (the "License");
3994 * you may not use this file except in compliance with the License.
3995 * You may obtain a copy of the License at
3997 * http://www.apache.org/licenses/LICENSE-2.0
3999 * Unless required by applicable law or agreed to in writing, software
4000 * distributed under the License is distributed on an "AS IS" BASIS,
4001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4002 * See the License for the specific language governing permissions and
4003 * limitations under the License.
4009 * Code: Common code for unused bytecodes. Uses no subtitutions.
4011 * For: all unused bytecodes
4013 * Description: aborts if executed.
4015 * Format: ØØ|op (10x)
4023 /* ------------------------------ */
4025 .L_OP_UNUSED_40: /* 0x40 */
4026 /* File: x86-atom/OP_UNUSED_40.S */
4027 /* Copyright (C) 2008 The Android Open Source Project
4029 * Licensed under the Apache License, Version 2.0 (the "License");
4030 * you may not use this file except in compliance with the License.
4031 * You may obtain a copy of the License at
4033 * http://www.apache.org/licenses/LICENSE-2.0
4035 * Unless required by applicable law or agreed to in writing, software
4036 * distributed under the License is distributed on an "AS IS" BASIS,
4037 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4038 * See the License for the specific language governing permissions and
4039 * limitations under the License.
4043 * File: OP_UNUSED_40.S
4046 /* File: x86-atom/unused.S */
4047 /* Copyright (C) 2008 The Android Open Source Project
4049 * Licensed under the Apache License, Version 2.0 (the "License");
4050 * you may not use this file except in compliance with the License.
4051 * You may obtain a copy of the License at
4053 * http://www.apache.org/licenses/LICENSE-2.0
4055 * Unless required by applicable law or agreed to in writing, software
4056 * distributed under the License is distributed on an "AS IS" BASIS,
4057 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4058 * See the License for the specific language governing permissions and
4059 * limitations under the License.
4065 * Code: Common code for unused bytecodes. Uses no subtitutions.
4067 * For: all unused bytecodes
4069 * Description: aborts if executed.
4071 * Format: ØØ|op (10x)
4079 /* ------------------------------ */
4081 .L_OP_UNUSED_41: /* 0x41 */
4082 /* File: x86-atom/OP_UNUSED_41.S */
4083 /* Copyright (C) 2008 The Android Open Source Project
4085 * Licensed under the Apache License, Version 2.0 (the "License");
4086 * you may not use this file except in compliance with the License.
4087 * You may obtain a copy of the License at
4089 * http://www.apache.org/licenses/LICENSE-2.0
4091 * Unless required by applicable law or agreed to in writing, software
4092 * distributed under the License is distributed on an "AS IS" BASIS,
4093 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4094 * See the License for the specific language governing permissions and
4095 * limitations under the License.
4099 * File: OP_UNUSED_41.S
4102 /* File: x86-atom/unused.S */
4103 /* Copyright (C) 2008 The Android Open Source Project
4105 * Licensed under the Apache License, Version 2.0 (the "License");
4106 * you may not use this file except in compliance with the License.
4107 * You may obtain a copy of the License at
4109 * http://www.apache.org/licenses/LICENSE-2.0
4111 * Unless required by applicable law or agreed to in writing, software
4112 * distributed under the License is distributed on an "AS IS" BASIS,
4113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4114 * See the License for the specific language governing permissions and
4115 * limitations under the License.
4121 * Code: Common code for unused bytecodes. Uses no subtitutions.
4123 * For: all unused bytecodes
4125 * Description: aborts if executed.
4127 * Format: ØØ|op (10x)
4135 /* ------------------------------ */
4137 .L_OP_UNUSED_42: /* 0x42 */
4138 /* File: x86-atom/OP_UNUSED_42.S */
4139 /* Copyright (C) 2008 The Android Open Source Project
4141 * Licensed under the Apache License, Version 2.0 (the "License");
4142 * you may not use this file except in compliance with the License.
4143 * You may obtain a copy of the License at
4145 * http://www.apache.org/licenses/LICENSE-2.0
4147 * Unless required by applicable law or agreed to in writing, software
4148 * distributed under the License is distributed on an "AS IS" BASIS,
4149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4150 * See the License for the specific language governing permissions and
4151 * limitations under the License.
4155 * File: OP_UNUSED_42.S
4158 /* File: x86-atom/unused.S */
4159 /* Copyright (C) 2008 The Android Open Source Project
4161 * Licensed under the Apache License, Version 2.0 (the "License");
4162 * you may not use this file except in compliance with the License.
4163 * You may obtain a copy of the License at
4165 * http://www.apache.org/licenses/LICENSE-2.0
4167 * Unless required by applicable law or agreed to in writing, software
4168 * distributed under the License is distributed on an "AS IS" BASIS,
4169 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4170 * See the License for the specific language governing permissions and
4171 * limitations under the License.
4177 * Code: Common code for unused bytecodes. Uses no subtitutions.
4179 * For: all unused bytecodes
4181 * Description: aborts if executed.
4183 * Format: ØØ|op (10x)
4191 /* ------------------------------ */
4193 .L_OP_UNUSED_43: /* 0x43 */
4194 /* File: x86-atom/OP_UNUSED_43.S */
4195 /* Copyright (C) 2008 The Android Open Source Project
4197 * Licensed under the Apache License, Version 2.0 (the "License");
4198 * you may not use this file except in compliance with the License.
4199 * You may obtain a copy of the License at
4201 * http://www.apache.org/licenses/LICENSE-2.0
4203 * Unless required by applicable law or agreed to in writing, software
4204 * distributed under the License is distributed on an "AS IS" BASIS,
4205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4206 * See the License for the specific language governing permissions and
4207 * limitations under the License.
4211 * File: OP_UNUSED_43.S
4214 /* File: x86-atom/unused.S */
4215 /* Copyright (C) 2008 The Android Open Source Project
4217 * Licensed under the Apache License, Version 2.0 (the "License");
4218 * you may not use this file except in compliance with the License.
4219 * You may obtain a copy of the License at
4221 * http://www.apache.org/licenses/LICENSE-2.0
4223 * Unless required by applicable law or agreed to in writing, software
4224 * distributed under the License is distributed on an "AS IS" BASIS,
4225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4226 * See the License for the specific language governing permissions and
4227 * limitations under the License.
4233 * Code: Common code for unused bytecodes. Uses no subtitutions.
4235 * For: all unused bytecodes
4237 * Description: aborts if executed.
4239 * Format: ØØ|op (10x)
4247 /* ------------------------------ */
4249 .L_OP_AGET: /* 0x44 */
4250 /* File: x86-atom/OP_AGET.S */
4251 /* Copyright (C) 2008 The Android Open Source Project
4253 * Licensed under the Apache License, Version 2.0 (the "License");
4254 * you may not use this file except in compliance with the License.
4255 * You may obtain a copy of the License at
4257 * http://www.apache.org/licenses/LICENSE-2.0
4259 * Unless required by applicable law or agreed to in writing, software
4260 * distributed under the License is distributed on an "AS IS" BASIS,
4261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4262 * See the License for the specific language governing permissions and
4263 * limitations under the License.
4269 * Code: Generic 32-bit array "get" operation. Provides a "scale" variable
4270 * to specify a scale value which depends on the width of the array
4271 * elements. Provides a "mov" variable which determines the type of
4272 * mov performed also dependent on the type of the array element.
4274 * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
4276 * Description: Perform an array get operation at the identified index
4277 * of a given array; load the array value into the value
4278 * register. vAA <- vBB[vCC].
4280 * Format: AA|op CC|BB (23x)
4282 * Syntax: op vAA, vBB, vCC
4286 FETCH_BB 1, %ecx # %ecx<- BB
4287 FETCH_CC 1, %edx # %edx<- CC
4288 GET_VREG %ecx # %ecx<- vBB
4289 GET_VREG %edx # %edx<- vCC
4290 cmp $0, %ecx # check for null array object
4291 je common_errNullObject # handle null array object
4292 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4293 jnc common_errArrayIndex # handle index >= length, bail
4294 lea (%ecx, %edx, 4), %ecx # %ecx<- &vBB[vCC]
4295 # trying: lea (%ecx, %edx, scale), %ecx
4296 # to reduce code size
4297 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4298 movl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
4299 # doing this and the previous instr
4300 # with one instr was not faster
4301 SET_VREG %edx rINST # vAA<- %edx; value
4302 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4303 /* ------------------------------ */
4305 .L_OP_AGET_WIDE: /* 0x45 */
4306 /* File: x86-atom/OP_AGET_WIDE.S */
4307 /* Copyright (C) 2008 The Android Open Source Project
4309 * Licensed under the Apache License, Version 2.0 (the "License");
4310 * you may not use this file except in compliance with the License.
4311 * You may obtain a copy of the License at
4313 * http://www.apache.org/licenses/LICENSE-2.0
4315 * Unless required by applicable law or agreed to in writing, software
4316 * distributed under the License is distributed on an "AS IS" BASIS,
4317 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4318 * See the License for the specific language governing permissions and
4319 * limitations under the License.
4323 * File: OP_AGET_WIDE.S
4325 * Code: 64-bit array get operation.
4329 * Description: Perform an array get operation at the identified index
4330 * of a given array; load the array value into the destination
4331 * register. vAA <- vBB[vCC].
4333 * Format: AA|op CC|BB (23x)
4335 * Syntax: op vAA, vBB, vCC
4338 FETCH_BB 1, %ecx # %ecx<- BB
4339 FETCH_CC 1, %edx # %edx<- CC
4340 GET_VREG %ecx # %ecx<- vBB
4341 GET_VREG %edx # %edx<- vCC
4342 cmp $0, %ecx # check for null array object
4343 je common_errNullObject # handle null array object
4344 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4345 jnc common_errArrayIndex # handle index >= length, bail
4346 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4347 movq offArrayObject_contents(%ecx, %edx, 8), %xmm0 # %xmm0<- vBB[vCC]
4348 movq %xmm0, (rFP, rINST, 4) # vAA<- %xmm0; value
4349 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4350 /* ------------------------------ */
4352 .L_OP_AGET_OBJECT: /* 0x46 */
4353 /* File: x86-atom/OP_AGET_OBJECT.S */
4354 /* Copyright (C) 2008 The Android Open Source Project
4356 * Licensed under the Apache License, Version 2.0 (the "License");
4357 * you may not use this file except in compliance with the License.
4358 * You may obtain a copy of the License at
4360 * http://www.apache.org/licenses/LICENSE-2.0
4362 * Unless required by applicable law or agreed to in writing, software
4363 * distributed under the License is distributed on an "AS IS" BASIS,
4364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4365 * See the License for the specific language governing permissions and
4366 * limitations under the License.
4370 * File: OP_AGET_OBJECT.S
4373 /* File: x86-atom/OP_AGET.S */
4374 /* Copyright (C) 2008 The Android Open Source Project
4376 * Licensed under the Apache License, Version 2.0 (the "License");
4377 * you may not use this file except in compliance with the License.
4378 * You may obtain a copy of the License at
4380 * http://www.apache.org/licenses/LICENSE-2.0
4382 * Unless required by applicable law or agreed to in writing, software
4383 * distributed under the License is distributed on an "AS IS" BASIS,
4384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4385 * See the License for the specific language governing permissions and
4386 * limitations under the License.
4392 * Code: Generic 32-bit array "get" operation. Provides a "scale" variable
4393 * to specify a scale value which depends on the width of the array
4394 * elements. Provides a "mov" variable which determines the type of
4395 * mov performed also dependent on the type of the array element.
4397 * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
4399 * Description: Perform an array get operation at the identified index
4400 * of a given array; load the array value into the value
4401 * register. vAA <- vBB[vCC].
4403 * Format: AA|op CC|BB (23x)
4405 * Syntax: op vAA, vBB, vCC
4409 FETCH_BB 1, %ecx # %ecx<- BB
4410 FETCH_CC 1, %edx # %edx<- CC
4411 GET_VREG %ecx # %ecx<- vBB
4412 GET_VREG %edx # %edx<- vCC
4413 cmp $0, %ecx # check for null array object
4414 je common_errNullObject # handle null array object
4415 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4416 jnc common_errArrayIndex # handle index >= length, bail
4417 lea (%ecx, %edx, 4), %ecx # %ecx<- &vBB[vCC]
4418 # trying: lea (%ecx, %edx, scale), %ecx
4419 # to reduce code size
4420 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4421 movl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
4422 # doing this and the previous instr
4423 # with one instr was not faster
4424 SET_VREG %edx rINST # vAA<- %edx; value
4425 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4427 /* ------------------------------ */
4429 .L_OP_AGET_BOOLEAN: /* 0x47 */
4430 /* File: x86-atom/OP_AGET_BOOLEAN.S */
4431 /* Copyright (C) 2008 The Android Open Source Project
4433 * Licensed under the Apache License, Version 2.0 (the "License");
4434 * you may not use this file except in compliance with the License.
4435 * You may obtain a copy of the License at
4437 * http://www.apache.org/licenses/LICENSE-2.0
4439 * Unless required by applicable law or agreed to in writing, software
4440 * distributed under the License is distributed on an "AS IS" BASIS,
4441 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4442 * See the License for the specific language governing permissions and
4443 * limitations under the License.
4447 * File: OP_AGET_BOOLEAN.S
4450 /* File: x86-atom/OP_AGET.S */
4451 /* Copyright (C) 2008 The Android Open Source Project
4453 * Licensed under the Apache License, Version 2.0 (the "License");
4454 * you may not use this file except in compliance with the License.
4455 * You may obtain a copy of the License at
4457 * http://www.apache.org/licenses/LICENSE-2.0
4459 * Unless required by applicable law or agreed to in writing, software
4460 * distributed under the License is distributed on an "AS IS" BASIS,
4461 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4462 * See the License for the specific language governing permissions and
4463 * limitations under the License.
4469 * Code: Generic 32-bit array "get" operation. Provides a "scale" variable
4470 * to specify a scale value which depends on the width of the array
4471 * elements. Provides a "mov" variable which determines the type of
4472 * mov performed also dependent on the type of the array element.
4474 * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
4476 * Description: Perform an array get operation at the identified index
4477 * of a given array; load the array value into the value
4478 * register. vAA <- vBB[vCC].
4480 * Format: AA|op CC|BB (23x)
4482 * Syntax: op vAA, vBB, vCC
4486 FETCH_BB 1, %ecx # %ecx<- BB
4487 FETCH_CC 1, %edx # %edx<- CC
4488 GET_VREG %ecx # %ecx<- vBB
4489 GET_VREG %edx # %edx<- vCC
4490 cmp $0, %ecx # check for null array object
4491 je common_errNullObject # handle null array object
4492 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4493 jnc common_errArrayIndex # handle index >= length, bail
4494 lea (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
4495 # trying: lea (%ecx, %edx, scale), %ecx
4496 # to reduce code size
4497 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4498 movzbl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
4499 # doing this and the previous instr
4500 # with one instr was not faster
4501 SET_VREG %edx rINST # vAA<- %edx; value
4502 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4504 /* ------------------------------ */
4506 .L_OP_AGET_BYTE: /* 0x48 */
4507 /* File: x86-atom/OP_AGET_BYTE.S */
4508 /* Copyright (C) 2008 The Android Open Source Project
4510 * Licensed under the Apache License, Version 2.0 (the "License");
4511 * you may not use this file except in compliance with the License.
4512 * You may obtain a copy of the License at
4514 * http://www.apache.org/licenses/LICENSE-2.0
4516 * Unless required by applicable law or agreed to in writing, software
4517 * distributed under the License is distributed on an "AS IS" BASIS,
4518 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4519 * See the License for the specific language governing permissions and
4520 * limitations under the License.
4524 * File: OP_AGET_BYTE.S
4527 /* File: x86-atom/OP_AGET.S */
4528 /* Copyright (C) 2008 The Android Open Source Project
4530 * Licensed under the Apache License, Version 2.0 (the "License");
4531 * you may not use this file except in compliance with the License.
4532 * You may obtain a copy of the License at
4534 * http://www.apache.org/licenses/LICENSE-2.0
4536 * Unless required by applicable law or agreed to in writing, software
4537 * distributed under the License is distributed on an "AS IS" BASIS,
4538 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4539 * See the License for the specific language governing permissions and
4540 * limitations under the License.
4546 * Code: Generic 32-bit array "get" operation. Provides a "scale" variable
4547 * to specify a scale value which depends on the width of the array
4548 * elements. Provides a "mov" variable which determines the type of
4549 * mov performed also dependent on the type of the array element.
4551 * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
4553 * Description: Perform an array get operation at the identified index
4554 * of a given array; load the array value into the value
4555 * register. vAA <- vBB[vCC].
4557 * Format: AA|op CC|BB (23x)
4559 * Syntax: op vAA, vBB, vCC
4563 FETCH_BB 1, %ecx # %ecx<- BB
4564 FETCH_CC 1, %edx # %edx<- CC
4565 GET_VREG %ecx # %ecx<- vBB
4566 GET_VREG %edx # %edx<- vCC
4567 cmp $0, %ecx # check for null array object
4568 je common_errNullObject # handle null array object
4569 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4570 jnc common_errArrayIndex # handle index >= length, bail
4571 lea (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
4572 # trying: lea (%ecx, %edx, scale), %ecx
4573 # to reduce code size
4574 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4575 movsbl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
4576 # doing this and the previous instr
4577 # with one instr was not faster
4578 SET_VREG %edx rINST # vAA<- %edx; value
4579 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4581 /* ------------------------------ */
4583 .L_OP_AGET_CHAR: /* 0x49 */
4584 /* File: x86-atom/OP_AGET_CHAR.S */
4585 /* Copyright (C) 2008 The Android Open Source Project
4587 * Licensed under the Apache License, Version 2.0 (the "License");
4588 * you may not use this file except in compliance with the License.
4589 * You may obtain a copy of the License at
4591 * http://www.apache.org/licenses/LICENSE-2.0
4593 * Unless required by applicable law or agreed to in writing, software
4594 * distributed under the License is distributed on an "AS IS" BASIS,
4595 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4596 * See the License for the specific language governing permissions and
4597 * limitations under the License.
4601 * File: OP_AGET_CHAR.S
4604 /* File: x86-atom/OP_AGET.S */
4605 /* Copyright (C) 2008 The Android Open Source Project
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
4611 * http://www.apache.org/licenses/LICENSE-2.0
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.
4623 * Code: Generic 32-bit array "get" operation. Provides a "scale" variable
4624 * to specify a scale value which depends on the width of the array
4625 * elements. Provides a "mov" variable which determines the type of
4626 * mov performed also dependent on the type of the array element.
4628 * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
4630 * Description: Perform an array get operation at the identified index
4631 * of a given array; load the array value into the value
4632 * register. vAA <- vBB[vCC].
4634 * Format: AA|op CC|BB (23x)
4636 * Syntax: op vAA, vBB, vCC
4640 FETCH_BB 1, %ecx # %ecx<- BB
4641 FETCH_CC 1, %edx # %edx<- CC
4642 GET_VREG %ecx # %ecx<- vBB
4643 GET_VREG %edx # %edx<- vCC
4644 cmp $0, %ecx # check for null array object
4645 je common_errNullObject # handle null array object
4646 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4647 jnc common_errArrayIndex # handle index >= length, bail
4648 lea (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
4649 # trying: lea (%ecx, %edx, scale), %ecx
4650 # to reduce code size
4651 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4652 movzwl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
4653 # doing this and the previous instr
4654 # with one instr was not faster
4655 SET_VREG %edx rINST # vAA<- %edx; value
4656 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4658 /* ------------------------------ */
4660 .L_OP_AGET_SHORT: /* 0x4a */
4661 /* File: x86-atom/OP_AGET_SHORT.S */
4662 /* Copyright (C) 2008 The Android Open Source Project
4664 * Licensed under the Apache License, Version 2.0 (the "License");
4665 * you may not use this file except in compliance with the License.
4666 * You may obtain a copy of the License at
4668 * http://www.apache.org/licenses/LICENSE-2.0
4670 * Unless required by applicable law or agreed to in writing, software
4671 * distributed under the License is distributed on an "AS IS" BASIS,
4672 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4673 * See the License for the specific language governing permissions and
4674 * limitations under the License.
4678 * File: OP_AGET_SHORT.S
4681 /* File: x86-atom/OP_AGET.S */
4682 /* Copyright (C) 2008 The Android Open Source Project
4684 * Licensed under the Apache License, Version 2.0 (the "License");
4685 * you may not use this file except in compliance with the License.
4686 * You may obtain a copy of the License at
4688 * http://www.apache.org/licenses/LICENSE-2.0
4690 * Unless required by applicable law or agreed to in writing, software
4691 * distributed under the License is distributed on an "AS IS" BASIS,
4692 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4693 * See the License for the specific language governing permissions and
4694 * limitations under the License.
4700 * Code: Generic 32-bit array "get" operation. Provides a "scale" variable
4701 * to specify a scale value which depends on the width of the array
4702 * elements. Provides a "mov" variable which determines the type of
4703 * mov performed also dependent on the type of the array element.
4705 * For: aget, aget-boolean, aget-byte, aget-char, aget-object, sget, aget-short
4707 * Description: Perform an array get operation at the identified index
4708 * of a given array; load the array value into the value
4709 * register. vAA <- vBB[vCC].
4711 * Format: AA|op CC|BB (23x)
4713 * Syntax: op vAA, vBB, vCC
4717 FETCH_BB 1, %ecx # %ecx<- BB
4718 FETCH_CC 1, %edx # %edx<- CC
4719 GET_VREG %ecx # %ecx<- vBB
4720 GET_VREG %edx # %edx<- vCC
4721 cmp $0, %ecx # check for null array object
4722 je common_errNullObject # handle null array object
4723 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4724 jnc common_errArrayIndex # handle index >= length, bail
4725 lea (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
4726 # trying: lea (%ecx, %edx, scale), %ecx
4727 # to reduce code size
4728 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4729 movswl offArrayObject_contents(%ecx), %edx # %edx<- vBB[vCC]
4730 # doing this and the previous instr
4731 # with one instr was not faster
4732 SET_VREG %edx rINST # vAA<- %edx; value
4733 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4735 /* ------------------------------ */
4737 .L_OP_APUT: /* 0x4b */
4738 /* File: x86-atom/OP_APUT.S */
4739 /* Copyright (C) 2008 The Android Open Source Project
4741 * Licensed under the Apache License, Version 2.0 (the "License");
4742 * you may not use this file except in compliance with the License.
4743 * You may obtain a copy of the License at
4745 * http://www.apache.org/licenses/LICENSE-2.0
4747 * Unless required by applicable law or agreed to in writing, software
4748 * distributed under the License is distributed on an "AS IS" BASIS,
4749 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4750 * See the License for the specific language governing permissions and
4751 * limitations under the License.
4757 * Code: Generic 32-bit array put operation. Provides a "scale" variable
4758 * to specify a scale value which depends on the width of the array
4759 * elements. Provides a "mov" variable which determines the type of
4760 * move performed also dependent on the type of the array element.
4761 * Provides a "value" register to specify the source of the move
4763 * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
4765 * Description: Perform an array put operation from the value register;
4766 * store the value register at the identified index of a
4767 * given array. vBB[vCC] <- vAA
4769 * Format: AA|op CC|BB (23x)
4771 * Syntax: op vAA, vBB, vCC
4775 FETCH_BB 1, %ecx # %ecx<- BB
4776 FETCH_CC 1, %edx # %edx<- CC
4777 GET_VREG %ecx # %ecx<- vBB
4778 GET_VREG %edx # %edx<- vCC
4779 cmp $0, %ecx # check for null array object
4780 je common_errNullObject # handle null array object
4781 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4782 jnc common_errArrayIndex # handle index >= length, bail
4783 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4784 lea (%ecx, %edx, 4), %ecx # %ecx<- &vBB[vCC]
4785 GET_VREG rINST # rINST<- vAA
4786 movl rINST, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
4787 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4788 /* ------------------------------ */
4790 .L_OP_APUT_WIDE: /* 0x4c */
4791 /* File: x86-atom/OP_APUT_WIDE.S */
4792 /* Copyright (C) 2008 The Android Open Source Project
4794 * Licensed under the Apache License, Version 2.0 (the "License");
4795 * you may not use this file except in compliance with the License.
4796 * You may obtain a copy of the License at
4798 * http://www.apache.org/licenses/LICENSE-2.0
4800 * Unless required by applicable law or agreed to in writing, software
4801 * distributed under the License is distributed on an "AS IS" BASIS,
4802 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4803 * See the License for the specific language governing permissions and
4804 * limitations under the License.
4808 * File: OP_APUT_WIDE.S
4810 * Code: 64-bit array put operation.
4814 * Description: Perform an array put operation from the value register;
4815 * store the value register at the identified index of a
4816 * given array. vBB[vCC] <- vAA.
4818 * Format: AA|op CC|BB (23x)
4820 * Syntax: op vAA, vBB, vCC
4823 FETCH_BB 1, %ecx # %ecx<- BB
4824 FETCH_CC 1, %edx # %edx<- CC
4825 GET_VREG %ecx # %ecx<- vBB
4826 GET_VREG %edx # %edx<- vCC
4827 cmp $0, %ecx # check for null array object
4828 je common_errNullObject # handle null array object
4829 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4830 jnc common_errArrayIndex # handle index >= length, bail
4831 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4832 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vAA
4833 movq %xmm0, offArrayObject_contents(%ecx, %edx, 8) # vBB[vCC]<- %xmm0; value
4834 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4835 /* ------------------------------ */
4837 .L_OP_APUT_OBJECT: /* 0x4d */
4838 /* File: x86-atom/OP_APUT_OBJECT.S */
4839 /* Copyright (C) 2008 The Android Open Source Project
4841 * Licensed under the Apache License, Version 2.0 (the "License");
4842 * you may not use this file except in compliance with the License.
4843 * You may obtain a copy of the License at
4845 * http://www.apache.org/licenses/LICENSE-2.0
4847 * Unless required by applicable law or agreed to in writing, software
4848 * distributed under the License is distributed on an "AS IS" BASIS,
4849 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4850 * See the License for the specific language governing permissions and
4851 * limitations under the License.
4855 * File: OP_APUT_OBJECT.S
4857 * Code: 32-bit array put operation. Provides an "scale" variable
4858 * specify a scale value which depends on the width of the array
4859 * elements. Provides a "mov" variable which determines the type of
4860 * mov performed also dependent on the type of the array element.
4861 * Provides a "value" register to specify the source of the mov
4863 * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
4865 * Description: Perform an array put operation from the value register;
4866 * store the value register at the identified index of a
4867 * given array. vBB[vCC] <- vAA
4869 * Format: AA|op CC|BB (23x)
4871 * Syntax: op vAA, vBB, vCC
4874 FETCH_BB 1, %eax # %eax<- BB
4875 FETCH_CC 1, %edx # %edx<- CC
4876 GET_VREG %eax # %eax<- vBB
4877 GET_VREG %edx # %edx<- vCC
4878 cmp $0, %eax # check for null array object
4879 je common_errNullObject # handle null array object
4880 cmp offArrayObject_length(%eax), %edx # compare index to arrayObj->length
4881 jnc common_errArrayIndex # handle index >= length, bail
4882 GET_VREG rINST # rINST<- vAA
4883 lea (%eax, %edx, 4), %edx # %edx<- &vBB[vCC]
4884 cmp $0, rINST # check for null reference
4885 je .LOP_APUT_OBJECT_skip_check # reference is null so skip type check
4886 jmp .LOP_APUT_OBJECT_finish
4888 /* ------------------------------ */
4890 .L_OP_APUT_BOOLEAN: /* 0x4e */
4891 /* File: x86-atom/OP_APUT_BOOLEAN.S */
4892 /* Copyright (C) 2008 The Android Open Source Project
4894 * Licensed under the Apache License, Version 2.0 (the "License");
4895 * you may not use this file except in compliance with the License.
4896 * You may obtain a copy of the License at
4898 * http://www.apache.org/licenses/LICENSE-2.0
4900 * Unless required by applicable law or agreed to in writing, software
4901 * distributed under the License is distributed on an "AS IS" BASIS,
4902 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4903 * See the License for the specific language governing permissions and
4904 * limitations under the License.
4908 * File: OP_APUT_BOOLEAN.S
4911 /* File: x86-atom/OP_APUT.S */
4912 /* Copyright (C) 2008 The Android Open Source Project
4914 * Licensed under the Apache License, Version 2.0 (the "License");
4915 * you may not use this file except in compliance with the License.
4916 * You may obtain a copy of the License at
4918 * http://www.apache.org/licenses/LICENSE-2.0
4920 * Unless required by applicable law or agreed to in writing, software
4921 * distributed under the License is distributed on an "AS IS" BASIS,
4922 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4923 * See the License for the specific language governing permissions and
4924 * limitations under the License.
4930 * Code: Generic 32-bit array put operation. Provides a "scale" variable
4931 * to specify a scale value which depends on the width of the array
4932 * elements. Provides a "mov" variable which determines the type of
4933 * move performed also dependent on the type of the array element.
4934 * Provides a "value" register to specify the source of the move
4936 * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
4938 * Description: Perform an array put operation from the value register;
4939 * store the value register at the identified index of a
4940 * given array. vBB[vCC] <- vAA
4942 * Format: AA|op CC|BB (23x)
4944 * Syntax: op vAA, vBB, vCC
4948 FETCH_BB 1, %ecx # %ecx<- BB
4949 FETCH_CC 1, %edx # %edx<- CC
4950 GET_VREG %ecx # %ecx<- vBB
4951 GET_VREG %edx # %edx<- vCC
4952 cmp $0, %ecx # check for null array object
4953 je common_errNullObject # handle null array object
4954 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
4955 jnc common_errArrayIndex # handle index >= length, bail
4956 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
4957 lea (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
4958 GET_VREG rINST # rINST<- vAA
4959 movb rINSTbl, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
4960 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
4962 /* ------------------------------ */
4964 .L_OP_APUT_BYTE: /* 0x4f */
4965 /* File: x86-atom/OP_APUT_BYTE.S */
4966 /* Copyright (C) 2008 The Android Open Source Project
4968 * Licensed under the Apache License, Version 2.0 (the "License");
4969 * you may not use this file except in compliance with the License.
4970 * You may obtain a copy of the License at
4972 * http://www.apache.org/licenses/LICENSE-2.0
4974 * Unless required by applicable law or agreed to in writing, software
4975 * distributed under the License is distributed on an "AS IS" BASIS,
4976 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4977 * See the License for the specific language governing permissions and
4978 * limitations under the License.
4982 * File: OP_APUT_BYTE.S
4985 /* File: x86-atom/OP_APUT.S */
4986 /* Copyright (C) 2008 The Android Open Source Project
4988 * Licensed under the Apache License, Version 2.0 (the "License");
4989 * you may not use this file except in compliance with the License.
4990 * You may obtain a copy of the License at
4992 * http://www.apache.org/licenses/LICENSE-2.0
4994 * Unless required by applicable law or agreed to in writing, software
4995 * distributed under the License is distributed on an "AS IS" BASIS,
4996 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4997 * See the License for the specific language governing permissions and
4998 * limitations under the License.
5004 * Code: Generic 32-bit array put operation. Provides a "scale" variable
5005 * to specify a scale value which depends on the width of the array
5006 * elements. Provides a "mov" variable which determines the type of
5007 * move performed also dependent on the type of the array element.
5008 * Provides a "value" register to specify the source of the move
5010 * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
5012 * Description: Perform an array put operation from the value register;
5013 * store the value register at the identified index of a
5014 * given array. vBB[vCC] <- vAA
5016 * Format: AA|op CC|BB (23x)
5018 * Syntax: op vAA, vBB, vCC
5022 FETCH_BB 1, %ecx # %ecx<- BB
5023 FETCH_CC 1, %edx # %edx<- CC
5024 GET_VREG %ecx # %ecx<- vBB
5025 GET_VREG %edx # %edx<- vCC
5026 cmp $0, %ecx # check for null array object
5027 je common_errNullObject # handle null array object
5028 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
5029 jnc common_errArrayIndex # handle index >= length, bail
5030 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
5031 lea (%ecx, %edx, 1), %ecx # %ecx<- &vBB[vCC]
5032 GET_VREG rINST # rINST<- vAA
5033 movb rINSTbl, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
5034 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
5036 /* ------------------------------ */
5038 .L_OP_APUT_CHAR: /* 0x50 */
5039 /* File: x86-atom/OP_APUT_CHAR.S */
5040 /* Copyright (C) 2008 The Android Open Source Project
5042 * Licensed under the Apache License, Version 2.0 (the "License");
5043 * you may not use this file except in compliance with the License.
5044 * You may obtain a copy of the License at
5046 * http://www.apache.org/licenses/LICENSE-2.0
5048 * Unless required by applicable law or agreed to in writing, software
5049 * distributed under the License is distributed on an "AS IS" BASIS,
5050 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5051 * See the License for the specific language governing permissions and
5052 * limitations under the License.
5056 * File: OP_APUT_CHAR.S
5059 /* File: x86-atom/OP_APUT.S */
5060 /* Copyright (C) 2008 The Android Open Source Project
5062 * Licensed under the Apache License, Version 2.0 (the "License");
5063 * you may not use this file except in compliance with the License.
5064 * You may obtain a copy of the License at
5066 * http://www.apache.org/licenses/LICENSE-2.0
5068 * Unless required by applicable law or agreed to in writing, software
5069 * distributed under the License is distributed on an "AS IS" BASIS,
5070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5071 * See the License for the specific language governing permissions and
5072 * limitations under the License.
5078 * Code: Generic 32-bit array put operation. Provides a "scale" variable
5079 * to specify a scale value which depends on the width of the array
5080 * elements. Provides a "mov" variable which determines the type of
5081 * move performed also dependent on the type of the array element.
5082 * Provides a "value" register to specify the source of the move
5084 * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
5086 * Description: Perform an array put operation from the value register;
5087 * store the value register at the identified index of a
5088 * given array. vBB[vCC] <- vAA
5090 * Format: AA|op CC|BB (23x)
5092 * Syntax: op vAA, vBB, vCC
5096 FETCH_BB 1, %ecx # %ecx<- BB
5097 FETCH_CC 1, %edx # %edx<- CC
5098 GET_VREG %ecx # %ecx<- vBB
5099 GET_VREG %edx # %edx<- vCC
5100 cmp $0, %ecx # check for null array object
5101 je common_errNullObject # handle null array object
5102 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
5103 jnc common_errArrayIndex # handle index >= length, bail
5104 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
5105 lea (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
5106 GET_VREG rINST # rINST<- vAA
5107 movw rINSTw, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
5108 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
5110 /* ------------------------------ */
5112 .L_OP_APUT_SHORT: /* 0x51 */
5113 /* File: x86-atom/OP_APUT_SHORT.S */
5114 /* Copyright (C) 2008 The Android Open Source Project
5116 * Licensed under the Apache License, Version 2.0 (the "License");
5117 * you may not use this file except in compliance with the License.
5118 * You may obtain a copy of the License at
5120 * http://www.apache.org/licenses/LICENSE-2.0
5122 * Unless required by applicable law or agreed to in writing, software
5123 * distributed under the License is distributed on an "AS IS" BASIS,
5124 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5125 * See the License for the specific language governing permissions and
5126 * limitations under the License.
5130 * File: OP_APUT_SHORT.S
5133 /* File: x86-atom/OP_APUT.S */
5134 /* Copyright (C) 2008 The Android Open Source Project
5136 * Licensed under the Apache License, Version 2.0 (the "License");
5137 * you may not use this file except in compliance with the License.
5138 * You may obtain a copy of the License at
5140 * http://www.apache.org/licenses/LICENSE-2.0
5142 * Unless required by applicable law or agreed to in writing, software
5143 * distributed under the License is distributed on an "AS IS" BASIS,
5144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5145 * See the License for the specific language governing permissions and
5146 * limitations under the License.
5152 * Code: Generic 32-bit array put operation. Provides a "scale" variable
5153 * to specify a scale value which depends on the width of the array
5154 * elements. Provides a "mov" variable which determines the type of
5155 * move performed also dependent on the type of the array element.
5156 * Provides a "value" register to specify the source of the move
5158 * For: aput-boolean, aput-byte, aput-char, aput-object, aput-short
5160 * Description: Perform an array put operation from the value register;
5161 * store the value register at the identified index of a
5162 * given array. vBB[vCC] <- vAA
5164 * Format: AA|op CC|BB (23x)
5166 * Syntax: op vAA, vBB, vCC
5170 FETCH_BB 1, %ecx # %ecx<- BB
5171 FETCH_CC 1, %edx # %edx<- CC
5172 GET_VREG %ecx # %ecx<- vBB
5173 GET_VREG %edx # %edx<- vCC
5174 cmp $0, %ecx # check for null array object
5175 je common_errNullObject # handle null array object
5176 cmp offArrayObject_length(%ecx), %edx # compare index to arrayObj->length
5177 jnc common_errArrayIndex # handle index >= length, bail
5178 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
5179 lea (%ecx, %edx, 2), %ecx # %ecx<- &vBB[vCC]
5180 GET_VREG rINST # rINST<- vAA
5181 movw rINSTw, offArrayObject_contents(%ecx) # vBB[vCC]<- rINSTx; value
5182 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
5184 /* ------------------------------ */
5186 .L_OP_IGET: /* 0x52 */
5187 /* File: x86-atom/OP_IGET.S */
5188 /* Copyright (C) 2008 The Android Open Source Project
5190 * Licensed under the Apache License, Version 2.0 (the "License");
5191 * you may not use this file except in compliance with the License.
5192 * You may obtain a copy of the License at
5194 * http://www.apache.org/licenses/LICENSE-2.0
5196 * Unless required by applicable law or agreed to in writing, software
5197 * distributed under the License is distributed on an "AS IS" BASIS,
5198 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5199 * See the License for the specific language governing permissions and
5200 * limitations under the License.
5206 * Code: Generic 32-bit instance field "get" operation. Provides a
5207 * "mov" variable which determines the type of mov performed.
5208 * Currently, none of the iget's use this variable - may want
5209 * to change this, but seems ok for now.
5211 * For: iget-boolean, iget-byte, iget-char, iget-object, iget
5214 * Description: Perform the object instance field "get" operation
5215 * with the identified field; load the instance value into
5216 * the value register.
5219 * Format: B|A|op CCCC (22c)
5221 * Syntax: op vA, vB, type@CCCC
5222 * op vA, vB, field@CCCC
5226 movl rGLUE, %edx # %edx<- pMterpGlue
5227 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5228 FETCH 1, %ecx # %ecx<- CCCC
5229 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5230 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5231 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5232 jne .LOP_IGET_finish2
5233 movl rGLUE, %edx # %edx<- pMterpGlue
5234 movl offGlue_method(%edx), %edx # %edx <- current method
5235 EXPORT_PC # in case an exception is thrown
5236 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
5237 movl %ecx, -4(%esp) # push parameter CCCC; field ref
5238 movl %edx, -8(%esp) # push parameter method->clazz
5240 jmp .LOP_IGET_finish
5242 /* ------------------------------ */
5244 .L_OP_IGET_WIDE: /* 0x53 */
5245 /* File: x86-atom/OP_IGET_WIDE.S */
5246 /* Copyright (C) 2008 The Android Open Source Project
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
5252 * http://www.apache.org/licenses/LICENSE-2.0
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.
5262 * File: OP_IGET_WIDE.S
5264 * Code: 64 bit instance field "get" operation. Uses no substitutions.
5268 * Description: Perform the object instance field "get" operation
5269 * with the identified field; load the instance value into
5270 * the value register.
5272 * Format: B|A|op CCCC (22c)
5274 * Syntax: op vA, vB, type@CCCC
5275 * op vA, vB, field@CCCC
5278 movl rGLUE, %eax # %eax<- MterpGlue pointer
5279 movl offGlue_methodClassDex(%eax), %ecx # %ecx<- pDvmDex
5280 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- CCCC
5281 FETCH 1, %edx # %edx<- pDvmDex->pResFields
5282 movl (%ecx, %edx, 4), %ecx # %ecx<- resolved InstField ptr
5283 cmp $0, %ecx # check for null ptr; resolved InstField ptr
5284 jne .LOP_IGET_WIDE_finish
5285 movl offGlue_method(%eax), %ecx # %ecx <- current method
5286 EXPORT_PC # in case an exception is thrown
5287 movl offMethod_clazz(%ecx), %ecx # %ecx<- method->clazz
5288 movl %ecx, -8(%esp) # push parameter CCCC; field ref
5289 movl %edx, -4(%esp) # push parameter method->clazz
5290 jmp .LOP_IGET_WIDE_finish2
5292 /* ------------------------------ */
5294 .L_OP_IGET_OBJECT: /* 0x54 */
5295 /* File: x86-atom/OP_IGET_OBJECT.S */
5296 /* Copyright (C) 2008 The Android Open Source Project
5298 * Licensed under the Apache License, Version 2.0 (the "License");
5299 * you may not use this file except in compliance with the License.
5300 * You may obtain a copy of the License at
5302 * http://www.apache.org/licenses/LICENSE-2.0
5304 * Unless required by applicable law or agreed to in writing, software
5305 * distributed under the License is distributed on an "AS IS" BASIS,
5306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5307 * See the License for the specific language governing permissions and
5308 * limitations under the License.
5312 * File: OP_IGET_OBJECT.S
5315 /* File: x86-atom/OP_IGET.S */
5316 /* Copyright (C) 2008 The Android Open Source Project
5318 * Licensed under the Apache License, Version 2.0 (the "License");
5319 * you may not use this file except in compliance with the License.
5320 * You may obtain a copy of the License at
5322 * http://www.apache.org/licenses/LICENSE-2.0
5324 * Unless required by applicable law or agreed to in writing, software
5325 * distributed under the License is distributed on an "AS IS" BASIS,
5326 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5327 * See the License for the specific language governing permissions and
5328 * limitations under the License.
5334 * Code: Generic 32-bit instance field "get" operation. Provides a
5335 * "mov" variable which determines the type of mov performed.
5336 * Currently, none of the iget's use this variable - may want
5337 * to change this, but seems ok for now.
5339 * For: iget-boolean, iget-byte, iget-char, iget-object, iget
5342 * Description: Perform the object instance field "get" operation
5343 * with the identified field; load the instance value into
5344 * the value register.
5347 * Format: B|A|op CCCC (22c)
5349 * Syntax: op vA, vB, type@CCCC
5350 * op vA, vB, field@CCCC
5354 movl rGLUE, %edx # %edx<- pMterpGlue
5355 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5356 FETCH 1, %ecx # %ecx<- CCCC
5357 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5358 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5359 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5360 jne .LOP_IGET_OBJECT_finish2
5361 movl rGLUE, %edx # %edx<- pMterpGlue
5362 movl offGlue_method(%edx), %edx # %edx <- current method
5363 EXPORT_PC # in case an exception is thrown
5364 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
5365 movl %ecx, -4(%esp) # push parameter CCCC; field ref
5366 movl %edx, -8(%esp) # push parameter method->clazz
5368 jmp .LOP_IGET_OBJECT_finish
5371 /* ------------------------------ */
5373 .L_OP_IGET_BOOLEAN: /* 0x55 */
5374 /* File: x86-atom/OP_IGET_BOOLEAN.S */
5375 /* Copyright (C) 2008 The Android Open Source Project
5377 * Licensed under the Apache License, Version 2.0 (the "License");
5378 * you may not use this file except in compliance with the License.
5379 * You may obtain a copy of the License at
5381 * http://www.apache.org/licenses/LICENSE-2.0
5383 * Unless required by applicable law or agreed to in writing, software
5384 * distributed under the License is distributed on an "AS IS" BASIS,
5385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5386 * See the License for the specific language governing permissions and
5387 * limitations under the License.
5391 * File: OP_IGET_BOOLEAN.S
5394 /* File: x86-atom/OP_IGET.S */
5395 /* Copyright (C) 2008 The Android Open Source Project
5397 * Licensed under the Apache License, Version 2.0 (the "License");
5398 * you may not use this file except in compliance with the License.
5399 * You may obtain a copy of the License at
5401 * http://www.apache.org/licenses/LICENSE-2.0
5403 * Unless required by applicable law or agreed to in writing, software
5404 * distributed under the License is distributed on an "AS IS" BASIS,
5405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5406 * See the License for the specific language governing permissions and
5407 * limitations under the License.
5413 * Code: Generic 32-bit instance field "get" operation. Provides a
5414 * "mov" variable which determines the type of mov performed.
5415 * Currently, none of the iget's use this variable - may want
5416 * to change this, but seems ok for now.
5418 * For: iget-boolean, iget-byte, iget-char, iget-object, iget
5421 * Description: Perform the object instance field "get" operation
5422 * with the identified field; load the instance value into
5423 * the value register.
5426 * Format: B|A|op CCCC (22c)
5428 * Syntax: op vA, vB, type@CCCC
5429 * op vA, vB, field@CCCC
5433 movl rGLUE, %edx # %edx<- pMterpGlue
5434 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5435 FETCH 1, %ecx # %ecx<- CCCC
5436 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5437 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5438 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5439 jne .LOP_IGET_BOOLEAN_finish2
5440 movl rGLUE, %edx # %edx<- pMterpGlue
5441 movl offGlue_method(%edx), %edx # %edx <- current method
5442 EXPORT_PC # in case an exception is thrown
5443 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
5444 movl %ecx, -4(%esp) # push parameter CCCC; field ref
5445 movl %edx, -8(%esp) # push parameter method->clazz
5447 jmp .LOP_IGET_BOOLEAN_finish
5450 /* ------------------------------ */
5452 .L_OP_IGET_BYTE: /* 0x56 */
5453 /* File: x86-atom/OP_IGET_BYTE.S */
5454 /* Copyright (C) 2008 The Android Open Source Project
5456 * Licensed under the Apache License, Version 2.0 (the "License");
5457 * you may not use this file except in compliance with the License.
5458 * You may obtain a copy of the License at
5460 * http://www.apache.org/licenses/LICENSE-2.0
5462 * Unless required by applicable law or agreed to in writing, software
5463 * distributed under the License is distributed on an "AS IS" BASIS,
5464 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5465 * See the License for the specific language governing permissions and
5466 * limitations under the License.
5470 * File: OP_IGET_BYTE.S
5473 /* File: x86-atom/OP_IGET.S */
5474 /* Copyright (C) 2008 The Android Open Source Project
5476 * Licensed under the Apache License, Version 2.0 (the "License");
5477 * you may not use this file except in compliance with the License.
5478 * You may obtain a copy of the License at
5480 * http://www.apache.org/licenses/LICENSE-2.0
5482 * Unless required by applicable law or agreed to in writing, software
5483 * distributed under the License is distributed on an "AS IS" BASIS,
5484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5485 * See the License for the specific language governing permissions and
5486 * limitations under the License.
5492 * Code: Generic 32-bit instance field "get" operation. Provides a
5493 * "mov" variable which determines the type of mov performed.
5494 * Currently, none of the iget's use this variable - may want
5495 * to change this, but seems ok for now.
5497 * For: iget-boolean, iget-byte, iget-char, iget-object, iget
5500 * Description: Perform the object instance field "get" operation
5501 * with the identified field; load the instance value into
5502 * the value register.
5505 * Format: B|A|op CCCC (22c)
5507 * Syntax: op vA, vB, type@CCCC
5508 * op vA, vB, field@CCCC
5512 movl rGLUE, %edx # %edx<- pMterpGlue
5513 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5514 FETCH 1, %ecx # %ecx<- CCCC
5515 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5516 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5517 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5518 jne .LOP_IGET_BYTE_finish2
5519 movl rGLUE, %edx # %edx<- pMterpGlue
5520 movl offGlue_method(%edx), %edx # %edx <- current method
5521 EXPORT_PC # in case an exception is thrown
5522 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
5523 movl %ecx, -4(%esp) # push parameter CCCC; field ref
5524 movl %edx, -8(%esp) # push parameter method->clazz
5526 jmp .LOP_IGET_BYTE_finish
5529 /* ------------------------------ */
5531 .L_OP_IGET_CHAR: /* 0x57 */
5532 /* File: x86-atom/OP_IGET_CHAR.S */
5533 /* Copyright (C) 2008 The Android Open Source Project
5535 * Licensed under the Apache License, Version 2.0 (the "License");
5536 * you may not use this file except in compliance with the License.
5537 * You may obtain a copy of the License at
5539 * http://www.apache.org/licenses/LICENSE-2.0
5541 * Unless required by applicable law or agreed to in writing, software
5542 * distributed under the License is distributed on an "AS IS" BASIS,
5543 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5544 * See the License for the specific language governing permissions and
5545 * limitations under the License.
5549 * File: OP_IGET_CHAR.S
5552 /* File: x86-atom/OP_IGET.S */
5553 /* Copyright (C) 2008 The Android Open Source Project
5555 * Licensed under the Apache License, Version 2.0 (the "License");
5556 * you may not use this file except in compliance with the License.
5557 * You may obtain a copy of the License at
5559 * http://www.apache.org/licenses/LICENSE-2.0
5561 * Unless required by applicable law or agreed to in writing, software
5562 * distributed under the License is distributed on an "AS IS" BASIS,
5563 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5564 * See the License for the specific language governing permissions and
5565 * limitations under the License.
5571 * Code: Generic 32-bit instance field "get" operation. Provides a
5572 * "mov" variable which determines the type of mov performed.
5573 * Currently, none of the iget's use this variable - may want
5574 * to change this, but seems ok for now.
5576 * For: iget-boolean, iget-byte, iget-char, iget-object, iget
5579 * Description: Perform the object instance field "get" operation
5580 * with the identified field; load the instance value into
5581 * the value register.
5584 * Format: B|A|op CCCC (22c)
5586 * Syntax: op vA, vB, type@CCCC
5587 * op vA, vB, field@CCCC
5591 movl rGLUE, %edx # %edx<- pMterpGlue
5592 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5593 FETCH 1, %ecx # %ecx<- CCCC
5594 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5595 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5596 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5597 jne .LOP_IGET_CHAR_finish2
5598 movl rGLUE, %edx # %edx<- pMterpGlue
5599 movl offGlue_method(%edx), %edx # %edx <- current method
5600 EXPORT_PC # in case an exception is thrown
5601 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
5602 movl %ecx, -4(%esp) # push parameter CCCC; field ref
5603 movl %edx, -8(%esp) # push parameter method->clazz
5605 jmp .LOP_IGET_CHAR_finish
5608 /* ------------------------------ */
5610 .L_OP_IGET_SHORT: /* 0x58 */
5611 /* File: x86-atom/OP_IGET_SHORT.S */
5612 /* Copyright (C) 2008 The Android Open Source Project
5614 * Licensed under the Apache License, Version 2.0 (the "License");
5615 * you may not use this file except in compliance with the License.
5616 * You may obtain a copy of the License at
5618 * http://www.apache.org/licenses/LICENSE-2.0
5620 * Unless required by applicable law or agreed to in writing, software
5621 * distributed under the License is distributed on an "AS IS" BASIS,
5622 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5623 * See the License for the specific language governing permissions and
5624 * limitations under the License.
5628 * File: OP_IGET_SHORT.S
5631 /* File: x86-atom/OP_IGET.S */
5632 /* Copyright (C) 2008 The Android Open Source Project
5634 * Licensed under the Apache License, Version 2.0 (the "License");
5635 * you may not use this file except in compliance with the License.
5636 * You may obtain a copy of the License at
5638 * http://www.apache.org/licenses/LICENSE-2.0
5640 * Unless required by applicable law or agreed to in writing, software
5641 * distributed under the License is distributed on an "AS IS" BASIS,
5642 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5643 * See the License for the specific language governing permissions and
5644 * limitations under the License.
5650 * Code: Generic 32-bit instance field "get" operation. Provides a
5651 * "mov" variable which determines the type of mov performed.
5652 * Currently, none of the iget's use this variable - may want
5653 * to change this, but seems ok for now.
5655 * For: iget-boolean, iget-byte, iget-char, iget-object, iget
5658 * Description: Perform the object instance field "get" operation
5659 * with the identified field; load the instance value into
5660 * the value register.
5663 * Format: B|A|op CCCC (22c)
5665 * Syntax: op vA, vB, type@CCCC
5666 * op vA, vB, field@CCCC
5670 movl rGLUE, %edx # %edx<- pMterpGlue
5671 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5672 FETCH 1, %ecx # %ecx<- CCCC
5673 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5674 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5675 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5676 jne .LOP_IGET_SHORT_finish2
5677 movl rGLUE, %edx # %edx<- pMterpGlue
5678 movl offGlue_method(%edx), %edx # %edx <- current method
5679 EXPORT_PC # in case an exception is thrown
5680 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
5681 movl %ecx, -4(%esp) # push parameter CCCC; field ref
5682 movl %edx, -8(%esp) # push parameter method->clazz
5684 jmp .LOP_IGET_SHORT_finish
5687 /* ------------------------------ */
5689 .L_OP_IPUT: /* 0x59 */
5690 /* File: x86-atom/OP_IPUT.S */
5691 /* Copyright (C) 2008 The Android Open Source Project
5693 * Licensed under the Apache License, Version 2.0 (the "License");
5694 * you may not use this file except in compliance with the License.
5695 * You may obtain a copy of the License at
5697 * http://www.apache.org/licenses/LICENSE-2.0
5699 * Unless required by applicable law or agreed to in writing, software
5700 * distributed under the License is distributed on an "AS IS" BASIS,
5701 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5702 * See the License for the specific language governing permissions and
5703 * limitations under the License.
5709 * Code: Generic 32-bit instance field "put" operation. Provides a
5710 * "mov" variable which determines the type of mov performed.
5711 * Currently, none of the iput's use this variable - may want
5712 * to change this, but seems ok for now.
5714 * For: iput-boolean, iput-byte, iput-char, iput-object, iput
5717 * Description: Perform the object instance field "get" operation
5718 * with the identified field; load the instance value into
5719 * the value register.
5722 * Format: B|A|op CCCC (22c)
5724 * Syntax: op vA, vB, type@CCCC
5725 * op vA, vB, field@CCCC
5729 movl rGLUE, %edx # %edx<- pMterpGlue
5730 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5731 FETCH 1, %ecx # %ecx<- CCCC
5732 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5733 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5734 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5735 jne .LOP_IPUT_finish2
5736 movl rGLUE, %edx # %edx<- pMterpGlue
5737 jmp .LOP_IPUT_finish
5739 /* ------------------------------ */
5741 .L_OP_IPUT_WIDE: /* 0x5a */
5742 /* File: x86-atom/OP_IPUT_WIDE.S */
5743 /* Copyright (C) 2008 The Android Open Source Project
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
5749 * http://www.apache.org/licenses/LICENSE-2.0
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.
5759 * File: OP_IPUT_WIDE.S
5761 * Code: 64 bit instance field "put" operation. Uses no substitutions.
5765 * Description: Perform the object instance field "put" operation
5766 * with the identified field; load the instance value into
5767 * the value register.
5769 * Format: B|A|op CCCC (22c)
5771 * Syntax: op vA, vB, type@CCCC
5772 * op vA, vB, field@CCCC
5775 movl rGLUE, %eax # %eax<- MterpGlue pointer
5776 movl offGlue_methodClassDex(%eax), %ecx # %ecx<- pDvmDex
5777 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- CCCC
5778 FETCH 1, %edx # %edx<- pDvmDex->pResFields
5779 movl (%ecx, %edx, 4), %ecx # %ecx<- resolved InstField ptr
5780 cmp $0, %ecx # check for null ptr; resolved InstField ptr
5781 jne .LOP_IPUT_WIDE_finish
5782 movl offGlue_method(%eax), %ecx # %ecx <- current method
5783 EXPORT_PC # in case an exception is thrown
5784 movl offMethod_clazz(%ecx), %ecx # %ecx<- method->clazz
5785 movl %ecx, -8(%esp) # push parameter CCCC; field ref
5786 movl %edx, -4(%esp) # push parameter method->clazz
5787 jmp .LOP_IPUT_WIDE_finish2
5789 /* ------------------------------ */
5791 .L_OP_IPUT_OBJECT: /* 0x5b */
5792 /* File: x86-atom/OP_IPUT_OBJECT.S */
5793 /* Copyright (C) 2008 The Android Open Source Project
5795 * Licensed under the Apache License, Version 2.0 (the "License");
5796 * you may not use this file except in compliance with the License.
5797 * You may obtain a copy of the License at
5799 * http://www.apache.org/licenses/LICENSE-2.0
5801 * Unless required by applicable law or agreed to in writing, software
5802 * distributed under the License is distributed on an "AS IS" BASIS,
5803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5804 * See the License for the specific language governing permissions and
5805 * limitations under the License.
5809 * File: OP_IPUT_OBJECT.S
5812 /* File: x86-atom/OP_IPUT.S */
5813 /* Copyright (C) 2008 The Android Open Source Project
5815 * Licensed under the Apache License, Version 2.0 (the "License");
5816 * you may not use this file except in compliance with the License.
5817 * You may obtain a copy of the License at
5819 * http://www.apache.org/licenses/LICENSE-2.0
5821 * Unless required by applicable law or agreed to in writing, software
5822 * distributed under the License is distributed on an "AS IS" BASIS,
5823 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5824 * See the License for the specific language governing permissions and
5825 * limitations under the License.
5831 * Code: Generic 32-bit instance field "put" operation. Provides a
5832 * "mov" variable which determines the type of mov performed.
5833 * Currently, none of the iput's use this variable - may want
5834 * to change this, but seems ok for now.
5836 * For: iput-boolean, iput-byte, iput-char, iput-object, iput
5839 * Description: Perform the object instance field "get" operation
5840 * with the identified field; load the instance value into
5841 * the value register.
5844 * Format: B|A|op CCCC (22c)
5846 * Syntax: op vA, vB, type@CCCC
5847 * op vA, vB, field@CCCC
5851 movl rGLUE, %edx # %edx<- pMterpGlue
5852 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5853 FETCH 1, %ecx # %ecx<- CCCC
5854 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5855 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5856 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5857 jne .LOP_IPUT_OBJECT_finish2
5858 movl rGLUE, %edx # %edx<- pMterpGlue
5859 jmp .LOP_IPUT_OBJECT_finish
5862 /* ------------------------------ */
5864 .L_OP_IPUT_BOOLEAN: /* 0x5c */
5865 /* File: x86-atom/OP_IPUT_BOOLEAN.S */
5866 /* Copyright (C) 2008 The Android Open Source Project
5868 * Licensed under the Apache License, Version 2.0 (the "License");
5869 * you may not use this file except in compliance with the License.
5870 * You may obtain a copy of the License at
5872 * http://www.apache.org/licenses/LICENSE-2.0
5874 * Unless required by applicable law or agreed to in writing, software
5875 * distributed under the License is distributed on an "AS IS" BASIS,
5876 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5877 * See the License for the specific language governing permissions and
5878 * limitations under the License.
5882 * File: OP_IPUT_BOOLEAN.S
5885 /* File: x86-atom/OP_IPUT.S */
5886 /* Copyright (C) 2008 The Android Open Source Project
5888 * Licensed under the Apache License, Version 2.0 (the "License");
5889 * you may not use this file except in compliance with the License.
5890 * You may obtain a copy of the License at
5892 * http://www.apache.org/licenses/LICENSE-2.0
5894 * Unless required by applicable law or agreed to in writing, software
5895 * distributed under the License is distributed on an "AS IS" BASIS,
5896 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5897 * See the License for the specific language governing permissions and
5898 * limitations under the License.
5904 * Code: Generic 32-bit instance field "put" operation. Provides a
5905 * "mov" variable which determines the type of mov performed.
5906 * Currently, none of the iput's use this variable - may want
5907 * to change this, but seems ok for now.
5909 * For: iput-boolean, iput-byte, iput-char, iput-object, iput
5912 * Description: Perform the object instance field "get" operation
5913 * with the identified field; load the instance value into
5914 * the value register.
5917 * Format: B|A|op CCCC (22c)
5919 * Syntax: op vA, vB, type@CCCC
5920 * op vA, vB, field@CCCC
5924 movl rGLUE, %edx # %edx<- pMterpGlue
5925 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5926 FETCH 1, %ecx # %ecx<- CCCC
5927 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
5928 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
5929 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
5930 jne .LOP_IPUT_BOOLEAN_finish2
5931 movl rGLUE, %edx # %edx<- pMterpGlue
5932 jmp .LOP_IPUT_BOOLEAN_finish
5935 /* ------------------------------ */
5937 .L_OP_IPUT_BYTE: /* 0x5d */
5938 /* File: x86-atom/OP_IPUT_BYTE.S */
5939 /* Copyright (C) 2008 The Android Open Source Project
5941 * Licensed under the Apache License, Version 2.0 (the "License");
5942 * you may not use this file except in compliance with the License.
5943 * You may obtain a copy of the License at
5945 * http://www.apache.org/licenses/LICENSE-2.0
5947 * Unless required by applicable law or agreed to in writing, software
5948 * distributed under the License is distributed on an "AS IS" BASIS,
5949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5950 * See the License for the specific language governing permissions and
5951 * limitations under the License.
5955 * File: OP_IPUT_BYTE.S
5958 /* File: x86-atom/OP_IPUT.S */
5959 /* Copyright (C) 2008 The Android Open Source Project
5961 * Licensed under the Apache License, Version 2.0 (the "License");
5962 * you may not use this file except in compliance with the License.
5963 * You may obtain a copy of the License at
5965 * http://www.apache.org/licenses/LICENSE-2.0
5967 * Unless required by applicable law or agreed to in writing, software
5968 * distributed under the License is distributed on an "AS IS" BASIS,
5969 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5970 * See the License for the specific language governing permissions and
5971 * limitations under the License.
5977 * Code: Generic 32-bit instance field "put" operation. Provides a
5978 * "mov" variable which determines the type of mov performed.
5979 * Currently, none of the iput's use this variable - may want
5980 * to change this, but seems ok for now.
5982 * For: iput-boolean, iput-byte, iput-char, iput-object, iput
5985 * Description: Perform the object instance field "get" operation
5986 * with the identified field; load the instance value into
5987 * the value register.
5990 * Format: B|A|op CCCC (22c)
5992 * Syntax: op vA, vB, type@CCCC
5993 * op vA, vB, field@CCCC
5997 movl rGLUE, %edx # %edx<- pMterpGlue
5998 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
5999 FETCH 1, %ecx # %ecx<- CCCC
6000 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
6001 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
6002 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
6003 jne .LOP_IPUT_BYTE_finish2
6004 movl rGLUE, %edx # %edx<- pMterpGlue
6005 jmp .LOP_IPUT_BYTE_finish
6008 /* ------------------------------ */
6010 .L_OP_IPUT_CHAR: /* 0x5e */
6011 /* File: x86-atom/OP_IPUT_CHAR.S */
6012 /* Copyright (C) 2008 The Android Open Source Project
6014 * Licensed under the Apache License, Version 2.0 (the "License");
6015 * you may not use this file except in compliance with the License.
6016 * You may obtain a copy of the License at
6018 * http://www.apache.org/licenses/LICENSE-2.0
6020 * Unless required by applicable law or agreed to in writing, software
6021 * distributed under the License is distributed on an "AS IS" BASIS,
6022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6023 * See the License for the specific language governing permissions and
6024 * limitations under the License.
6028 * File: OP_IPUT_CHAR.S
6031 /* File: x86-atom/OP_IPUT.S */
6032 /* Copyright (C) 2008 The Android Open Source Project
6034 * Licensed under the Apache License, Version 2.0 (the "License");
6035 * you may not use this file except in compliance with the License.
6036 * You may obtain a copy of the License at
6038 * http://www.apache.org/licenses/LICENSE-2.0
6040 * Unless required by applicable law or agreed to in writing, software
6041 * distributed under the License is distributed on an "AS IS" BASIS,
6042 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6043 * See the License for the specific language governing permissions and
6044 * limitations under the License.
6050 * Code: Generic 32-bit instance field "put" operation. Provides a
6051 * "mov" variable which determines the type of mov performed.
6052 * Currently, none of the iput's use this variable - may want
6053 * to change this, but seems ok for now.
6055 * For: iput-boolean, iput-byte, iput-char, iput-object, iput
6058 * Description: Perform the object instance field "get" operation
6059 * with the identified field; load the instance value into
6060 * the value register.
6063 * Format: B|A|op CCCC (22c)
6065 * Syntax: op vA, vB, type@CCCC
6066 * op vA, vB, field@CCCC
6070 movl rGLUE, %edx # %edx<- pMterpGlue
6071 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
6072 FETCH 1, %ecx # %ecx<- CCCC
6073 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
6074 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
6075 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
6076 jne .LOP_IPUT_CHAR_finish2
6077 movl rGLUE, %edx # %edx<- pMterpGlue
6078 jmp .LOP_IPUT_CHAR_finish
6081 /* ------------------------------ */
6083 .L_OP_IPUT_SHORT: /* 0x5f */
6084 /* File: x86-atom/OP_IPUT_SHORT.S */
6085 /* Copyright (C) 2008 The Android Open Source Project
6087 * Licensed under the Apache License, Version 2.0 (the "License");
6088 * you may not use this file except in compliance with the License.
6089 * You may obtain a copy of the License at
6091 * http://www.apache.org/licenses/LICENSE-2.0
6093 * Unless required by applicable law or agreed to in writing, software
6094 * distributed under the License is distributed on an "AS IS" BASIS,
6095 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6096 * See the License for the specific language governing permissions and
6097 * limitations under the License.
6101 * File: OP_IPUT_SHORT.S
6104 /* File: x86-atom/OP_IPUT.S */
6105 /* Copyright (C) 2008 The Android Open Source Project
6107 * Licensed under the Apache License, Version 2.0 (the "License");
6108 * you may not use this file except in compliance with the License.
6109 * You may obtain a copy of the License at
6111 * http://www.apache.org/licenses/LICENSE-2.0
6113 * Unless required by applicable law or agreed to in writing, software
6114 * distributed under the License is distributed on an "AS IS" BASIS,
6115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6116 * See the License for the specific language governing permissions and
6117 * limitations under the License.
6123 * Code: Generic 32-bit instance field "put" operation. Provides a
6124 * "mov" variable which determines the type of mov performed.
6125 * Currently, none of the iput's use this variable - may want
6126 * to change this, but seems ok for now.
6128 * For: iput-boolean, iput-byte, iput-char, iput-object, iput
6131 * Description: Perform the object instance field "get" operation
6132 * with the identified field; load the instance value into
6133 * the value register.
6136 * Format: B|A|op CCCC (22c)
6138 * Syntax: op vA, vB, type@CCCC
6139 * op vA, vB, field@CCCC
6143 movl rGLUE, %edx # %edx<- pMterpGlue
6144 movl offGlue_methodClassDex(%edx), %edx # %edx<- pDvmDex
6145 FETCH 1, %ecx # %ecx<- CCCC
6146 movl offDvmDex_pResFields(%edx), %edx # %edx<- pDvmDex->pResFields
6147 cmp $0, (%edx, %ecx, 4) # check for null ptr; resolved InstField ptr
6148 movl (%edx, %ecx, 4), %eax # %eax<- resolved InstField ptr
6149 jne .LOP_IPUT_SHORT_finish2
6150 movl rGLUE, %edx # %edx<- pMterpGlue
6151 jmp .LOP_IPUT_SHORT_finish
6154 /* ------------------------------ */
6156 .L_OP_SGET: /* 0x60 */
6157 /* File: x86-atom/OP_SGET.S */
6158 /* Copyright (C) 2008 The Android Open Source Project
6160 * Licensed under the Apache License, Version 2.0 (the "License");
6161 * you may not use this file except in compliance with the License.
6162 * You may obtain a copy of the License at
6164 * http://www.apache.org/licenses/LICENSE-2.0
6166 * Unless required by applicable law or agreed to in writing, software
6167 * distributed under the License is distributed on an "AS IS" BASIS,
6168 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6169 * See the License for the specific language governing permissions and
6170 * limitations under the License.
6176 * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
6178 * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
6180 * Description: Perform the identified object static field operation
6181 * with the identified static field; load the field value
6182 * into the value register.
6184 * Format: AA|op BBBB (21c)
6186 * Syntax: op vAA, string@BBBB
6189 movl rGLUE, %edx # %edx<- pMterpGlue
6190 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
6191 FETCH 1, %eax # %eax<- BBBB
6192 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6193 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6194 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6195 je .LOP_SGET_resolve
6196 jmp .LOP_SGET_finish
6198 /* ------------------------------ */
6200 .L_OP_SGET_WIDE: /* 0x61 */
6201 /* File: x86-atom/OP_SGET_WIDE.S */
6202 /* Copyright (C) 2008 The Android Open Source Project
6204 * Licensed under the Apache License, Version 2.0 (the "License");
6205 * you may not use this file except in compliance with the License.
6206 * You may obtain a copy of the License at
6208 * http://www.apache.org/licenses/LICENSE-2.0
6210 * Unless required by applicable law or agreed to in writing, software
6211 * distributed under the License is distributed on an "AS IS" BASIS,
6212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6213 * See the License for the specific language governing permissions and
6214 * limitations under the License.
6218 * File: OP_SGET_WIDE.S
6220 * Code: 64-bit static field "get" operation. Uses no substitutions.
6224 * Description: Perform the identified object static field operation
6225 * with the identified static field, loading or storing
6226 * into the value register.
6228 * Format: AA|op BBBB (21c)
6230 * Syntax: op vAA, string@BBBB
6233 movl rGLUE, %eax # %eax<- pMterpGlue
6234 movl offGlue_methodClassDex(%eax), %ecx # %ecx<- glue->pDvmDex
6235 FETCH 1, %edx # %edx<- BBBB
6236 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6237 cmp $0, (%ecx, %edx, 4) # check for null ptr; resolved StaticField ptr
6238 movl (%ecx, %edx, 4), %ecx # %ecx<- resolved StaticField ptr
6239 je .LOP_SGET_WIDE_resolve
6241 .LOP_SGET_WIDE_finish:
6242 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
6243 movq offStaticField_value(%ecx), %xmm0 # %xmm0<- field value
6244 movq %xmm0, (rFP, rINST, 4) # vAA<- field value
6245 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
6247 /* ------------------------------ */
6249 .L_OP_SGET_OBJECT: /* 0x62 */
6250 /* File: x86-atom/OP_SGET_OBJECT.S */
6251 /* Copyright (C) 2008 The Android Open Source Project
6253 * Licensed under the Apache License, Version 2.0 (the "License");
6254 * you may not use this file except in compliance with the License.
6255 * You may obtain a copy of the License at
6257 * http://www.apache.org/licenses/LICENSE-2.0
6259 * Unless required by applicable law or agreed to in writing, software
6260 * distributed under the License is distributed on an "AS IS" BASIS,
6261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6262 * See the License for the specific language governing permissions and
6263 * limitations under the License.
6267 * File: OP_SGET_OBJECT.S
6270 /* File: x86-atom/OP_SGET.S */
6271 /* Copyright (C) 2008 The Android Open Source Project
6273 * Licensed under the Apache License, Version 2.0 (the "License");
6274 * you may not use this file except in compliance with the License.
6275 * You may obtain a copy of the License at
6277 * http://www.apache.org/licenses/LICENSE-2.0
6279 * Unless required by applicable law or agreed to in writing, software
6280 * distributed under the License is distributed on an "AS IS" BASIS,
6281 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6282 * See the License for the specific language governing permissions and
6283 * limitations under the License.
6289 * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
6291 * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
6293 * Description: Perform the identified object static field operation
6294 * with the identified static field; load the field value
6295 * into the value register.
6297 * Format: AA|op BBBB (21c)
6299 * Syntax: op vAA, string@BBBB
6302 movl rGLUE, %edx # %edx<- pMterpGlue
6303 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
6304 FETCH 1, %eax # %eax<- BBBB
6305 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6306 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6307 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6308 je .LOP_SGET_OBJECT_resolve
6309 jmp .LOP_SGET_OBJECT_finish
6312 /* ------------------------------ */
6314 .L_OP_SGET_BOOLEAN: /* 0x63 */
6315 /* File: x86-atom/OP_SGET_BOOLEAN.S */
6316 /* Copyright (C) 2008 The Android Open Source Project
6318 * Licensed under the Apache License, Version 2.0 (the "License");
6319 * you may not use this file except in compliance with the License.
6320 * You may obtain a copy of the License at
6322 * http://www.apache.org/licenses/LICENSE-2.0
6324 * Unless required by applicable law or agreed to in writing, software
6325 * distributed under the License is distributed on an "AS IS" BASIS,
6326 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6327 * See the License for the specific language governing permissions and
6328 * limitations under the License.
6332 * File: OP_SGET_BOOLEAN.S
6335 /* File: x86-atom/OP_SGET.S */
6336 /* Copyright (C) 2008 The Android Open Source Project
6338 * Licensed under the Apache License, Version 2.0 (the "License");
6339 * you may not use this file except in compliance with the License.
6340 * You may obtain a copy of the License at
6342 * http://www.apache.org/licenses/LICENSE-2.0
6344 * Unless required by applicable law or agreed to in writing, software
6345 * distributed under the License is distributed on an "AS IS" BASIS,
6346 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6347 * See the License for the specific language governing permissions and
6348 * limitations under the License.
6354 * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
6356 * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
6358 * Description: Perform the identified object static field operation
6359 * with the identified static field; load the field value
6360 * into the value register.
6362 * Format: AA|op BBBB (21c)
6364 * Syntax: op vAA, string@BBBB
6367 movl rGLUE, %edx # %edx<- pMterpGlue
6368 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
6369 FETCH 1, %eax # %eax<- BBBB
6370 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6371 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6372 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6373 je .LOP_SGET_BOOLEAN_resolve
6374 jmp .LOP_SGET_BOOLEAN_finish
6377 /* ------------------------------ */
6379 .L_OP_SGET_BYTE: /* 0x64 */
6380 /* File: x86-atom/OP_SGET_BYTE.S */
6381 /* Copyright (C) 2008 The Android Open Source Project
6383 * Licensed under the Apache License, Version 2.0 (the "License");
6384 * you may not use this file except in compliance with the License.
6385 * You may obtain a copy of the License at
6387 * http://www.apache.org/licenses/LICENSE-2.0
6389 * Unless required by applicable law or agreed to in writing, software
6390 * distributed under the License is distributed on an "AS IS" BASIS,
6391 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6392 * See the License for the specific language governing permissions and
6393 * limitations under the License.
6397 * File: OP_SGET_BYTE.S
6400 /* File: x86-atom/OP_SGET.S */
6401 /* Copyright (C) 2008 The Android Open Source Project
6403 * Licensed under the Apache License, Version 2.0 (the "License");
6404 * you may not use this file except in compliance with the License.
6405 * You may obtain a copy of the License at
6407 * http://www.apache.org/licenses/LICENSE-2.0
6409 * Unless required by applicable law or agreed to in writing, software
6410 * distributed under the License is distributed on an "AS IS" BASIS,
6411 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6412 * See the License for the specific language governing permissions and
6413 * limitations under the License.
6419 * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
6421 * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
6423 * Description: Perform the identified object static field operation
6424 * with the identified static field; load the field value
6425 * into the value register.
6427 * Format: AA|op BBBB (21c)
6429 * Syntax: op vAA, string@BBBB
6432 movl rGLUE, %edx # %edx<- pMterpGlue
6433 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
6434 FETCH 1, %eax # %eax<- BBBB
6435 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6436 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6437 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6438 je .LOP_SGET_BYTE_resolve
6439 jmp .LOP_SGET_BYTE_finish
6442 /* ------------------------------ */
6444 .L_OP_SGET_CHAR: /* 0x65 */
6445 /* File: x86-atom/OP_SGET_CHAR.S */
6446 /* Copyright (C) 2008 The Android Open Source Project
6448 * Licensed under the Apache License, Version 2.0 (the "License");
6449 * you may not use this file except in compliance with the License.
6450 * You may obtain a copy of the License at
6452 * http://www.apache.org/licenses/LICENSE-2.0
6454 * Unless required by applicable law or agreed to in writing, software
6455 * distributed under the License is distributed on an "AS IS" BASIS,
6456 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6457 * See the License for the specific language governing permissions and
6458 * limitations under the License.
6462 * File: OP_SGET_CHAR.S
6465 /* File: x86-atom/OP_SGET.S */
6466 /* Copyright (C) 2008 The Android Open Source Project
6468 * Licensed under the Apache License, Version 2.0 (the "License");
6469 * you may not use this file except in compliance with the License.
6470 * You may obtain a copy of the License at
6472 * http://www.apache.org/licenses/LICENSE-2.0
6474 * Unless required by applicable law or agreed to in writing, software
6475 * distributed under the License is distributed on an "AS IS" BASIS,
6476 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6477 * See the License for the specific language governing permissions and
6478 * limitations under the License.
6484 * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
6486 * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
6488 * Description: Perform the identified object static field operation
6489 * with the identified static field; load the field value
6490 * into the value register.
6492 * Format: AA|op BBBB (21c)
6494 * Syntax: op vAA, string@BBBB
6497 movl rGLUE, %edx # %edx<- pMterpGlue
6498 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
6499 FETCH 1, %eax # %eax<- BBBB
6500 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6501 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6502 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6503 je .LOP_SGET_CHAR_resolve
6504 jmp .LOP_SGET_CHAR_finish
6507 /* ------------------------------ */
6509 .L_OP_SGET_SHORT: /* 0x66 */
6510 /* File: x86-atom/OP_SGET_SHORT.S */
6511 /* Copyright (C) 2008 The Android Open Source Project
6513 * Licensed under the Apache License, Version 2.0 (the "License");
6514 * you may not use this file except in compliance with the License.
6515 * You may obtain a copy of the License at
6517 * http://www.apache.org/licenses/LICENSE-2.0
6519 * Unless required by applicable law or agreed to in writing, software
6520 * distributed under the License is distributed on an "AS IS" BASIS,
6521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6522 * See the License for the specific language governing permissions and
6523 * limitations under the License.
6527 * File: OP_SGET_SHORT.S
6530 /* File: x86-atom/OP_SGET.S */
6531 /* Copyright (C) 2008 The Android Open Source Project
6533 * Licensed under the Apache License, Version 2.0 (the "License");
6534 * you may not use this file except in compliance with the License.
6535 * You may obtain a copy of the License at
6537 * http://www.apache.org/licenses/LICENSE-2.0
6539 * Unless required by applicable law or agreed to in writing, software
6540 * distributed under the License is distributed on an "AS IS" BASIS,
6541 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6542 * See the License for the specific language governing permissions and
6543 * limitations under the License.
6549 * Code: Generic 32-bit static field "get" operation. Uses no substitutions.
6551 * For: sget-boolean, sget-byte, sget-char, sget-object, sget, sget-short
6553 * Description: Perform the identified object static field operation
6554 * with the identified static field; load the field value
6555 * into the value register.
6557 * Format: AA|op BBBB (21c)
6559 * Syntax: op vAA, string@BBBB
6562 movl rGLUE, %edx # %edx<- pMterpGlue
6563 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- glue->pDvmDex
6564 FETCH 1, %eax # %eax<- BBBB
6565 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6566 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6567 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6568 je .LOP_SGET_SHORT_resolve
6569 jmp .LOP_SGET_SHORT_finish
6572 /* ------------------------------ */
6574 .L_OP_SPUT: /* 0x67 */
6575 /* File: x86-atom/OP_SPUT.S */
6576 /* Copyright (C) 2008 The Android Open Source Project
6578 * Licensed under the Apache License, Version 2.0 (the "License");
6579 * you may not use this file except in compliance with the License.
6580 * You may obtain a copy of the License at
6582 * http://www.apache.org/licenses/LICENSE-2.0
6584 * Unless required by applicable law or agreed to in writing, software
6585 * distributed under the License is distributed on an "AS IS" BASIS,
6586 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6587 * See the License for the specific language governing permissions and
6588 * limitations under the License.
6594 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6596 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6598 * Description: Perform the identified object static field operation
6599 * with the identified static field; store the field value
6602 * Format: AA|op BBBB (21c)
6604 * Syntax: op vAA, string@BBBB
6607 movl rGLUE, %edx # %edx<- pMterpGlue
6608 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
6609 FETCH 1, %eax # %eax<- BBBB
6610 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6611 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6612 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6613 je .LOP_SPUT_resolve
6614 jmp .LOP_SPUT_finish
6616 /* ------------------------------ */
6618 .L_OP_SPUT_WIDE: /* 0x68 */
6619 /* File: x86-atom/OP_SPUT_WIDE.S */
6620 /* Copyright (C) 2008 The Android Open Source Project
6622 * Licensed under the Apache License, Version 2.0 (the "License");
6623 * you may not use this file except in compliance with the License.
6624 * You may obtain a copy of the License at
6626 * http://www.apache.org/licenses/LICENSE-2.0
6628 * Unless required by applicable law or agreed to in writing, software
6629 * distributed under the License is distributed on an "AS IS" BASIS,
6630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6631 * See the License for the specific language governing permissions and
6632 * limitations under the License.
6636 * File: OP_SPUT_WIDE.S
6638 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6640 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6642 * Description: Perform the identified object static field operation
6643 * with the identified static field; store the field value
6646 * Format: AA|op BBBB (21c)
6648 * Syntax: op vAA, string@BBBB
6651 movl rGLUE, %eax # %eax<- pMterpGlue
6652 movl offGlue_methodClassDex(%eax), %ecx # %ecx<- glue->pDvmDex
6653 FETCH 1, %edx # %edx<- BBBB
6654 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6655 cmp $0, (%ecx, %edx, 4) # check for null ptr; resolved StaticField ptr
6656 movl (%ecx, %edx, 4), %ecx # %ecx<- resolved StaticField ptr
6657 je .LOP_SPUT_WIDE_resolve
6659 .LOP_SPUT_WIDE_finish:
6660 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
6661 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vAA
6662 movq %xmm0, offStaticField_value(%ecx) # field value<- field value
6663 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
6665 /* ------------------------------ */
6667 .L_OP_SPUT_OBJECT: /* 0x69 */
6668 /* File: x86-atom/OP_SPUT_OBJECT.S */
6669 /* Copyright (C) 2008 The Android Open Source Project
6671 * Licensed under the Apache License, Version 2.0 (the "License");
6672 * you may not use this file except in compliance with the License.
6673 * You may obtain a copy of the License at
6675 * http://www.apache.org/licenses/LICENSE-2.0
6677 * Unless required by applicable law or agreed to in writing, software
6678 * distributed under the License is distributed on an "AS IS" BASIS,
6679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6680 * See the License for the specific language governing permissions and
6681 * limitations under the License.
6685 * File: OP_SPUT_OBJECT.S
6688 /* File: x86-atom/OP_SPUT.S */
6689 /* Copyright (C) 2008 The Android Open Source Project
6691 * Licensed under the Apache License, Version 2.0 (the "License");
6692 * you may not use this file except in compliance with the License.
6693 * You may obtain a copy of the License at
6695 * http://www.apache.org/licenses/LICENSE-2.0
6697 * Unless required by applicable law or agreed to in writing, software
6698 * distributed under the License is distributed on an "AS IS" BASIS,
6699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6700 * See the License for the specific language governing permissions and
6701 * limitations under the License.
6707 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6709 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6711 * Description: Perform the identified object static field operation
6712 * with the identified static field; store the field value
6715 * Format: AA|op BBBB (21c)
6717 * Syntax: op vAA, string@BBBB
6720 movl rGLUE, %edx # %edx<- pMterpGlue
6721 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
6722 FETCH 1, %eax # %eax<- BBBB
6723 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6724 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6725 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6726 je .LOP_SPUT_OBJECT_resolve
6727 jmp .LOP_SPUT_OBJECT_finish
6730 /* ------------------------------ */
6732 .L_OP_SPUT_BOOLEAN: /* 0x6a */
6733 /* File: x86-atom/OP_SPUT_BOOLEAN.S */
6734 /* Copyright (C) 2008 The Android Open Source Project
6736 * Licensed under the Apache License, Version 2.0 (the "License");
6737 * you may not use this file except in compliance with the License.
6738 * You may obtain a copy of the License at
6740 * http://www.apache.org/licenses/LICENSE-2.0
6742 * Unless required by applicable law or agreed to in writing, software
6743 * distributed under the License is distributed on an "AS IS" BASIS,
6744 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6745 * See the License for the specific language governing permissions and
6746 * limitations under the License.
6750 * File: OP_SPUT_BOOLEAN.S
6753 /* File: x86-atom/OP_SPUT.S */
6754 /* Copyright (C) 2008 The Android Open Source Project
6756 * Licensed under the Apache License, Version 2.0 (the "License");
6757 * you may not use this file except in compliance with the License.
6758 * You may obtain a copy of the License at
6760 * http://www.apache.org/licenses/LICENSE-2.0
6762 * Unless required by applicable law or agreed to in writing, software
6763 * distributed under the License is distributed on an "AS IS" BASIS,
6764 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6765 * See the License for the specific language governing permissions and
6766 * limitations under the License.
6772 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6774 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6776 * Description: Perform the identified object static field operation
6777 * with the identified static field; store the field value
6780 * Format: AA|op BBBB (21c)
6782 * Syntax: op vAA, string@BBBB
6785 movl rGLUE, %edx # %edx<- pMterpGlue
6786 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
6787 FETCH 1, %eax # %eax<- BBBB
6788 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6789 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6790 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6791 je .LOP_SPUT_BOOLEAN_resolve
6792 jmp .LOP_SPUT_BOOLEAN_finish
6795 /* ------------------------------ */
6797 .L_OP_SPUT_BYTE: /* 0x6b */
6798 /* File: x86-atom/OP_SPUT_BYTE.S */
6799 /* Copyright (C) 2008 The Android Open Source Project
6801 * Licensed under the Apache License, Version 2.0 (the "License");
6802 * you may not use this file except in compliance with the License.
6803 * You may obtain a copy of the License at
6805 * http://www.apache.org/licenses/LICENSE-2.0
6807 * Unless required by applicable law or agreed to in writing, software
6808 * distributed under the License is distributed on an "AS IS" BASIS,
6809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6810 * See the License for the specific language governing permissions and
6811 * limitations under the License.
6815 * File: OP_SPUT_BYTE.S
6818 /* File: x86-atom/OP_SPUT.S */
6819 /* Copyright (C) 2008 The Android Open Source Project
6821 * Licensed under the Apache License, Version 2.0 (the "License");
6822 * you may not use this file except in compliance with the License.
6823 * You may obtain a copy of the License at
6825 * http://www.apache.org/licenses/LICENSE-2.0
6827 * Unless required by applicable law or agreed to in writing, software
6828 * distributed under the License is distributed on an "AS IS" BASIS,
6829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6830 * See the License for the specific language governing permissions and
6831 * limitations under the License.
6837 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6839 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6841 * Description: Perform the identified object static field operation
6842 * with the identified static field; store the field value
6845 * Format: AA|op BBBB (21c)
6847 * Syntax: op vAA, string@BBBB
6850 movl rGLUE, %edx # %edx<- pMterpGlue
6851 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
6852 FETCH 1, %eax # %eax<- BBBB
6853 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6854 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6855 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6856 je .LOP_SPUT_BYTE_resolve
6857 jmp .LOP_SPUT_BYTE_finish
6860 /* ------------------------------ */
6862 .L_OP_SPUT_CHAR: /* 0x6c */
6863 /* File: x86-atom/OP_SPUT_CHAR.S */
6864 /* Copyright (C) 2008 The Android Open Source Project
6866 * Licensed under the Apache License, Version 2.0 (the "License");
6867 * you may not use this file except in compliance with the License.
6868 * You may obtain a copy of the License at
6870 * http://www.apache.org/licenses/LICENSE-2.0
6872 * Unless required by applicable law or agreed to in writing, software
6873 * distributed under the License is distributed on an "AS IS" BASIS,
6874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6875 * See the License for the specific language governing permissions and
6876 * limitations under the License.
6880 * File: OP_SPUT_CHAR.S
6883 /* File: x86-atom/OP_SPUT.S */
6884 /* Copyright (C) 2008 The Android Open Source Project
6886 * Licensed under the Apache License, Version 2.0 (the "License");
6887 * you may not use this file except in compliance with the License.
6888 * You may obtain a copy of the License at
6890 * http://www.apache.org/licenses/LICENSE-2.0
6892 * Unless required by applicable law or agreed to in writing, software
6893 * distributed under the License is distributed on an "AS IS" BASIS,
6894 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6895 * See the License for the specific language governing permissions and
6896 * limitations under the License.
6902 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6904 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6906 * Description: Perform the identified object static field operation
6907 * with the identified static field; store the field value
6910 * Format: AA|op BBBB (21c)
6912 * Syntax: op vAA, string@BBBB
6915 movl rGLUE, %edx # %edx<- pMterpGlue
6916 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
6917 FETCH 1, %eax # %eax<- BBBB
6918 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6919 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6920 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6921 je .LOP_SPUT_CHAR_resolve
6922 jmp .LOP_SPUT_CHAR_finish
6925 /* ------------------------------ */
6927 .L_OP_SPUT_SHORT: /* 0x6d */
6928 /* File: x86-atom/OP_SPUT_SHORT.S */
6929 /* Copyright (C) 2008 The Android Open Source Project
6931 * Licensed under the Apache License, Version 2.0 (the "License");
6932 * you may not use this file except in compliance with the License.
6933 * You may obtain a copy of the License at
6935 * http://www.apache.org/licenses/LICENSE-2.0
6937 * Unless required by applicable law or agreed to in writing, software
6938 * distributed under the License is distributed on an "AS IS" BASIS,
6939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6940 * See the License for the specific language governing permissions and
6941 * limitations under the License.
6945 * File: OP_SPUT_SHORT.S
6948 /* File: x86-atom/OP_SPUT.S */
6949 /* Copyright (C) 2008 The Android Open Source Project
6951 * Licensed under the Apache License, Version 2.0 (the "License");
6952 * you may not use this file except in compliance with the License.
6953 * You may obtain a copy of the License at
6955 * http://www.apache.org/licenses/LICENSE-2.0
6957 * Unless required by applicable law or agreed to in writing, software
6958 * distributed under the License is distributed on an "AS IS" BASIS,
6959 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6960 * See the License for the specific language governing permissions and
6961 * limitations under the License.
6967 * Code: Generic 32-bit static field "put" operation. Uses no substitutions.
6969 * For: sput-boolean, sput-byte, sput-char, sput-object, sput, sput-short
6971 * Description: Perform the identified object static field operation
6972 * with the identified static field; store the field value
6975 * Format: AA|op BBBB (21c)
6977 * Syntax: op vAA, string@BBBB
6980 movl rGLUE, %edx # %edx<- pMterpGlue
6981 movl offGlue_methodClassDex(%edx), %ecx # %ecx<- pDvmDex
6982 FETCH 1, %eax # %eax<- BBBB
6983 movl offDvmDex_pResFields(%ecx), %ecx # %ecx<- pResFields
6984 cmp $0, (%ecx, %eax, 4) # check for null ptr; resolved StaticField ptr
6985 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved StaticField ptr
6986 je .LOP_SPUT_SHORT_resolve
6987 jmp .LOP_SPUT_SHORT_finish
6990 /* ------------------------------ */
6992 .L_OP_INVOKE_VIRTUAL: /* 0x6e */
6993 /* File: x86-atom/OP_INVOKE_VIRTUAL.S */
6994 /* Copyright (C) 2008 The Android Open Source Project
6996 * Licensed under the Apache License, Version 2.0 (the "License");
6997 * you may not use this file except in compliance with the License.
6998 * You may obtain a copy of the License at
7000 * http://www.apache.org/licenses/LICENSE-2.0
7002 * Unless required by applicable law or agreed to in writing, software
7003 * distributed under the License is distributed on an "AS IS" BASIS,
7004 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7005 * See the License for the specific language governing permissions and
7006 * limitations under the License.
7010 * File: OP_INVOKE_VIRTUAL.S
7012 * Code: Call a virtual method. Provides an "isrange" variable and
7013 * a "routine" variable to specify this is the "range" version of
7014 * invoke_direct that allows up to 255 arguments.
7016 * For: invoke-virtual, invoke-virtual/range
7018 * Description: invoke-virtual is used to invoke a normal virtual method;
7019 * a method that is not static or final, and is not a constructor.
7021 * Format: B|A|op CCCC G|F|E|D (35c)
7022 * AA|op BBBB CCCC (3rc)
7024 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7025 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7026 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7027 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7028 * [B=2] op {vD, vE}, kind@CCCC (35c)
7029 * [B=1] op {vD}, kind@CCCC (35c)
7030 * [B=0] op {}, kind@CCCC (35c)
7032 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7033 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7034 * and C determines the first register)
7038 movl rGLUE, %eax # %eax<- pMterpGlue
7039 EXPORT_PC # must export pc for invoke
7040 movl offGlue_methodClassDex(%eax), %eax # %eax<- pDvmDex
7041 FETCH 1, %ecx # %ecx<- method index
7042 movl offDvmDex_pResMethods(%eax), %eax # %eax<- pDvmDex->pResMethods
7043 FETCH 2, %edx # %edx<- GFED or CCCC
7045 and $15, %edx # %edx<- D if not range
7047 cmp $0, (%eax, %ecx, 4) # check if already resolved
7048 je .LOP_INVOKE_VIRTUAL_break
7049 movl (%eax, %ecx, 4), %eax # %eax<- resolved base method
7050 jmp .LOP_INVOKE_VIRTUAL_continue
7052 /* ------------------------------ */
7054 .L_OP_INVOKE_SUPER: /* 0x6f */
7055 /* File: x86-atom/OP_INVOKE_SUPER.S */
7056 /* Copyright (C) 2008 The Android Open Source Project
7058 * Licensed under the Apache License, Version 2.0 (the "License");
7059 * you may not use this file except in compliance with the License.
7060 * You may obtain a copy of the License at
7062 * http://www.apache.org/licenses/LICENSE-2.0
7064 * Unless required by applicable law or agreed to in writing, software
7065 * distributed under the License is distributed on an "AS IS" BASIS,
7066 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7067 * See the License for the specific language governing permissions and
7068 * limitations under the License.
7072 * File: OP_INVOKE_SUPER.S
7074 * Code: Call super method.
7076 * For: invoke-super, invoke-super/range
7078 * Description: invoke-super is used to invoke the closest superclass's virtual
7079 * method (as opposed to the one with the same method_id in the
7082 * Format: B|A|op CCCC G|F|E|D (35c)
7083 * AA|op BBBB CCCC (3rc)
7085 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7086 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7087 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7088 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7089 * [B=2] op {vD, vE}, kind@CCCC (35c)
7090 * [B=1] op {vD}, kind@CCCC (35c)
7091 * [B=0] op {}, kind@CCCC (35c)
7093 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7094 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7095 * and C determines the first register)
7099 movl rGLUE, %ecx # %ecx<- pMterpGlue
7100 FETCH 2, %eax # %eax<- GFED or CCCC
7101 movl offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
7103 and $15, %eax # %eax<- D if not range
7105 FETCH 1, %edx # %edx<- method index
7106 movl offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
7107 cmp $0, (rFP, %eax, 4) # check for null object
7108 movl (%ecx, %edx, 4), %ecx # %ecx<- resolved base method
7109 je common_errNullObject # handle null object
7110 jmp .LOP_INVOKE_SUPER_continue2
7112 /* ------------------------------ */
7114 .L_OP_INVOKE_DIRECT: /* 0x70 */
7115 /* File: x86-atom/OP_INVOKE_DIRECT.S */
7116 /* Copyright (C) 2008 The Android Open Source Project
7118 * Licensed under the Apache License, Version 2.0 (the "License");
7119 * you may not use this file except in compliance with the License.
7120 * You may obtain a copy of the License at
7122 * http://www.apache.org/licenses/LICENSE-2.0
7124 * Unless required by applicable law or agreed to in writing, software
7125 * distributed under the License is distributed on an "AS IS" BASIS,
7126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7127 * See the License for the specific language governing permissions and
7128 * limitations under the License.
7132 * File: OP_INVOKE_DIRECT.S
7134 * Code: Call a non-static direct method. Provides an "isrange" variable and
7135 * a "routine" variable to specify this is the "range" version of
7136 * invoke_direct that allows up to 255 arguments.
7138 * For: invoke-direct, invoke-direct/range
7140 * Description: invoke-direct is used to invoke a non-static direct method;
7141 * an instance method that is non-overridable, for example,
7142 * either a private instance method or a constructor.
7144 * Format: B|A|op CCCC G|F|E|D (35c)
7145 * AA|op BBBB CCCC (3rc)
7147 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7148 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7149 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7150 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7151 * [B=2] op {vD, vE}, kind@CCCC (35c)
7152 * [B=1] op {vD}, kind@CCCC (35c)
7153 * [B=0] op {}, kind@CCCC (35c)
7155 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7156 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7157 * and C determines the first register)
7161 movl rGLUE, %ecx # %ecx<- pMterpGlue
7162 movl offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
7163 FETCH 1, %eax # %eax<- method index
7164 movl offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
7165 FETCH 2, %edx # %edx<- GFED or CCCC
7166 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved method to call
7168 andl $15, %edx # %edx<- D if not range
7170 EXPORT_PC # must export for invoke
7171 movl %edx, -4(%esp) # save "this" pointer register
7172 cmp $0, %ecx # check if already resolved
7173 GET_VREG %edx # %edx<- "this" pointer
7174 je .LOP_INVOKE_DIRECT_resolve # handle resolve
7176 .LOP_INVOKE_DIRECT_finish:
7177 cmp $0, %edx # check for null "this"
7178 jne common_invokeMethodNoRange # invoke method common code
7179 jmp common_errNullObject
7181 /* ------------------------------ */
7183 .L_OP_INVOKE_STATIC: /* 0x71 */
7184 /* File: x86-atom/OP_INVOKE_STATIC.S */
7185 /* Copyright (C) 2008 The Android Open Source Project
7187 * Licensed under the Apache License, Version 2.0 (the "License");
7188 * you may not use this file except in compliance with the License.
7189 * You may obtain a copy of the License at
7191 * http://www.apache.org/licenses/LICENSE-2.0
7193 * Unless required by applicable law or agreed to in writing, software
7194 * distributed under the License is distributed on an "AS IS" BASIS,
7195 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7196 * See the License for the specific language governing permissions and
7197 * limitations under the License.
7201 * File: OP_INVOKE_STATIC.S
7203 * Code: Call static direct method. Provides an "isrange" variable and
7204 * a "routine" variable to specify this is the "range" version of
7205 * invoke_static that allows up to 255 arguments.
7207 * For: invoke-static, invoke-static/range
7209 * Description: invoke-static is used to invoke static direct method.
7211 * Format: B|A|op CCCC G|F|E|D (35c)
7212 * AA|op BBBB CCCC (3rc)
7214 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7215 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7216 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7217 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7218 * [B=2] op {vD, vE}, kind@CCCC (35c)
7219 * [B=1] op {vD}, kind@CCCC (35c)
7220 * [B=0] op {}, kind@CCCC (35c)
7222 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7223 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7224 * and C determines the first register)
7228 movl rGLUE, %edx # %edx<- pMterpGlue
7229 movl offGlue_methodClassDex(%edx), %ecx # %edx<- pDvmDex
7230 FETCH 1, %eax # %eax<- method index
7231 movl offDvmDex_pResMethods(%ecx), %ecx # %edx<- pDvmDex->pResMethods
7232 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved method to call
7233 cmp $0, %ecx # check if already resolved
7234 EXPORT_PC # must export for invoke
7235 jne common_invokeMethodNoRange # invoke method common code
7236 jmp .LOP_INVOKE_STATIC_break
7238 /* ------------------------------ */
7240 .L_OP_INVOKE_INTERFACE: /* 0x72 */
7241 /* File: x86-atom/OP_INVOKE_INTERFACE.S */
7242 /* Copyright (C) 2008 The Android Open Source Project
7244 * Licensed under the Apache License, Version 2.0 (the "License");
7245 * you may not use this file except in compliance with the License.
7246 * You may obtain a copy of the License at
7248 * http://www.apache.org/licenses/LICENSE-2.0
7250 * Unless required by applicable law or agreed to in writing, software
7251 * distributed under the License is distributed on an "AS IS" BASIS,
7252 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7253 * See the License for the specific language governing permissions and
7254 * limitations under the License.
7258 * File: OP_INVOKE_INTERFACE.S
7260 * Code: Call at method. Provides an "isrange" variable and
7261 * a "routine" variable to specify this is the "range" version of
7262 * invoke_interface that allows up to 255 arguments.
7264 * For: invoke-interface, invoke-interface-range
7266 * Description: invoke-interface is used to invoke an interface method; on an
7267 * object whose concrete class isn't known, using a method_id that
7268 * refers to an interface.
7270 * Format: B|A|op CCCC G|F|E|D (35c)
7271 * AA|op BBBB CCCC (3rc)
7273 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7274 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7275 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7276 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7277 * [B=2] op {vD, vE}, kind@CCCC (35c)
7278 * [B=1] op {vD}, kind@CCCC (35c)
7279 * [B=0] op {}, kind@CCCC (35c)
7281 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7282 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7283 * and C determines the first register)
7287 FETCH 2, %edx # %edx<- GFED or CCCC
7288 FETCH 1, %ecx # %ecx<- method index
7289 movl %ecx, -12(%esp) # push argument method index
7291 and $15, %edx # %edx<- D if not range
7293 EXPORT_PC # must export for invoke
7294 GET_VREG %edx # %edx<- first arg "this pointer"
7295 movl rGLUE, %eax # %eax<- pMterpGlue
7296 movl offGlue_methodClassDex(%eax), %eax # %eax<- glue->pDvmDex
7297 movl %eax, -4(%esp) # push parameter class
7298 cmp $0, %edx # check for null object
7299 je common_errNullObject # handle null object
7300 jmp .LOP_INVOKE_INTERFACE_break
7302 /* ------------------------------ */
7304 .L_OP_UNUSED_73: /* 0x73 */
7305 /* File: x86-atom/OP_UNUSED_73.S */
7306 /* Copyright (C) 2008 The Android Open Source Project
7308 * Licensed under the Apache License, Version 2.0 (the "License");
7309 * you may not use this file except in compliance with the License.
7310 * You may obtain a copy of the License at
7312 * http://www.apache.org/licenses/LICENSE-2.0
7314 * Unless required by applicable law or agreed to in writing, software
7315 * distributed under the License is distributed on an "AS IS" BASIS,
7316 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7317 * See the License for the specific language governing permissions and
7318 * limitations under the License.
7322 * File: OP_UNUSED_73.S
7325 /* File: x86-atom/unused.S */
7326 /* Copyright (C) 2008 The Android Open Source Project
7328 * Licensed under the Apache License, Version 2.0 (the "License");
7329 * you may not use this file except in compliance with the License.
7330 * You may obtain a copy of the License at
7332 * http://www.apache.org/licenses/LICENSE-2.0
7334 * Unless required by applicable law or agreed to in writing, software
7335 * distributed under the License is distributed on an "AS IS" BASIS,
7336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7337 * See the License for the specific language governing permissions and
7338 * limitations under the License.
7344 * Code: Common code for unused bytecodes. Uses no subtitutions.
7346 * For: all unused bytecodes
7348 * Description: aborts if executed.
7350 * Format: ØØ|op (10x)
7358 /* ------------------------------ */
7360 .L_OP_INVOKE_VIRTUAL_RANGE: /* 0x74 */
7361 /* File: x86-atom/OP_INVOKE_VIRTUAL_RANGE.S */
7362 /* Copyright (C) 2008 The Android Open Source Project
7364 * Licensed under the Apache License, Version 2.0 (the "License");
7365 * you may not use this file except in compliance with the License.
7366 * You may obtain a copy of the License at
7368 * http://www.apache.org/licenses/LICENSE-2.0
7370 * Unless required by applicable law or agreed to in writing, software
7371 * distributed under the License is distributed on an "AS IS" BASIS,
7372 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7373 * See the License for the specific language governing permissions and
7374 * limitations under the License.
7378 * File: OP_INVOKE_VIRTUAL_RANGE.S
7381 /* File: x86-atom/OP_INVOKE_VIRTUAL.S */
7382 /* Copyright (C) 2008 The Android Open Source Project
7384 * Licensed under the Apache License, Version 2.0 (the "License");
7385 * you may not use this file except in compliance with the License.
7386 * You may obtain a copy of the License at
7388 * http://www.apache.org/licenses/LICENSE-2.0
7390 * Unless required by applicable law or agreed to in writing, software
7391 * distributed under the License is distributed on an "AS IS" BASIS,
7392 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7393 * See the License for the specific language governing permissions and
7394 * limitations under the License.
7398 * File: OP_INVOKE_VIRTUAL.S
7400 * Code: Call a virtual method. Provides an "isrange" variable and
7401 * a "routine" variable to specify this is the "range" version of
7402 * invoke_direct that allows up to 255 arguments.
7404 * For: invoke-virtual, invoke-virtual/range
7406 * Description: invoke-virtual is used to invoke a normal virtual method;
7407 * a method that is not static or final, and is not a constructor.
7409 * Format: B|A|op CCCC G|F|E|D (35c)
7410 * AA|op BBBB CCCC (3rc)
7412 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7413 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7414 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7415 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7416 * [B=2] op {vD, vE}, kind@CCCC (35c)
7417 * [B=1] op {vD}, kind@CCCC (35c)
7418 * [B=0] op {}, kind@CCCC (35c)
7420 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7421 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7422 * and C determines the first register)
7426 movl rGLUE, %eax # %eax<- pMterpGlue
7427 EXPORT_PC # must export pc for invoke
7428 movl offGlue_methodClassDex(%eax), %eax # %eax<- pDvmDex
7429 FETCH 1, %ecx # %ecx<- method index
7430 movl offDvmDex_pResMethods(%eax), %eax # %eax<- pDvmDex->pResMethods
7431 FETCH 2, %edx # %edx<- GFED or CCCC
7433 and $15, %edx # %edx<- D if not range
7435 cmp $0, (%eax, %ecx, 4) # check if already resolved
7436 je .LOP_INVOKE_VIRTUAL_RANGE_break
7437 movl (%eax, %ecx, 4), %eax # %eax<- resolved base method
7438 jmp .LOP_INVOKE_VIRTUAL_RANGE_continue
7441 /* ------------------------------ */
7443 .L_OP_INVOKE_SUPER_RANGE: /* 0x75 */
7444 /* File: x86-atom/OP_INVOKE_SUPER_RANGE.S */
7445 /* Copyright (C) 2008 The Android Open Source Project
7447 * Licensed under the Apache License, Version 2.0 (the "License");
7448 * you may not use this file except in compliance with the License.
7449 * You may obtain a copy of the License at
7451 * http://www.apache.org/licenses/LICENSE-2.0
7453 * Unless required by applicable law or agreed to in writing, software
7454 * distributed under the License is distributed on an "AS IS" BASIS,
7455 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7456 * See the License for the specific language governing permissions and
7457 * limitations under the License.
7461 * File: OP_INVOKE_SUPER_RANGE.S
7464 /* File: x86-atom/OP_INVOKE_SUPER.S */
7465 /* Copyright (C) 2008 The Android Open Source Project
7467 * Licensed under the Apache License, Version 2.0 (the "License");
7468 * you may not use this file except in compliance with the License.
7469 * You may obtain a copy of the License at
7471 * http://www.apache.org/licenses/LICENSE-2.0
7473 * Unless required by applicable law or agreed to in writing, software
7474 * distributed under the License is distributed on an "AS IS" BASIS,
7475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7476 * See the License for the specific language governing permissions and
7477 * limitations under the License.
7481 * File: OP_INVOKE_SUPER.S
7483 * Code: Call super method.
7485 * For: invoke-super, invoke-super/range
7487 * Description: invoke-super is used to invoke the closest superclass's virtual
7488 * method (as opposed to the one with the same method_id in the
7491 * Format: B|A|op CCCC G|F|E|D (35c)
7492 * AA|op BBBB CCCC (3rc)
7494 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7495 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7496 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7497 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7498 * [B=2] op {vD, vE}, kind@CCCC (35c)
7499 * [B=1] op {vD}, kind@CCCC (35c)
7500 * [B=0] op {}, kind@CCCC (35c)
7502 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7503 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7504 * and C determines the first register)
7508 movl rGLUE, %ecx # %ecx<- pMterpGlue
7509 FETCH 2, %eax # %eax<- GFED or CCCC
7510 movl offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
7512 and $15, %eax # %eax<- D if not range
7514 FETCH 1, %edx # %edx<- method index
7515 movl offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
7516 cmp $0, (rFP, %eax, 4) # check for null object
7517 movl (%ecx, %edx, 4), %ecx # %ecx<- resolved base method
7518 je common_errNullObject # handle null object
7519 jmp .LOP_INVOKE_SUPER_RANGE_continue2
7522 /* ------------------------------ */
7524 .L_OP_INVOKE_DIRECT_RANGE: /* 0x76 */
7525 /* File: x86-atom/OP_INVOKE_DIRECT_RANGE.S */
7526 /* Copyright (C) 2008 The Android Open Source Project
7528 * Licensed under the Apache License, Version 2.0 (the "License");
7529 * you may not use this file except in compliance with the License.
7530 * You may obtain a copy of the License at
7532 * http://www.apache.org/licenses/LICENSE-2.0
7534 * Unless required by applicable law or agreed to in writing, software
7535 * distributed under the License is distributed on an "AS IS" BASIS,
7536 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7537 * See the License for the specific language governing permissions and
7538 * limitations under the License.
7542 * File: OP_INVOKE_DIRECT_RANGE.S
7545 /* File: x86-atom/OP_INVOKE_DIRECT.S */
7546 /* Copyright (C) 2008 The Android Open Source Project
7548 * Licensed under the Apache License, Version 2.0 (the "License");
7549 * you may not use this file except in compliance with the License.
7550 * You may obtain a copy of the License at
7552 * http://www.apache.org/licenses/LICENSE-2.0
7554 * Unless required by applicable law or agreed to in writing, software
7555 * distributed under the License is distributed on an "AS IS" BASIS,
7556 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7557 * See the License for the specific language governing permissions and
7558 * limitations under the License.
7562 * File: OP_INVOKE_DIRECT.S
7564 * Code: Call a non-static direct method. Provides an "isrange" variable and
7565 * a "routine" variable to specify this is the "range" version of
7566 * invoke_direct that allows up to 255 arguments.
7568 * For: invoke-direct, invoke-direct/range
7570 * Description: invoke-direct is used to invoke a non-static direct method;
7571 * an instance method that is non-overridable, for example,
7572 * either a private instance method or a constructor.
7574 * Format: B|A|op CCCC G|F|E|D (35c)
7575 * AA|op BBBB CCCC (3rc)
7577 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7578 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7579 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7580 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7581 * [B=2] op {vD, vE}, kind@CCCC (35c)
7582 * [B=1] op {vD}, kind@CCCC (35c)
7583 * [B=0] op {}, kind@CCCC (35c)
7585 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7586 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7587 * and C determines the first register)
7591 movl rGLUE, %ecx # %ecx<- pMterpGlue
7592 movl offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
7593 FETCH 1, %eax # %eax<- method index
7594 movl offDvmDex_pResMethods(%ecx), %ecx # %ecx<- pDvmDex->pResMethods
7595 FETCH 2, %edx # %edx<- GFED or CCCC
7596 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved method to call
7598 andl $15, %edx # %edx<- D if not range
7600 EXPORT_PC # must export for invoke
7601 movl %edx, -4(%esp) # save "this" pointer register
7602 cmp $0, %ecx # check if already resolved
7603 GET_VREG %edx # %edx<- "this" pointer
7604 je .LOP_INVOKE_DIRECT_RANGE_resolve # handle resolve
7606 .LOP_INVOKE_DIRECT_RANGE_finish:
7607 cmp $0, %edx # check for null "this"
7608 jne common_invokeMethodRange # invoke method common code
7609 jmp common_errNullObject
7612 /* ------------------------------ */
7614 .L_OP_INVOKE_STATIC_RANGE: /* 0x77 */
7615 /* File: x86-atom/OP_INVOKE_STATIC_RANGE.S */
7616 /* Copyright (C) 2008 The Android Open Source Project
7618 * Licensed under the Apache License, Version 2.0 (the "License");
7619 * you may not use this file except in compliance with the License.
7620 * You may obtain a copy of the License at
7622 * http://www.apache.org/licenses/LICENSE-2.0
7624 * Unless required by applicable law or agreed to in writing, software
7625 * distributed under the License is distributed on an "AS IS" BASIS,
7626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7627 * See the License for the specific language governing permissions and
7628 * limitations under the License.
7632 * File: OP_INVOKE_STATIC_RANGE.S
7635 /* File: x86-atom/OP_INVOKE_STATIC.S */
7636 /* Copyright (C) 2008 The Android Open Source Project
7638 * Licensed under the Apache License, Version 2.0 (the "License");
7639 * you may not use this file except in compliance with the License.
7640 * You may obtain a copy of the License at
7642 * http://www.apache.org/licenses/LICENSE-2.0
7644 * Unless required by applicable law or agreed to in writing, software
7645 * distributed under the License is distributed on an "AS IS" BASIS,
7646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7647 * See the License for the specific language governing permissions and
7648 * limitations under the License.
7652 * File: OP_INVOKE_STATIC.S
7654 * Code: Call static direct method. Provides an "isrange" variable and
7655 * a "routine" variable to specify this is the "range" version of
7656 * invoke_static that allows up to 255 arguments.
7658 * For: invoke-static, invoke-static/range
7660 * Description: invoke-static is used to invoke static direct method.
7662 * Format: B|A|op CCCC G|F|E|D (35c)
7663 * AA|op BBBB CCCC (3rc)
7665 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7666 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7667 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7668 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7669 * [B=2] op {vD, vE}, kind@CCCC (35c)
7670 * [B=1] op {vD}, kind@CCCC (35c)
7671 * [B=0] op {}, kind@CCCC (35c)
7673 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7674 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7675 * and C determines the first register)
7679 movl rGLUE, %edx # %edx<- pMterpGlue
7680 movl offGlue_methodClassDex(%edx), %ecx # %edx<- pDvmDex
7681 FETCH 1, %eax # %eax<- method index
7682 movl offDvmDex_pResMethods(%ecx), %ecx # %edx<- pDvmDex->pResMethods
7683 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved method to call
7684 cmp $0, %ecx # check if already resolved
7685 EXPORT_PC # must export for invoke
7686 jne common_invokeMethodRange # invoke method common code
7687 jmp .LOP_INVOKE_STATIC_RANGE_break
7690 /* ------------------------------ */
7692 .L_OP_INVOKE_INTERFACE_RANGE: /* 0x78 */
7693 /* File: x86-atom/OP_INVOKE_INTERFACE_RANGE.S */
7694 /* Copyright (C) 2008 The Android Open Source Project
7696 * Licensed under the Apache License, Version 2.0 (the "License");
7697 * you may not use this file except in compliance with the License.
7698 * You may obtain a copy of the License at
7700 * http://www.apache.org/licenses/LICENSE-2.0
7702 * Unless required by applicable law or agreed to in writing, software
7703 * distributed under the License is distributed on an "AS IS" BASIS,
7704 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7705 * See the License for the specific language governing permissions and
7706 * limitations under the License.
7710 * File: OP_INVOKE_INTERFACE_RANGE.S
7713 /* File: x86-atom/OP_INVOKE_INTERFACE.S */
7714 /* Copyright (C) 2008 The Android Open Source Project
7716 * Licensed under the Apache License, Version 2.0 (the "License");
7717 * you may not use this file except in compliance with the License.
7718 * You may obtain a copy of the License at
7720 * http://www.apache.org/licenses/LICENSE-2.0
7722 * Unless required by applicable law or agreed to in writing, software
7723 * distributed under the License is distributed on an "AS IS" BASIS,
7724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7725 * See the License for the specific language governing permissions and
7726 * limitations under the License.
7730 * File: OP_INVOKE_INTERFACE.S
7732 * Code: Call at method. Provides an "isrange" variable and
7733 * a "routine" variable to specify this is the "range" version of
7734 * invoke_interface that allows up to 255 arguments.
7736 * For: invoke-interface, invoke-interface-range
7738 * Description: invoke-interface is used to invoke an interface method; on an
7739 * object whose concrete class isn't known, using a method_id that
7740 * refers to an interface.
7742 * Format: B|A|op CCCC G|F|E|D (35c)
7743 * AA|op BBBB CCCC (3rc)
7745 * Syntax: [B=5] op {vD, vE, vF, vG, vA}, meth@CCCC (35c)
7746 * [B=5] op {vD, vE, vF, vG, vA}, type@CCCC (35c)
7747 * [B=4] op {vD, vE, vF, vG}, kind@CCCC (35c)
7748 * [B=3] op {vD, vE, vF}, kind@CCCC (35c)
7749 * [B=2] op {vD, vE}, kind@CCCC (35c)
7750 * [B=1] op {vD}, kind@CCCC (35c)
7751 * [B=0] op {}, kind@CCCC (35c)
7753 * op {vCCCC .. vNNNN}, meth@BBBB (3rc) (where NNNN = CCCC+AA-1, that
7754 * op {vCCCC .. vNNNN}, type@BBBB (3rc) is A determines the count 0..255,
7755 * and C determines the first register)
7759 FETCH 2, %edx # %edx<- GFED or CCCC
7760 FETCH 1, %ecx # %ecx<- method index
7761 movl %ecx, -12(%esp) # push argument method index
7763 and $15, %edx # %edx<- D if not range
7765 EXPORT_PC # must export for invoke
7766 GET_VREG %edx # %edx<- first arg "this pointer"
7767 movl rGLUE, %eax # %eax<- pMterpGlue
7768 movl offGlue_methodClassDex(%eax), %eax # %eax<- glue->pDvmDex
7769 movl %eax, -4(%esp) # push parameter class
7770 cmp $0, %edx # check for null object
7771 je common_errNullObject # handle null object
7772 jmp .LOP_INVOKE_INTERFACE_RANGE_break
7775 /* ------------------------------ */
7777 .L_OP_UNUSED_79: /* 0x79 */
7778 /* File: x86-atom/OP_UNUSED_79.S */
7779 /* Copyright (C) 2008 The Android Open Source Project
7781 * Licensed under the Apache License, Version 2.0 (the "License");
7782 * you may not use this file except in compliance with the License.
7783 * You may obtain a copy of the License at
7785 * http://www.apache.org/licenses/LICENSE-2.0
7787 * Unless required by applicable law or agreed to in writing, software
7788 * distributed under the License is distributed on an "AS IS" BASIS,
7789 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7790 * See the License for the specific language governing permissions and
7791 * limitations under the License.
7795 * File: OP_UNUSED_79.S
7798 /* File: x86-atom/unused.S */
7799 /* Copyright (C) 2008 The Android Open Source Project
7801 * Licensed under the Apache License, Version 2.0 (the "License");
7802 * you may not use this file except in compliance with the License.
7803 * You may obtain a copy of the License at
7805 * http://www.apache.org/licenses/LICENSE-2.0
7807 * Unless required by applicable law or agreed to in writing, software
7808 * distributed under the License is distributed on an "AS IS" BASIS,
7809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7810 * See the License for the specific language governing permissions and
7811 * limitations under the License.
7817 * Code: Common code for unused bytecodes. Uses no subtitutions.
7819 * For: all unused bytecodes
7821 * Description: aborts if executed.
7823 * Format: ØØ|op (10x)
7831 /* ------------------------------ */
7833 .L_OP_UNUSED_7A: /* 0x7a */
7834 /* File: x86-atom/OP_UNUSED_7A.S */
7835 /* Copyright (C) 2008 The Android Open Source Project
7837 * Licensed under the Apache License, Version 2.0 (the "License");
7838 * you may not use this file except in compliance with the License.
7839 * You may obtain a copy of the License at
7841 * http://www.apache.org/licenses/LICENSE-2.0
7843 * Unless required by applicable law or agreed to in writing, software
7844 * distributed under the License is distributed on an "AS IS" BASIS,
7845 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7846 * See the License for the specific language governing permissions and
7847 * limitations under the License.
7851 * File: OP_UNUSED_7A.S
7854 /* File: x86-atom/unused.S */
7855 /* Copyright (C) 2008 The Android Open Source Project
7857 * Licensed under the Apache License, Version 2.0 (the "License");
7858 * you may not use this file except in compliance with the License.
7859 * You may obtain a copy of the License at
7861 * http://www.apache.org/licenses/LICENSE-2.0
7863 * Unless required by applicable law or agreed to in writing, software
7864 * distributed under the License is distributed on an "AS IS" BASIS,
7865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7866 * See the License for the specific language governing permissions and
7867 * limitations under the License.
7873 * Code: Common code for unused bytecodes. Uses no subtitutions.
7875 * For: all unused bytecodes
7877 * Description: aborts if executed.
7879 * Format: ØØ|op (10x)
7887 /* ------------------------------ */
7889 .L_OP_NEG_INT: /* 0x7b */
7890 /* File: x86-atom/OP_NEG_INT.S */
7891 /* Copyright (C) 2008 The Android Open Source Project
7893 * Licensed under the Apache License, Version 2.0 (the "License");
7894 * you may not use this file except in compliance with the License.
7895 * You may obtain a copy of the License at
7897 * http://www.apache.org/licenses/LICENSE-2.0
7899 * Unless required by applicable law or agreed to in writing, software
7900 * distributed under the License is distributed on an "AS IS" BASIS,
7901 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7902 * See the License for the specific language governing permissions and
7903 * limitations under the License.
7907 * File: OP_NEG_INT.S
7910 /* File: x86-atom/unop.S */
7911 /* Copyright (C) 2008 The Android Open Source Project
7913 * Licensed under the Apache License, Version 2.0 (the "License");
7914 * you may not use this file except in compliance with the License.
7915 * You may obtain a copy of the License at
7917 * http://www.apache.org/licenses/LICENSE-2.0
7919 * Unless required by applicable law or agreed to in writing, software
7920 * distributed under the License is distributed on an "AS IS" BASIS,
7921 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7922 * See the License for the specific language governing permissions and
7923 * limitations under the License.
7929 * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
7930 * preinstr variable that together specify an instruction that
7931 * performs, for example, "%ecx = op %edx".
7933 * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
7935 * Description: Perform the identified unary operation on the source
7936 * register, storing the result in the destination register
7938 * Format: B|A|op (12x)
7944 movl rINST, %ecx # %ecx<- BA+
7945 shr $4, %ecx # %ecx<- B
7946 and $15, rINST # rINST<- A
7947 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
7948 GET_VREG %ecx # %ecx<- vB
7949 # do operation part 1
7950 neg %ecx # do operation part 2
7951 SET_VREG %ecx, rINST # vA<- result
7952 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
7954 /* ------------------------------ */
7956 .L_OP_NOT_INT: /* 0x7c */
7957 /* File: x86-atom/OP_NOT_INT.S */
7958 /* Copyright (C) 2008 The Android Open Source Project
7960 * Licensed under the Apache License, Version 2.0 (the "License");
7961 * you may not use this file except in compliance with the License.
7962 * You may obtain a copy of the License at
7964 * http://www.apache.org/licenses/LICENSE-2.0
7966 * Unless required by applicable law or agreed to in writing, software
7967 * distributed under the License is distributed on an "AS IS" BASIS,
7968 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7969 * See the License for the specific language governing permissions and
7970 * limitations under the License.
7974 * File: OP_NOT_INT.S
7977 /* File: x86-atom/unop.S */
7978 /* Copyright (C) 2008 The Android Open Source Project
7980 * Licensed under the Apache License, Version 2.0 (the "License");
7981 * you may not use this file except in compliance with the License.
7982 * You may obtain a copy of the License at
7984 * http://www.apache.org/licenses/LICENSE-2.0
7986 * Unless required by applicable law or agreed to in writing, software
7987 * distributed under the License is distributed on an "AS IS" BASIS,
7988 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7989 * See the License for the specific language governing permissions and
7990 * limitations under the License.
7996 * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
7997 * preinstr variable that together specify an instruction that
7998 * performs, for example, "%ecx = op %edx".
8000 * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
8002 * Description: Perform the identified unary operation on the source
8003 * register, storing the result in the destination register
8005 * Format: B|A|op (12x)
8011 movl rINST, %ecx # %ecx<- BA+
8012 shr $4, %ecx # %ecx<- B
8013 and $15, rINST # rINST<- A
8014 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8015 GET_VREG %ecx # %ecx<- vB
8016 # do operation part 1
8017 not %ecx # do operation part 2
8018 SET_VREG %ecx, rINST # vA<- result
8019 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8021 /* ------------------------------ */
8023 .L_OP_NEG_LONG: /* 0x7d */
8024 /* File: x86-atom/OP_NEG_LONG.S */
8025 /* Copyright (C) 2008 The Android Open Source Project
8027 * Licensed under the Apache License, Version 2.0 (the "License");
8028 * you may not use this file except in compliance with the License.
8029 * You may obtain a copy of the License at
8031 * http://www.apache.org/licenses/LICENSE-2.0
8033 * Unless required by applicable law or agreed to in writing, software
8034 * distributed under the License is distributed on an "AS IS" BASIS,
8035 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8036 * See the License for the specific language governing permissions and
8037 * limitations under the License.
8041 * File: OP_NEG_LONG.S
8044 /* File: x86-atom/unopWide.S */
8045 /* Copyright (C) 2008 The Android Open Source Project
8047 * Licensed under the Apache License, Version 2.0 (the "License");
8048 * you may not use this file except in compliance with the License.
8049 * You may obtain a copy of the License at
8051 * http://www.apache.org/licenses/LICENSE-2.0
8053 * Unless required by applicable law or agreed to in writing, software
8054 * distributed under the License is distributed on an "AS IS" BASIS,
8055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8056 * See the License for the specific language governing permissions and
8057 * limitations under the License.
8063 * Code: Generic 64-bit unary operation. Provide an "instr" variable and a
8064 * preinstr variable that together specify an instruction that
8065 * performs, for example, "%xmm0 = op %xmm1".
8067 * For: neg-double, neg-long, not-long
8069 * Description: Perform the identified unary operation on the source
8070 * register, storing the result in the destination register
8072 * Format: B|A|op (12x)
8078 movl rINST, %ecx # %ecx<- BA+
8079 shr $4, rINST # rINST<- B
8080 and $15, %ecx # %ecx<- A
8081 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8082 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vB
8083 xorps %xmm1, %xmm1 # do operation part 1
8084 psubq %xmm0, %xmm1 # do operation part 2
8085 movq %xmm1, (rFP, %ecx, 4) # vA<- result
8086 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8089 /* ------------------------------ */
8091 .L_OP_NOT_LONG: /* 0x7e */
8092 /* File: x86-atom/OP_NOT_LONG.S */
8093 /* Copyright (C) 2008 The Android Open Source Project
8095 * Licensed under the Apache License, Version 2.0 (the "License");
8096 * you may not use this file except in compliance with the License.
8097 * You may obtain a copy of the License at
8099 * http://www.apache.org/licenses/LICENSE-2.0
8101 * Unless required by applicable law or agreed to in writing, software
8102 * distributed under the License is distributed on an "AS IS" BASIS,
8103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8104 * See the License for the specific language governing permissions and
8105 * limitations under the License.
8109 * File: OP_NOT_LONG.S
8112 /* File: x86-atom/unopWide.S */
8113 /* Copyright (C) 2008 The Android Open Source Project
8115 * Licensed under the Apache License, Version 2.0 (the "License");
8116 * you may not use this file except in compliance with the License.
8117 * You may obtain a copy of the License at
8119 * http://www.apache.org/licenses/LICENSE-2.0
8121 * Unless required by applicable law or agreed to in writing, software
8122 * distributed under the License is distributed on an "AS IS" BASIS,
8123 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8124 * See the License for the specific language governing permissions and
8125 * limitations under the License.
8131 * Code: Generic 64-bit unary operation. Provide an "instr" variable and a
8132 * preinstr variable that together specify an instruction that
8133 * performs, for example, "%xmm0 = op %xmm1".
8135 * For: neg-double, neg-long, not-long
8137 * Description: Perform the identified unary operation on the source
8138 * register, storing the result in the destination register
8140 * Format: B|A|op (12x)
8146 movl rINST, %ecx # %ecx<- BA+
8147 shr $4, rINST # rINST<- B
8148 and $15, %ecx # %ecx<- A
8149 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8150 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vB
8151 # do operation part 1
8152 pandn 0xFFFFFFFF, %xmm0 # do operation part 2
8153 movq %xmm0, (rFP, %ecx, 4) # vA<- result
8154 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8157 /* ------------------------------ */
8159 .L_OP_NEG_FLOAT: /* 0x7f */
8160 /* File: x86-atom/OP_NEG_FLOAT.S */
8161 /* Copyright (C) 2008 The Android Open Source Project
8163 * Licensed under the Apache License, Version 2.0 (the "License");
8164 * you may not use this file except in compliance with the License.
8165 * You may obtain a copy of the License at
8167 * http://www.apache.org/licenses/LICENSE-2.0
8169 * Unless required by applicable law or agreed to in writing, software
8170 * distributed under the License is distributed on an "AS IS" BASIS,
8171 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8172 * See the License for the specific language governing permissions and
8173 * limitations under the License.
8177 * File: OP_NEG_FLOAT.S
8180 /* File: x86-atom/unop.S */
8181 /* Copyright (C) 2008 The Android Open Source Project
8183 * Licensed under the Apache License, Version 2.0 (the "License");
8184 * you may not use this file except in compliance with the License.
8185 * You may obtain a copy of the License at
8187 * http://www.apache.org/licenses/LICENSE-2.0
8189 * Unless required by applicable law or agreed to in writing, software
8190 * distributed under the License is distributed on an "AS IS" BASIS,
8191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8192 * See the License for the specific language governing permissions and
8193 * limitations under the License.
8199 * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
8200 * preinstr variable that together specify an instruction that
8201 * performs, for example, "%ecx = op %edx".
8203 * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
8205 * Description: Perform the identified unary operation on the source
8206 * register, storing the result in the destination register
8208 * Format: B|A|op (12x)
8214 movl rINST, %ecx # %ecx<- BA+
8215 shr $4, %ecx # %ecx<- B
8216 and $15, rINST # rINST<- A
8217 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8218 GET_VREG %ecx # %ecx<- vB
8219 # do operation part 1
8220 addl $0x80000000, %ecx # do operation part 2
8221 SET_VREG %ecx, rINST # vA<- result
8222 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8224 /* ------------------------------ */
8226 .L_OP_NEG_DOUBLE: /* 0x80 */
8227 /* File: x86-atom/OP_NEG_DOUBLE.S */
8228 /* Copyright (C) 2008 The Android Open Source Project
8230 * Licensed under the Apache License, Version 2.0 (the "License");
8231 * you may not use this file except in compliance with the License.
8232 * You may obtain a copy of the License at
8234 * http://www.apache.org/licenses/LICENSE-2.0
8236 * Unless required by applicable law or agreed to in writing, software
8237 * distributed under the License is distributed on an "AS IS" BASIS,
8238 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8239 * See the License for the specific language governing permissions and
8240 * limitations under the License.
8244 * File: OP_NEG_DOUBLE.S
8247 /* File: x86-atom/unopWide.S */
8248 /* Copyright (C) 2008 The Android Open Source Project
8250 * Licensed under the Apache License, Version 2.0 (the "License");
8251 * you may not use this file except in compliance with the License.
8252 * You may obtain a copy of the License at
8254 * http://www.apache.org/licenses/LICENSE-2.0
8256 * Unless required by applicable law or agreed to in writing, software
8257 * distributed under the License is distributed on an "AS IS" BASIS,
8258 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8259 * See the License for the specific language governing permissions and
8260 * limitations under the License.
8266 * Code: Generic 64-bit unary operation. Provide an "instr" variable and a
8267 * preinstr variable that together specify an instruction that
8268 * performs, for example, "%xmm0 = op %xmm1".
8270 * For: neg-double, neg-long, not-long
8272 * Description: Perform the identified unary operation on the source
8273 * register, storing the result in the destination register
8275 * Format: B|A|op (12x)
8281 movl rINST, %ecx # %ecx<- BA+
8282 shr $4, rINST # rINST<- B
8283 and $15, %ecx # %ecx<- A
8284 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8285 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vB
8286 movq .LdoubNeg, %xmm1 # do operation part 1
8287 pxor %xmm1, %xmm0 # do operation part 2
8288 movq %xmm0, (rFP, %ecx, 4) # vA<- result
8289 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8292 /* ------------------------------ */
8294 .L_OP_INT_TO_LONG: /* 0x81 */
8295 /* File: x86-atom/OP_INT_TO_LONG.S */
8296 /* Copyright (C) 2008 The Android Open Source Project
8298 * Licensed under the Apache License, Version 2.0 (the "License");
8299 * you may not use this file except in compliance with the License.
8300 * You may obtain a copy of the License at
8302 * http://www.apache.org/licenses/LICENSE-2.0
8304 * Unless required by applicable law or agreed to in writing, software
8305 * distributed under the License is distributed on an "AS IS" BASIS,
8306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8307 * See the License for the specific language governing permissions and
8308 * limitations under the License.
8312 * File: OP_INT_TO_LONG.S
8314 * Code: Convert an int to a long. Uses no substitutions.
8318 * Description: Convert an int in the source register, to a long, and
8319 * stores the result in the destintation register. vA<- (long) vB
8322 * Format: B|A|op (12x)
8327 movl rINST, %eax # %eax<- BA+
8328 movl rINST, %ecx # %ecx<- BA+
8329 shr $4, %eax # %eax<- B
8330 andl $15, %ecx # %ecx<- A
8331 GET_VREG %eax # %eax<- vB
8332 cdq # %edx:%eax<- sign-extend of %eax
8333 movl %eax, (rFP, %ecx, 4) # vA<- lo part
8334 movl %edx, 4(rFP, %ecx, 4) # vA+1<- hi part
8335 FINISH 1 # jump to next instruction
8337 /* ------------------------------ */
8339 .L_OP_INT_TO_FLOAT: /* 0x82 */
8340 /* File: x86-atom/OP_INT_TO_FLOAT.S */
8341 /* Copyright (C) 2008 The Android Open Source Project
8343 * Licensed under the Apache License, Version 2.0 (the "License");
8344 * you may not use this file except in compliance with the License.
8345 * You may obtain a copy of the License at
8347 * http://www.apache.org/licenses/LICENSE-2.0
8349 * Unless required by applicable law or agreed to in writing, software
8350 * distributed under the License is distributed on an "AS IS" BASIS,
8351 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8352 * See the License for the specific language governing permissions and
8353 * limitations under the License.
8357 * File: OP_INT_TO_FLOAT.S
8359 * Code: Convert an int to a float. Uses no substitutions.
8363 * Description: Convert an int in the source register, to a float, and
8364 * stores the result in the destintation register. vA<- (float) vB
8366 * Format: B|A|op (12x)
8371 movl rINST, %eax # %eax<- BA+
8372 shr $4, %eax # %eax<- B
8373 andl $15, rINST # rINST<- A
8374 cvtsi2ss (rFP,%eax,4), %xmm0 # %xmm0<- vB
8375 movss %xmm0, (rFP, rINST, 4) # vA<- %xmm0
8376 FINISH 1 # jump to next instruction
8378 /* ------------------------------ */
8380 .L_OP_INT_TO_DOUBLE: /* 0x83 */
8381 /* File: x86-atom/OP_INT_TO_DOUBLE.S */
8382 /* Copyright (C) 2008 The Android Open Source Project
8384 * Licensed under the Apache License, Version 2.0 (the "License");
8385 * you may not use this file except in compliance with the License.
8386 * You may obtain a copy of the License at
8388 * http://www.apache.org/licenses/LICENSE-2.0
8390 * Unless required by applicable law or agreed to in writing, software
8391 * distributed under the License is distributed on an "AS IS" BASIS,
8392 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8393 * See the License for the specific language governing permissions and
8394 * limitations under the License.
8398 * File: OP_INT_TO_DOUBLE.S
8400 * Code: Convert an int to a double. Uses no substitutions.
8402 * For: int-to-double
8404 * Description: Converts an int in the source register, to a double, and
8405 * stores the result in the destination register. vA<- (double) vB
8407 * Format: B|A|op (12x)
8412 movl rINST, %eax # %eax<- BA+
8413 shr $4, %eax # %eax<- B
8414 andl $15, rINST # rINST<- A
8415 cvtsi2sd (rFP, %eax, 4), %xmm0 # %xmm0<- vB
8416 movq %xmm0, (rFP, rINST, 4) # vA<- %xmm0; (double) vB
8417 FFETCH_ADV 1, %edx # %edx<- next instruction hi; fetch, advance
8418 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
8420 /* ------------------------------ */
8422 .L_OP_LONG_TO_INT: /* 0x84 */
8423 /* File: x86-atom/OP_LONG_TO_INT.S */
8424 /* Copyright (C) 2008 The Android Open Source Project
8426 * Licensed under the Apache License, Version 2.0 (the "License");
8427 * you may not use this file except in compliance with the License.
8428 * You may obtain a copy of the License at
8430 * http://www.apache.org/licenses/LICENSE-2.0
8432 * Unless required by applicable law or agreed to in writing, software
8433 * distributed under the License is distributed on an "AS IS" BASIS,
8434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8435 * See the License for the specific language governing permissions and
8436 * limitations under the License.
8440 * File: OP_LONG_TO_INT.S
8443 /* File: x86-atom/OP_MOVE.S */
8444 /* Copyright (C) 2008 The Android Open Source Project
8446 * Licensed under the Apache License, Version 2.0 (the "License");
8447 * you may not use this file except in compliance with the License.
8448 * You may obtain a copy of the License at
8450 * http://www.apache.org/licenses/LICENSE-2.0
8452 * Unless required by applicable law or agreed to in writing, software
8453 * distributed under the License is distributed on an "AS IS" BASIS,
8454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8455 * See the License for the specific language governing permissions and
8456 * limitations under the License.
8462 * Code: Copies contents from one register to another. Uses no
8465 * For: move, move-object, long-to-int
8467 * Description: Copies contents from one non-object register to another.
8468 * vA<- vB; fp[A]<- fp[B]
8470 * Format: B|A|op (12x)
8475 movl rINST, %ecx # %ecx<- BA
8476 shr $4, rINST # rINST<- B
8477 and $15, %ecx # %ecx<- A
8478 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8479 GET_VREG rINST # rINST<- vB
8480 SET_VREG rINST, %ecx # vA<- vB; %edx
8481 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8483 /* ------------------------------ */
8485 .L_OP_LONG_TO_FLOAT: /* 0x85 */
8486 /* File: x86-atom/OP_LONG_TO_FLOAT.S */
8487 /* Copyright (C) 2008 The Android Open Source Project
8489 * Licensed under the Apache License, Version 2.0 (the "License");
8490 * you may not use this file except in compliance with the License.
8491 * You may obtain a copy of the License at
8493 * http://www.apache.org/licenses/LICENSE-2.0
8495 * Unless required by applicable law or agreed to in writing, software
8496 * distributed under the License is distributed on an "AS IS" BASIS,
8497 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8498 * See the License for the specific language governing permissions and
8499 * limitations under the License.
8503 * File: OP_LONG_TO_FLOAT.S
8505 * Code: Convert a long to a float. Uses no substitutions.
8509 * Description: Converts a float in the source register, to a float, and
8510 * stores the result in the destination register. vA<- (double) vB
8512 * Format: B|A|op (12x)
8517 movl rINST, %ecx # %ecx<- BA+
8518 shr $4, rINST # rINST<- B
8519 and $15, %ecx # %ecx<- A
8520 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8521 fildll (rFP, rINST, 4) # FPU<- vB
8522 fstps (rFP, %ecx, 4) # vA<- FPU; (float) vB
8523 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8525 /* ------------------------------ */
8527 .L_OP_LONG_TO_DOUBLE: /* 0x86 */
8528 /* File: x86-atom/OP_LONG_TO_DOUBLE.S */
8529 /* Copyright (C) 2008 The Android Open Source Project
8531 * Licensed under the Apache License, Version 2.0 (the "License");
8532 * you may not use this file except in compliance with the License.
8533 * You may obtain a copy of the License at
8535 * http://www.apache.org/licenses/LICENSE-2.0
8537 * Unless required by applicable law or agreed to in writing, software
8538 * distributed under the License is distributed on an "AS IS" BASIS,
8539 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8540 * See the License for the specific language governing permissions and
8541 * limitations under the License.
8545 * File: OP_LONG_TO_DOUBLE.S
8547 * Code: Convert a long to a dobule. Uses no substitutions.
8549 * For: long-to-double
8551 * Description: Converts a long in the source register to a double, and
8552 * stores the result in the destination register. vA<- (double) vB
8554 * Format: B|A|op (12x)
8559 movl rINST, %ecx # %ecx<- BA+
8560 shr $4, rINST # rINST<- B
8561 and $15, %ecx # %ecx<- A
8562 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8563 fildll (rFP, rINST, 4) # FPU<- vB
8564 fstpl (rFP, %ecx, 4) # vA<- FPU; (double) vB
8565 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8567 /* ------------------------------ */
8569 .L_OP_FLOAT_TO_INT: /* 0x87 */
8570 /* File: x86-atom/OP_FLOAT_TO_INT.S */
8571 /* Copyright (C) 2008 The Android Open Source Project
8573 * Licensed under the Apache License, Version 2.0 (the "License");
8574 * you may not use this file except in compliance with the License.
8575 * You may obtain a copy of the License at
8577 * http://www.apache.org/licenses/LICENSE-2.0
8579 * Unless required by applicable law or agreed to in writing, software
8580 * distributed under the License is distributed on an "AS IS" BASIS,
8581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8582 * See the License for the specific language governing permissions and
8583 * limitations under the License.
8587 * File: OP_FLOAT_TO_INT.S
8589 * Code: Converts a float to a int. Uses no substitutions.
8593 * Description: Convert the float in source register to a int
8594 * and store the result in the destintation register
8596 * Format: B|A|op (12x)
8601 movl rINST, %edx # %edx<- BA
8602 shr $4, rINST # rINST<- B
8603 and $15, %edx # %edx<- A
8604 flds (rFP, rINST, 4) # push vB to floating point stack
8605 fildl .LintMax # push max int value
8606 fildl .LintMin # push min int value
8607 fucomip %st(2), %st(0) # check for negInf
8608 jae .LOP_FLOAT_TO_INT_negInf # handle negInf
8609 fucomip %st(1), %st(0) # check for posInf or NaN
8610 jc .LOP_FLOAT_TO_INT_nanInf # handle posInf or NaN
8611 jmp .LOP_FLOAT_TO_INT_break # do conversion
8613 /* ------------------------------ */
8615 .L_OP_FLOAT_TO_LONG: /* 0x88 */
8616 /* File: x86-atom/OP_FLOAT_TO_LONG.S */
8617 /* Copyright (C) 2008 The Android Open Source Project
8619 * Licensed under the Apache License, Version 2.0 (the "License");
8620 * you may not use this file except in compliance with the License.
8621 * You may obtain a copy of the License at
8623 * http://www.apache.org/licenses/LICENSE-2.0
8625 * Unless required by applicable law or agreed to in writing, software
8626 * distributed under the License is distributed on an "AS IS" BASIS,
8627 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8628 * See the License for the specific language governing permissions and
8629 * limitations under the License.
8633 * File: OP_FLOAT_TO_LONG.S
8635 * Code: Converts a float to a long. Uses no substitutions.
8637 * For: float-to-long
8639 * Description: Convert the float in source register to a long
8640 * and store the result in the destintation register
8642 * Format: B|A|op (12x)
8647 movl rINST, %edx # %edx<- BA
8648 shr $4, rINST # rINST<- B
8649 and $15, %edx # %edx<- A
8650 flds (rFP, rINST, 4) # push vB to floating point stack
8651 fildll .LvaluePosInfLong # push max int value
8652 fildll .LvalueNegInfLong # push min int value
8653 fucomip %st(2), %st(0) # check for negInf
8654 jae .LOP_FLOAT_TO_LONG_negInf # handle negInf
8655 fucomip %st(1), %st(0) # check for posInf or NaN
8656 jc .LOP_FLOAT_TO_LONG_nanInf # handle posInf or NaN
8657 jmp .LOP_FLOAT_TO_LONG_break # do conversion
8659 /* ------------------------------ */
8661 .L_OP_FLOAT_TO_DOUBLE: /* 0x89 */
8662 /* File: x86-atom/OP_FLOAT_TO_DOUBLE.S */
8663 /* Copyright (C) 2008 The Android Open Source Project
8665 * Licensed under the Apache License, Version 2.0 (the "License");
8666 * you may not use this file except in compliance with the License.
8667 * You may obtain a copy of the License at
8669 * http://www.apache.org/licenses/LICENSE-2.0
8671 * Unless required by applicable law or agreed to in writing, software
8672 * distributed under the License is distributed on an "AS IS" BASIS,
8673 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8674 * See the License for the specific language governing permissions and
8675 * limitations under the License.
8679 * File: OP_FLOAT_TO_DOUBLE.S
8681 * Code: Converts a float to a double. Uses no substitutions.
8683 * For: float-to-double
8685 * Description: Convert the float in source register to a double
8686 * and store the result in the destintation register
8688 * Format: B|A|op (12x)
8693 movl rINST, %edx # %edx<- BA
8694 shr $4, rINST # rINST<- B
8695 and $15, %edx # %edx<- A
8696 flds (rFP, rINST, 4) # load float
8697 fstpl (rFP, %edx, 4) # store double
8698 FINISH 1 # jump to next instruction
8700 /* ------------------------------ */
8702 .L_OP_DOUBLE_TO_INT: /* 0x8a */
8703 /* File: x86-atom/OP_DOUBLE_TO_INT.S */
8704 /* Copyright (C) 2008 The Android Open Source Project
8706 * Licensed under the Apache License, Version 2.0 (the "License");
8707 * you may not use this file except in compliance with the License.
8708 * You may obtain a copy of the License at
8710 * http://www.apache.org/licenses/LICENSE-2.0
8712 * Unless required by applicable law or agreed to in writing, software
8713 * distributed under the License is distributed on an "AS IS" BASIS,
8714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8715 * See the License for the specific language governing permissions and
8716 * limitations under the License.
8720 * File: OP_DOUBLE_TO_INT.S
8722 * Code: Converts a double to an integer. Uses no substitutions.
8724 * For: double-to-int
8726 * Description: Convert the source register (a double) to an integer
8727 * and store the result in the destination register
8729 * Format: B|A|op (12x)
8734 movl rINST, %edx # %edx<- BA
8735 shr $4, rINST # rINST<- B
8736 and $15, %edx # %edx<- A
8737 fldl (rFP, rINST, 4) # load &vB
8738 fildl .LintMax # push max int value
8739 fildl .LintMin # push min int value
8740 fucomip %st(2), %st(0) # check for negInf
8741 jae .LOP_DOUBLE_TO_INT_negInf # handle negInf
8742 fucomip %st(1), %st(0) # check for posInf or NaN
8743 jc .LOP_DOUBLE_TO_INT_nanInf # handle posInf or NaN
8744 jmp .LOP_DOUBLE_TO_INT_break # do conversion
8746 /* ------------------------------ */
8748 .L_OP_DOUBLE_TO_LONG: /* 0x8b */
8749 /* File: x86-atom/OP_DOUBLE_TO_LONG.S */
8750 /* Copyright (C) 2008 The Android Open Source Project
8752 * Licensed under the Apache License, Version 2.0 (the "License");
8753 * you may not use this file except in compliance with the License.
8754 * You may obtain a copy of the License at
8756 * http://www.apache.org/licenses/LICENSE-2.0
8758 * Unless required by applicable law or agreed to in writing, software
8759 * distributed under the License is distributed on an "AS IS" BASIS,
8760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8761 * See the License for the specific language governing permissions and
8762 * limitations under the License.
8766 * File: OP_DOUBLE_TO_LONG.S
8768 * Code: Converts a double to a long. Uses no substitutions.
8770 * For: double-to-long
8772 * Description: Convert the double in source register to a long
8773 * and store in the destintation register
8775 * Format: B|A|op (12x)
8780 movl rINST, %edx # %ecx<- BA
8781 shr $4, rINST # rINST<- B
8782 and $15, %edx # %ecx<- A
8783 fldl (rFP, rINST, 4) # push vB to floating point stack
8784 fildll .LvaluePosInfLong # push max int value
8785 fildll .LvalueNegInfLong # push min int value
8786 fucomip %st(2), %st(0) # check for negInf
8787 jae .LOP_DOUBLE_TO_LONG_negInf # handle negInf
8788 fucomip %st(1), %st(0) # check for posInf or NaN
8789 jc .LOP_DOUBLE_TO_LONG_nanInf # handle posInf or NaN
8790 jmp .LOP_DOUBLE_TO_LONG_break # do conversion
8792 /* ------------------------------ */
8794 .L_OP_DOUBLE_TO_FLOAT: /* 0x8c */
8795 /* File: x86-atom/OP_DOUBLE_TO_FLOAT.S */
8796 /* Copyright (C) 2008 The Android Open Source Project
8798 * Licensed under the Apache License, Version 2.0 (the "License");
8799 * you may not use this file except in compliance with the License.
8800 * You may obtain a copy of the License at
8802 * http://www.apache.org/licenses/LICENSE-2.0
8804 * Unless required by applicable law or agreed to in writing, software
8805 * distributed under the License is distributed on an "AS IS" BASIS,
8806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8807 * See the License for the specific language governing permissions and
8808 * limitations under the License.
8812 * File: OP_DOUBLE_TO_FLOAT.S
8814 * Code: Converts a double to a float. Uses no substitutions.
8816 * For: double-to-float
8818 * Description: Convert the source register (a double) to a float
8819 * and store the result in the destination register
8821 * Format: B|A|op (12x)
8826 movl rINST, %edx # %edx<- BA
8827 shr $4, rINST # rINST<- B
8828 and $15, %edx # %edx<- A
8829 fldl (rFP, rINST, 4) # load &vB
8830 fstps (rFP, %edx, 4) # store float
8831 FINISH 1 # jump to next instruction
8833 /* ------------------------------ */
8835 .L_OP_INT_TO_BYTE: /* 0x8d */
8836 /* File: x86-atom/OP_INT_TO_BYTE.S */
8837 /* Copyright (C) 2008 The Android Open Source Project
8839 * Licensed under the Apache License, Version 2.0 (the "License");
8840 * you may not use this file except in compliance with the License.
8841 * You may obtain a copy of the License at
8843 * http://www.apache.org/licenses/LICENSE-2.0
8845 * Unless required by applicable law or agreed to in writing, software
8846 * distributed under the License is distributed on an "AS IS" BASIS,
8847 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8848 * See the License for the specific language governing permissions and
8849 * limitations under the License.
8853 * File: OP_INT_TO_BYTE.S
8856 /* File: x86-atom/unop.S */
8857 /* Copyright (C) 2008 The Android Open Source Project
8859 * Licensed under the Apache License, Version 2.0 (the "License");
8860 * you may not use this file except in compliance with the License.
8861 * You may obtain a copy of the License at
8863 * http://www.apache.org/licenses/LICENSE-2.0
8865 * Unless required by applicable law or agreed to in writing, software
8866 * distributed under the License is distributed on an "AS IS" BASIS,
8867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8868 * See the License for the specific language governing permissions and
8869 * limitations under the License.
8875 * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
8876 * preinstr variable that together specify an instruction that
8877 * performs, for example, "%ecx = op %edx".
8879 * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
8881 * Description: Perform the identified unary operation on the source
8882 * register, storing the result in the destination register
8884 * Format: B|A|op (12x)
8890 movl rINST, %ecx # %ecx<- BA+
8891 shr $4, %ecx # %ecx<- B
8892 and $15, rINST # rINST<- A
8893 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8894 GET_VREG %ecx # %ecx<- vB
8895 sal $24, %ecx # do operation part 1
8896 sar $24, %ecx # do operation part 2
8897 SET_VREG %ecx, rINST # vA<- result
8898 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8900 /* ------------------------------ */
8902 .L_OP_INT_TO_CHAR: /* 0x8e */
8903 /* File: x86-atom/OP_INT_TO_CHAR.S */
8904 /* Copyright (C) 2008 The Android Open Source Project
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
8910 * http://www.apache.org/licenses/LICENSE-2.0
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.
8920 * File: OP_INT_TO_CHAR.S
8923 /* File: x86-atom/unop.S */
8924 /* Copyright (C) 2008 The Android Open Source Project
8926 * Licensed under the Apache License, Version 2.0 (the "License");
8927 * you may not use this file except in compliance with the License.
8928 * You may obtain a copy of the License at
8930 * http://www.apache.org/licenses/LICENSE-2.0
8932 * Unless required by applicable law or agreed to in writing, software
8933 * distributed under the License is distributed on an "AS IS" BASIS,
8934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8935 * See the License for the specific language governing permissions and
8936 * limitations under the License.
8942 * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
8943 * preinstr variable that together specify an instruction that
8944 * performs, for example, "%ecx = op %edx".
8946 * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
8948 * Description: Perform the identified unary operation on the source
8949 * register, storing the result in the destination register
8951 * Format: B|A|op (12x)
8957 movl rINST, %ecx # %ecx<- BA+
8958 shr $4, %ecx # %ecx<- B
8959 and $15, rINST # rINST<- A
8960 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
8961 GET_VREG %ecx # %ecx<- vB
8962 sal $16, %ecx # do operation part 1
8963 shr $16, %ecx # do operation part 2
8964 SET_VREG %ecx, rINST # vA<- result
8965 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
8967 /* ------------------------------ */
8969 .L_OP_INT_TO_SHORT: /* 0x8f */
8970 /* File: x86-atom/OP_INT_TO_SHORT.S */
8971 /* Copyright (C) 2008 The Android Open Source Project
8973 * Licensed under the Apache License, Version 2.0 (the "License");
8974 * you may not use this file except in compliance with the License.
8975 * You may obtain a copy of the License at
8977 * http://www.apache.org/licenses/LICENSE-2.0
8979 * Unless required by applicable law or agreed to in writing, software
8980 * distributed under the License is distributed on an "AS IS" BASIS,
8981 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8982 * See the License for the specific language governing permissions and
8983 * limitations under the License.
8987 * File: OP_INT_TO_SHORT.S
8990 /* File: x86-atom/unop.S */
8991 /* Copyright (C) 2008 The Android Open Source Project
8993 * Licensed under the Apache License, Version 2.0 (the "License");
8994 * you may not use this file except in compliance with the License.
8995 * You may obtain a copy of the License at
8997 * http://www.apache.org/licenses/LICENSE-2.0
8999 * Unless required by applicable law or agreed to in writing, software
9000 * distributed under the License is distributed on an "AS IS" BASIS,
9001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9002 * See the License for the specific language governing permissions and
9003 * limitations under the License.
9009 * Code: Generic 32-bit unary operation. Provide an "instr" variable and a
9010 * preinstr variable that together specify an instruction that
9011 * performs, for example, "%ecx = op %edx".
9013 * For: int-to-byte, int-to-char, int-to-short, neg-float, neg-int, not-int
9015 * Description: Perform the identified unary operation on the source
9016 * register, storing the result in the destination register
9018 * Format: B|A|op (12x)
9024 movl rINST, %ecx # %ecx<- BA+
9025 shr $4, %ecx # %ecx<- B
9026 and $15, rINST # rINST<- A
9027 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
9028 GET_VREG %ecx # %ecx<- vB
9029 sal $16, %ecx # do operation part 1
9030 sar $16, %ecx # do operation part 2
9031 SET_VREG %ecx, rINST # vA<- result
9032 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
9034 /* ------------------------------ */
9036 .L_OP_ADD_INT: /* 0x90 */
9037 /* File: x86-atom/OP_ADD_INT.S */
9038 /* Copyright (C) 2008 The Android Open Source Project
9040 * Licensed under the Apache License, Version 2.0 (the "License");
9041 * you may not use this file except in compliance with the License.
9042 * You may obtain a copy of the License at
9044 * http://www.apache.org/licenses/LICENSE-2.0
9046 * Unless required by applicable law or agreed to in writing, software
9047 * distributed under the License is distributed on an "AS IS" BASIS,
9048 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9049 * See the License for the specific language governing permissions and
9050 * limitations under the License.
9054 * File: OP_ADD_INT.S
9057 /* File: x86-atom/binop.S */
9058 /* Copyright (C) 2008 The Android Open Source Project
9060 * Licensed under the Apache License, Version 2.0 (the "License");
9061 * you may not use this file except in compliance with the License.
9062 * You may obtain a copy of the License at
9064 * http://www.apache.org/licenses/LICENSE-2.0
9066 * Unless required by applicable law or agreed to in writing, software
9067 * distributed under the License is distributed on an "AS IS" BASIS,
9068 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9069 * See the License for the specific language governing permissions and
9070 * limitations under the License.
9076 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9077 * specify an instruction that performs "%ecx = %ecx op %edx"
9079 * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
9081 * Description: Perform a binary operation on two source registers
9082 * and store the result in a destination register.
9084 * Format: AA|op CC|BB (23x)
9086 * Syntax: op vAA, vBB, vCC
9091 FETCH_BB 1, %ecx # %ecx<- BB
9094 FETCH_CC 1, %edx # %edx<- CC
9096 GET_VREG %ecx # %ecx<- vBB
9097 addl (rFP, %edx, 4), %ecx # %ecx<- vBB op vCC
9098 SET_VREG %ecx, rINST # vAA<- %ecx; result
9102 /* ------------------------------ */
9104 .L_OP_SUB_INT: /* 0x91 */
9105 /* File: x86-atom/OP_SUB_INT.S */
9106 /* Copyright (C) 2008 The Android Open Source Project
9108 * Licensed under the Apache License, Version 2.0 (the "License");
9109 * you may not use this file except in compliance with the License.
9110 * You may obtain a copy of the License at
9112 * http://www.apache.org/licenses/LICENSE-2.0
9114 * Unless required by applicable law or agreed to in writing, software
9115 * distributed under the License is distributed on an "AS IS" BASIS,
9116 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9117 * See the License for the specific language governing permissions and
9118 * limitations under the License.
9122 * File: OP_SUB_INT.S
9125 /* File: x86-atom/binop.S */
9126 /* Copyright (C) 2008 The Android Open Source Project
9128 * Licensed under the Apache License, Version 2.0 (the "License");
9129 * you may not use this file except in compliance with the License.
9130 * You may obtain a copy of the License at
9132 * http://www.apache.org/licenses/LICENSE-2.0
9134 * Unless required by applicable law or agreed to in writing, software
9135 * distributed under the License is distributed on an "AS IS" BASIS,
9136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9137 * See the License for the specific language governing permissions and
9138 * limitations under the License.
9144 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9145 * specify an instruction that performs "%ecx = %ecx op %edx"
9147 * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
9149 * Description: Perform a binary operation on two source registers
9150 * and store the result in a destination register.
9152 * Format: AA|op CC|BB (23x)
9154 * Syntax: op vAA, vBB, vCC
9159 FETCH_BB 1, %ecx # %ecx<- BB
9162 FETCH_CC 1, %edx # %edx<- CC
9164 GET_VREG %ecx # %ecx<- vBB
9165 subl (rFP, %edx, 4), %ecx # %ecx<- vBB op vCC
9166 SET_VREG %ecx, rINST # vAA<- %ecx; result
9170 /* ------------------------------ */
9172 .L_OP_MUL_INT: /* 0x92 */
9173 /* File: x86-atom/OP_MUL_INT.S */
9174 /* Copyright (C) 2008 The Android Open Source Project
9176 * Licensed under the Apache License, Version 2.0 (the "License");
9177 * you may not use this file except in compliance with the License.
9178 * You may obtain a copy of the License at
9180 * http://www.apache.org/licenses/LICENSE-2.0
9182 * Unless required by applicable law or agreed to in writing, software
9183 * distributed under the License is distributed on an "AS IS" BASIS,
9184 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9185 * See the License for the specific language governing permissions and
9186 * limitations under the License.
9190 * File: OP_MUL_INT.S
9192 * Code: 32-bit multiply operation. Performs "%ecx = %ecx * %edx"
9194 * Description: Perform a multiplication operation on two source registers
9195 * and store the result in a destination register.
9197 * Format: AA|op CC|BB (23x)
9199 * Syntax: op vAA, vBB, vCC
9202 FETCH_BB 1, %ecx # %ecx<- BB
9203 FETCH_CC 1, %edx # %edx<- CC
9204 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
9205 GET_VREG %ecx # %ecx<- vBB
9206 addl $4, rPC # update PC
9207 imul (rFP, %edx, 4), %ecx # %ecx<- vBB * vCC
9208 SET_VREG %ecx, rINST # vAA<- %ecx; result
9209 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
9211 /* ------------------------------ */
9213 .L_OP_DIV_INT: /* 0x93 */
9214 /* File: x86-atom/OP_DIV_INT.S */
9215 /* Copyright (C) 2008 The Android Open Source Project
9217 * Licensed under the Apache License, Version 2.0 (the "License");
9218 * you may not use this file except in compliance with the License.
9219 * You may obtain a copy of the License at
9221 * http://www.apache.org/licenses/LICENSE-2.0
9223 * Unless required by applicable law or agreed to in writing, software
9224 * distributed under the License is distributed on an "AS IS" BASIS,
9225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9226 * See the License for the specific language governing permissions and
9227 * limitations under the License.
9231 * File: OP_DIV_INT.S
9234 /* File: x86-atom/binopD.S */
9235 /* Copyright (C) 2008 The Android Open Source Project
9237 * Licensed under the Apache License, Version 2.0 (the "License");
9238 * you may not use this file except in compliance with the License.
9239 * You may obtain a copy of the License at
9241 * http://www.apache.org/licenses/LICENSE-2.0
9243 * Unless required by applicable law or agreed to in writing, software
9244 * distributed under the License is distributed on an "AS IS" BASIS,
9245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9246 * See the License for the specific language governing permissions and
9247 * limitations under the License.
9253 * Code: 32-bit integer divide operation. If "div" is set, the code
9254 * returns the quotient, else it returns the remainder.
9255 * Also, a divide-by-zero check is done.
9257 * For: div-int, rem-int
9259 * Description: Perform a binary operation on two source
9261 * Format: AA|op CC|BB (23x)
9263 * Syntax: op vAA, vBB, vCC
9268 FETCH_CC 1, %ecx # %ecx<- CC
9269 FETCH_BB 1, %eax # %eax<- BB
9270 GET_VREG %ecx # %ecx<- vCC
9272 GET_VREG %eax # %eax<- vBB
9273 je common_errDivideByZero # handle divide by zero
9274 cmpl $-1, %ecx # handle -1 special case divide error
9275 jnz .LOP_DIV_INT_continue
9276 cmpl $0x80000000,%eax # handle min int special case divide error
9277 je .LOP_DIV_INT_break
9278 .LOP_DIV_INT_continue:
9279 cdq # sign-extend %eax to %edx
9280 idiv %ecx # divide %edx:%eax by %ecx
9283 SET_VREG %eax rINST # vAA<- %eax (quotient)
9287 SET_VREG %edx rINST # vAA<- %edx (remainder)
9292 /* ------------------------------ */
9294 .L_OP_REM_INT: /* 0x94 */
9295 /* File: x86-atom/OP_REM_INT.S */
9296 /* Copyright (C) 2008 The Android Open Source Project
9298 * Licensed under the Apache License, Version 2.0 (the "License");
9299 * you may not use this file except in compliance with the License.
9300 * You may obtain a copy of the License at
9302 * http://www.apache.org/licenses/LICENSE-2.0
9304 * Unless required by applicable law or agreed to in writing, software
9305 * distributed under the License is distributed on an "AS IS" BASIS,
9306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9307 * See the License for the specific language governing permissions and
9308 * limitations under the License.
9312 * File: OP_REM_INT.S
9315 /* File: x86-atom/binopD.S */
9316 /* Copyright (C) 2008 The Android Open Source Project
9318 * Licensed under the Apache License, Version 2.0 (the "License");
9319 * you may not use this file except in compliance with the License.
9320 * You may obtain a copy of the License at
9322 * http://www.apache.org/licenses/LICENSE-2.0
9324 * Unless required by applicable law or agreed to in writing, software
9325 * distributed under the License is distributed on an "AS IS" BASIS,
9326 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9327 * See the License for the specific language governing permissions and
9328 * limitations under the License.
9334 * Code: 32-bit integer divide operation. If "div" is set, the code
9335 * returns the quotient, else it returns the remainder.
9336 * Also, a divide-by-zero check is done.
9338 * For: div-int, rem-int
9340 * Description: Perform a binary operation on two source
9342 * Format: AA|op CC|BB (23x)
9344 * Syntax: op vAA, vBB, vCC
9349 FETCH_CC 1, %ecx # %ecx<- CC
9350 FETCH_BB 1, %eax # %eax<- BB
9351 GET_VREG %ecx # %ecx<- vCC
9353 GET_VREG %eax # %eax<- vBB
9354 je common_errDivideByZero # handle divide by zero
9355 cmpl $-1, %ecx # handle -1 special case divide error
9356 jnz .LOP_REM_INT_continue
9357 cmpl $0x80000000,%eax # handle min int special case divide error
9358 je .LOP_REM_INT_break
9359 .LOP_REM_INT_continue:
9360 cdq # sign-extend %eax to %edx
9361 idiv %ecx # divide %edx:%eax by %ecx
9364 SET_VREG %eax rINST # vAA<- %eax (quotient)
9368 SET_VREG %edx rINST # vAA<- %edx (remainder)
9373 /* ------------------------------ */
9375 .L_OP_AND_INT: /* 0x95 */
9376 /* File: x86-atom/OP_AND_INT.S */
9377 /* Copyright (C) 2008 The Android Open Source Project
9379 * Licensed under the Apache License, Version 2.0 (the "License");
9380 * you may not use this file except in compliance with the License.
9381 * You may obtain a copy of the License at
9383 * http://www.apache.org/licenses/LICENSE-2.0
9385 * Unless required by applicable law or agreed to in writing, software
9386 * distributed under the License is distributed on an "AS IS" BASIS,
9387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9388 * See the License for the specific language governing permissions and
9389 * limitations under the License.
9393 * File: OP_AND_INT.S
9396 /* File: x86-atom/binop.S */
9397 /* Copyright (C) 2008 The Android Open Source Project
9399 * Licensed under the Apache License, Version 2.0 (the "License");
9400 * you may not use this file except in compliance with the License.
9401 * You may obtain a copy of the License at
9403 * http://www.apache.org/licenses/LICENSE-2.0
9405 * Unless required by applicable law or agreed to in writing, software
9406 * distributed under the License is distributed on an "AS IS" BASIS,
9407 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9408 * See the License for the specific language governing permissions and
9409 * limitations under the License.
9415 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9416 * specify an instruction that performs "%ecx = %ecx op %edx"
9418 * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
9420 * Description: Perform a binary operation on two source registers
9421 * and store the result in a destination register.
9423 * Format: AA|op CC|BB (23x)
9425 * Syntax: op vAA, vBB, vCC
9430 FETCH_BB 1, %ecx # %ecx<- BB
9433 FETCH_CC 1, %edx # %edx<- CC
9435 GET_VREG %ecx # %ecx<- vBB
9436 andl (rFP, %edx, 4), %ecx # %ecx<- vBB op vCC
9437 SET_VREG %ecx, rINST # vAA<- %ecx; result
9441 /* ------------------------------ */
9443 .L_OP_OR_INT: /* 0x96 */
9444 /* File: x86-atom/OP_OR_INT.S */
9445 /* Copyright (C) 2008 The Android Open Source Project
9447 * Licensed under the Apache License, Version 2.0 (the "License");
9448 * you may not use this file except in compliance with the License.
9449 * You may obtain a copy of the License at
9451 * http://www.apache.org/licenses/LICENSE-2.0
9453 * Unless required by applicable law or agreed to in writing, software
9454 * distributed under the License is distributed on an "AS IS" BASIS,
9455 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9456 * See the License for the specific language governing permissions and
9457 * limitations under the License.
9464 /* File: x86-atom/binop.S */
9465 /* Copyright (C) 2008 The Android Open Source Project
9467 * Licensed under the Apache License, Version 2.0 (the "License");
9468 * you may not use this file except in compliance with the License.
9469 * You may obtain a copy of the License at
9471 * http://www.apache.org/licenses/LICENSE-2.0
9473 * Unless required by applicable law or agreed to in writing, software
9474 * distributed under the License is distributed on an "AS IS" BASIS,
9475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9476 * See the License for the specific language governing permissions and
9477 * limitations under the License.
9483 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9484 * specify an instruction that performs "%ecx = %ecx op %edx"
9486 * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
9488 * Description: Perform a binary operation on two source registers
9489 * and store the result in a destination register.
9491 * Format: AA|op CC|BB (23x)
9493 * Syntax: op vAA, vBB, vCC
9498 FETCH_BB 1, %ecx # %ecx<- BB
9501 FETCH_CC 1, %edx # %edx<- CC
9503 GET_VREG %ecx # %ecx<- vBB
9504 or (rFP, %edx, 4), %ecx # %ecx<- vBB op vCC
9505 SET_VREG %ecx, rINST # vAA<- %ecx; result
9509 /* ------------------------------ */
9511 .L_OP_XOR_INT: /* 0x97 */
9512 /* File: x86-atom/OP_XOR_INT.S */
9513 /* Copyright (C) 2008 The Android Open Source Project
9515 * Licensed under the Apache License, Version 2.0 (the "License");
9516 * you may not use this file except in compliance with the License.
9517 * You may obtain a copy of the License at
9519 * http://www.apache.org/licenses/LICENSE-2.0
9521 * Unless required by applicable law or agreed to in writing, software
9522 * distributed under the License is distributed on an "AS IS" BASIS,
9523 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9524 * See the License for the specific language governing permissions and
9525 * limitations under the License.
9529 * File: OP_XOR_INT.S
9532 /* File: x86-atom/binop.S */
9533 /* Copyright (C) 2008 The Android Open Source Project
9535 * Licensed under the Apache License, Version 2.0 (the "License");
9536 * you may not use this file except in compliance with the License.
9537 * You may obtain a copy of the License at
9539 * http://www.apache.org/licenses/LICENSE-2.0
9541 * Unless required by applicable law or agreed to in writing, software
9542 * distributed under the License is distributed on an "AS IS" BASIS,
9543 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9544 * See the License for the specific language governing permissions and
9545 * limitations under the License.
9551 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9552 * specify an instruction that performs "%ecx = %ecx op %edx"
9554 * For: add-int, and-int, mul-int, or-int, sub-int, xor-int
9556 * Description: Perform a binary operation on two source registers
9557 * and store the result in a destination register.
9559 * Format: AA|op CC|BB (23x)
9561 * Syntax: op vAA, vBB, vCC
9566 FETCH_BB 1, %ecx # %ecx<- BB
9569 FETCH_CC 1, %edx # %edx<- CC
9571 GET_VREG %ecx # %ecx<- vBB
9572 xor (rFP, %edx, 4), %ecx # %ecx<- vBB op vCC
9573 SET_VREG %ecx, rINST # vAA<- %ecx; result
9577 /* ------------------------------ */
9579 .L_OP_SHL_INT: /* 0x98 */
9580 /* File: x86-atom/OP_SHL_INT.S */
9581 /* Copyright (C) 2008 The Android Open Source Project
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
9587 * http://www.apache.org/licenses/LICENSE-2.0
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.
9597 * File: OP_SHL_INT.S
9600 /* File: x86-atom/binopS.S */
9601 /* Copyright (C) 2008 The Android Open Source Project
9603 * Licensed under the Apache License, Version 2.0 (the "License");
9604 * you may not use this file except in compliance with the License.
9605 * You may obtain a copy of the License at
9607 * http://www.apache.org/licenses/LICENSE-2.0
9609 * Unless required by applicable law or agreed to in writing, software
9610 * distributed under the License is distributed on an "AS IS" BASIS,
9611 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9612 * See the License for the specific language governing permissions and
9613 * limitations under the License.
9619 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9620 * specify an instruction that performs "%edx = %edx op %cl"
9622 * For: shl-int, shr-int, ushr-int
9624 * Description: Perform a binary operation on two source registers
9625 * and store the result in a destination register.
9627 * Format: AA|op CC|BB (23x)
9629 * Syntax: op vAA, vBB, vCC
9632 FETCH_CC 1, %ecx # %ecx<- CC
9633 FETCH_BB 1, %edx # %edx<- BB
9634 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
9635 addl $4, rPC # update PC
9636 GET_VREG %ecx # %ecx<- vCC
9637 GET_VREG %edx # %edx<- vBB
9638 sal %cl, %edx # %edx<- vBB op +CC
9639 SET_VREG %edx, rINST # vAA<- %edx; result
9640 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
9642 /* ------------------------------ */
9644 .L_OP_SHR_INT: /* 0x99 */
9645 /* File: x86-atom/OP_SHR_INT.S */
9646 /* Copyright (C) 2008 The Android Open Source Project
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
9652 * http://www.apache.org/licenses/LICENSE-2.0
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.
9662 * File: OP_SHR_INT.S
9665 /* File: x86-atom/binopS.S */
9666 /* Copyright (C) 2008 The Android Open Source Project
9668 * Licensed under the Apache License, Version 2.0 (the "License");
9669 * you may not use this file except in compliance with the License.
9670 * You may obtain a copy of the License at
9672 * http://www.apache.org/licenses/LICENSE-2.0
9674 * Unless required by applicable law or agreed to in writing, software
9675 * distributed under the License is distributed on an "AS IS" BASIS,
9676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9677 * See the License for the specific language governing permissions and
9678 * limitations under the License.
9684 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9685 * specify an instruction that performs "%edx = %edx op %cl"
9687 * For: shl-int, shr-int, ushr-int
9689 * Description: Perform a binary operation on two source registers
9690 * and store the result in a destination register.
9692 * Format: AA|op CC|BB (23x)
9694 * Syntax: op vAA, vBB, vCC
9697 FETCH_CC 1, %ecx # %ecx<- CC
9698 FETCH_BB 1, %edx # %edx<- BB
9699 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
9700 addl $4, rPC # update PC
9701 GET_VREG %ecx # %ecx<- vCC
9702 GET_VREG %edx # %edx<- vBB
9703 sar %cl, %edx # %edx<- vBB op +CC
9704 SET_VREG %edx, rINST # vAA<- %edx; result
9705 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
9707 /* ------------------------------ */
9709 .L_OP_USHR_INT: /* 0x9a */
9710 /* File: x86-atom/OP_USHR_INT.S */
9711 /* Copyright (C) 2008 The Android Open Source Project
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
9717 * http://www.apache.org/licenses/LICENSE-2.0
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.
9727 * File: OP_USHR_INT.S
9730 /* File: x86-atom/binopS.S */
9731 /* Copyright (C) 2008 The Android Open Source Project
9733 * Licensed under the Apache License, Version 2.0 (the "License");
9734 * you may not use this file except in compliance with the License.
9735 * You may obtain a copy of the License at
9737 * http://www.apache.org/licenses/LICENSE-2.0
9739 * Unless required by applicable law or agreed to in writing, software
9740 * distributed under the License is distributed on an "AS IS" BASIS,
9741 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9742 * See the License for the specific language governing permissions and
9743 * limitations under the License.
9749 * Code: Generic 32-bit binary operation. Provides an "instr" line to
9750 * specify an instruction that performs "%edx = %edx op %cl"
9752 * For: shl-int, shr-int, ushr-int
9754 * Description: Perform a binary operation on two source registers
9755 * and store the result in a destination register.
9757 * Format: AA|op CC|BB (23x)
9759 * Syntax: op vAA, vBB, vCC
9762 FETCH_CC 1, %ecx # %ecx<- CC
9763 FETCH_BB 1, %edx # %edx<- BB
9764 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
9765 addl $4, rPC # update PC
9766 GET_VREG %ecx # %ecx<- vCC
9767 GET_VREG %edx # %edx<- vBB
9768 shr %cl, %edx # %edx<- vBB op +CC
9769 SET_VREG %edx, rINST # vAA<- %edx; result
9770 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
9772 /* ------------------------------ */
9774 .L_OP_ADD_LONG: /* 0x9b */
9775 /* File: x86-atom/OP_ADD_LONG.S */
9776 /* Copyright (C) 2008 The Android Open Source Project
9778 * Licensed under the Apache License, Version 2.0 (the "License");
9779 * you may not use this file except in compliance with the License.
9780 * You may obtain a copy of the License at
9782 * http://www.apache.org/licenses/LICENSE-2.0
9784 * Unless required by applicable law or agreed to in writing, software
9785 * distributed under the License is distributed on an "AS IS" BASIS,
9786 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9787 * See the License for the specific language governing permissions and
9788 * limitations under the License.
9792 * File: OP_ADD_LONG.S
9795 /* File: x86-atom/binopWide.S */
9796 /* Copyright (C) 2008 The Android Open Source Project
9798 * Licensed under the Apache License, Version 2.0 (the "License");
9799 * you may not use this file except in compliance with the License.
9800 * You may obtain a copy of the License at
9802 * http://www.apache.org/licenses/LICENSE-2.0
9804 * Unless required by applicable law or agreed to in writing, software
9805 * distributed under the License is distributed on an "AS IS" BASIS,
9806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9807 * See the License for the specific language governing permissions and
9808 * limitations under the License.
9814 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
9815 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
9817 * For: add-double, add-long, and-long, mul-double, or-long,
9818 * sub-double, sub-long, xor-long
9820 * Description: Perform a binary operation on two source registers
9821 * and store the result in a destination register.
9823 * Format: AA|op CC|BB (23x)
9825 * Syntax: op vAA, vBB, vCC
9828 FETCH_BB 1, %ecx # %ecx<- BB
9829 FETCH_CC 1, %edx # %edx<- CC
9830 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
9831 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
9832 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
9833 paddq %xmm1, %xmm0 # %xmm0<- vBB op vCC
9834 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
9835 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
9837 /* ------------------------------ */
9839 .L_OP_SUB_LONG: /* 0x9c */
9840 /* File: x86-atom/OP_SUB_LONG.S */
9841 /* Copyright (C) 2008 The Android Open Source Project
9843 * Licensed under the Apache License, Version 2.0 (the "License");
9844 * you may not use this file except in compliance with the License.
9845 * You may obtain a copy of the License at
9847 * http://www.apache.org/licenses/LICENSE-2.0
9849 * Unless required by applicable law or agreed to in writing, software
9850 * distributed under the License is distributed on an "AS IS" BASIS,
9851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9852 * See the License for the specific language governing permissions and
9853 * limitations under the License.
9857 * File: OP_SUB_LONG.S
9860 /* File: x86-atom/binopWide.S */
9861 /* Copyright (C) 2008 The Android Open Source Project
9863 * Licensed under the Apache License, Version 2.0 (the "License");
9864 * you may not use this file except in compliance with the License.
9865 * You may obtain a copy of the License at
9867 * http://www.apache.org/licenses/LICENSE-2.0
9869 * Unless required by applicable law or agreed to in writing, software
9870 * distributed under the License is distributed on an "AS IS" BASIS,
9871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9872 * See the License for the specific language governing permissions and
9873 * limitations under the License.
9879 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
9880 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
9882 * For: add-double, add-long, and-long, mul-double, or-long,
9883 * sub-double, sub-long, xor-long
9885 * Description: Perform a binary operation on two source registers
9886 * and store the result in a destination register.
9888 * Format: AA|op CC|BB (23x)
9890 * Syntax: op vAA, vBB, vCC
9893 FETCH_BB 1, %ecx # %ecx<- BB
9894 FETCH_CC 1, %edx # %edx<- CC
9895 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
9896 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
9897 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
9898 psubq %xmm1, %xmm0 # %xmm0<- vBB op vCC
9899 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
9900 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
9902 /* ------------------------------ */
9904 .L_OP_MUL_LONG: /* 0x9d */
9905 /* File: x86-atom/OP_MUL_LONG.S */
9906 /* Copyright (C) 2008 The Android Open Source Project
9908 * Licensed under the Apache License, Version 2.0 (the "License");
9909 * you may not use this file except in compliance with the License.
9910 * You may obtain a copy of the License at
9912 * http://www.apache.org/licenses/LICENSE-2.0
9914 * Unless required by applicable law or agreed to in writing, software
9915 * distributed under the License is distributed on an "AS IS" BASIS,
9916 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9917 * See the License for the specific language governing permissions and
9918 * limitations under the License.
9922 * File: OP_MUL_LONG.S
9924 * Code: 64-bit integer multiply
9928 * Description: Multiply two source registers and store the
9929 * result in a destination register.
9931 * Format: AA|op CC|BB (23x)
9933 * Syntax: op vAA, vBB, vCC
9937 * Signed 64-bit integer multiply.
9939 * Consider WXxYZ (r1r0 x r3r2) with a long multiply:
9946 * The low word of the result holds ZX, the high word holds
9947 * (ZW+YX) + (the high overflow from ZX). YW doesn't matter because
9948 * it doesn't fit in the low 64 bits.
9951 movl rINST, -4(%esp) # -4(%esp)<- AA+
9952 FETCH_BB 1, rINST # rINST<- BB
9953 FETCH_CC 1, %edx # %edx<- CC
9954 jmp .LOP_MUL_LONG_finish
9956 /* ------------------------------ */
9958 .L_OP_DIV_LONG: /* 0x9e */
9959 /* File: x86-atom/OP_DIV_LONG.S */
9960 /* Copyright (C) 2008 The Android Open Source Project
9962 * Licensed under the Apache License, Version 2.0 (the "License");
9963 * you may not use this file except in compliance with the License.
9964 * You may obtain a copy of the License at
9966 * http://www.apache.org/licenses/LICENSE-2.0
9968 * Unless required by applicable law or agreed to in writing, software
9969 * distributed under the License is distributed on an "AS IS" BASIS,
9970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9971 * See the License for the specific language governing permissions and
9972 * limitations under the License.
9976 * File: OP_DIV_LONG.S
9979 /* File: x86-atom/binopDivRemLong.S */
9980 /* Copyright (C) 2008 The Android Open Source Project
9982 * Licensed under the Apache License, Version 2.0 (the "License");
9983 * you may not use this file except in compliance with the License.
9984 * You may obtain a copy of the License at
9986 * http://www.apache.org/licenses/LICENSE-2.0
9988 * Unless required by applicable law or agreed to in writing, software
9989 * distributed under the License is distributed on an "AS IS" BASIS,
9990 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9991 * See the License for the specific language governing permissions and
9992 * limitations under the License.
9996 * File: binopDivRemLong.S
9998 * Code: 64-bit long divide operation. Variable
9999 * "func" defines the function called to do the operation.
10001 * For: div-long, rem-long
10003 * Description: Perform a binary operation on two source registers
10004 * and store the result in a destination register.
10006 * Format: AA|op CC|BB (23x)
10008 * Syntax: op vAA, vBB, vCC
10012 FETCH_CC 1, %edx # %edx<- CC
10013 movl (rFP, %edx, 4), %eax # %eax<- vCC
10014 movl 4(rFP, %edx, 4), %ecx # %ecx<- vCC+1
10015 movl %eax, -8(%esp) # push arg vCC
10016 or %ecx, %eax # check for divide by zero
10017 je common_errDivideByZero # handle divide by zero
10018 FETCH_BB 1, %edx # %edx<- BB
10019 movl %ecx, -4(%esp) # push arg vCC+1
10020 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vBB,vBB+1
10021 jmp .LOP_DIV_LONG_finish
10024 /* ------------------------------ */
10026 .L_OP_REM_LONG: /* 0x9f */
10027 /* File: x86-atom/OP_REM_LONG.S */
10028 /* Copyright (C) 2008 The Android Open Source Project
10030 * Licensed under the Apache License, Version 2.0 (the "License");
10031 * you may not use this file except in compliance with the License.
10032 * You may obtain a copy of the License at
10034 * http://www.apache.org/licenses/LICENSE-2.0
10036 * Unless required by applicable law or agreed to in writing, software
10037 * distributed under the License is distributed on an "AS IS" BASIS,
10038 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10039 * See the License for the specific language governing permissions and
10040 * limitations under the License.
10044 * File: OP_REM_LONG.S
10047 /* File: x86-atom/binopDivRemLong.S */
10048 /* Copyright (C) 2008 The Android Open Source Project
10050 * Licensed under the Apache License, Version 2.0 (the "License");
10051 * you may not use this file except in compliance with the License.
10052 * You may obtain a copy of the License at
10054 * http://www.apache.org/licenses/LICENSE-2.0
10056 * Unless required by applicable law or agreed to in writing, software
10057 * distributed under the License is distributed on an "AS IS" BASIS,
10058 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10059 * See the License for the specific language governing permissions and
10060 * limitations under the License.
10064 * File: binopDivRemLong.S
10066 * Code: 64-bit long divide operation. Variable
10067 * "func" defines the function called to do the operation.
10069 * For: div-long, rem-long
10071 * Description: Perform a binary operation on two source registers
10072 * and store the result in a destination register.
10074 * Format: AA|op CC|BB (23x)
10076 * Syntax: op vAA, vBB, vCC
10080 FETCH_CC 1, %edx # %edx<- CC
10081 movl (rFP, %edx, 4), %eax # %eax<- vCC
10082 movl 4(rFP, %edx, 4), %ecx # %ecx<- vCC+1
10083 movl %eax, -8(%esp) # push arg vCC
10084 or %ecx, %eax # check for divide by zero
10085 je common_errDivideByZero # handle divide by zero
10086 FETCH_BB 1, %edx # %edx<- BB
10087 movl %ecx, -4(%esp) # push arg vCC+1
10088 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vBB,vBB+1
10089 jmp .LOP_REM_LONG_finish
10092 /* ------------------------------ */
10094 .L_OP_AND_LONG: /* 0xa0 */
10095 /* File: x86-atom/OP_AND_LONG.S */
10096 /* Copyright (C) 2008 The Android Open Source Project
10098 * Licensed under the Apache License, Version 2.0 (the "License");
10099 * you may not use this file except in compliance with the License.
10100 * You may obtain a copy of the License at
10102 * http://www.apache.org/licenses/LICENSE-2.0
10104 * Unless required by applicable law or agreed to in writing, software
10105 * distributed under the License is distributed on an "AS IS" BASIS,
10106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10107 * See the License for the specific language governing permissions and
10108 * limitations under the License.
10112 * File: OP_AND_LONG.S
10115 /* File: x86-atom/binopWide.S */
10116 /* Copyright (C) 2008 The Android Open Source Project
10118 * Licensed under the Apache License, Version 2.0 (the "License");
10119 * you may not use this file except in compliance with the License.
10120 * You may obtain a copy of the License at
10122 * http://www.apache.org/licenses/LICENSE-2.0
10124 * Unless required by applicable law or agreed to in writing, software
10125 * distributed under the License is distributed on an "AS IS" BASIS,
10126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10127 * See the License for the specific language governing permissions and
10128 * limitations under the License.
10132 * File: binopWide.S
10134 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
10135 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10137 * For: add-double, add-long, and-long, mul-double, or-long,
10138 * sub-double, sub-long, xor-long
10140 * Description: Perform a binary operation on two source registers
10141 * and store the result in a destination register.
10143 * Format: AA|op CC|BB (23x)
10145 * Syntax: op vAA, vBB, vCC
10148 FETCH_BB 1, %ecx # %ecx<- BB
10149 FETCH_CC 1, %edx # %edx<- CC
10150 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10151 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
10152 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10153 pand %xmm1, %xmm0 # %xmm0<- vBB op vCC
10154 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
10155 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10157 /* ------------------------------ */
10159 .L_OP_OR_LONG: /* 0xa1 */
10160 /* File: x86-atom/OP_OR_LONG.S */
10161 /* Copyright (C) 2008 The Android Open Source Project
10163 * Licensed under the Apache License, Version 2.0 (the "License");
10164 * you may not use this file except in compliance with the License.
10165 * You may obtain a copy of the License at
10167 * http://www.apache.org/licenses/LICENSE-2.0
10169 * Unless required by applicable law or agreed to in writing, software
10170 * distributed under the License is distributed on an "AS IS" BASIS,
10171 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10172 * See the License for the specific language governing permissions and
10173 * limitations under the License.
10177 * File: OP_OR_LONG.S
10180 /* File: x86-atom/binopWide.S */
10181 /* Copyright (C) 2008 The Android Open Source Project
10183 * Licensed under the Apache License, Version 2.0 (the "License");
10184 * you may not use this file except in compliance with the License.
10185 * You may obtain a copy of the License at
10187 * http://www.apache.org/licenses/LICENSE-2.0
10189 * Unless required by applicable law or agreed to in writing, software
10190 * distributed under the License is distributed on an "AS IS" BASIS,
10191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10192 * See the License for the specific language governing permissions and
10193 * limitations under the License.
10197 * File: binopWide.S
10199 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
10200 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10202 * For: add-double, add-long, and-long, mul-double, or-long,
10203 * sub-double, sub-long, xor-long
10205 * Description: Perform a binary operation on two source registers
10206 * and store the result in a destination register.
10208 * Format: AA|op CC|BB (23x)
10210 * Syntax: op vAA, vBB, vCC
10213 FETCH_BB 1, %ecx # %ecx<- BB
10214 FETCH_CC 1, %edx # %edx<- CC
10215 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10216 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
10217 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10218 por %xmm1, %xmm0 # %xmm0<- vBB op vCC
10219 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
10220 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10222 /* ------------------------------ */
10224 .L_OP_XOR_LONG: /* 0xa2 */
10225 /* File: x86-atom/OP_XOR_LONG.S */
10226 /* Copyright (C) 2008 The Android Open Source Project
10228 * Licensed under the Apache License, Version 2.0 (the "License");
10229 * you may not use this file except in compliance with the License.
10230 * You may obtain a copy of the License at
10232 * http://www.apache.org/licenses/LICENSE-2.0
10234 * Unless required by applicable law or agreed to in writing, software
10235 * distributed under the License is distributed on an "AS IS" BASIS,
10236 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10237 * See the License for the specific language governing permissions and
10238 * limitations under the License.
10242 * File: OP_XOR_LONG.S
10245 /* File: x86-atom/binopWide.S */
10246 /* Copyright (C) 2008 The Android Open Source Project
10248 * Licensed under the Apache License, Version 2.0 (the "License");
10249 * you may not use this file except in compliance with the License.
10250 * You may obtain a copy of the License at
10252 * http://www.apache.org/licenses/LICENSE-2.0
10254 * Unless required by applicable law or agreed to in writing, software
10255 * distributed under the License is distributed on an "AS IS" BASIS,
10256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10257 * See the License for the specific language governing permissions and
10258 * limitations under the License.
10262 * File: binopWide.S
10264 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
10265 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10267 * For: add-double, add-long, and-long, mul-double, or-long,
10268 * sub-double, sub-long, xor-long
10270 * Description: Perform a binary operation on two source registers
10271 * and store the result in a destination register.
10273 * Format: AA|op CC|BB (23x)
10275 * Syntax: op vAA, vBB, vCC
10278 FETCH_BB 1, %ecx # %ecx<- BB
10279 FETCH_CC 1, %edx # %edx<- CC
10280 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10281 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
10282 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10283 pxor %xmm1, %xmm0 # %xmm0<- vBB op vCC
10284 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
10285 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10287 /* ------------------------------ */
10289 .L_OP_SHL_LONG: /* 0xa3 */
10290 /* File: x86-atom/OP_SHL_LONG.S */
10291 /* Copyright (C) 2008 The Android Open Source Project
10293 * Licensed under the Apache License, Version 2.0 (the "License");
10294 * you may not use this file except in compliance with the License.
10295 * You may obtain a copy of the License at
10297 * http://www.apache.org/licenses/LICENSE-2.0
10299 * Unless required by applicable law or agreed to in writing, software
10300 * distributed under the License is distributed on an "AS IS" BASIS,
10301 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10302 * See the License for the specific language governing permissions and
10303 * limitations under the License.
10307 * File: OP_SHL_LONG.S
10309 * Code: Performs a shift left long. Uses no substitutions.
10313 * Description: Perform a binary shift operation using two source registers
10314 * where one is the shift amount and the other is the value to shift.
10315 * Store the result in a destination register.
10317 * Format: AA|op CC|BB (23x)
10319 * Syntax: op vAA, vBB, vCC
10322 FETCH_CC 1, %eax # %eax<- CC
10323 FETCH_BB 1, %edx # %edx<- BB
10324 movq .LshiftMask, %xmm2 # %xmm2<- mask for the shift bits
10325 movss (rFP, %eax, 4), %xmm0 # %xmm0<- vCC
10326 pand %xmm2, %xmm0 # %xmm0<- masked shift bits
10327 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vBB
10328 psllq %xmm0, %xmm1 # %xmm1<- shifted vBB
10329 movq %xmm1, (rFP, rINST, 4) # vAA<- shifted vBB
10330 FINISH 2 # jump to next instruction
10332 /* ------------------------------ */
10334 .L_OP_SHR_LONG: /* 0xa4 */
10335 /* File: x86-atom/OP_SHR_LONG.S */
10336 /* Copyright (C) 2008 The Android Open Source Project
10338 * Licensed under the Apache License, Version 2.0 (the "License");
10339 * you may not use this file except in compliance with the License.
10340 * You may obtain a copy of the License at
10342 * http://www.apache.org/licenses/LICENSE-2.0
10344 * Unless required by applicable law or agreed to in writing, software
10345 * distributed under the License is distributed on an "AS IS" BASIS,
10346 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10347 * See the License for the specific language governing permissions and
10348 * limitations under the License.
10352 * File: OP_SHR_LONG.S
10354 * Code: Performs a shift right long
10358 * Description: Perform a binary shift operation using two source registers
10359 * where one is the shift amount and the other is the value to shift.
10360 * Store the result in a destination register.
10362 * Format: AA|op CC|BB (23x)
10364 * Syntax: op vAA, vBB, vCC
10367 FETCH_BB 1, %edx # %edx<- BB
10368 FETCH_CC 1, %eax # %eax<- CC
10369 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vBB
10370 movss (rFP, %eax, 4), %xmm0 # %xmm0<- vCC
10371 movq .LshiftMask, %xmm2
10372 pand %xmm2, %xmm0 # %xmm0<- masked for the shift bits
10373 psrlq %xmm0, %xmm1 # %xmm1<- shifted vBB
10374 cmpl $0, 4(rFP, %edx, 4) # check if we need to consider sign
10375 jl .LOP_SHR_LONG_finish # consider sign
10376 jmp .LOP_SHR_LONG_final # sign is fine, finish
10378 /* ------------------------------ */
10380 .L_OP_USHR_LONG: /* 0xa5 */
10381 /* File: x86-atom/OP_USHR_LONG.S */
10382 /* Copyright (C) 2008 The Android Open Source Project
10384 * Licensed under the Apache License, Version 2.0 (the "License");
10385 * you may not use this file except in compliance with the License.
10386 * You may obtain a copy of the License at
10388 * http://www.apache.org/licenses/LICENSE-2.0
10390 * Unless required by applicable law or agreed to in writing, software
10391 * distributed under the License is distributed on an "AS IS" BASIS,
10392 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10393 * See the License for the specific language governing permissions and
10394 * limitations under the License.
10398 * File: OP_USHR_LONG.S
10400 * Code: Performs an unsigned shift right long operation. Uses no substitutions.
10404 * Description: Perform a binary shift operation using two source registers
10405 * where one is the shift amount and the other is the value to shift.
10407 * Format: AA|op CC|BB (23x)
10409 * Syntax: op vAA, vBB, vCC
10412 FETCH_CC 1, %eax # %eax<- CC
10413 FETCH_BB 1, %edx # %edx<- BB
10414 movsd .LshiftMask, %xmm2 # %xmm2<- mask for the shift bits
10415 movss (rFP, %eax, 4), %xmm0 # %xmm0<- vCC
10416 pand %xmm2, %xmm0 # %xmm0<- masked shift bits
10417 movsd (rFP, %edx, 4), %xmm1 # %xmm1<- vBB
10418 psrlq %xmm0, %xmm1 # %xmm1<- shifted vBB
10419 movsd %xmm1, (rFP, rINST, 4) # vAA<- shifted vBB
10420 FINISH 2 # jump to next instruction
10422 /* ------------------------------ */
10424 .L_OP_ADD_FLOAT: /* 0xa6 */
10425 /* File: x86-atom/OP_ADD_FLOAT.S */
10426 /* Copyright (C) 2008 The Android Open Source Project
10428 * Licensed under the Apache License, Version 2.0 (the "License");
10429 * you may not use this file except in compliance with the License.
10430 * You may obtain a copy of the License at
10432 * http://www.apache.org/licenses/LICENSE-2.0
10434 * Unless required by applicable law or agreed to in writing, software
10435 * distributed under the License is distributed on an "AS IS" BASIS,
10436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10437 * See the License for the specific language governing permissions and
10438 * limitations under the License.
10442 * File: OP_ADD_FLOAT.S
10445 /* File: x86-atom/binopF.S */
10446 /* Copyright (C) 2008 The Android Open Source Project
10448 * Licensed under the Apache License, Version 2.0 (the "License");
10449 * you may not use this file except in compliance with the License.
10450 * You may obtain a copy of the License at
10452 * http://www.apache.org/licenses/LICENSE-2.0
10454 * Unless required by applicable law or agreed to in writing, software
10455 * distributed under the License is distributed on an "AS IS" BASIS,
10456 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10457 * See the License for the specific language governing permissions and
10458 * limitations under the License.
10464 * Code: Generic 32-bit binary operation. Provides an "instr" line to
10465 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10467 * For: add-float, mul-float, sub-float
10469 * Description: Perform a binary operation on two source registers
10470 * and store the result in a destination register.
10472 * Format: AA|op CC|BB (23x)
10474 * Syntax: op vAA, vBB, vCC
10477 FETCH_BB 1, %ecx # %ecx<- BB
10478 FETCH_CC 1, %edx # %edx<- CC
10479 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10480 movss (rFP, %ecx, 4), %xmm0 # %xmm0<-vBB
10481 movss (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10482 addss %xmm1, %xmm0 # %xmm0<- vBB op vCC
10483 movss %xmm0, (rFP, rINST, 4) # vAA<- %xmm0; result
10484 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10486 /* ------------------------------ */
10488 .L_OP_SUB_FLOAT: /* 0xa7 */
10489 /* File: x86-atom/OP_SUB_FLOAT.S */
10490 /* Copyright (C) 2008 The Android Open Source Project
10492 * Licensed under the Apache License, Version 2.0 (the "License");
10493 * you may not use this file except in compliance with the License.
10494 * You may obtain a copy of the License at
10496 * http://www.apache.org/licenses/LICENSE-2.0
10498 * Unless required by applicable law or agreed to in writing, software
10499 * distributed under the License is distributed on an "AS IS" BASIS,
10500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10501 * See the License for the specific language governing permissions and
10502 * limitations under the License.
10506 * File: OP_SUB_FLOAT.S
10509 /* File: x86-atom/binopF.S */
10510 /* Copyright (C) 2008 The Android Open Source Project
10512 * Licensed under the Apache License, Version 2.0 (the "License");
10513 * you may not use this file except in compliance with the License.
10514 * You may obtain a copy of the License at
10516 * http://www.apache.org/licenses/LICENSE-2.0
10518 * Unless required by applicable law or agreed to in writing, software
10519 * distributed under the License is distributed on an "AS IS" BASIS,
10520 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10521 * See the License for the specific language governing permissions and
10522 * limitations under the License.
10528 * Code: Generic 32-bit binary operation. Provides an "instr" line to
10529 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10531 * For: add-float, mul-float, sub-float
10533 * Description: Perform a binary operation on two source registers
10534 * and store the result in a destination register.
10536 * Format: AA|op CC|BB (23x)
10538 * Syntax: op vAA, vBB, vCC
10541 FETCH_BB 1, %ecx # %ecx<- BB
10542 FETCH_CC 1, %edx # %edx<- CC
10543 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10544 movss (rFP, %ecx, 4), %xmm0 # %xmm0<-vBB
10545 movss (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10546 subss %xmm1, %xmm0 # %xmm0<- vBB op vCC
10547 movss %xmm0, (rFP, rINST, 4) # vAA<- %xmm0; result
10548 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10550 /* ------------------------------ */
10552 .L_OP_MUL_FLOAT: /* 0xa8 */
10553 /* File: x86-atom/OP_MUL_FLOAT.S */
10554 /* Copyright (C) 2008 The Android Open Source Project
10556 * Licensed under the Apache License, Version 2.0 (the "License");
10557 * you may not use this file except in compliance with the License.
10558 * You may obtain a copy of the License at
10560 * http://www.apache.org/licenses/LICENSE-2.0
10562 * Unless required by applicable law or agreed to in writing, software
10563 * distributed under the License is distributed on an "AS IS" BASIS,
10564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10565 * See the License for the specific language governing permissions and
10566 * limitations under the License.
10570 * File: OP_MUL_FLOAT.S
10573 /* File: x86-atom/binopF.S */
10574 /* Copyright (C) 2008 The Android Open Source Project
10576 * Licensed under the Apache License, Version 2.0 (the "License");
10577 * you may not use this file except in compliance with the License.
10578 * You may obtain a copy of the License at
10580 * http://www.apache.org/licenses/LICENSE-2.0
10582 * Unless required by applicable law or agreed to in writing, software
10583 * distributed under the License is distributed on an "AS IS" BASIS,
10584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10585 * See the License for the specific language governing permissions and
10586 * limitations under the License.
10592 * Code: Generic 32-bit binary operation. Provides an "instr" line to
10593 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10595 * For: add-float, mul-float, sub-float
10597 * Description: Perform a binary operation on two source registers
10598 * and store the result in a destination register.
10600 * Format: AA|op CC|BB (23x)
10602 * Syntax: op vAA, vBB, vCC
10605 FETCH_BB 1, %ecx # %ecx<- BB
10606 FETCH_CC 1, %edx # %edx<- CC
10607 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10608 movss (rFP, %ecx, 4), %xmm0 # %xmm0<-vBB
10609 movss (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10610 mulss %xmm1, %xmm0 # %xmm0<- vBB op vCC
10611 movss %xmm0, (rFP, rINST, 4) # vAA<- %xmm0; result
10612 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10614 /* ------------------------------ */
10616 .L_OP_DIV_FLOAT: /* 0xa9 */
10617 /* File: x86-atom/OP_DIV_FLOAT.S */
10618 /* Copyright (C) 2008 The Android Open Source Project
10620 * Licensed under the Apache License, Version 2.0 (the "License");
10621 * you may not use this file except in compliance with the License.
10622 * You may obtain a copy of the License at
10624 * http://www.apache.org/licenses/LICENSE-2.0
10626 * Unless required by applicable law or agreed to in writing, software
10627 * distributed under the License is distributed on an "AS IS" BASIS,
10628 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10629 * See the License for the specific language governing permissions and
10630 * limitations under the License.
10634 * File: OP_DIV_FLOAT.S
10636 * Code: Divides floats. Uses no substitutions.
10640 * Description: Divide operation on two source registers, storing
10641 * the result in a destiniation register
10643 * Format: AA|op CC|BB (23x)
10645 * Syntax: op vAA, vBB, vCC
10648 FETCH_BB 1, %eax # %eax<- BB
10649 FETCH_CC 1, %ecx # %ecx<- CC
10650 flds (rFP, %eax, 4) # floating point stack vBB
10651 fdivs (rFP, %ecx, 4) # divide double; vBB/vCC
10652 fstps (rFP, rINST, 4) # vAA<- result
10653 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10654 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10656 /* ------------------------------ */
10658 .L_OP_REM_FLOAT: /* 0xaa */
10659 /* File: x86-atom/OP_REM_FLOAT.S */
10660 /* Copyright (C) 2008 The Android Open Source Project
10662 * Licensed under the Apache License, Version 2.0 (the "License");
10663 * you may not use this file except in compliance with the License.
10664 * You may obtain a copy of the License at
10666 * http://www.apache.org/licenses/LICENSE-2.0
10668 * Unless required by applicable law or agreed to in writing, software
10669 * distributed under the License is distributed on an "AS IS" BASIS,
10670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10671 * See the License for the specific language governing permissions and
10672 * limitations under the License.
10676 * File: OP_REM_FLOAT.S
10678 * Code: Computes the remainder of a division. Performs no substitutions.
10682 * Description: Calls fmod to compute the remainder of the result of dividing a
10683 * source register by a second, and stores the result in a
10684 * destination register.
10686 * Format: AA|op CC|BB (23x)
10688 * Syntax: op vAA, vBB, vCC
10691 FETCH_BB 1, %ecx # %ecx<- BB
10692 FETCH_CC 1, %edx # %edx<- CC
10693 GET_VREG %ecx # %ecx<- vBB
10694 GET_VREG %edx # %edx<- vCC
10695 movl %ecx, -8(%esp) # push parameter float
10696 movl %edx, -4(%esp) # push parameter float
10698 call fmodf # call: (float x, float y)
10701 fstps (rFP, rINST, 4) # vAA<- remainder; return of fmod
10702 FINISH 2 # jump to next instruction
10704 /* ------------------------------ */
10706 .L_OP_ADD_DOUBLE: /* 0xab */
10707 /* File: x86-atom/OP_ADD_DOUBLE.S */
10708 /* Copyright (C) 2008 The Android Open Source Project
10710 * Licensed under the Apache License, Version 2.0 (the "License");
10711 * you may not use this file except in compliance with the License.
10712 * You may obtain a copy of the License at
10714 * http://www.apache.org/licenses/LICENSE-2.0
10716 * Unless required by applicable law or agreed to in writing, software
10717 * distributed under the License is distributed on an "AS IS" BASIS,
10718 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10719 * See the License for the specific language governing permissions and
10720 * limitations under the License.
10724 * File: OP_ADD_DOUBLE.S
10727 /* File: x86-atom/binopWide.S */
10728 /* Copyright (C) 2008 The Android Open Source Project
10730 * Licensed under the Apache License, Version 2.0 (the "License");
10731 * you may not use this file except in compliance with the License.
10732 * You may obtain a copy of the License at
10734 * http://www.apache.org/licenses/LICENSE-2.0
10736 * Unless required by applicable law or agreed to in writing, software
10737 * distributed under the License is distributed on an "AS IS" BASIS,
10738 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10739 * See the License for the specific language governing permissions and
10740 * limitations under the License.
10744 * File: binopWide.S
10746 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
10747 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10749 * For: add-double, add-long, and-long, mul-double, or-long,
10750 * sub-double, sub-long, xor-long
10752 * Description: Perform a binary operation on two source registers
10753 * and store the result in a destination register.
10755 * Format: AA|op CC|BB (23x)
10757 * Syntax: op vAA, vBB, vCC
10760 FETCH_BB 1, %ecx # %ecx<- BB
10761 FETCH_CC 1, %edx # %edx<- CC
10762 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10763 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
10764 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10765 addsd %xmm1, %xmm0 # %xmm0<- vBB op vCC
10766 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
10767 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10769 /* ------------------------------ */
10771 .L_OP_SUB_DOUBLE: /* 0xac */
10772 /* File: x86-atom/OP_SUB_DOUBLE.S */
10773 /* Copyright (C) 2008 The Android Open Source Project
10775 * Licensed under the Apache License, Version 2.0 (the "License");
10776 * you may not use this file except in compliance with the License.
10777 * You may obtain a copy of the License at
10779 * http://www.apache.org/licenses/LICENSE-2.0
10781 * Unless required by applicable law or agreed to in writing, software
10782 * distributed under the License is distributed on an "AS IS" BASIS,
10783 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10784 * See the License for the specific language governing permissions and
10785 * limitations under the License.
10789 * File: OP_SUB_DOUBLE.S
10792 /* File: x86-atom/binopWide.S */
10793 /* Copyright (C) 2008 The Android Open Source Project
10795 * Licensed under the Apache License, Version 2.0 (the "License");
10796 * you may not use this file except in compliance with the License.
10797 * You may obtain a copy of the License at
10799 * http://www.apache.org/licenses/LICENSE-2.0
10801 * Unless required by applicable law or agreed to in writing, software
10802 * distributed under the License is distributed on an "AS IS" BASIS,
10803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10804 * See the License for the specific language governing permissions and
10805 * limitations under the License.
10809 * File: binopWide.S
10811 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
10812 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10814 * For: add-double, add-long, and-long, mul-double, or-long,
10815 * sub-double, sub-long, xor-long
10817 * Description: Perform a binary operation on two source registers
10818 * and store the result in a destination register.
10820 * Format: AA|op CC|BB (23x)
10822 * Syntax: op vAA, vBB, vCC
10825 FETCH_BB 1, %ecx # %ecx<- BB
10826 FETCH_CC 1, %edx # %edx<- CC
10827 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10828 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
10829 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10830 subsd %xmm1, %xmm0 # %xmm0<- vBB op vCC
10831 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
10832 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10834 /* ------------------------------ */
10836 .L_OP_MUL_DOUBLE: /* 0xad */
10837 /* File: x86-atom/OP_MUL_DOUBLE.S */
10838 /* Copyright (C) 2008 The Android Open Source Project
10840 * Licensed under the Apache License, Version 2.0 (the "License");
10841 * you may not use this file except in compliance with the License.
10842 * You may obtain a copy of the License at
10844 * http://www.apache.org/licenses/LICENSE-2.0
10846 * Unless required by applicable law or agreed to in writing, software
10847 * distributed under the License is distributed on an "AS IS" BASIS,
10848 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10849 * See the License for the specific language governing permissions and
10850 * limitations under the License.
10854 * File: OP_MUL_DOUBLE.S
10857 /* File: x86-atom/binopWide.S */
10858 /* Copyright (C) 2008 The Android Open Source Project
10860 * Licensed under the Apache License, Version 2.0 (the "License");
10861 * you may not use this file except in compliance with the License.
10862 * You may obtain a copy of the License at
10864 * http://www.apache.org/licenses/LICENSE-2.0
10866 * Unless required by applicable law or agreed to in writing, software
10867 * distributed under the License is distributed on an "AS IS" BASIS,
10868 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10869 * See the License for the specific language governing permissions and
10870 * limitations under the License.
10874 * File: binopWide.S
10876 * Code: Generic 64-bit binary operation. Provides an "instr" variable to
10877 * specify an instruction that performs "%xmm0 = %xmm0 op %xmm1"
10879 * For: add-double, add-long, and-long, mul-double, or-long,
10880 * sub-double, sub-long, xor-long
10882 * Description: Perform a binary operation on two source registers
10883 * and store the result in a destination register.
10885 * Format: AA|op CC|BB (23x)
10887 * Syntax: op vAA, vBB, vCC
10890 FETCH_BB 1, %ecx # %ecx<- BB
10891 FETCH_CC 1, %edx # %edx<- CC
10892 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10893 movq (rFP, %ecx, 4), %xmm0 # %xmm0<- vBB
10894 movq (rFP, %edx, 4), %xmm1 # %xmm1<- vCC
10895 mulsd %xmm1, %xmm0 # %xmm0<- vBB op vCC
10896 movq %xmm0, (rFP, rINST, 4) # vAA<- %ecx
10897 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10899 /* ------------------------------ */
10901 .L_OP_DIV_DOUBLE: /* 0xae */
10902 /* File: x86-atom/OP_DIV_DOUBLE.S */
10903 /* Copyright (C) 2008 The Android Open Source Project
10905 * Licensed under the Apache License, Version 2.0 (the "License");
10906 * you may not use this file except in compliance with the License.
10907 * You may obtain a copy of the License at
10909 * http://www.apache.org/licenses/LICENSE-2.0
10911 * Unless required by applicable law or agreed to in writing, software
10912 * distributed under the License is distributed on an "AS IS" BASIS,
10913 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10914 * See the License for the specific language governing permissions and
10915 * limitations under the License.
10919 * File: OP_DIV_DOUBLE.S
10921 * Code: Divides doubles. Uses no substitutions.
10925 * Description: Divide operation on two source registers, storing
10926 * the result in a destination register
10928 * Format: AA|op CC|BB (23x)
10930 * Syntax: op vAA, vBB, vCC
10933 FETCH_BB 1, %ecx # %ecx<- BB
10934 FETCH_CC 1, %edx # %edx<- CC
10935 fldl (rFP, %ecx, 4) # floating point stack vBB
10936 fdivl (rFP, %edx, 4) # divide double; vBB/vCC
10937 fstpl (rFP, rINST, 4) # vAA<- result
10938 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
10939 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
10941 /* ------------------------------ */
10943 .L_OP_REM_DOUBLE: /* 0xaf */
10944 /* File: x86-atom/OP_REM_DOUBLE.S */
10945 /* Copyright (C) 2008 The Android Open Source Project
10947 * Licensed under the Apache License, Version 2.0 (the "License");
10948 * you may not use this file except in compliance with the License.
10949 * You may obtain a copy of the License at
10951 * http://www.apache.org/licenses/LICENSE-2.0
10953 * Unless required by applicable law or agreed to in writing, software
10954 * distributed under the License is distributed on an "AS IS" BASIS,
10955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10956 * See the License for the specific language governing permissions and
10957 * limitations under the License.
10961 * File: OP_REM_DOUBLE.S
10963 * Code: Computes the remainder of a division. Performs no substitutions.
10967 * Description: Calls fmod to compute the remainder of the result of dividing a
10968 * source register by a second, and stores the result in a
10969 * destination register.
10971 * Format: AA|op CC|BB (23x)
10973 * Syntax: op vAA, vBB, vCC
10976 FETCH_BB 1, %ecx # %ecx<- BB
10977 FETCH_CC 1, %edx # %edx<- CC
10978 movl (rFP, %ecx, 4), %eax # %eax<- vBBlo
10979 movl %eax, -16(%esp) # push parameter double lo
10980 movl 4(rFP, %ecx, 4), %eax # %eax<- vBBhi
10981 movl %eax, -12(%esp) # push parameter double hi
10982 movl (rFP, %edx, 4), %eax # %eax<- vCClo
10983 movl %eax, -8(%esp) # push parameter double lo
10984 movl 4(rFP, %edx, 4), %eax # %eax<- vCChi
10985 movl %eax, -4(%esp) # push parameter double hi
10986 lea -16(%esp), %esp
10987 jmp .LOP_REM_DOUBLE_break
10989 /* ------------------------------ */
10991 .L_OP_ADD_INT_2ADDR: /* 0xb0 */
10992 /* File: x86-atom/OP_ADD_INT_2ADDR.S */
10993 /* Copyright (C) 2008 The Android Open Source Project
10995 * Licensed under the Apache License, Version 2.0 (the "License");
10996 * you may not use this file except in compliance with the License.
10997 * You may obtain a copy of the License at
10999 * http://www.apache.org/licenses/LICENSE-2.0
11001 * Unless required by applicable law or agreed to in writing, software
11002 * distributed under the License is distributed on an "AS IS" BASIS,
11003 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11004 * See the License for the specific language governing permissions and
11005 * limitations under the License.
11009 * File: OP_ADD_INT_2ADDR.S
11012 /* File: x86-atom/binop2addr.S */
11013 /* Copyright (C) 2008 The Android Open Source Project
11015 * Licensed under the Apache License, Version 2.0 (the "License");
11016 * you may not use this file except in compliance with the License.
11017 * You may obtain a copy of the License at
11019 * http://www.apache.org/licenses/LICENSE-2.0
11021 * Unless required by applicable law or agreed to in writing, software
11022 * distributed under the License is distributed on an "AS IS" BASIS,
11023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11024 * See the License for the specific language governing permissions and
11025 * limitations under the License.
11029 * File: binop2addr.S
11031 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11032 * "instr" line to specify an instruction that performs
11033 * "%ecx = %ecx op %edx".
11035 * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
11036 * sub-int/2addr, xor-int/2addr
11038 * Description: Perform a binary operation on two sources registers
11039 * and store the result in the first source register
11041 * Format: B|A|op (12x)
11043 * Syntax: op vA, vB
11046 movl rINST, %edx # %edx<- BA
11047 shr $4, %edx # %edx<- B
11048 #FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11050 andl $15, rINST # rINST<- A
11052 GET_VREG %edx # %edx<- vB
11054 addl %edx, (rFP, rINST, 4) # %ecx<- vA op vB
11055 #FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11059 /* ------------------------------ */
11061 .L_OP_SUB_INT_2ADDR: /* 0xb1 */
11062 /* File: x86-atom/OP_SUB_INT_2ADDR.S */
11063 /* Copyright (C) 2008 The Android Open Source Project
11065 * Licensed under the Apache License, Version 2.0 (the "License");
11066 * you may not use this file except in compliance with the License.
11067 * You may obtain a copy of the License at
11069 * http://www.apache.org/licenses/LICENSE-2.0
11071 * Unless required by applicable law or agreed to in writing, software
11072 * distributed under the License is distributed on an "AS IS" BASIS,
11073 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11074 * See the License for the specific language governing permissions and
11075 * limitations under the License.
11079 * File: OP_SUB_INT_2ADDR.S
11082 /* File: x86-atom/binop2addr.S */
11083 /* Copyright (C) 2008 The Android Open Source Project
11085 * Licensed under the Apache License, Version 2.0 (the "License");
11086 * you may not use this file except in compliance with the License.
11087 * You may obtain a copy of the License at
11089 * http://www.apache.org/licenses/LICENSE-2.0
11091 * Unless required by applicable law or agreed to in writing, software
11092 * distributed under the License is distributed on an "AS IS" BASIS,
11093 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11094 * See the License for the specific language governing permissions and
11095 * limitations under the License.
11099 * File: binop2addr.S
11101 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11102 * "instr" line to specify an instruction that performs
11103 * "%ecx = %ecx op %edx".
11105 * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
11106 * sub-int/2addr, xor-int/2addr
11108 * Description: Perform a binary operation on two sources registers
11109 * and store the result in the first source register
11111 * Format: B|A|op (12x)
11113 * Syntax: op vA, vB
11116 movl rINST, %edx # %edx<- BA
11117 shr $4, %edx # %edx<- B
11118 #FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11120 andl $15, rINST # rINST<- A
11122 GET_VREG %edx # %edx<- vB
11124 subl %edx, (rFP, rINST, 4) # %ecx<- vA op vB
11125 #FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11129 /* ------------------------------ */
11131 .L_OP_MUL_INT_2ADDR: /* 0xb2 */
11132 /* File: x86-atom/OP_MUL_INT_2ADDR.S */
11133 /* Copyright (C) 2008 The Android Open Source Project
11135 * Licensed under the Apache License, Version 2.0 (the "License");
11136 * you may not use this file except in compliance with the License.
11137 * You may obtain a copy of the License at
11139 * http://www.apache.org/licenses/LICENSE-2.0
11141 * Unless required by applicable law or agreed to in writing, software
11142 * distributed under the License is distributed on an "AS IS" BASIS,
11143 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11144 * See the License for the specific language governing permissions and
11145 * limitations under the License.
11149 * File: OP_MUL_INT_2ADDR.S
11152 movl rINST, %edx # %edx<- BA
11153 shr $4, %edx # %edx<- B
11154 andl $15, rINST # rINST<- A
11155 movl rINST, %ecx # %ecx<- A
11156 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11157 GET_VREG %ecx # %ecx<- vA
11158 imul (rFP, %edx, 4), %ecx # %ecx<- vA * vB
11159 addl $2, rPC # update PC
11160 SET_VREG %ecx, rINST # vAA<- %ecx; result
11161 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
11163 /* ------------------------------ */
11165 .L_OP_DIV_INT_2ADDR: /* 0xb3 */
11166 /* File: x86-atom/OP_DIV_INT_2ADDR.S */
11167 /* Copyright (C) 2008 The Android Open Source Project
11169 * Licensed under the Apache License, Version 2.0 (the "License");
11170 * you may not use this file except in compliance with the License.
11171 * You may obtain a copy of the License at
11173 * http://www.apache.org/licenses/LICENSE-2.0
11175 * Unless required by applicable law or agreed to in writing, software
11176 * distributed under the License is distributed on an "AS IS" BASIS,
11177 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11178 * See the License for the specific language governing permissions and
11179 * limitations under the License.
11183 * File: OP_DIV_INT_2ADDR.S
11186 /* File: x86-atom/binopD2addr.S */
11187 /* Copyright (C) 2008 The Android Open Source Project
11189 * Licensed under the Apache License, Version 2.0 (the "License");
11190 * you may not use this file except in compliance with the License.
11191 * You may obtain a copy of the License at
11193 * http://www.apache.org/licenses/LICENSE-2.0
11195 * Unless required by applicable law or agreed to in writing, software
11196 * distributed under the License is distributed on an "AS IS" BASIS,
11197 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11198 * See the License for the specific language governing permissions and
11199 * limitations under the License.
11203 * File: binopD2addr.S
11205 * Code: 32-bit "/2addr" integer divde operation. If "div"
11206 * is set, the code returns the quotient, else it returns
11207 * the remainder. Also, a divide-by-zero check is done.
11209 * For: div-int/2addr, rem-int/2addr
11211 * Description: Perform a binary operation on two sources registers
11212 * and store the result in the first source register
11214 * Format: B|A|op (12x)
11216 * Syntax: op vA, vB
11219 movl rINST, %ecx # %ecx<- BA
11220 shr $4, %ecx # %ecx<- B
11221 andl $15, rINST # rINST<- A, to be used as dest
11222 movl rINST, %eax # %eax<- A
11223 GET_VREG %ecx # %edx<- vB
11224 testl %ecx, %ecx # check for divide by zero
11225 GET_VREG %eax # %eax<- vA
11226 jz common_errDivideByZero # handle divide by zero
11227 cmpl $-1, %ecx # handle -1 special case divide error
11228 jnz .LOP_DIV_INT_2ADDR_continue
11229 cmpl $0x80000000, %eax # handle min int special case divide error
11230 je .LOP_DIV_INT_2ADDR_break
11232 .LOP_DIV_INT_2ADDR_continue:
11233 cdq # sign-extend %eax to %edx
11234 idiv %ecx # divide %edx:%eax by %ecx
11236 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
11237 SET_VREG %eax rINST # vAA<- %eax (quotient)
11238 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
11240 FFETCH_ADV 1, %eax # %ecx<- next instruction hi; fetch, advance
11241 SET_VREG %edx rINST # vAA<- %edx (remainder)
11242 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11247 /* ------------------------------ */
11249 .L_OP_REM_INT_2ADDR: /* 0xb4 */
11250 /* File: x86-atom/OP_REM_INT_2ADDR.S */
11251 /* Copyright (C) 2008 The Android Open Source Project
11253 * Licensed under the Apache License, Version 2.0 (the "License");
11254 * you may not use this file except in compliance with the License.
11255 * You may obtain a copy of the License at
11257 * http://www.apache.org/licenses/LICENSE-2.0
11259 * Unless required by applicable law or agreed to in writing, software
11260 * distributed under the License is distributed on an "AS IS" BASIS,
11261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11262 * See the License for the specific language governing permissions and
11263 * limitations under the License.
11267 * File: OP_REM_INT_2ADDR.S
11270 /* File: x86-atom/binopD2addr.S */
11271 /* Copyright (C) 2008 The Android Open Source Project
11273 * Licensed under the Apache License, Version 2.0 (the "License");
11274 * you may not use this file except in compliance with the License.
11275 * You may obtain a copy of the License at
11277 * http://www.apache.org/licenses/LICENSE-2.0
11279 * Unless required by applicable law or agreed to in writing, software
11280 * distributed under the License is distributed on an "AS IS" BASIS,
11281 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11282 * See the License for the specific language governing permissions and
11283 * limitations under the License.
11287 * File: binopD2addr.S
11289 * Code: 32-bit "/2addr" integer divde operation. If "div"
11290 * is set, the code returns the quotient, else it returns
11291 * the remainder. Also, a divide-by-zero check is done.
11293 * For: div-int/2addr, rem-int/2addr
11295 * Description: Perform a binary operation on two sources registers
11296 * and store the result in the first source register
11298 * Format: B|A|op (12x)
11300 * Syntax: op vA, vB
11303 movl rINST, %ecx # %ecx<- BA
11304 shr $4, %ecx # %ecx<- B
11305 andl $15, rINST # rINST<- A, to be used as dest
11306 movl rINST, %eax # %eax<- A
11307 GET_VREG %ecx # %edx<- vB
11308 testl %ecx, %ecx # check for divide by zero
11309 GET_VREG %eax # %eax<- vA
11310 jz common_errDivideByZero # handle divide by zero
11311 cmpl $-1, %ecx # handle -1 special case divide error
11312 jnz .LOP_REM_INT_2ADDR_continue
11313 cmpl $0x80000000, %eax # handle min int special case divide error
11314 je .LOP_REM_INT_2ADDR_break
11316 .LOP_REM_INT_2ADDR_continue:
11317 cdq # sign-extend %eax to %edx
11318 idiv %ecx # divide %edx:%eax by %ecx
11320 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
11321 SET_VREG %eax rINST # vAA<- %eax (quotient)
11322 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
11324 FFETCH_ADV 1, %eax # %ecx<- next instruction hi; fetch, advance
11325 SET_VREG %edx rINST # vAA<- %edx (remainder)
11326 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11331 /* ------------------------------ */
11333 .L_OP_AND_INT_2ADDR: /* 0xb5 */
11334 /* File: x86-atom/OP_AND_INT_2ADDR.S */
11335 /* Copyright (C) 2008 The Android Open Source Project
11337 * Licensed under the Apache License, Version 2.0 (the "License");
11338 * you may not use this file except in compliance with the License.
11339 * You may obtain a copy of the License at
11341 * http://www.apache.org/licenses/LICENSE-2.0
11343 * Unless required by applicable law or agreed to in writing, software
11344 * distributed under the License is distributed on an "AS IS" BASIS,
11345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11346 * See the License for the specific language governing permissions and
11347 * limitations under the License.
11351 * File: OP_AND_INT_2ADDR.S
11354 /* File: x86-atom/binop2addr.S */
11355 /* Copyright (C) 2008 The Android Open Source Project
11357 * Licensed under the Apache License, Version 2.0 (the "License");
11358 * you may not use this file except in compliance with the License.
11359 * You may obtain a copy of the License at
11361 * http://www.apache.org/licenses/LICENSE-2.0
11363 * Unless required by applicable law or agreed to in writing, software
11364 * distributed under the License is distributed on an "AS IS" BASIS,
11365 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11366 * See the License for the specific language governing permissions and
11367 * limitations under the License.
11371 * File: binop2addr.S
11373 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11374 * "instr" line to specify an instruction that performs
11375 * "%ecx = %ecx op %edx".
11377 * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
11378 * sub-int/2addr, xor-int/2addr
11380 * Description: Perform a binary operation on two sources registers
11381 * and store the result in the first source register
11383 * Format: B|A|op (12x)
11385 * Syntax: op vA, vB
11388 movl rINST, %edx # %edx<- BA
11389 shr $4, %edx # %edx<- B
11390 #FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11392 andl $15, rINST # rINST<- A
11394 GET_VREG %edx # %edx<- vB
11396 andl %edx, (rFP, rINST, 4) # %ecx<- vA op vB
11397 #FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11401 /* ------------------------------ */
11403 .L_OP_OR_INT_2ADDR: /* 0xb6 */
11404 /* File: x86-atom/OP_OR_INT_2ADDR.S */
11405 /* Copyright (C) 2008 The Android Open Source Project
11407 * Licensed under the Apache License, Version 2.0 (the "License");
11408 * you may not use this file except in compliance with the License.
11409 * You may obtain a copy of the License at
11411 * http://www.apache.org/licenses/LICENSE-2.0
11413 * Unless required by applicable law or agreed to in writing, software
11414 * distributed under the License is distributed on an "AS IS" BASIS,
11415 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11416 * See the License for the specific language governing permissions and
11417 * limitations under the License.
11421 * File: OP_OR_INT_2ADDR.S
11424 /* File: x86-atom/binop2addr.S */
11425 /* Copyright (C) 2008 The Android Open Source Project
11427 * Licensed under the Apache License, Version 2.0 (the "License");
11428 * you may not use this file except in compliance with the License.
11429 * You may obtain a copy of the License at
11431 * http://www.apache.org/licenses/LICENSE-2.0
11433 * Unless required by applicable law or agreed to in writing, software
11434 * distributed under the License is distributed on an "AS IS" BASIS,
11435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11436 * See the License for the specific language governing permissions and
11437 * limitations under the License.
11441 * File: binop2addr.S
11443 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11444 * "instr" line to specify an instruction that performs
11445 * "%ecx = %ecx op %edx".
11447 * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
11448 * sub-int/2addr, xor-int/2addr
11450 * Description: Perform a binary operation on two sources registers
11451 * and store the result in the first source register
11453 * Format: B|A|op (12x)
11455 * Syntax: op vA, vB
11458 movl rINST, %edx # %edx<- BA
11459 shr $4, %edx # %edx<- B
11460 #FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11462 andl $15, rINST # rINST<- A
11464 GET_VREG %edx # %edx<- vB
11466 or %edx, (rFP, rINST, 4) # %ecx<- vA op vB
11467 #FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11471 /* ------------------------------ */
11473 .L_OP_XOR_INT_2ADDR: /* 0xb7 */
11474 /* File: x86-atom/OP_XOR_INT_2ADDR.S */
11475 /* Copyright (C) 2008 The Android Open Source Project
11477 * Licensed under the Apache License, Version 2.0 (the "License");
11478 * you may not use this file except in compliance with the License.
11479 * You may obtain a copy of the License at
11481 * http://www.apache.org/licenses/LICENSE-2.0
11483 * Unless required by applicable law or agreed to in writing, software
11484 * distributed under the License is distributed on an "AS IS" BASIS,
11485 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11486 * See the License for the specific language governing permissions and
11487 * limitations under the License.
11491 * File: OP_XOR_INT_2ADDR.S
11494 /* File: x86-atom/binop2addr.S */
11495 /* Copyright (C) 2008 The Android Open Source Project
11497 * Licensed under the Apache License, Version 2.0 (the "License");
11498 * you may not use this file except in compliance with the License.
11499 * You may obtain a copy of the License at
11501 * http://www.apache.org/licenses/LICENSE-2.0
11503 * Unless required by applicable law or agreed to in writing, software
11504 * distributed under the License is distributed on an "AS IS" BASIS,
11505 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11506 * See the License for the specific language governing permissions and
11507 * limitations under the License.
11511 * File: binop2addr.S
11513 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11514 * "instr" line to specify an instruction that performs
11515 * "%ecx = %ecx op %edx".
11517 * For: add-int/2addr, and-int/2addr, mul-int/2addr, or-int/2addr,
11518 * sub-int/2addr, xor-int/2addr
11520 * Description: Perform a binary operation on two sources registers
11521 * and store the result in the first source register
11523 * Format: B|A|op (12x)
11525 * Syntax: op vA, vB
11528 movl rINST, %edx # %edx<- BA
11529 shr $4, %edx # %edx<- B
11530 #FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11532 andl $15, rINST # rINST<- A
11534 GET_VREG %edx # %edx<- vB
11536 xor %edx, (rFP, rINST, 4) # %ecx<- vA op vB
11537 #FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11541 /* ------------------------------ */
11543 .L_OP_SHL_INT_2ADDR: /* 0xb8 */
11544 /* File: x86-atom/OP_SHL_INT_2ADDR.S */
11545 /* Copyright (C) 2008 The Android Open Source Project
11547 * Licensed under the Apache License, Version 2.0 (the "License");
11548 * you may not use this file except in compliance with the License.
11549 * You may obtain a copy of the License at
11551 * http://www.apache.org/licenses/LICENSE-2.0
11553 * Unless required by applicable law or agreed to in writing, software
11554 * distributed under the License is distributed on an "AS IS" BASIS,
11555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11556 * See the License for the specific language governing permissions and
11557 * limitations under the License.
11561 * File: OP_SHL_INT_2ADDR.S
11564 /* File: x86-atom/binopS2addr.S */
11565 /* Copyright (C) 2008 The Android Open Source Project
11567 * Licensed under the Apache License, Version 2.0 (the "License");
11568 * you may not use this file except in compliance with the License.
11569 * You may obtain a copy of the License at
11571 * http://www.apache.org/licenses/LICENSE-2.0
11573 * Unless required by applicable law or agreed to in writing, software
11574 * distributed under the License is distributed on an "AS IS" BASIS,
11575 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11576 * See the License for the specific language governing permissions and
11577 * limitations under the License.
11581 * File: binopS2addr.S
11583 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11584 * "instr" line to specify an instruction that performs
11585 * "%edx = %edx op %cl".
11587 * For: shl-int/2addr, shr-int/2addr, ushr-int/2addr
11589 * Description: Perform a binary operation on two sources registers
11590 * and store the result in the first source register
11592 * Format: B|A|op (12x)
11594 * Syntax: op vA, vB
11597 movl rINST, %ecx # %ecx<- BA
11598 shr $4, %ecx # %ecx<- B
11599 FFETCH_ADV 1, %eax # %ecx<- next i nstruction hi; fetch, advance
11600 andl $15, rINST # rINST<- A
11601 addl $2, rPC # update PC
11602 movl rINST, %edx # %edx<- A
11603 GET_VREG %ecx # %ecx<- vB
11604 GET_VREG %edx # %edx<- vA
11605 sal %cl, %edx # %edx<- vA op vB
11606 SET_VREG %edx, rINST # vAA<- %edx; result
11607 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
11609 /* ------------------------------ */
11611 .L_OP_SHR_INT_2ADDR: /* 0xb9 */
11612 /* File: x86-atom/OP_SHR_INT_2ADDR.S */
11613 /* Copyright (C) 2008 The Android Open Source Project
11615 * Licensed under the Apache License, Version 2.0 (the "License");
11616 * you may not use this file except in compliance with the License.
11617 * You may obtain a copy of the License at
11619 * http://www.apache.org/licenses/LICENSE-2.0
11621 * Unless required by applicable law or agreed to in writing, software
11622 * distributed under the License is distributed on an "AS IS" BASIS,
11623 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11624 * See the License for the specific language governing permissions and
11625 * limitations under the License.
11629 * File: OP_SHR_INT_2ADDR.S
11632 /* File: x86-atom/binopS2addr.S */
11633 /* Copyright (C) 2008 The Android Open Source Project
11635 * Licensed under the Apache License, Version 2.0 (the "License");
11636 * you may not use this file except in compliance with the License.
11637 * You may obtain a copy of the License at
11639 * http://www.apache.org/licenses/LICENSE-2.0
11641 * Unless required by applicable law or agreed to in writing, software
11642 * distributed under the License is distributed on an "AS IS" BASIS,
11643 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11644 * See the License for the specific language governing permissions and
11645 * limitations under the License.
11649 * File: binopS2addr.S
11651 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11652 * "instr" line to specify an instruction that performs
11653 * "%edx = %edx op %cl".
11655 * For: shl-int/2addr, shr-int/2addr, ushr-int/2addr
11657 * Description: Perform a binary operation on two sources registers
11658 * and store the result in the first source register
11660 * Format: B|A|op (12x)
11662 * Syntax: op vA, vB
11665 movl rINST, %ecx # %ecx<- BA
11666 shr $4, %ecx # %ecx<- B
11667 FFETCH_ADV 1, %eax # %ecx<- next i nstruction hi; fetch, advance
11668 andl $15, rINST # rINST<- A
11669 addl $2, rPC # update PC
11670 movl rINST, %edx # %edx<- A
11671 GET_VREG %ecx # %ecx<- vB
11672 GET_VREG %edx # %edx<- vA
11673 sar %cl, %edx # %edx<- vA op vB
11674 SET_VREG %edx, rINST # vAA<- %edx; result
11675 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
11677 /* ------------------------------ */
11679 .L_OP_USHR_INT_2ADDR: /* 0xba */
11680 /* File: x86-atom/OP_USHR_INT_2ADDR.S */
11681 /* Copyright (C) 2008 The Android Open Source Project
11683 * Licensed under the Apache License, Version 2.0 (the "License");
11684 * you may not use this file except in compliance with the License.
11685 * You may obtain a copy of the License at
11687 * http://www.apache.org/licenses/LICENSE-2.0
11689 * Unless required by applicable law or agreed to in writing, software
11690 * distributed under the License is distributed on an "AS IS" BASIS,
11691 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11692 * See the License for the specific language governing permissions and
11693 * limitations under the License.
11697 * File: OP_USHR_INT_2ADDR.S
11700 /* File: x86-atom/binopS2addr.S */
11701 /* Copyright (C) 2008 The Android Open Source Project
11703 * Licensed under the Apache License, Version 2.0 (the "License");
11704 * you may not use this file except in compliance with the License.
11705 * You may obtain a copy of the License at
11707 * http://www.apache.org/licenses/LICENSE-2.0
11709 * Unless required by applicable law or agreed to in writing, software
11710 * distributed under the License is distributed on an "AS IS" BASIS,
11711 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11712 * See the License for the specific language governing permissions and
11713 * limitations under the License.
11717 * File: binopS2addr.S
11719 * Code: Generic 32-bit "/2addr" binary operation. Provides an
11720 * "instr" line to specify an instruction that performs
11721 * "%edx = %edx op %cl".
11723 * For: shl-int/2addr, shr-int/2addr, ushr-int/2addr
11725 * Description: Perform a binary operation on two sources registers
11726 * and store the result in the first source register
11728 * Format: B|A|op (12x)
11730 * Syntax: op vA, vB
11733 movl rINST, %ecx # %ecx<- BA
11734 shr $4, %ecx # %ecx<- B
11735 FFETCH_ADV 1, %eax # %ecx<- next i nstruction hi; fetch, advance
11736 andl $15, rINST # rINST<- A
11737 addl $2, rPC # update PC
11738 movl rINST, %edx # %edx<- A
11739 GET_VREG %ecx # %ecx<- vB
11740 GET_VREG %edx # %edx<- vA
11741 shr %cl, %edx # %edx<- vA op vB
11742 SET_VREG %edx, rINST # vAA<- %edx; result
11743 FGETOP_JMP2 %eax # jump to next instruction; getop, jmp
11745 /* ------------------------------ */
11747 .L_OP_ADD_LONG_2ADDR: /* 0xbb */
11748 /* File: x86-atom/OP_ADD_LONG_2ADDR.S */
11749 /* Copyright (C) 2008 The Android Open Source Project
11751 * Licensed under the Apache License, Version 2.0 (the "License");
11752 * you may not use this file except in compliance with the License.
11753 * You may obtain a copy of the License at
11755 * http://www.apache.org/licenses/LICENSE-2.0
11757 * Unless required by applicable law or agreed to in writing, software
11758 * distributed under the License is distributed on an "AS IS" BASIS,
11759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11760 * See the License for the specific language governing permissions and
11761 * limitations under the License.
11765 * File: OP_ADD_LONG_2ADDR.S
11768 /* File: x86-atom/binopWide2addr.S */
11769 /* Copyright (C) 2008 The Android Open Source Project
11771 * Licensed under the Apache License, Version 2.0 (the "License");
11772 * you may not use this file except in compliance with the License.
11773 * You may obtain a copy of the License at
11775 * http://www.apache.org/licenses/LICENSE-2.0
11777 * Unless required by applicable law or agreed to in writing, software
11778 * distributed under the License is distributed on an "AS IS" BASIS,
11779 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11780 * See the License for the specific language governing permissions and
11781 * limitations under the License.
11785 * File: binopWide2addr.S
11787 * Code: Generic 64-bit "/2addr" binary operation. Provides an
11788 * "instr" line to specify an instruction that performs
11789 * "%xmm0= %xmm0 op %xmm1".
11791 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
11792 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
11794 * Description: Perform a binary operation on two sources registers
11795 * and store the result in the first source register
11797 * Format: B|A|op (12x)
11799 * Syntax: op vA, vB
11802 movl rINST, %edx # %edx<- BA
11803 shr $4, rINST # rINST<- B
11804 andl $15, %edx # %edx<- A
11805 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11806 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
11807 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
11808 paddq %xmm1, %xmm0 # %xmm0<- vA op vB
11809 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
11810 #FINISH 1 # jump to next instruction
11811 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11813 /* ------------------------------ */
11815 .L_OP_SUB_LONG_2ADDR: /* 0xbc */
11816 /* File: x86-atom/OP_SUB_LONG_2ADDR.S */
11817 /* Copyright (C) 2008 The Android Open Source Project
11819 * Licensed under the Apache License, Version 2.0 (the "License");
11820 * you may not use this file except in compliance with the License.
11821 * You may obtain a copy of the License at
11823 * http://www.apache.org/licenses/LICENSE-2.0
11825 * Unless required by applicable law or agreed to in writing, software
11826 * distributed under the License is distributed on an "AS IS" BASIS,
11827 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11828 * See the License for the specific language governing permissions and
11829 * limitations under the License.
11833 * File: OP_SUB_LONG_2ADDR.S
11836 /* File: x86-atom/binopWide2addr.S */
11837 /* Copyright (C) 2008 The Android Open Source Project
11839 * Licensed under the Apache License, Version 2.0 (the "License");
11840 * you may not use this file except in compliance with the License.
11841 * You may obtain a copy of the License at
11843 * http://www.apache.org/licenses/LICENSE-2.0
11845 * Unless required by applicable law or agreed to in writing, software
11846 * distributed under the License is distributed on an "AS IS" BASIS,
11847 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11848 * See the License for the specific language governing permissions and
11849 * limitations under the License.
11853 * File: binopWide2addr.S
11855 * Code: Generic 64-bit "/2addr" binary operation. Provides an
11856 * "instr" line to specify an instruction that performs
11857 * "%xmm0= %xmm0 op %xmm1".
11859 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
11860 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
11862 * Description: Perform a binary operation on two sources registers
11863 * and store the result in the first source register
11865 * Format: B|A|op (12x)
11867 * Syntax: op vA, vB
11870 movl rINST, %edx # %edx<- BA
11871 shr $4, rINST # rINST<- B
11872 andl $15, %edx # %edx<- A
11873 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
11874 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
11875 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
11876 psubq %xmm1, %xmm0 # %xmm0<- vA op vB
11877 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
11878 #FINISH 1 # jump to next instruction
11879 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
11881 /* ------------------------------ */
11883 .L_OP_MUL_LONG_2ADDR: /* 0xbd */
11884 /* File: x86-atom/OP_MUL_LONG_2ADDR.S */
11885 /* Copyright (C) 2008 The Android Open Source Project
11887 * Licensed under the Apache License, Version 2.0 (the "License");
11888 * you may not use this file except in compliance with the License.
11889 * You may obtain a copy of the License at
11891 * http://www.apache.org/licenses/LICENSE-2.0
11893 * Unless required by applicable law or agreed to in writing, software
11894 * distributed under the License is distributed on an "AS IS" BASIS,
11895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11896 * See the License for the specific language governing permissions and
11897 * limitations under the License.
11901 * File: OP_MUL_LONG_2ADDR.S
11903 * Code: 64-bit integer multiply
11905 * For: mul-long/2addr
11907 * Description: Multiply two sources registers and store the result
11908 * in the first source register.
11910 * Format: B|A|op (12x)
11912 * Syntax: op vA, vB
11916 * Signed 64-bit integer multiply.
11918 * Consider WXxYZ (r1r0 x r3r2) with a long multiply:
11925 * The low word of the result holds ZX, the high word holds
11926 * (ZW+YX) + (the high overflow from ZX). YW doesn't matter because
11927 * it doesn't fit in the low 64 bits.
11930 movl rINST, %edx # %edx<- BA+
11931 shr $4, rINST # rINST<- B
11932 andl $15, %edx # %edx<- A
11933 movl %edx, sReg0 # sReg0<- A
11934 jmp .LOP_MUL_LONG_2ADDR_finish
11936 /* ------------------------------ */
11938 .L_OP_DIV_LONG_2ADDR: /* 0xbe */
11939 /* File: x86-atom/OP_DIV_LONG_2ADDR.S */
11940 /* Copyright (C) 2008 The Android Open Source Project
11942 * Licensed under the Apache License, Version 2.0 (the "License");
11943 * you may not use this file except in compliance with the License.
11944 * You may obtain a copy of the License at
11946 * http://www.apache.org/licenses/LICENSE-2.0
11948 * Unless required by applicable law or agreed to in writing, software
11949 * distributed under the License is distributed on an "AS IS" BASIS,
11950 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11951 * See the License for the specific language governing permissions and
11952 * limitations under the License.
11956 * File: OP_DIV_LONG_2ADDR.S
11959 /* File: x86-atom/binopDivRemLong2Addr.S */
11960 /* Copyright (C) 2008 The Android Open Source Project
11962 * Licensed under the Apache License, Version 2.0 (the "License");
11963 * you may not use this file except in compliance with the License.
11964 * You may obtain a copy of the License at
11966 * http://www.apache.org/licenses/LICENSE-2.0
11968 * Unless required by applicable law or agreed to in writing, software
11969 * distributed under the License is distributed on an "AS IS" BASIS,
11970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11971 * See the License for the specific language governing permissions and
11972 * limitations under the License.
11976 * File: binopDivRemLong2Addr.S
11978 * Code: 64-bit "/2addr" long divide operation. Variable
11979 * "func" defines the function called to do the operation.
11981 * For: div-long/2addr, rem-long/2addr
11983 * Description: Perform a binary operation on two sources registers
11984 * and store the result in the first source register.
11986 * Format: B|A|op (12x)
11988 * Syntax: op vA, vB
11992 movl rINST, %edx # %edx<- BA
11993 shr $4, %edx # %edx<- B
11994 and $15, rINST # rINST<- A
11995 movl (rFP, %edx, 4), %eax # %eax<- vB
11996 movl %eax, -12(%esp) # push arg vB
11997 movl 4(rFP, %edx, 4), %ecx # %ecx<- vB+1
11998 or %ecx, %eax # check for divide by zero
11999 je common_errDivideByZero # handle divide by zero
12000 movl %ecx, -8(%esp) # push arg vB+1
12001 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vA,vA+1
12002 jmp .LOP_DIV_LONG_2ADDR_break
12005 /* ------------------------------ */
12007 .L_OP_REM_LONG_2ADDR: /* 0xbf */
12008 /* File: x86-atom/OP_REM_LONG_2ADDR.S */
12009 /* Copyright (C) 2008 The Android Open Source Project
12011 * Licensed under the Apache License, Version 2.0 (the "License");
12012 * you may not use this file except in compliance with the License.
12013 * You may obtain a copy of the License at
12015 * http://www.apache.org/licenses/LICENSE-2.0
12017 * Unless required by applicable law or agreed to in writing, software
12018 * distributed under the License is distributed on an "AS IS" BASIS,
12019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12020 * See the License for the specific language governing permissions and
12021 * limitations under the License.
12025 * File: OP_REM_LONG_2ADDR.S
12028 /* File: x86-atom/binopDivRemLong2Addr.S */
12029 /* Copyright (C) 2008 The Android Open Source Project
12031 * Licensed under the Apache License, Version 2.0 (the "License");
12032 * you may not use this file except in compliance with the License.
12033 * You may obtain a copy of the License at
12035 * http://www.apache.org/licenses/LICENSE-2.0
12037 * Unless required by applicable law or agreed to in writing, software
12038 * distributed under the License is distributed on an "AS IS" BASIS,
12039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12040 * See the License for the specific language governing permissions and
12041 * limitations under the License.
12045 * File: binopDivRemLong2Addr.S
12047 * Code: 64-bit "/2addr" long divide operation. Variable
12048 * "func" defines the function called to do the operation.
12050 * For: div-long/2addr, rem-long/2addr
12052 * Description: Perform a binary operation on two sources registers
12053 * and store the result in the first source register.
12055 * Format: B|A|op (12x)
12057 * Syntax: op vA, vB
12061 movl rINST, %edx # %edx<- BA
12062 shr $4, %edx # %edx<- B
12063 and $15, rINST # rINST<- A
12064 movl (rFP, %edx, 4), %eax # %eax<- vB
12065 movl %eax, -12(%esp) # push arg vB
12066 movl 4(rFP, %edx, 4), %ecx # %ecx<- vB+1
12067 or %ecx, %eax # check for divide by zero
12068 je common_errDivideByZero # handle divide by zero
12069 movl %ecx, -8(%esp) # push arg vB+1
12070 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vA,vA+1
12071 jmp .LOP_REM_LONG_2ADDR_break
12074 /* ------------------------------ */
12076 .L_OP_AND_LONG_2ADDR: /* 0xc0 */
12077 /* File: x86-atom/OP_AND_LONG_2ADDR.S */
12078 /* Copyright (C) 2008 The Android Open Source Project
12080 * Licensed under the Apache License, Version 2.0 (the "License");
12081 * you may not use this file except in compliance with the License.
12082 * You may obtain a copy of the License at
12084 * http://www.apache.org/licenses/LICENSE-2.0
12086 * Unless required by applicable law or agreed to in writing, software
12087 * distributed under the License is distributed on an "AS IS" BASIS,
12088 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12089 * See the License for the specific language governing permissions and
12090 * limitations under the License.
12094 * File: OP_AND_LONG_2ADDR.S
12097 /* File: x86-atom/binopWide2addr.S */
12098 /* Copyright (C) 2008 The Android Open Source Project
12100 * Licensed under the Apache License, Version 2.0 (the "License");
12101 * you may not use this file except in compliance with the License.
12102 * You may obtain a copy of the License at
12104 * http://www.apache.org/licenses/LICENSE-2.0
12106 * Unless required by applicable law or agreed to in writing, software
12107 * distributed under the License is distributed on an "AS IS" BASIS,
12108 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12109 * See the License for the specific language governing permissions and
12110 * limitations under the License.
12114 * File: binopWide2addr.S
12116 * Code: Generic 64-bit "/2addr" binary operation. Provides an
12117 * "instr" line to specify an instruction that performs
12118 * "%xmm0= %xmm0 op %xmm1".
12120 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
12121 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
12123 * Description: Perform a binary operation on two sources registers
12124 * and store the result in the first source register
12126 * Format: B|A|op (12x)
12128 * Syntax: op vA, vB
12131 movl rINST, %edx # %edx<- BA
12132 shr $4, rINST # rINST<- B
12133 andl $15, %edx # %edx<- A
12134 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
12135 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12136 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
12137 pand %xmm1, %xmm0 # %xmm0<- vA op vB
12138 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
12139 #FINISH 1 # jump to next instruction
12140 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
12142 /* ------------------------------ */
12144 .L_OP_OR_LONG_2ADDR: /* 0xc1 */
12145 /* File: x86-atom/OP_OR_LONG_2ADDR.S */
12146 /* Copyright (C) 2008 The Android Open Source Project
12148 * Licensed under the Apache License, Version 2.0 (the "License");
12149 * you may not use this file except in compliance with the License.
12150 * You may obtain a copy of the License at
12152 * http://www.apache.org/licenses/LICENSE-2.0
12154 * Unless required by applicable law or agreed to in writing, software
12155 * distributed under the License is distributed on an "AS IS" BASIS,
12156 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12157 * See the License for the specific language governing permissions and
12158 * limitations under the License.
12162 * File: OP_OR_LONG_2ADDR.S
12165 /* File: x86-atom/binopWide2addr.S */
12166 /* Copyright (C) 2008 The Android Open Source Project
12168 * Licensed under the Apache License, Version 2.0 (the "License");
12169 * you may not use this file except in compliance with the License.
12170 * You may obtain a copy of the License at
12172 * http://www.apache.org/licenses/LICENSE-2.0
12174 * Unless required by applicable law or agreed to in writing, software
12175 * distributed under the License is distributed on an "AS IS" BASIS,
12176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12177 * See the License for the specific language governing permissions and
12178 * limitations under the License.
12182 * File: binopWide2addr.S
12184 * Code: Generic 64-bit "/2addr" binary operation. Provides an
12185 * "instr" line to specify an instruction that performs
12186 * "%xmm0= %xmm0 op %xmm1".
12188 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
12189 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
12191 * Description: Perform a binary operation on two sources registers
12192 * and store the result in the first source register
12194 * Format: B|A|op (12x)
12196 * Syntax: op vA, vB
12199 movl rINST, %edx # %edx<- BA
12200 shr $4, rINST # rINST<- B
12201 andl $15, %edx # %edx<- A
12202 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
12203 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12204 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
12205 por %xmm1, %xmm0 # %xmm0<- vA op vB
12206 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
12207 #FINISH 1 # jump to next instruction
12208 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
12210 /* ------------------------------ */
12212 .L_OP_XOR_LONG_2ADDR: /* 0xc2 */
12213 /* File: x86-atom/OP_XOR_LONG_2ADDR.S */
12214 /* Copyright (C) 2008 The Android Open Source Project
12216 * Licensed under the Apache License, Version 2.0 (the "License");
12217 * you may not use this file except in compliance with the License.
12218 * You may obtain a copy of the License at
12220 * http://www.apache.org/licenses/LICENSE-2.0
12222 * Unless required by applicable law or agreed to in writing, software
12223 * distributed under the License is distributed on an "AS IS" BASIS,
12224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12225 * See the License for the specific language governing permissions and
12226 * limitations under the License.
12230 * File: OP_XOR_LONG_2ADDR.S
12233 /* File: x86-atom/binopWide2addr.S */
12234 /* Copyright (C) 2008 The Android Open Source Project
12236 * Licensed under the Apache License, Version 2.0 (the "License");
12237 * you may not use this file except in compliance with the License.
12238 * You may obtain a copy of the License at
12240 * http://www.apache.org/licenses/LICENSE-2.0
12242 * Unless required by applicable law or agreed to in writing, software
12243 * distributed under the License is distributed on an "AS IS" BASIS,
12244 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12245 * See the License for the specific language governing permissions and
12246 * limitations under the License.
12250 * File: binopWide2addr.S
12252 * Code: Generic 64-bit "/2addr" binary operation. Provides an
12253 * "instr" line to specify an instruction that performs
12254 * "%xmm0= %xmm0 op %xmm1".
12256 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
12257 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
12259 * Description: Perform a binary operation on two sources registers
12260 * and store the result in the first source register
12262 * Format: B|A|op (12x)
12264 * Syntax: op vA, vB
12267 movl rINST, %edx # %edx<- BA
12268 shr $4, rINST # rINST<- B
12269 andl $15, %edx # %edx<- A
12270 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
12271 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12272 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
12273 pxor %xmm1, %xmm0 # %xmm0<- vA op vB
12274 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
12275 #FINISH 1 # jump to next instruction
12276 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
12278 /* ------------------------------ */
12280 .L_OP_SHL_LONG_2ADDR: /* 0xc3 */
12281 /* File: x86-atom/OP_SHL_LONG_2ADDR.S */
12282 /* Copyright (C) 2008 The Android Open Source Project
12284 * Licensed under the Apache License, Version 2.0 (the "License");
12285 * you may not use this file except in compliance with the License.
12286 * You may obtain a copy of the License at
12288 * http://www.apache.org/licenses/LICENSE-2.0
12290 * Unless required by applicable law or agreed to in writing, software
12291 * distributed under the License is distributed on an "AS IS" BASIS,
12292 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12293 * See the License for the specific language governing permissions and
12294 * limitations under the License.
12298 * File: OP_SHL_LONG_2ADDR.S
12300 * Code: Performs a shift left long. Uses no substitutions.
12302 * For: shl-long/2addr
12304 * Description: Perform a binary shift operation using two source registers
12305 * where the fist is the value to shift and the second is the
12306 * shift amount. Store the result in the first source register.
12308 * Format: B|A|op (12x)
12310 * Syntax: op vA, vB
12313 movl rINST, %edx # %edx<- BA
12314 shr $4, %edx # %edx<- B
12315 andl $15, rINST # rINST<- A
12316 movss (rFP, %edx, 4), %xmm0 # %xmm0<- vB
12317 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vA
12318 movq .LshiftMask, %xmm2 # %xmm2<- mask for the shift bits
12319 pand %xmm2, %xmm0 # %xmm0<- masked shift bits
12320 psllq %xmm0, %xmm1 # %xmm1<- shifted vA
12321 movq %xmm1, (rFP, rINST, 4) # vA<- shifted vA
12322 FINISH 1 # jump to next instruction
12324 /* ------------------------------ */
12326 .L_OP_SHR_LONG_2ADDR: /* 0xc4 */
12327 /* File: x86-atom/OP_SHR_LONG_2ADDR.S */
12328 /* Copyright (C) 2008 The Android Open Source Project
12330 * Licensed under the Apache License, Version 2.0 (the "License");
12331 * you may not use this file except in compliance with the License.
12332 * You may obtain a copy of the License at
12334 * http://www.apache.org/licenses/LICENSE-2.0
12336 * Unless required by applicable law or agreed to in writing, software
12337 * distributed under the License is distributed on an "AS IS" BASIS,
12338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12339 * See the License for the specific language governing permissions and
12340 * limitations under the License.
12344 * File: OP_SHR_LONG_2ADDR.S
12346 * Code: Performs a shift left long
12348 * For: shl-long/2addr
12350 * Description: Perform a binary shift operation using two source registers
12351 * where the fist is the value to shift and the second is the
12352 * shift amount. Store the result in the first source register.
12354 * Format: B|A|op (12x)
12356 * Syntax: op vA, vB
12359 movl rINST, %edx # %edx<- BA
12360 shr $4, %edx # %edx<- B
12361 andl $15, rINST # rINST<- BA
12362 movss (rFP, %edx, 4), %xmm0 # %xmm0<- vB
12363 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vA
12364 movq .LshiftMask, %xmm2
12365 pand %xmm2, %xmm0 # %xmm0<- masked for the shift bits
12366 psrlq %xmm0, %xmm1 # %xmm1<- shifted vBB
12367 cmpl $0, 4(rFP, rINST, 4) # check if we need to consider sign
12368 jl .LOP_SHR_LONG_2ADDR_finish # consider sign
12369 jmp .LOP_SHR_LONG_2ADDR_final # sign is fine, finish
12371 /* ------------------------------ */
12373 .L_OP_USHR_LONG_2ADDR: /* 0xc5 */
12374 /* File: x86-atom/OP_USHR_LONG_2ADDR.S */
12375 /* Copyright (C) 2008 The Android Open Source Project
12377 * Licensed under the Apache License, Version 2.0 (the "License");
12378 * you may not use this file except in compliance with the License.
12379 * You may obtain a copy of the License at
12381 * http://www.apache.org/licenses/LICENSE-2.0
12383 * Unless required by applicable law or agreed to in writing, software
12384 * distributed under the License is distributed on an "AS IS" BASIS,
12385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12386 * See the License for the specific language governing permissions and
12387 * limitations under the License.
12391 * File: OP_USHR_LONG_2ADDR.S
12393 * Code: Performs an unsigned shift right long operation. Uses no substiutions.
12395 * For: ushr-long/2addr
12397 * Description: Perform a binary shift operation using two source registers
12398 * where the fist is the value to shift and the second is the
12399 * shift amount. Store the result in the first source register.
12401 * Format: B|A|op (12x)
12403 * Syntax: op vA, vB
12406 movl rINST, %edx # %edx<- BA
12407 shr $4, %edx # %edx<- B
12408 andl $15, rINST # rINST<- A
12409 movq .LshiftMask, %xmm2 # %xmm2<- mask for the shift bits
12410 movss (rFP, %edx, 4), %xmm0 # %xmm0<- vB
12411 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vA
12412 pand %xmm2, %xmm0 # %xmm0<- masked shift bits
12413 psrlq %xmm0, %xmm1 # %xmm1<- shifted vA
12414 movq %xmm1, (rFP, rINST, 4) # vA<- shifted vA
12415 FINISH 1 # jump to next instruction
12417 /* ------------------------------ */
12419 .L_OP_ADD_FLOAT_2ADDR: /* 0xc6 */
12420 /* File: x86-atom/OP_ADD_FLOAT_2ADDR.S */
12421 /* Copyright (C) 2008 The Android Open Source Project
12423 * Licensed under the Apache License, Version 2.0 (the "License");
12424 * you may not use this file except in compliance with the License.
12425 * You may obtain a copy of the License at
12427 * http://www.apache.org/licenses/LICENSE-2.0
12429 * Unless required by applicable law or agreed to in writing, software
12430 * distributed under the License is distributed on an "AS IS" BASIS,
12431 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12432 * See the License for the specific language governing permissions and
12433 * limitations under the License.
12437 * File: OP_ADD_FLOAT_2ADDR.S
12440 /* File: x86-atom/binopF2addr.S */
12441 /* Copyright (C) 2008 The Android Open Source Project
12443 * Licensed under the Apache License, Version 2.0 (the "License");
12444 * you may not use this file except in compliance with the License.
12445 * You may obtain a copy of the License at
12447 * http://www.apache.org/licenses/LICENSE-2.0
12449 * Unless required by applicable law or agreed to in writing, software
12450 * distributed under the License is distributed on an "AS IS" BASIS,
12451 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12452 * See the License for the specific language governing permissions and
12453 * limitations under the License.
12457 * File: binopF2addr.S
12459 * Code: Generic 32-bit "/2addr" binary operation. Provides an
12460 * "instr" line to specify an instruction that performs
12461 * "%xmm0 = %xmm0 op %xmm1".
12463 * For: add-float/2addr, mul-float/2addr, sub-float/2addr
12465 * Description: Perform a binary operation on two sources registers
12466 * and store the result in the first source register
12468 * Format: B|A|op (12x)
12470 * Syntax: op vA, vB
12473 movl rINST, %ecx # %ecx<- BA
12474 andl $15, %ecx # %ecx<- A
12475 shr $4, rINST # rINST<- B
12476 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
12477 movss (rFP, %ecx, 4), %xmm0 # %xmm0<- vA
12478 movss (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12479 addss %xmm1, %xmm0 # %xmm0<- vA op vB
12480 movss %xmm0, (rFP, %ecx, 4) # vA<- %xmm0; result
12481 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
12483 /* ------------------------------ */
12485 .L_OP_SUB_FLOAT_2ADDR: /* 0xc7 */
12486 /* File: x86-atom/OP_SUB_FLOAT_2ADDR.S */
12487 /* Copyright (C) 2008 The Android Open Source Project
12489 * Licensed under the Apache License, Version 2.0 (the "License");
12490 * you may not use this file except in compliance with the License.
12491 * You may obtain a copy of the License at
12493 * http://www.apache.org/licenses/LICENSE-2.0
12495 * Unless required by applicable law or agreed to in writing, software
12496 * distributed under the License is distributed on an "AS IS" BASIS,
12497 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12498 * See the License for the specific language governing permissions and
12499 * limitations under the License.
12503 * File: OP_SUB_FLOAT_2ADDR.S
12506 /* File: x86-atom/binopF2addr.S */
12507 /* Copyright (C) 2008 The Android Open Source Project
12509 * Licensed under the Apache License, Version 2.0 (the "License");
12510 * you may not use this file except in compliance with the License.
12511 * You may obtain a copy of the License at
12513 * http://www.apache.org/licenses/LICENSE-2.0
12515 * Unless required by applicable law or agreed to in writing, software
12516 * distributed under the License is distributed on an "AS IS" BASIS,
12517 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12518 * See the License for the specific language governing permissions and
12519 * limitations under the License.
12523 * File: binopF2addr.S
12525 * Code: Generic 32-bit "/2addr" binary operation. Provides an
12526 * "instr" line to specify an instruction that performs
12527 * "%xmm0 = %xmm0 op %xmm1".
12529 * For: add-float/2addr, mul-float/2addr, sub-float/2addr
12531 * Description: Perform a binary operation on two sources registers
12532 * and store the result in the first source register
12534 * Format: B|A|op (12x)
12536 * Syntax: op vA, vB
12539 movl rINST, %ecx # %ecx<- BA
12540 andl $15, %ecx # %ecx<- A
12541 shr $4, rINST # rINST<- B
12542 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
12543 movss (rFP, %ecx, 4), %xmm0 # %xmm0<- vA
12544 movss (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12545 subss %xmm1, %xmm0 # %xmm0<- vA op vB
12546 movss %xmm0, (rFP, %ecx, 4) # vA<- %xmm0; result
12547 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
12549 /* ------------------------------ */
12551 .L_OP_MUL_FLOAT_2ADDR: /* 0xc8 */
12552 /* File: x86-atom/OP_MUL_FLOAT_2ADDR.S */
12553 /* Copyright (C) 2008 The Android Open Source Project
12555 * Licensed under the Apache License, Version 2.0 (the "License");
12556 * you may not use this file except in compliance with the License.
12557 * You may obtain a copy of the License at
12559 * http://www.apache.org/licenses/LICENSE-2.0
12561 * Unless required by applicable law or agreed to in writing, software
12562 * distributed under the License is distributed on an "AS IS" BASIS,
12563 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12564 * See the License for the specific language governing permissions and
12565 * limitations under the License.
12569 * File: OP_MUL_FLOAT_2ADDR.S
12572 /* File: x86-atom/binopF2addr.S */
12573 /* Copyright (C) 2008 The Android Open Source Project
12575 * Licensed under the Apache License, Version 2.0 (the "License");
12576 * you may not use this file except in compliance with the License.
12577 * You may obtain a copy of the License at
12579 * http://www.apache.org/licenses/LICENSE-2.0
12581 * Unless required by applicable law or agreed to in writing, software
12582 * distributed under the License is distributed on an "AS IS" BASIS,
12583 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12584 * See the License for the specific language governing permissions and
12585 * limitations under the License.
12589 * File: binopF2addr.S
12591 * Code: Generic 32-bit "/2addr" binary operation. Provides an
12592 * "instr" line to specify an instruction that performs
12593 * "%xmm0 = %xmm0 op %xmm1".
12595 * For: add-float/2addr, mul-float/2addr, sub-float/2addr
12597 * Description: Perform a binary operation on two sources registers
12598 * and store the result in the first source register
12600 * Format: B|A|op (12x)
12602 * Syntax: op vA, vB
12605 movl rINST, %ecx # %ecx<- BA
12606 andl $15, %ecx # %ecx<- A
12607 shr $4, rINST # rINST<- B
12608 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
12609 movss (rFP, %ecx, 4), %xmm0 # %xmm0<- vA
12610 movss (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12611 mulss %xmm1, %xmm0 # %xmm0<- vA op vB
12612 movss %xmm0, (rFP, %ecx, 4) # vA<- %xmm0; result
12613 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
12615 /* ------------------------------ */
12617 .L_OP_DIV_FLOAT_2ADDR: /* 0xc9 */
12618 /* File: x86-atom/OP_DIV_FLOAT_2ADDR.S */
12619 /* Copyright (C) 2008 The Android Open Source Project
12621 * Licensed under the Apache License, Version 2.0 (the "License");
12622 * you may not use this file except in compliance with the License.
12623 * You may obtain a copy of the License at
12625 * http://www.apache.org/licenses/LICENSE-2.0
12627 * Unless required by applicable law or agreed to in writing, software
12628 * distributed under the License is distributed on an "AS IS" BASIS,
12629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12630 * See the License for the specific language governing permissions and
12631 * limitations under the License.
12635 * File: OP_DIV_FLOAT_2ADDR.S
12637 * Code: Divides floats. Uses no substitutions.
12639 * For: div-float/2addr
12641 * Description: Divide operation on two source registers, storing
12642 * the result in the first source reigster
12644 * Format: B|A|op (12x)
12646 * Syntax: op vA, vB
12649 movl rINST, %ecx # %ecx<- BA
12650 andl $15, %ecx # %ecx<- A
12651 shr $4, rINST # rINST<- B
12652 flds (rFP, %ecx, 4) # %xmm0<- vA
12653 fdivs (rFP, rINST, 4) # divide double; vA/vB
12654 fstps (rFP, %ecx, 4) # vAA<- result
12655 FINISH 1 # jump to next instruction
12657 /* ------------------------------ */
12659 .L_OP_REM_FLOAT_2ADDR: /* 0xca */
12660 /* File: x86-atom/OP_REM_FLOAT_2ADDR.S */
12661 /* Copyright (C) 2008 The Android Open Source Project
12663 * Licensed under the Apache License, Version 2.0 (the "License");
12664 * you may not use this file except in compliance with the License.
12665 * You may obtain a copy of the License at
12667 * http://www.apache.org/licenses/LICENSE-2.0
12669 * Unless required by applicable law or agreed to in writing, software
12670 * distributed under the License is distributed on an "AS IS" BASIS,
12671 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12672 * See the License for the specific language governing permissions and
12673 * limitations under the License.
12677 * File: OP_REM_FLOAT_2ADDR.S
12679 * Code: Computes the remainder of a division. Performs no substitutions.
12681 * For: rem-float/2addr
12683 * Description: Calls fmod to compute the remainder of the result of dividing a
12684 * source register by a second, and stores the result in the first
12687 * Format: B|A|op (12x)
12689 * Syntax: op vA, vB
12692 movl rINST, %edx # %edx<- BA
12693 shr $4, %edx # %edx<- B
12694 andl $15, rINST # rINST<- A
12695 GET_VREG %edx # %edx<- vB
12696 movl (rFP, rINST, 4), %ecx # %ecx<- vA
12697 movl %ecx, -8(%esp) # push parameter vA
12698 movl %edx, -4(%esp) # push parameter vB
12700 call fmodf # call: (float x, float y)
12703 fstps (rFP, rINST, 4)
12704 FINISH 1 # jump to next instruction
12706 /* ------------------------------ */
12708 .L_OP_ADD_DOUBLE_2ADDR: /* 0xcb */
12709 /* File: x86-atom/OP_ADD_DOUBLE_2ADDR.S */
12710 /* Copyright (C) 2008 The Android Open Source Project
12712 * Licensed under the Apache License, Version 2.0 (the "License");
12713 * you may not use this file except in compliance with the License.
12714 * You may obtain a copy of the License at
12716 * http://www.apache.org/licenses/LICENSE-2.0
12718 * Unless required by applicable law or agreed to in writing, software
12719 * distributed under the License is distributed on an "AS IS" BASIS,
12720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12721 * See the License for the specific language governing permissions and
12722 * limitations under the License.
12726 * File: OP_ADD_DOUBLE_2ADDR.S
12729 /* File: x86-atom/binopWide2addr.S */
12730 /* Copyright (C) 2008 The Android Open Source Project
12732 * Licensed under the Apache License, Version 2.0 (the "License");
12733 * you may not use this file except in compliance with the License.
12734 * You may obtain a copy of the License at
12736 * http://www.apache.org/licenses/LICENSE-2.0
12738 * Unless required by applicable law or agreed to in writing, software
12739 * distributed under the License is distributed on an "AS IS" BASIS,
12740 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12741 * See the License for the specific language governing permissions and
12742 * limitations under the License.
12746 * File: binopWide2addr.S
12748 * Code: Generic 64-bit "/2addr" binary operation. Provides an
12749 * "instr" line to specify an instruction that performs
12750 * "%xmm0= %xmm0 op %xmm1".
12752 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
12753 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
12755 * Description: Perform a binary operation on two sources registers
12756 * and store the result in the first source register
12758 * Format: B|A|op (12x)
12760 * Syntax: op vA, vB
12763 movl rINST, %edx # %edx<- BA
12764 shr $4, rINST # rINST<- B
12765 andl $15, %edx # %edx<- A
12766 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
12767 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12768 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
12769 addsd %xmm1, %xmm0 # %xmm0<- vA op vB
12770 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
12771 #FINISH 1 # jump to next instruction
12772 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
12774 /* ------------------------------ */
12776 .L_OP_SUB_DOUBLE_2ADDR: /* 0xcc */
12777 /* File: x86-atom/OP_SUB_DOUBLE_2ADDR.S */
12778 /* Copyright (C) 2008 The Android Open Source Project
12780 * Licensed under the Apache License, Version 2.0 (the "License");
12781 * you may not use this file except in compliance with the License.
12782 * You may obtain a copy of the License at
12784 * http://www.apache.org/licenses/LICENSE-2.0
12786 * Unless required by applicable law or agreed to in writing, software
12787 * distributed under the License is distributed on an "AS IS" BASIS,
12788 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12789 * See the License for the specific language governing permissions and
12790 * limitations under the License.
12794 * File: OP_SUB_DOUBLE_2ADDR.S
12797 /* File: x86-atom/binopWide2addr.S */
12798 /* Copyright (C) 2008 The Android Open Source Project
12800 * Licensed under the Apache License, Version 2.0 (the "License");
12801 * you may not use this file except in compliance with the License.
12802 * You may obtain a copy of the License at
12804 * http://www.apache.org/licenses/LICENSE-2.0
12806 * Unless required by applicable law or agreed to in writing, software
12807 * distributed under the License is distributed on an "AS IS" BASIS,
12808 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12809 * See the License for the specific language governing permissions and
12810 * limitations under the License.
12814 * File: binopWide2addr.S
12816 * Code: Generic 64-bit "/2addr" binary operation. Provides an
12817 * "instr" line to specify an instruction that performs
12818 * "%xmm0= %xmm0 op %xmm1".
12820 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
12821 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
12823 * Description: Perform a binary operation on two sources registers
12824 * and store the result in the first source register
12826 * Format: B|A|op (12x)
12828 * Syntax: op vA, vB
12831 movl rINST, %edx # %edx<- BA
12832 shr $4, rINST # rINST<- B
12833 andl $15, %edx # %edx<- A
12834 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
12835 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12836 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
12837 subsd %xmm1, %xmm0 # %xmm0<- vA op vB
12838 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
12839 #FINISH 1 # jump to next instruction
12840 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
12842 /* ------------------------------ */
12844 .L_OP_MUL_DOUBLE_2ADDR: /* 0xcd */
12845 /* File: x86-atom/OP_MUL_DOUBLE_2ADDR.S */
12846 /* Copyright (C) 2008 The Android Open Source Project
12848 * Licensed under the Apache License, Version 2.0 (the "License");
12849 * you may not use this file except in compliance with the License.
12850 * You may obtain a copy of the License at
12852 * http://www.apache.org/licenses/LICENSE-2.0
12854 * Unless required by applicable law or agreed to in writing, software
12855 * distributed under the License is distributed on an "AS IS" BASIS,
12856 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12857 * See the License for the specific language governing permissions and
12858 * limitations under the License.
12862 * File: OP_MUL_DOUBLE_2ADDR.S
12865 /* File: x86-atom/binopWide2addr.S */
12866 /* Copyright (C) 2008 The Android Open Source Project
12868 * Licensed under the Apache License, Version 2.0 (the "License");
12869 * you may not use this file except in compliance with the License.
12870 * You may obtain a copy of the License at
12872 * http://www.apache.org/licenses/LICENSE-2.0
12874 * Unless required by applicable law or agreed to in writing, software
12875 * distributed under the License is distributed on an "AS IS" BASIS,
12876 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12877 * See the License for the specific language governing permissions and
12878 * limitations under the License.
12882 * File: binopWide2addr.S
12884 * Code: Generic 64-bit "/2addr" binary operation. Provides an
12885 * "instr" line to specify an instruction that performs
12886 * "%xmm0= %xmm0 op %xmm1".
12888 * For: add-double/2addr, add-long/2addr, and-long/2addr, mul-long/2addr,
12889 * or-long/2addr, sub-double/2addr, sub-long/2addr, xor-long/2addr
12891 * Description: Perform a binary operation on two sources registers
12892 * and store the result in the first source register
12894 * Format: B|A|op (12x)
12896 * Syntax: op vA, vB
12899 movl rINST, %edx # %edx<- BA
12900 shr $4, rINST # rINST<- B
12901 andl $15, %edx # %edx<- A
12902 FFETCH_ADV 1, %eax # %eax<- next instruction hi; fetch, advance
12903 movq (rFP, rINST, 4), %xmm1 # %xmm1<- vB
12904 movq (rFP, %edx, 4), %xmm0 # %xmm0<- vA
12905 mulsd %xmm1, %xmm0 # %xmm0<- vA op vB
12906 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; result
12907 #FINISH 1 # jump to next instruction
12908 FGETOP_JMP 1, %eax # jump to next instruction; getop, jmp
12910 /* ------------------------------ */
12912 .L_OP_DIV_DOUBLE_2ADDR: /* 0xce */
12913 /* File: x86-atom/OP_DIV_DOUBLE_2ADDR.S */
12914 /* Copyright (C) 2008 The Android Open Source Project
12916 * Licensed under the Apache License, Version 2.0 (the "License");
12917 * you may not use this file except in compliance with the License.
12918 * You may obtain a copy of the License at
12920 * http://www.apache.org/licenses/LICENSE-2.0
12922 * Unless required by applicable law or agreed to in writing, software
12923 * distributed under the License is distributed on an "AS IS" BASIS,
12924 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12925 * See the License for the specific language governing permissions and
12926 * limitations under the License.
12930 * File: OP_DIV_DOUBLE_2ADDR.S
12932 * Code: Divides doubles. Uses no substitutions.
12934 * For: div-double/2addr
12936 * Description: Divide operation on two source registers, storing
12937 * the result in the first source reigster
12939 * Format: B|A|op (12x)
12941 * Syntax: op vA, vB
12944 movl rINST, %edx # %edx<- BA
12945 andl $15, %edx # %edx<- A
12946 shr $4, rINST # rINST<- B
12947 fldl (rFP, %edx, 4) # %xmm0<- vA
12948 fdivl (rFP, rINST, 4) # divide double; vA/vB
12949 fstpl (rFP, %edx, 4) # vAA<- result
12950 FINISH 1 # jump to next instruction
12952 /* ------------------------------ */
12954 .L_OP_REM_DOUBLE_2ADDR: /* 0xcf */
12955 /* File: x86-atom/OP_REM_DOUBLE_2ADDR.S */
12956 /* Copyright (C) 2008 The Android Open Source Project
12958 * Licensed under the Apache License, Version 2.0 (the "License");
12959 * you may not use this file except in compliance with the License.
12960 * You may obtain a copy of the License at
12962 * http://www.apache.org/licenses/LICENSE-2.0
12964 * Unless required by applicable law or agreed to in writing, software
12965 * distributed under the License is distributed on an "AS IS" BASIS,
12966 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12967 * See the License for the specific language governing permissions and
12968 * limitations under the License.
12972 * File: OP_REM_DOUBLE_2ADDR.S
12974 * Code: Computes the remainder of a division. Performs no substitutions.
12976 * For: rem-double/2addr
12978 * Description: Calls fmod to compute the remainder of the result of dividing a
12979 * source register by a second, and stores the result in the first
12982 * Format: B|A|op (12x)
12984 * Syntax: op vA, vB
12987 movl rINST, %edx # %edx<- BA
12988 and $15, rINST # rINST<- A
12989 shr $4, %edx # %edx<- B
12990 movl (rFP, rINST, 4), %eax # %eax<- vAlo
12991 movl %eax, -20(%esp) # push parameter vAAlo
12992 movl 4(rFP, rINST, 4), %eax # %eax<- vAhi
12993 movl %eax, -16(%esp) # push parameter vAAhi
12994 movl (rFP, %edx, 4), %eax # %eax<- vBlo
12995 movl %eax, -12(%esp) # push parameter vBBlo
12996 movl 4(rFP, %edx, 4), %eax # %eax<- vBhi
12997 movl %eax, -8(%esp) # push parameter vBBhi
12998 lea -20(%esp), %esp
12999 jmp .LOP_REM_DOUBLE_2ADDR_break
13001 /* ------------------------------ */
13003 .L_OP_ADD_INT_LIT16: /* 0xd0 */
13004 /* File: x86-atom/OP_ADD_INT_LIT16.S */
13005 /* Copyright (C) 2008 The Android Open Source Project
13007 * Licensed under the Apache License, Version 2.0 (the "License");
13008 * you may not use this file except in compliance with the License.
13009 * You may obtain a copy of the License at
13011 * http://www.apache.org/licenses/LICENSE-2.0
13013 * Unless required by applicable law or agreed to in writing, software
13014 * distributed under the License is distributed on an "AS IS" BASIS,
13015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13016 * See the License for the specific language governing permissions and
13017 * limitations under the License.
13021 * File: OP_ADD_INT_LIT16.S
13024 /* File: x86-atom/binopLit16.S */
13025 /* Copyright (C) 2008 The Android Open Source Project
13027 * Licensed under the Apache License, Version 2.0 (the "License");
13028 * you may not use this file except in compliance with the License.
13029 * You may obtain a copy of the License at
13031 * http://www.apache.org/licenses/LICENSE-2.0
13033 * Unless required by applicable law or agreed to in writing, software
13034 * distributed under the License is distributed on an "AS IS" BASIS,
13035 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13036 * See the License for the specific language governing permissions and
13037 * limitations under the License.
13041 * File: binopLit16.S
13043 * Code: 32-bit "lit16" operation. Provides an "instr" line to
13044 * specify an instruction that performs "%ecx = %ecx op %edx"
13047 * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
13050 * Description: Perform a binary operation on a register and a
13051 * sign extended 16-bit literal value and store the
13052 * result in a destination register.
13054 * Format: B|A|op CCCC (22s)
13056 * Syntax: op vA, vB, #+CCCC
13059 movl rINST, %ecx # %ecx<- BA
13060 shr $4, %ecx # %ecx<- B
13061 andl $15, rINST # rINST<- A
13062 FETCHs 1, %edx # %edx<- +CCCC, sign-extended literal
13063 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13064 GET_VREG %ecx # %ecx<- vB
13065 addl %edx, %ecx # %ecx<- vA op vB
13066 SET_VREG %ecx, rINST # vA<- %ecx; result
13067 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13069 /* ------------------------------ */
13071 .L_OP_RSUB_INT: /* 0xd1 */
13072 /* File: x86-atom/OP_RSUB_INT.S */
13073 /* Copyright (C) 2008 The Android Open Source Project
13075 * Licensed under the Apache License, Version 2.0 (the "License");
13076 * you may not use this file except in compliance with the License.
13077 * You may obtain a copy of the License at
13079 * http://www.apache.org/licenses/LICENSE-2.0
13081 * Unless required by applicable law or agreed to in writing, software
13082 * distributed under the License is distributed on an "AS IS" BASIS,
13083 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13084 * See the License for the specific language governing permissions and
13085 * limitations under the License.
13089 * File: OP_RSUB_INT.S
13091 * Code: 32-bit reverse-subtraction. Uses no substitutions.
13095 * Description: Perform a reverse subtraction on a register and a
13096 * signed extended 16-bit literal value and store the
13097 * result in a destination register.
13099 * Format: B|A|op CCCC (22s)
13101 * Syntax: op vA, vB, #+CCCC
13104 movl rINST, %ecx # %ecx<- BA
13105 shr $4, %ecx # %ecx<- B
13106 andl $15, rINST # rINST<- A
13107 FETCHs 1, %edx # %edx<- +CCCC, sign-extended literal
13108 GET_VREG %ecx # %ecx<- vB
13109 subl %ecx, %edx # %edx<- +CCCC sub vB
13110 SET_VREG %edx, rINST # vA<- %edx; result
13111 FINISH 2 # jump to next instruction
13112 /* ------------------------------ */
13114 .L_OP_MUL_INT_LIT16: /* 0xd2 */
13115 /* File: x86-atom/OP_MUL_INT_LIT16.S */
13116 /* Copyright (C) 2008 The Android Open Source Project
13118 * Licensed under the Apache License, Version 2.0 (the "License");
13119 * you may not use this file except in compliance with the License.
13120 * You may obtain a copy of the License at
13122 * http://www.apache.org/licenses/LICENSE-2.0
13124 * Unless required by applicable law or agreed to in writing, software
13125 * distributed under the License is distributed on an "AS IS" BASIS,
13126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13127 * See the License for the specific language governing permissions and
13128 * limitations under the License.
13132 * File: OP_MUL_INT_LIT16.S
13135 /* File: x86-atom/binopLit16.S */
13136 /* Copyright (C) 2008 The Android Open Source Project
13138 * Licensed under the Apache License, Version 2.0 (the "License");
13139 * you may not use this file except in compliance with the License.
13140 * You may obtain a copy of the License at
13142 * http://www.apache.org/licenses/LICENSE-2.0
13144 * Unless required by applicable law or agreed to in writing, software
13145 * distributed under the License is distributed on an "AS IS" BASIS,
13146 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13147 * See the License for the specific language governing permissions and
13148 * limitations under the License.
13152 * File: binopLit16.S
13154 * Code: 32-bit "lit16" operation. Provides an "instr" line to
13155 * specify an instruction that performs "%ecx = %ecx op %edx"
13158 * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
13161 * Description: Perform a binary operation on a register and a
13162 * sign extended 16-bit literal value and store the
13163 * result in a destination register.
13165 * Format: B|A|op CCCC (22s)
13167 * Syntax: op vA, vB, #+CCCC
13170 movl rINST, %ecx # %ecx<- BA
13171 shr $4, %ecx # %ecx<- B
13172 andl $15, rINST # rINST<- A
13173 FETCHs 1, %edx # %edx<- +CCCC, sign-extended literal
13174 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13175 GET_VREG %ecx # %ecx<- vB
13176 imul %edx, %ecx # %ecx<- vA op vB
13177 SET_VREG %ecx, rINST # vA<- %ecx; result
13178 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13180 /* ------------------------------ */
13182 .L_OP_DIV_INT_LIT16: /* 0xd3 */
13183 /* File: x86-atom/OP_DIV_INT_LIT16.S */
13184 /* Copyright (C) 2008 The Android Open Source Project
13186 * Licensed under the Apache License, Version 2.0 (the "License");
13187 * you may not use this file except in compliance with the License.
13188 * You may obtain a copy of the License at
13190 * http://www.apache.org/licenses/LICENSE-2.0
13192 * Unless required by applicable law or agreed to in writing, software
13193 * distributed under the License is distributed on an "AS IS" BASIS,
13194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13195 * See the License for the specific language governing permissions and
13196 * limitations under the License.
13200 * File: OP_DIV_INT_LIT16.S
13203 /* File: x86-atom/binopDLit16.S */
13204 /* Copyright (C) 2008 The Android Open Source Project
13206 * Licensed under the Apache License, Version 2.0 (the "License");
13207 * you may not use this file except in compliance with the License.
13208 * You may obtain a copy of the License at
13210 * http://www.apache.org/licenses/LICENSE-2.0
13212 * Unless required by applicable law or agreed to in writing, software
13213 * distributed under the License is distributed on an "AS IS" BASIS,
13214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13215 * See the License for the specific language governing permissions and
13216 * limitations under the License.
13220 * File: binopDLit16.S
13222 * Code: 32-bit "lit16" divide operation. If "div" is set, the code
13223 * returns the quotient, else it returns the remainder.
13224 * Also, a divide-by-zero check is done.
13226 * For: div-int/lit16, rem-int/lit16
13228 * Description: Perform a binary operation on a register and a
13229 * sign extended 16-bit literal value
13231 * Format: B|A|op CCCC (22s)
13233 * Syntax: op vA, vB, #+CCCC
13237 movl rINST, %eax # %eax<- BA
13238 shr $4, %eax # %eax<- B
13239 FETCHs 1, %ecx # %ecx<- +CCCC, sign-extended literal
13240 testl %ecx, %ecx # check for divide by zero
13241 GET_VREG %eax # %eax<- vB
13242 je common_errDivideByZero # handle divide by zero
13243 addl $4, rPC # update PC
13244 andl $15, rINST # rINST<- A
13245 cmpl $-1, %ecx # handle -1 special case divide error
13246 jnz .LOP_DIV_INT_LIT16_continue
13247 cmpl $0x80000000,%eax # handle min int special case divide error
13248 je .LOP_DIV_INT_LIT16_break
13249 .LOP_DIV_INT_LIT16_continue:
13250 cdq # sign-extend %eax to %edx
13251 idiv %ecx # divide %edx:%eax by %ecx
13254 SET_VREG %eax, rINST # vA<- %eax (quotient)
13255 movzbl 1(rPC), rINST
13256 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
13259 SET_VREG %edx, rINST # vA<- %edx (remainder)
13260 movzbl 1(rPC), rINST
13261 jmp *dvmAsmInstructionJmpTable(, %eax, 4)
13266 /* ------------------------------ */
13268 .L_OP_REM_INT_LIT16: /* 0xd4 */
13269 /* File: x86-atom/OP_REM_INT_LIT16.S */
13270 /* Copyright (C) 2008 The Android Open Source Project
13272 * Licensed under the Apache License, Version 2.0 (the "License");
13273 * you may not use this file except in compliance with the License.
13274 * You may obtain a copy of the License at
13276 * http://www.apache.org/licenses/LICENSE-2.0
13278 * Unless required by applicable law or agreed to in writing, software
13279 * distributed under the License is distributed on an "AS IS" BASIS,
13280 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13281 * See the License for the specific language governing permissions and
13282 * limitations under the License.
13286 * File: OP_REM_INT_LIT16.S
13289 /* File: x86-atom/binopDLit16.S */
13290 /* Copyright (C) 2008 The Android Open Source Project
13292 * Licensed under the Apache License, Version 2.0 (the "License");
13293 * you may not use this file except in compliance with the License.
13294 * You may obtain a copy of the License at
13296 * http://www.apache.org/licenses/LICENSE-2.0
13298 * Unless required by applicable law or agreed to in writing, software
13299 * distributed under the License is distributed on an "AS IS" BASIS,
13300 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13301 * See the License for the specific language governing permissions and
13302 * limitations under the License.
13306 * File: binopDLit16.S
13308 * Code: 32-bit "lit16" divide operation. If "div" is set, the code
13309 * returns the quotient, else it returns the remainder.
13310 * Also, a divide-by-zero check is done.
13312 * For: div-int/lit16, rem-int/lit16
13314 * Description: Perform a binary operation on a register and a
13315 * sign extended 16-bit literal value
13317 * Format: B|A|op CCCC (22s)
13319 * Syntax: op vA, vB, #+CCCC
13323 movl rINST, %eax # %eax<- BA
13324 shr $4, %eax # %eax<- B
13325 FETCHs 1, %ecx # %ecx<- +CCCC, sign-extended literal
13326 testl %ecx, %ecx # check for divide by zero
13327 GET_VREG %eax # %eax<- vB
13328 je common_errDivideByZero # handle divide by zero
13329 addl $4, rPC # update PC
13330 andl $15, rINST # rINST<- A
13331 cmpl $-1, %ecx # handle -1 special case divide error
13332 jnz .LOP_REM_INT_LIT16_continue
13333 cmpl $0x80000000,%eax # handle min int special case divide error
13334 je .LOP_REM_INT_LIT16_break
13335 .LOP_REM_INT_LIT16_continue:
13336 cdq # sign-extend %eax to %edx
13337 idiv %ecx # divide %edx:%eax by %ecx
13340 SET_VREG %eax, rINST # vA<- %eax (quotient)
13341 movzbl 1(rPC), rINST
13342 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
13345 SET_VREG %edx, rINST # vA<- %edx (remainder)
13346 movzbl 1(rPC), rINST
13347 jmp *dvmAsmInstructionJmpTable(, %eax, 4)
13352 /* ------------------------------ */
13354 .L_OP_AND_INT_LIT16: /* 0xd5 */
13355 /* File: x86-atom/OP_AND_INT_LIT16.S */
13356 /* Copyright (C) 2008 The Android Open Source Project
13358 * Licensed under the Apache License, Version 2.0 (the "License");
13359 * you may not use this file except in compliance with the License.
13360 * You may obtain a copy of the License at
13362 * http://www.apache.org/licenses/LICENSE-2.0
13364 * Unless required by applicable law or agreed to in writing, software
13365 * distributed under the License is distributed on an "AS IS" BASIS,
13366 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13367 * See the License for the specific language governing permissions and
13368 * limitations under the License.
13372 * File: OP_AND_INT_LIT16.S
13375 /* File: x86-atom/binopLit16.S */
13376 /* Copyright (C) 2008 The Android Open Source Project
13378 * Licensed under the Apache License, Version 2.0 (the "License");
13379 * you may not use this file except in compliance with the License.
13380 * You may obtain a copy of the License at
13382 * http://www.apache.org/licenses/LICENSE-2.0
13384 * Unless required by applicable law or agreed to in writing, software
13385 * distributed under the License is distributed on an "AS IS" BASIS,
13386 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13387 * See the License for the specific language governing permissions and
13388 * limitations under the License.
13392 * File: binopLit16.S
13394 * Code: 32-bit "lit16" operation. Provides an "instr" line to
13395 * specify an instruction that performs "%ecx = %ecx op %edx"
13398 * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
13401 * Description: Perform a binary operation on a register and a
13402 * sign extended 16-bit literal value and store the
13403 * result in a destination register.
13405 * Format: B|A|op CCCC (22s)
13407 * Syntax: op vA, vB, #+CCCC
13410 movl rINST, %ecx # %ecx<- BA
13411 shr $4, %ecx # %ecx<- B
13412 andl $15, rINST # rINST<- A
13413 FETCHs 1, %edx # %edx<- +CCCC, sign-extended literal
13414 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13415 GET_VREG %ecx # %ecx<- vB
13416 andl %edx, %ecx # %ecx<- vA op vB
13417 SET_VREG %ecx, rINST # vA<- %ecx; result
13418 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13420 /* ------------------------------ */
13422 .L_OP_OR_INT_LIT16: /* 0xd6 */
13423 /* File: x86-atom/OP_OR_INT_LIT16.S */
13424 /* Copyright (C) 2008 The Android Open Source Project
13426 * Licensed under the Apache License, Version 2.0 (the "License");
13427 * you may not use this file except in compliance with the License.
13428 * You may obtain a copy of the License at
13430 * http://www.apache.org/licenses/LICENSE-2.0
13432 * Unless required by applicable law or agreed to in writing, software
13433 * distributed under the License is distributed on an "AS IS" BASIS,
13434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13435 * See the License for the specific language governing permissions and
13436 * limitations under the License.
13440 * File: OP_OR_INT_LIT16.S
13443 /* File: x86-atom/binopLit16.S */
13444 /* Copyright (C) 2008 The Android Open Source Project
13446 * Licensed under the Apache License, Version 2.0 (the "License");
13447 * you may not use this file except in compliance with the License.
13448 * You may obtain a copy of the License at
13450 * http://www.apache.org/licenses/LICENSE-2.0
13452 * Unless required by applicable law or agreed to in writing, software
13453 * distributed under the License is distributed on an "AS IS" BASIS,
13454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13455 * See the License for the specific language governing permissions and
13456 * limitations under the License.
13460 * File: binopLit16.S
13462 * Code: 32-bit "lit16" operation. Provides an "instr" line to
13463 * specify an instruction that performs "%ecx = %ecx op %edx"
13466 * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
13469 * Description: Perform a binary operation on a register and a
13470 * sign extended 16-bit literal value and store the
13471 * result in a destination register.
13473 * Format: B|A|op CCCC (22s)
13475 * Syntax: op vA, vB, #+CCCC
13478 movl rINST, %ecx # %ecx<- BA
13479 shr $4, %ecx # %ecx<- B
13480 andl $15, rINST # rINST<- A
13481 FETCHs 1, %edx # %edx<- +CCCC, sign-extended literal
13482 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13483 GET_VREG %ecx # %ecx<- vB
13484 or %edx, %ecx # %ecx<- vA op vB
13485 SET_VREG %ecx, rINST # vA<- %ecx; result
13486 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13488 /* ------------------------------ */
13490 .L_OP_XOR_INT_LIT16: /* 0xd7 */
13491 /* File: x86-atom/OP_XOR_INT_LIT16.S */
13492 /* Copyright (C) 2008 The Android Open Source Project
13494 * Licensed under the Apache License, Version 2.0 (the "License");
13495 * you may not use this file except in compliance with the License.
13496 * You may obtain a copy of the License at
13498 * http://www.apache.org/licenses/LICENSE-2.0
13500 * Unless required by applicable law or agreed to in writing, software
13501 * distributed under the License is distributed on an "AS IS" BASIS,
13502 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13503 * See the License for the specific language governing permissions and
13504 * limitations under the License.
13508 * File: OP_XOR_INT_LIT16.S
13511 /* File: x86-atom/binopLit16.S */
13512 /* Copyright (C) 2008 The Android Open Source Project
13514 * Licensed under the Apache License, Version 2.0 (the "License");
13515 * you may not use this file except in compliance with the License.
13516 * You may obtain a copy of the License at
13518 * http://www.apache.org/licenses/LICENSE-2.0
13520 * Unless required by applicable law or agreed to in writing, software
13521 * distributed under the License is distributed on an "AS IS" BASIS,
13522 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13523 * See the License for the specific language governing permissions and
13524 * limitations under the License.
13528 * File: binopLit16.S
13530 * Code: 32-bit "lit16" operation. Provides an "instr" line to
13531 * specify an instruction that performs "%ecx = %ecx op %edx"
13534 * For: add-int/lit16, and-int/lit16, mul-int/lit16, or-int/lit16
13537 * Description: Perform a binary operation on a register and a
13538 * sign extended 16-bit literal value and store the
13539 * result in a destination register.
13541 * Format: B|A|op CCCC (22s)
13543 * Syntax: op vA, vB, #+CCCC
13546 movl rINST, %ecx # %ecx<- BA
13547 shr $4, %ecx # %ecx<- B
13548 andl $15, rINST # rINST<- A
13549 FETCHs 1, %edx # %edx<- +CCCC, sign-extended literal
13550 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13551 GET_VREG %ecx # %ecx<- vB
13552 xor %edx, %ecx # %ecx<- vA op vB
13553 SET_VREG %ecx, rINST # vA<- %ecx; result
13554 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13556 /* ------------------------------ */
13558 .L_OP_ADD_INT_LIT8: /* 0xd8 */
13559 /* File: x86-atom/OP_ADD_INT_LIT8.S */
13560 /* Copyright (C) 2008 The Android Open Source Project
13562 * Licensed under the Apache License, Version 2.0 (the "License");
13563 * you may not use this file except in compliance with the License.
13564 * You may obtain a copy of the License at
13566 * http://www.apache.org/licenses/LICENSE-2.0
13568 * Unless required by applicable law or agreed to in writing, software
13569 * distributed under the License is distributed on an "AS IS" BASIS,
13570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13571 * See the License for the specific language governing permissions and
13572 * limitations under the License.
13576 * File: OP_ADD_INT_LIT8.S
13579 /* File: x86-atom/binopLit8.S */
13580 /* Copyright (C) 2008 The Android Open Source Project
13582 * Licensed under the Apache License, Version 2.0 (the "License");
13583 * you may not use this file except in compliance with the License.
13584 * You may obtain a copy of the License at
13586 * http://www.apache.org/licenses/LICENSE-2.0
13588 * Unless required by applicable law or agreed to in writing, software
13589 * distributed under the License is distributed on an "AS IS" BASIS,
13590 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13591 * See the License for the specific language governing permissions and
13592 * limitations under the License.
13596 * File: binopLit8.S
13598 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
13599 * to specify an instruction that performs "%ecx = %ecx op %edx"
13602 * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
13605 * Description: Perform a binary operation on a register and a
13606 * signed extended 8-bit literal value
13608 * Format: AA|op CC|BB (22b)
13610 * Syntax: op vAA, vBB, #+CC
13613 FETCH_BB 1, %ecx # %ecx<- BB
13614 FETCH_CCs 1, %edx # %edx<- +CC, sign-extended literal
13615 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13616 GET_VREG %ecx # %ecx<- vBB
13617 addl %edx, %ecx # %ecx<- vBB op +CC
13618 SET_VREG %ecx, rINST # vAA<- %ecx; result
13619 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13621 /* ------------------------------ */
13623 .L_OP_RSUB_INT_LIT8: /* 0xd9 */
13624 /* File: x86-atom/OP_RSUB_INT_LIT8.S */
13625 /* Copyright (C) 2008 The Android Open Source Project
13627 * Licensed under the Apache License, Version 2.0 (the "License");
13628 * you may not use this file except in compliance with the License.
13629 * You may obtain a copy of the License at
13631 * http://www.apache.org/licenses/LICENSE-2.0
13633 * Unless required by applicable law or agreed to in writing, software
13634 * distributed under the License is distributed on an "AS IS" BASIS,
13635 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13636 * See the License for the specific language governing permissions and
13637 * limitations under the License.
13641 * File: OP_RSUB_INT_LIT8.S
13643 * Code: 32-bit reverse-subtraction. Uses no substitutions.
13645 * For: rsub-int/lit8
13647 * Description: Perform a reverse subtraction on a register and a
13648 * signed extended 8-bit literal value.
13650 * Format: AA|op CC|BB (22b)
13652 * Syntax: op vAA, vBB, #+CC
13655 FETCH_BB 1, %ecx # %ecx<- BB
13656 FETCH_CCs 1, %edx # %edx<- +CC, sign-extended literal
13657 GET_VREG %ecx # %ecx<- vBB
13658 sub %ecx, %edx # %edx<- +CC sub vBB
13659 SET_VREG %edx, rINST # vAA<- %edx; result
13660 FINISH 2 # jump to next instruction
13662 /* ------------------------------ */
13664 .L_OP_MUL_INT_LIT8: /* 0xda */
13665 /* File: x86-atom/OP_MUL_INT_LIT8.S */
13666 /* Copyright (C) 2008 The Android Open Source Project
13668 * Licensed under the Apache License, Version 2.0 (the "License");
13669 * you may not use this file except in compliance with the License.
13670 * You may obtain a copy of the License at
13672 * http://www.apache.org/licenses/LICENSE-2.0
13674 * Unless required by applicable law or agreed to in writing, software
13675 * distributed under the License is distributed on an "AS IS" BASIS,
13676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13677 * See the License for the specific language governing permissions and
13678 * limitations under the License.
13682 * File: OP_MUL_INT_LIT8.S
13685 /* File: x86-atom/binopLit8.S */
13686 /* Copyright (C) 2008 The Android Open Source Project
13688 * Licensed under the Apache License, Version 2.0 (the "License");
13689 * you may not use this file except in compliance with the License.
13690 * You may obtain a copy of the License at
13692 * http://www.apache.org/licenses/LICENSE-2.0
13694 * Unless required by applicable law or agreed to in writing, software
13695 * distributed under the License is distributed on an "AS IS" BASIS,
13696 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13697 * See the License for the specific language governing permissions and
13698 * limitations under the License.
13702 * File: binopLit8.S
13704 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
13705 * to specify an instruction that performs "%ecx = %ecx op %edx"
13708 * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
13711 * Description: Perform a binary operation on a register and a
13712 * signed extended 8-bit literal value
13714 * Format: AA|op CC|BB (22b)
13716 * Syntax: op vAA, vBB, #+CC
13719 FETCH_BB 1, %ecx # %ecx<- BB
13720 FETCH_CCs 1, %edx # %edx<- +CC, sign-extended literal
13721 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13722 GET_VREG %ecx # %ecx<- vBB
13723 imul %edx, %ecx # %ecx<- vBB op +CC
13724 SET_VREG %ecx, rINST # vAA<- %ecx; result
13725 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13727 /* ------------------------------ */
13729 .L_OP_DIV_INT_LIT8: /* 0xdb */
13730 /* File: x86-atom/OP_DIV_INT_LIT8.S */
13731 /* Copyright (C) 2008 The Android Open Source Project
13733 * Licensed under the Apache License, Version 2.0 (the "License");
13734 * you may not use this file except in compliance with the License.
13735 * You may obtain a copy of the License at
13737 * http://www.apache.org/licenses/LICENSE-2.0
13739 * Unless required by applicable law or agreed to in writing, software
13740 * distributed under the License is distributed on an "AS IS" BASIS,
13741 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13742 * See the License for the specific language governing permissions and
13743 * limitations under the License.
13747 * File: OP_DIV_INT_LIT8.S
13750 /* File: x86-atom/binopDLit8.S */
13751 /* Copyright (C) 2008 The Android Open Source Project
13753 * Licensed under the Apache License, Version 2.0 (the "License");
13754 * you may not use this file except in compliance with the License.
13755 * You may obtain a copy of the License at
13757 * http://www.apache.org/licenses/LICENSE-2.0
13759 * Unless required by applicable law or agreed to in writing, software
13760 * distributed under the License is distributed on an "AS IS" BASIS,
13761 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13762 * See the License for the specific language governing permissions and
13763 * limitations under the License.
13767 * File: binopDLit8.S
13769 * Code: 32-bit "lit8" divide operation. If "div" is set, the code
13770 * returns the quotient, else it returns the remainder.
13771 * Also, a divide-by-zero check is done.
13773 * For: div-int/lit8, rem-int/lit8
13775 * Description: Perform a binary operation on a register and a
13776 * signe extended 8-bit literal value
13778 * Format: AA|op CC|BB (22b)
13780 * Syntax: op vAA, vBB, #+CC
13784 FETCH_CCs 1, %ecx # %ecx<- +CC, sign-extended literal
13785 testl %ecx, %ecx # handle -1 special case divide error
13786 FETCH_BB 1, %eax # %eax<- BB
13787 jz common_errDivideByZero # handle divide by zero
13788 addl $4, rPC # update PC
13790 GET_VREG %eax # %eax<- vBB
13791 jnz .LOP_DIV_INT_LIT8_continue
13792 cmpl $0x80000000,%eax # handle min int special case divide error
13793 je .LOP_DIV_INT_LIT8_break
13794 .LOP_DIV_INT_LIT8_continue:
13795 cdq # sign-extend %eax to %edx
13796 idiv %ecx # divide %edx:%eax by %ecx
13799 SET_VREG %eax, rINST # vA<- %eax (quotient)
13800 movzbl 1(rPC), rINST
13801 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
13804 SET_VREG %edx, rINST # vA<- %edx (remainder)
13805 movzbl 1(rPC), rINST
13806 jmp *dvmAsmInstructionJmpTable(, %eax, 4)
13810 /* ------------------------------ */
13812 .L_OP_REM_INT_LIT8: /* 0xdc */
13813 /* File: x86-atom/OP_REM_INT_LIT8.S */
13814 /* Copyright (C) 2008 The Android Open Source Project
13816 * Licensed under the Apache License, Version 2.0 (the "License");
13817 * you may not use this file except in compliance with the License.
13818 * You may obtain a copy of the License at
13820 * http://www.apache.org/licenses/LICENSE-2.0
13822 * Unless required by applicable law or agreed to in writing, software
13823 * distributed under the License is distributed on an "AS IS" BASIS,
13824 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13825 * See the License for the specific language governing permissions and
13826 * limitations under the License.
13830 * File: OP_REM_INT_LIT8.S
13833 /* File: x86-atom/binopDLit8.S */
13834 /* Copyright (C) 2008 The Android Open Source Project
13836 * Licensed under the Apache License, Version 2.0 (the "License");
13837 * you may not use this file except in compliance with the License.
13838 * You may obtain a copy of the License at
13840 * http://www.apache.org/licenses/LICENSE-2.0
13842 * Unless required by applicable law or agreed to in writing, software
13843 * distributed under the License is distributed on an "AS IS" BASIS,
13844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13845 * See the License for the specific language governing permissions and
13846 * limitations under the License.
13850 * File: binopDLit8.S
13852 * Code: 32-bit "lit8" divide operation. If "div" is set, the code
13853 * returns the quotient, else it returns the remainder.
13854 * Also, a divide-by-zero check is done.
13856 * For: div-int/lit8, rem-int/lit8
13858 * Description: Perform a binary operation on a register and a
13859 * signe extended 8-bit literal value
13861 * Format: AA|op CC|BB (22b)
13863 * Syntax: op vAA, vBB, #+CC
13867 FETCH_CCs 1, %ecx # %ecx<- +CC, sign-extended literal
13868 testl %ecx, %ecx # handle -1 special case divide error
13869 FETCH_BB 1, %eax # %eax<- BB
13870 jz common_errDivideByZero # handle divide by zero
13871 addl $4, rPC # update PC
13873 GET_VREG %eax # %eax<- vBB
13874 jnz .LOP_REM_INT_LIT8_continue
13875 cmpl $0x80000000,%eax # handle min int special case divide error
13876 je .LOP_REM_INT_LIT8_break
13877 .LOP_REM_INT_LIT8_continue:
13878 cdq # sign-extend %eax to %edx
13879 idiv %ecx # divide %edx:%eax by %ecx
13882 SET_VREG %eax, rINST # vA<- %eax (quotient)
13883 movzbl 1(rPC), rINST
13884 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
13887 SET_VREG %edx, rINST # vA<- %edx (remainder)
13888 movzbl 1(rPC), rINST
13889 jmp *dvmAsmInstructionJmpTable(, %eax, 4)
13893 /* ------------------------------ */
13895 .L_OP_AND_INT_LIT8: /* 0xdd */
13896 /* File: x86-atom/OP_AND_INT_LIT8.S */
13897 /* Copyright (C) 2008 The Android Open Source Project
13899 * Licensed under the Apache License, Version 2.0 (the "License");
13900 * you may not use this file except in compliance with the License.
13901 * You may obtain a copy of the License at
13903 * http://www.apache.org/licenses/LICENSE-2.0
13905 * Unless required by applicable law or agreed to in writing, software
13906 * distributed under the License is distributed on an "AS IS" BASIS,
13907 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13908 * See the License for the specific language governing permissions and
13909 * limitations under the License.
13913 * File: OP_AND_INT_LIT8.S
13916 /* File: x86-atom/binopLit8.S */
13917 /* Copyright (C) 2008 The Android Open Source Project
13919 * Licensed under the Apache License, Version 2.0 (the "License");
13920 * you may not use this file except in compliance with the License.
13921 * You may obtain a copy of the License at
13923 * http://www.apache.org/licenses/LICENSE-2.0
13925 * Unless required by applicable law or agreed to in writing, software
13926 * distributed under the License is distributed on an "AS IS" BASIS,
13927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13928 * See the License for the specific language governing permissions and
13929 * limitations under the License.
13933 * File: binopLit8.S
13935 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
13936 * to specify an instruction that performs "%ecx = %ecx op %edx"
13939 * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
13942 * Description: Perform a binary operation on a register and a
13943 * signed extended 8-bit literal value
13945 * Format: AA|op CC|BB (22b)
13947 * Syntax: op vAA, vBB, #+CC
13950 FETCH_BB 1, %ecx # %ecx<- BB
13951 FETCH_CCs 1, %edx # %edx<- +CC, sign-extended literal
13952 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
13953 GET_VREG %ecx # %ecx<- vBB
13954 andl %edx, %ecx # %ecx<- vBB op +CC
13955 SET_VREG %ecx, rINST # vAA<- %ecx; result
13956 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
13958 /* ------------------------------ */
13960 .L_OP_OR_INT_LIT8: /* 0xde */
13961 /* File: x86-atom/OP_OR_INT_LIT8.S */
13962 /* Copyright (C) 2008 The Android Open Source Project
13964 * Licensed under the Apache License, Version 2.0 (the "License");
13965 * you may not use this file except in compliance with the License.
13966 * You may obtain a copy of the License at
13968 * http://www.apache.org/licenses/LICENSE-2.0
13970 * Unless required by applicable law or agreed to in writing, software
13971 * distributed under the License is distributed on an "AS IS" BASIS,
13972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13973 * See the License for the specific language governing permissions and
13974 * limitations under the License.
13978 * File: OP_OR_INT_LIT8.S
13981 /* File: x86-atom/binopLit8.S */
13982 /* Copyright (C) 2008 The Android Open Source Project
13984 * Licensed under the Apache License, Version 2.0 (the "License");
13985 * you may not use this file except in compliance with the License.
13986 * You may obtain a copy of the License at
13988 * http://www.apache.org/licenses/LICENSE-2.0
13990 * Unless required by applicable law or agreed to in writing, software
13991 * distributed under the License is distributed on an "AS IS" BASIS,
13992 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13993 * See the License for the specific language governing permissions and
13994 * limitations under the License.
13998 * File: binopLit8.S
14000 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
14001 * to specify an instruction that performs "%ecx = %ecx op %edx"
14004 * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
14007 * Description: Perform a binary operation on a register and a
14008 * signed extended 8-bit literal value
14010 * Format: AA|op CC|BB (22b)
14012 * Syntax: op vAA, vBB, #+CC
14015 FETCH_BB 1, %ecx # %ecx<- BB
14016 FETCH_CCs 1, %edx # %edx<- +CC, sign-extended literal
14017 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14018 GET_VREG %ecx # %ecx<- vBB
14019 or %edx, %ecx # %ecx<- vBB op +CC
14020 SET_VREG %ecx, rINST # vAA<- %ecx; result
14021 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14023 /* ------------------------------ */
14025 .L_OP_XOR_INT_LIT8: /* 0xdf */
14026 /* File: x86-atom/OP_XOR_INT_LIT8.S */
14027 /* Copyright (C) 2008 The Android Open Source Project
14029 * Licensed under the Apache License, Version 2.0 (the "License");
14030 * you may not use this file except in compliance with the License.
14031 * You may obtain a copy of the License at
14033 * http://www.apache.org/licenses/LICENSE-2.0
14035 * Unless required by applicable law or agreed to in writing, software
14036 * distributed under the License is distributed on an "AS IS" BASIS,
14037 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14038 * See the License for the specific language governing permissions and
14039 * limitations under the License.
14043 * File: OP_XOR_INT_LIT8.S
14046 /* File: x86-atom/binopLit8.S */
14047 /* Copyright (C) 2008 The Android Open Source Project
14049 * Licensed under the Apache License, Version 2.0 (the "License");
14050 * you may not use this file except in compliance with the License.
14051 * You may obtain a copy of the License at
14053 * http://www.apache.org/licenses/LICENSE-2.0
14055 * Unless required by applicable law or agreed to in writing, software
14056 * distributed under the License is distributed on an "AS IS" BASIS,
14057 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14058 * See the License for the specific language governing permissions and
14059 * limitations under the License.
14063 * File: binopLit8.S
14065 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
14066 * to specify an instruction that performs "%ecx = %ecx op %edx"
14069 * For: add-int/lit8, and-int/lit8, mul-int/lit8, or-int/lit8
14072 * Description: Perform a binary operation on a register and a
14073 * signed extended 8-bit literal value
14075 * Format: AA|op CC|BB (22b)
14077 * Syntax: op vAA, vBB, #+CC
14080 FETCH_BB 1, %ecx # %ecx<- BB
14081 FETCH_CCs 1, %edx # %edx<- +CC, sign-extended literal
14082 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14083 GET_VREG %ecx # %ecx<- vBB
14084 xor %edx, %ecx # %ecx<- vBB op +CC
14085 SET_VREG %ecx, rINST # vAA<- %ecx; result
14086 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14088 /* ------------------------------ */
14090 .L_OP_SHL_INT_LIT8: /* 0xe0 */
14091 /* File: x86-atom/OP_SHL_INT_LIT8.S */
14092 /* Copyright (C) 2008 The Android Open Source Project
14094 * Licensed under the Apache License, Version 2.0 (the "License");
14095 * you may not use this file except in compliance with the License.
14096 * You may obtain a copy of the License at
14098 * http://www.apache.org/licenses/LICENSE-2.0
14100 * Unless required by applicable law or agreed to in writing, software
14101 * distributed under the License is distributed on an "AS IS" BASIS,
14102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14103 * See the License for the specific language governing permissions and
14104 * limitations under the License.
14108 * File: OP_SHL_INT_LIT8.S
14111 /* File: x86-atom/binopLit8S.S */
14112 /* Copyright (C) 2008 The Android Open Source Project
14114 * Licensed under the Apache License, Version 2.0 (the "License");
14115 * you may not use this file except in compliance with the License.
14116 * You may obtain a copy of the License at
14118 * http://www.apache.org/licenses/LICENSE-2.0
14120 * Unless required by applicable law or agreed to in writing, software
14121 * distributed under the License is distributed on an "AS IS" BASIS,
14122 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14123 * See the License for the specific language governing permissions and
14124 * limitations under the License.
14128 * File: binopLit8S.S
14130 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
14131 * to specify an instruction that performs "%edx = %edx op %cl"
14134 * For: shl-int/lit8, shr-int/lit8, ushr-int/lit8
14137 * Description: Perform a binary operation on a register and a
14138 * signed extended 8-bit literal value
14140 * Format: AA|op CC|BB (22b)
14142 * Syntax: op vAA, vBB, #+CC
14145 FETCH_BB 1, %edx # %edx<- BB
14146 FETCH_CCs 1, %ecx # %ecx<- +CC, sign-extended literal
14147 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14148 GET_VREG %edx # %edx<- vBB
14149 sal %cl, %edx # %edx<- vBB op +CC
14150 SET_VREG %edx, rINST # vAA<- %edx; result
14151 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14153 /* ------------------------------ */
14155 .L_OP_SHR_INT_LIT8: /* 0xe1 */
14156 /* File: x86-atom/OP_SHR_INT_LIT8.S */
14157 /* Copyright (C) 2008 The Android Open Source Project
14159 * Licensed under the Apache License, Version 2.0 (the "License");
14160 * you may not use this file except in compliance with the License.
14161 * You may obtain a copy of the License at
14163 * http://www.apache.org/licenses/LICENSE-2.0
14165 * Unless required by applicable law or agreed to in writing, software
14166 * distributed under the License is distributed on an "AS IS" BASIS,
14167 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14168 * See the License for the specific language governing permissions and
14169 * limitations under the License.
14173 * File: OP_SHR_INT_LIT8.S
14176 /* File: x86-atom/binopLit8S.S */
14177 /* Copyright (C) 2008 The Android Open Source Project
14179 * Licensed under the Apache License, Version 2.0 (the "License");
14180 * you may not use this file except in compliance with the License.
14181 * You may obtain a copy of the License at
14183 * http://www.apache.org/licenses/LICENSE-2.0
14185 * Unless required by applicable law or agreed to in writing, software
14186 * distributed under the License is distributed on an "AS IS" BASIS,
14187 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14188 * See the License for the specific language governing permissions and
14189 * limitations under the License.
14193 * File: binopLit8S.S
14195 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
14196 * to specify an instruction that performs "%edx = %edx op %cl"
14199 * For: shl-int/lit8, shr-int/lit8, ushr-int/lit8
14202 * Description: Perform a binary operation on a register and a
14203 * signed extended 8-bit literal value
14205 * Format: AA|op CC|BB (22b)
14207 * Syntax: op vAA, vBB, #+CC
14210 FETCH_BB 1, %edx # %edx<- BB
14211 FETCH_CCs 1, %ecx # %ecx<- +CC, sign-extended literal
14212 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14213 GET_VREG %edx # %edx<- vBB
14214 sar %cl, %edx # %edx<- vBB op +CC
14215 SET_VREG %edx, rINST # vAA<- %edx; result
14216 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14218 /* ------------------------------ */
14220 .L_OP_USHR_INT_LIT8: /* 0xe2 */
14221 /* File: x86-atom/OP_USHR_INT_LIT8.S */
14222 /* Copyright (C) 2008 The Android Open Source Project
14224 * Licensed under the Apache License, Version 2.0 (the "License");
14225 * you may not use this file except in compliance with the License.
14226 * You may obtain a copy of the License at
14228 * http://www.apache.org/licenses/LICENSE-2.0
14230 * Unless required by applicable law or agreed to in writing, software
14231 * distributed under the License is distributed on an "AS IS" BASIS,
14232 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14233 * See the License for the specific language governing permissions and
14234 * limitations under the License.
14238 * File: OP_USHR_INT_LIT8.S
14241 /* File: x86-atom/binopLit8S.S */
14242 /* Copyright (C) 2008 The Android Open Source Project
14244 * Licensed under the Apache License, Version 2.0 (the "License");
14245 * you may not use this file except in compliance with the License.
14246 * You may obtain a copy of the License at
14248 * http://www.apache.org/licenses/LICENSE-2.0
14250 * Unless required by applicable law or agreed to in writing, software
14251 * distributed under the License is distributed on an "AS IS" BASIS,
14252 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14253 * See the License for the specific language governing permissions and
14254 * limitations under the License.
14258 * File: binopLit8S.S
14260 * Code: 32-bit "lit8" divide operation. Provides an "instr" line
14261 * to specify an instruction that performs "%edx = %edx op %cl"
14264 * For: shl-int/lit8, shr-int/lit8, ushr-int/lit8
14267 * Description: Perform a binary operation on a register and a
14268 * signed extended 8-bit literal value
14270 * Format: AA|op CC|BB (22b)
14272 * Syntax: op vAA, vBB, #+CC
14275 FETCH_BB 1, %edx # %edx<- BB
14276 FETCH_CCs 1, %ecx # %ecx<- +CC, sign-extended literal
14277 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14278 GET_VREG %edx # %edx<- vBB
14279 shr %cl, %edx # %edx<- vBB op +CC
14280 SET_VREG %edx, rINST # vAA<- %edx; result
14281 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14283 /* ------------------------------ */
14285 .L_OP_IGET_VOLATILE: /* 0xe3 */
14286 /* Copyright (C) 2008 The Android Open Source Project
14288 * Licensed under the Apache License, Version 2.0 (the "License");
14289 * you may not use this file except in compliance with the License.
14290 * You may obtain a copy of the License at
14292 * http://www.apache.org/licenses/LICENSE-2.0
14294 * Unless required by applicable law or agreed to in writing, software
14295 * distributed under the License is distributed on an "AS IS" BASIS,
14296 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14297 * See the License for the specific language governing permissions and
14298 * limitations under the License.
14305 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14306 pushl rGLUE # push parameter glue
14307 call dvmMterp_OP_IGET_VOLATILE # call c-based implementation
14309 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14310 FINISH_A # jump to next instruction
14311 /* ------------------------------ */
14313 .L_OP_IPUT_VOLATILE: /* 0xe4 */
14314 /* Copyright (C) 2008 The Android Open Source Project
14316 * Licensed under the Apache License, Version 2.0 (the "License");
14317 * you may not use this file except in compliance with the License.
14318 * You may obtain a copy of the License at
14320 * http://www.apache.org/licenses/LICENSE-2.0
14322 * Unless required by applicable law or agreed to in writing, software
14323 * distributed under the License is distributed on an "AS IS" BASIS,
14324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14325 * See the License for the specific language governing permissions and
14326 * limitations under the License.
14333 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14334 pushl rGLUE # push parameter glue
14335 call dvmMterp_OP_IPUT_VOLATILE # call c-based implementation
14337 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14338 FINISH_A # jump to next instruction
14339 /* ------------------------------ */
14341 .L_OP_SGET_VOLATILE: /* 0xe5 */
14342 /* Copyright (C) 2008 The Android Open Source Project
14344 * Licensed under the Apache License, Version 2.0 (the "License");
14345 * you may not use this file except in compliance with the License.
14346 * You may obtain a copy of the License at
14348 * http://www.apache.org/licenses/LICENSE-2.0
14350 * Unless required by applicable law or agreed to in writing, software
14351 * distributed under the License is distributed on an "AS IS" BASIS,
14352 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14353 * See the License for the specific language governing permissions and
14354 * limitations under the License.
14361 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14362 pushl rGLUE # push parameter glue
14363 call dvmMterp_OP_SGET_VOLATILE # call c-based implementation
14365 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14366 FINISH_A # jump to next instruction
14367 /* ------------------------------ */
14369 .L_OP_SPUT_VOLATILE: /* 0xe6 */
14370 /* Copyright (C) 2008 The Android Open Source Project
14372 * Licensed under the Apache License, Version 2.0 (the "License");
14373 * you may not use this file except in compliance with the License.
14374 * You may obtain a copy of the License at
14376 * http://www.apache.org/licenses/LICENSE-2.0
14378 * Unless required by applicable law or agreed to in writing, software
14379 * distributed under the License is distributed on an "AS IS" BASIS,
14380 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14381 * See the License for the specific language governing permissions and
14382 * limitations under the License.
14389 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14390 pushl rGLUE # push parameter glue
14391 call dvmMterp_OP_SPUT_VOLATILE # call c-based implementation
14393 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14394 FINISH_A # jump to next instruction
14395 /* ------------------------------ */
14397 .L_OP_IGET_OBJECT_VOLATILE: /* 0xe7 */
14398 /* Copyright (C) 2008 The Android Open Source Project
14400 * Licensed under the Apache License, Version 2.0 (the "License");
14401 * you may not use this file except in compliance with the License.
14402 * You may obtain a copy of the License at
14404 * http://www.apache.org/licenses/LICENSE-2.0
14406 * Unless required by applicable law or agreed to in writing, software
14407 * distributed under the License is distributed on an "AS IS" BASIS,
14408 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14409 * See the License for the specific language governing permissions and
14410 * limitations under the License.
14417 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14418 pushl rGLUE # push parameter glue
14419 call dvmMterp_OP_IGET_OBJECT_VOLATILE # call c-based implementation
14421 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14422 FINISH_A # jump to next instruction
14423 /* ------------------------------ */
14425 .L_OP_IGET_WIDE_VOLATILE: /* 0xe8 */
14426 /* Copyright (C) 2008 The Android Open Source Project
14428 * Licensed under the Apache License, Version 2.0 (the "License");
14429 * you may not use this file except in compliance with the License.
14430 * You may obtain a copy of the License at
14432 * http://www.apache.org/licenses/LICENSE-2.0
14434 * Unless required by applicable law or agreed to in writing, software
14435 * distributed under the License is distributed on an "AS IS" BASIS,
14436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14437 * See the License for the specific language governing permissions and
14438 * limitations under the License.
14445 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14446 pushl rGLUE # push parameter glue
14447 call dvmMterp_OP_IGET_WIDE_VOLATILE # call c-based implementation
14449 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14450 FINISH_A # jump to next instruction
14451 /* ------------------------------ */
14453 .L_OP_IPUT_WIDE_VOLATILE: /* 0xe9 */
14454 /* Copyright (C) 2008 The Android Open Source Project
14456 * Licensed under the Apache License, Version 2.0 (the "License");
14457 * you may not use this file except in compliance with the License.
14458 * You may obtain a copy of the License at
14460 * http://www.apache.org/licenses/LICENSE-2.0
14462 * Unless required by applicable law or agreed to in writing, software
14463 * distributed under the License is distributed on an "AS IS" BASIS,
14464 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14465 * See the License for the specific language governing permissions and
14466 * limitations under the License.
14473 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14474 pushl rGLUE # push parameter glue
14475 call dvmMterp_OP_IPUT_WIDE_VOLATILE # call c-based implementation
14477 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14478 FINISH_A # jump to next instruction
14479 /* ------------------------------ */
14481 .L_OP_SGET_WIDE_VOLATILE: /* 0xea */
14482 /* Copyright (C) 2008 The Android Open Source Project
14484 * Licensed under the Apache License, Version 2.0 (the "License");
14485 * you may not use this file except in compliance with the License.
14486 * You may obtain a copy of the License at
14488 * http://www.apache.org/licenses/LICENSE-2.0
14490 * Unless required by applicable law or agreed to in writing, software
14491 * distributed under the License is distributed on an "AS IS" BASIS,
14492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14493 * See the License for the specific language governing permissions and
14494 * limitations under the License.
14501 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14502 pushl rGLUE # push parameter glue
14503 call dvmMterp_OP_SGET_WIDE_VOLATILE # call c-based implementation
14505 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14506 FINISH_A # jump to next instruction
14507 /* ------------------------------ */
14509 .L_OP_SPUT_WIDE_VOLATILE: /* 0xeb */
14510 /* Copyright (C) 2008 The Android Open Source Project
14512 * Licensed under the Apache License, Version 2.0 (the "License");
14513 * you may not use this file except in compliance with the License.
14514 * You may obtain a copy of the License at
14516 * http://www.apache.org/licenses/LICENSE-2.0
14518 * Unless required by applicable law or agreed to in writing, software
14519 * distributed under the License is distributed on an "AS IS" BASIS,
14520 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14521 * See the License for the specific language governing permissions and
14522 * limitations under the License.
14529 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14530 pushl rGLUE # push parameter glue
14531 call dvmMterp_OP_SPUT_WIDE_VOLATILE # call c-based implementation
14533 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14534 FINISH_A # jump to next instruction
14535 /* ------------------------------ */
14537 .L_OP_BREAKPOINT: /* 0xec */
14538 /* File: x86-atom/OP_BREAKPOINT.S */
14539 /* File: x86/unused.S */
14543 /* ------------------------------ */
14545 .L_OP_THROW_VERIFICATION_ERROR: /* 0xed */
14546 /* File: x86-atom/OP_THROW_VERIFICATION_ERROR.S */
14547 /* Copyright (C) 2009 The Android Open Source Project
14549 * Licensed under the Apache License, Version 2.0 (the "License");
14550 * you may not use this file except in compliance with the License.
14551 * You may obtain a copy of the License at
14553 * http://www.apache.org/licenses/LICENSE-2.0
14555 * Unless required by applicable law or agreed to in writing, software
14556 * distributed under the License is distributed on an "AS IS" BASIS,
14557 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14558 * See the License for the specific language governing permissions and
14559 * limitations under the License.
14563 * File: OP_THROW_VERIFICATION_ERROR.S
14567 * For: throw-verification-error
14569 * Description: Throws an exception for an error discovered during verification.
14570 * The exception is indicated by AA with details provided by BBBB.
14572 * Format: AA|op BBBB (21c)
14574 * Syntax: op vAA, ref@BBBB
14577 movl rGLUE, %edx # %edx<- pMterpGlue
14578 movl offGlue_method(%edx), %ecx # %ecx<- glue->method
14579 EXPORT_PC # in case an exception is thrown
14580 FETCH 1, %eax # %eax<- BBBB
14581 movl %eax, -4(%esp) # push parameter BBBB; ref
14582 movl rINST, -8(%esp) # push parameter AA
14583 movl %ecx, -12(%esp) # push parameter glue->method
14584 lea -12(%esp), %esp
14585 call dvmThrowVerificationError # call: (const Method* method, int kind, int ref)
14586 jmp common_exceptionThrown # failed; handle exception
14588 /* ------------------------------ */
14590 .L_OP_EXECUTE_INLINE: /* 0xee */
14591 /* File: x86-atom/OP_EXECUTE_INLINE.S */
14592 /* Copyright (C) 2008 The Android Open Source Project
14594 * Licensed under the Apache License, Version 2.0 (the "License");
14595 * you may not use this file except in compliance with the License.
14596 * You may obtain a copy of the License at
14598 * http://www.apache.org/licenses/LICENSE-2.0
14600 * Unless required by applicable law or agreed to in writing, software
14601 * distributed under the License is distributed on an "AS IS" BASIS,
14602 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14603 * See the License for the specific language governing permissions and
14604 * limitations under the License.
14608 * File: OP_EXECUTE_INLINE.S
14610 * Code: Executes a "native inline" instruction. Uses no substitutions.
14612 * For: execute-inline
14614 * Description: Executes a "native inline" instruction. This instruction
14615 * is generated by the optimizer.
14619 * Syntax: A, {vC, vD, vE, vF}, inline@BBBB
14622 FETCH 1, %ecx # %ecx<- BBBB
14623 movl rGLUE, %eax # %eax<- MterpGlue pointer
14624 addl $offGlue_retval, %eax # %eax<- &glue->retval
14626 shr $4, rINST # rINST<- A
14627 movl %eax, -8(%esp) # push parameter glue->retval
14628 lea -24(%esp), %esp
14629 jmp .LOP_EXECUTE_INLINE_continue
14631 /* ------------------------------ */
14633 .L_OP_EXECUTE_INLINE_RANGE: /* 0xef */
14634 /* File: x86-atom/OP_EXECUTE_INLINE_RANGE.S */
14635 /* Copyright (C) 2010 The Android Open Source Project
14637 * Licensed under the Apache License, Version 2.0 (the "License");
14638 * you may not use this file except in compliance with the License.
14639 * You may obtain a copy of the License at
14641 * http://www.apache.org/licenses/LICENSE-2.0
14643 * Unless required by applicable law or agreed to in writing, software
14644 * distributed under the License is distributed on an "AS IS" BASIS,
14645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14646 * See the License for the specific language governing permissions and
14647 * limitations under the License.
14651 * File: OP_EXECUTE_INLINE_RANGE.S
14653 * Code: Executes a "native inline" instruction. Uses no substitutions.
14655 * For: execute-inline
14657 * Description: Executes a "native inline" instruction. This instruction
14658 * is generated by the optimizer.
14662 * Syntax: AA, {vCCCC..v(CCCC+AA-1)}, inline@BBBB
14665 FETCH 1, %ecx # %ecx<- BBBB
14666 movl rGLUE, %eax # %eax<- MterpGlue pointer
14667 addl $offGlue_retval, %eax # %eax<- &glue->retval
14669 movl %eax, -8(%esp) # push parameter glue->retval
14670 lea -24(%esp), %esp
14671 jmp .LOP_EXECUTE_INLINE_RANGE_continue
14673 /* ------------------------------ */
14675 .L_OP_INVOKE_DIRECT_EMPTY: /* 0xf0 */
14676 /* File: x86-atom/OP_INVOKE_DIRECT_EMPTY.S */
14677 /* Copyright (C) 2008 The Android Open Source Project
14679 * Licensed under the Apache License, Version 2.0 (the "License");
14680 * you may not use this file except in compliance with the License.
14681 * You may obtain a copy of the License at
14683 * http://www.apache.org/licenses/LICENSE-2.0
14685 * Unless required by applicable law or agreed to in writing, software
14686 * distributed under the License is distributed on an "AS IS" BASIS,
14687 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14688 * See the License for the specific language governing permissions and
14689 * limitations under the License.
14693 * File: OP_INVOKE_DIRECT_EMPTY.S
14695 * Code: Used as a no-op. Uses no substitutions.
14697 * For: invoke-direct-empty
14699 * Format: B|A|op CCCC G|F|E|D (35c)
14703 /* ------------------------------ */
14705 .L_OP_RETURN_VOID_BARRIER: /* 0xf1 */
14706 /* Copyright (C) 2008 The Android Open Source Project
14708 * Licensed under the Apache License, Version 2.0 (the "License");
14709 * you may not use this file except in compliance with the License.
14710 * You may obtain a copy of the License at
14712 * http://www.apache.org/licenses/LICENSE-2.0
14714 * Unless required by applicable law or agreed to in writing, software
14715 * distributed under the License is distributed on an "AS IS" BASIS,
14716 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14717 * See the License for the specific language governing permissions and
14718 * limitations under the License.
14725 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
14726 pushl rGLUE # push parameter glue
14727 call dvmMterp_OP_RETURN_VOID_BARRIER # call c-based implementation
14729 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
14730 FINISH_A # jump to next instruction
14731 /* ------------------------------ */
14733 .L_OP_IGET_QUICK: /* 0xf2 */
14734 /* File: x86-atom/OP_IGET_QUICK.S */
14735 /* Copyright (C) 2008 The Android Open Source Project
14737 * Licensed under the Apache License, Version 2.0 (the "License");
14738 * you may not use this file except in compliance with the License.
14739 * You may obtain a copy of the License at
14741 * http://www.apache.org/licenses/LICENSE-2.0
14743 * Unless required by applicable law or agreed to in writing, software
14744 * distributed under the License is distributed on an "AS IS" BASIS,
14745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14746 * See the License for the specific language governing permissions and
14747 * limitations under the License.
14751 * File: OP_IGET_QUICK.S
14753 * Code: Optimization for iget
14757 * Format: B|A|op CCCC (22c)
14759 * Syntax: op vA, vB, offset@CCCC
14762 movl rINST, %eax # %eax<- BA
14763 shr $4, %eax # %eax<- B
14764 and $15, rINST # rINST<- A
14765 GET_VREG %eax # %eax<- vB; object to operate on
14766 FETCH 1, %ecx # %ecx<- CCCC; field byte offset
14767 cmp $0, %eax # check if object is null
14768 je common_errNullObject # handle null object
14769 FFETCH_ADV 2, %edx # %eax<- next instruction hi; fetch, advance
14770 movl (%ecx, %eax), %eax # %eax<- object field
14771 SET_VREG %eax, rINST # fp[A]<- %eax
14772 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
14774 /* ------------------------------ */
14776 .L_OP_IGET_WIDE_QUICK: /* 0xf3 */
14777 /* File: x86-atom/OP_IGET_WIDE_QUICK.S */
14778 /* Copyright (C) 2008 The Android Open Source Project
14780 * Licensed under the Apache License, Version 2.0 (the "License");
14781 * you may not use this file except in compliance with the License.
14782 * You may obtain a copy of the License at
14784 * http://www.apache.org/licenses/LICENSE-2.0
14786 * Unless required by applicable law or agreed to in writing, software
14787 * distributed under the License is distributed on an "AS IS" BASIS,
14788 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14789 * See the License for the specific language governing permissions and
14790 * limitations under the License.
14794 * File: OP_IGET_WIDE_QUICK.S
14796 * Code: Optimization for iget
14798 * For: iget/wide-quick
14800 * Format: B|A|op CCCC (22c)
14802 * Syntax: op vA, vB, offset@CCCC
14805 movl rINST, %edx # %edx<- BA
14806 shr $4, %edx # %edx<- B
14807 andl $15, rINST # rINST<- A
14808 GET_VREG %edx # %edx<- vB; object to operate on
14809 cmp $0, %edx # check if object is null
14810 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14811 je common_errNullObject # handle null object
14812 FETCH 1, %ecx # %ecx<- CCCC; field byte offset
14813 movq (%ecx, %edx), %xmm0 # %xmm0<- object field
14814 movq %xmm0, (rFP, rINST, 4) # fp[A]<- %xmm0
14815 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14817 /* ------------------------------ */
14819 .L_OP_IGET_OBJECT_QUICK: /* 0xf4 */
14820 /* File: x86-atom/OP_IGET_OBJECT_QUICK.S */
14821 /* Copyright (C) 2008 The Android Open Source Project
14823 * Licensed under the Apache License, Version 2.0 (the "License");
14824 * you may not use this file except in compliance with the License.
14825 * You may obtain a copy of the License at
14827 * http://www.apache.org/licenses/LICENSE-2.0
14829 * Unless required by applicable law or agreed to in writing, software
14830 * distributed under the License is distributed on an "AS IS" BASIS,
14831 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14832 * See the License for the specific language governing permissions and
14833 * limitations under the License.
14837 * File: OP_IGET_OBJECT_QUICK.S
14840 /* File: x86-atom/OP_IGET_QUICK.S */
14841 /* Copyright (C) 2008 The Android Open Source Project
14843 * Licensed under the Apache License, Version 2.0 (the "License");
14844 * you may not use this file except in compliance with the License.
14845 * You may obtain a copy of the License at
14847 * http://www.apache.org/licenses/LICENSE-2.0
14849 * Unless required by applicable law or agreed to in writing, software
14850 * distributed under the License is distributed on an "AS IS" BASIS,
14851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14852 * See the License for the specific language governing permissions and
14853 * limitations under the License.
14857 * File: OP_IGET_QUICK.S
14859 * Code: Optimization for iget
14863 * Format: B|A|op CCCC (22c)
14865 * Syntax: op vA, vB, offset@CCCC
14868 movl rINST, %eax # %eax<- BA
14869 shr $4, %eax # %eax<- B
14870 and $15, rINST # rINST<- A
14871 GET_VREG %eax # %eax<- vB; object to operate on
14872 FETCH 1, %ecx # %ecx<- CCCC; field byte offset
14873 cmp $0, %eax # check if object is null
14874 je common_errNullObject # handle null object
14875 FFETCH_ADV 2, %edx # %eax<- next instruction hi; fetch, advance
14876 movl (%ecx, %eax), %eax # %eax<- object field
14877 SET_VREG %eax, rINST # fp[A]<- %eax
14878 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
14881 /* ------------------------------ */
14883 .L_OP_IPUT_QUICK: /* 0xf5 */
14884 /* File: x86-atom/OP_IPUT_QUICK.S */
14885 /* Copyright (C) 2008 The Android Open Source Project
14887 * Licensed under the Apache License, Version 2.0 (the "License");
14888 * you may not use this file except in compliance with the License.
14889 * You may obtain a copy of the License at
14891 * http://www.apache.org/licenses/LICENSE-2.0
14893 * Unless required by applicable law or agreed to in writing, software
14894 * distributed under the License is distributed on an "AS IS" BASIS,
14895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14896 * See the License for the specific language governing permissions and
14897 * limitations under the License.
14901 * File: OP_IPUT_QUICK.S
14902 * Code: Optimization for iput
14906 * Format: B|A|op CCCC (22c)
14908 * Syntax: op vA, vB, offset@CCCC
14911 movl rINST, %eax # %eax<- BA
14912 shr $4, %eax # %eax<- B
14913 and $15, rINST # rINST<- A
14914 GET_VREG %eax # %eax<- vB; object to operate on
14915 FETCH 1, %ecx # %ecx<- CCCC; field byte offset
14916 cmp $0, %eax # check if object is null
14917 je common_errNullObject # handle null object
14918 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
14919 GET_VREG rINST # rINST<- vA
14920 movl rINST, (%eax, %ecx) # object field<- vA
14921 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
14923 /* ------------------------------ */
14925 .L_OP_IPUT_WIDE_QUICK: /* 0xf6 */
14926 /* File: x86-atom/OP_IPUT_WIDE_QUICK.S */
14927 /* Copyright (C) 2008 The Android Open Source Project
14929 * Licensed under the Apache License, Version 2.0 (the "License");
14930 * you may not use this file except in compliance with the License.
14931 * You may obtain a copy of the License at
14933 * http://www.apache.org/licenses/LICENSE-2.0
14935 * Unless required by applicable law or agreed to in writing, software
14936 * distributed under the License is distributed on an "AS IS" BASIS,
14937 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14938 * See the License for the specific language governing permissions and
14939 * limitations under the License.
14943 * File: OP_IPUT_WIDE_QUICK.S
14945 * Code: Optimization for iput
14947 * For: iput/wide-quick
14949 * Format: B|A|op CCCC (22c)
14951 * Syntax: op vA, vB, offset@CCCC
14954 movl rINST, %edx # %edx<- BA
14955 shr $4, %edx # %edx<- B
14956 andl $15, rINST # rINST<- A
14957 GET_VREG %edx # %edx<- vB; object to operate on
14958 cmp $0, %edx # check if object is null
14959 FETCH 1, %ecx # %ecx<- CCCC; field byte offset
14960 je common_errNullObject # handle null object
14961 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
14962 movq (rFP, rINST, 4), %xmm0 # %xmm0<- fp[A]
14963 movq %xmm0, (%edx, %ecx) # object field<- %xmm0; fp[A]
14964 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
14966 /* ------------------------------ */
14968 .L_OP_IPUT_OBJECT_QUICK: /* 0xf7 */
14969 /* File: x86-atom/OP_IPUT_OBJECT_QUICK.S */
14970 /* Copyright (C) 2008 The Android Open Source Project
14972 * Licensed under the Apache License, Version 2.0 (the "License");
14973 * you may not use this file except in compliance with the License.
14974 * You may obtain a copy of the License at
14976 * http://www.apache.org/licenses/LICENSE-2.0
14978 * Unless required by applicable law or agreed to in writing, software
14979 * distributed under the License is distributed on an "AS IS" BASIS,
14980 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14981 * See the License for the specific language governing permissions and
14982 * limitations under the License.
14986 * File: OP_IPUT_OBJECT_QUICK.S
14989 /* File: x86-atom/OP_IPUT_QUICK.S */
14990 /* Copyright (C) 2008 The Android Open Source Project
14992 * Licensed under the Apache License, Version 2.0 (the "License");
14993 * you may not use this file except in compliance with the License.
14994 * You may obtain a copy of the License at
14996 * http://www.apache.org/licenses/LICENSE-2.0
14998 * Unless required by applicable law or agreed to in writing, software
14999 * distributed under the License is distributed on an "AS IS" BASIS,
15000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15001 * See the License for the specific language governing permissions and
15002 * limitations under the License.
15006 * File: OP_IPUT_QUICK.S
15007 * Code: Optimization for iput
15011 * Format: B|A|op CCCC (22c)
15013 * Syntax: op vA, vB, offset@CCCC
15016 movl rINST, %eax # %eax<- BA
15017 shr $4, %eax # %eax<- B
15018 and $15, rINST # rINST<- A
15019 GET_VREG %eax # %eax<- vB; object to operate on
15020 FETCH 1, %ecx # %ecx<- CCCC; field byte offset
15021 cmp $0, %eax # check if object is null
15022 je common_errNullObject # handle null object
15023 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
15024 GET_VREG rINST # rINST<- vA
15025 movl rINST, (%eax, %ecx) # object field<- vA
15026 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
15029 /* ------------------------------ */
15031 .L_OP_INVOKE_VIRTUAL_QUICK: /* 0xf8 */
15032 /* File: x86-atom/OP_INVOKE_VIRTUAL_QUICK.S */
15033 /* Copyright (C) 2008 The Android Open Source Project
15035 * Licensed under the Apache License, Version 2.0 (the "License");
15036 * you may not use this file except in compliance with the License.
15037 * You may obtain a copy of the License at
15039 * http://www.apache.org/licenses/LICENSE-2.0
15041 * Unless required by applicable law or agreed to in writing, software
15042 * distributed under the License is distributed on an "AS IS" BASIS,
15043 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15044 * See the License for the specific language governing permissions and
15045 * limitations under the License.
15049 * File: OP_INVOKE_VIRTUAL_QUICK.S
15051 * Code: Optimization for invoke-virtual and invoke-virtual/range
15053 * For: invoke-virtual/quick, invoke-virtual/quick-range
15057 FETCH 2, %edx # %edx<- GFED or CCCC
15059 and $15, %edx # %edx<- D if not range
15061 FETCH 1, %ecx # %ecx<- method index
15062 GET_VREG %edx # %edx<- "this" ptr
15063 cmp $0, %edx # %edx<- check for null "this"
15064 EXPORT_PC # must export pc for invoke
15065 je common_errNullObject
15066 movl offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
15067 movl offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
15068 movl (%edx, %ecx, 4), %ecx # %ecx<- vtable[methodIndex]
15069 jmp common_invokeMethodNoRange # invoke method common code
15071 /* ------------------------------ */
15073 .L_OP_INVOKE_VIRTUAL_QUICK_RANGE: /* 0xf9 */
15074 /* File: x86-atom/OP_INVOKE_VIRTUAL_QUICK_RANGE.S */
15075 /* Copyright (C) 2008 The Android Open Source Project
15077 * Licensed under the Apache License, Version 2.0 (the "License");
15078 * you may not use this file except in compliance with the License.
15079 * You may obtain a copy of the License at
15081 * http://www.apache.org/licenses/LICENSE-2.0
15083 * Unless required by applicable law or agreed to in writing, software
15084 * distributed under the License is distributed on an "AS IS" BASIS,
15085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15086 * See the License for the specific language governing permissions and
15087 * limitations under the License.
15091 * File: OP_INVOKE_VIRTUAL_QUICK_RANGE.S
15094 /* File: x86-atom/OP_INVOKE_VIRTUAL_QUICK.S */
15095 /* Copyright (C) 2008 The Android Open Source Project
15097 * Licensed under the Apache License, Version 2.0 (the "License");
15098 * you may not use this file except in compliance with the License.
15099 * You may obtain a copy of the License at
15101 * http://www.apache.org/licenses/LICENSE-2.0
15103 * Unless required by applicable law or agreed to in writing, software
15104 * distributed under the License is distributed on an "AS IS" BASIS,
15105 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15106 * See the License for the specific language governing permissions and
15107 * limitations under the License.
15111 * File: OP_INVOKE_VIRTUAL_QUICK.S
15113 * Code: Optimization for invoke-virtual and invoke-virtual/range
15115 * For: invoke-virtual/quick, invoke-virtual/quick-range
15119 FETCH 2, %edx # %edx<- GFED or CCCC
15121 and $15, %edx # %edx<- D if not range
15123 FETCH 1, %ecx # %ecx<- method index
15124 GET_VREG %edx # %edx<- "this" ptr
15125 cmp $0, %edx # %edx<- check for null "this"
15126 EXPORT_PC # must export pc for invoke
15127 je common_errNullObject
15128 movl offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
15129 movl offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
15130 movl (%edx, %ecx, 4), %ecx # %ecx<- vtable[methodIndex]
15131 jmp common_invokeMethodRange # invoke method common code
15134 /* ------------------------------ */
15136 .L_OP_INVOKE_SUPER_QUICK: /* 0xfa */
15137 /* File: x86-atom/OP_INVOKE_SUPER_QUICK.S */
15138 /* Copyright (C) 2008 The Android Open Source Project
15140 * Licensed under the Apache License, Version 2.0 (the "License");
15141 * you may not use this file except in compliance with the License.
15142 * You may obtain a copy of the License at
15144 * http://www.apache.org/licenses/LICENSE-2.0
15146 * Unless required by applicable law or agreed to in writing, software
15147 * distributed under the License is distributed on an "AS IS" BASIS,
15148 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15149 * See the License for the specific language governing permissions and
15150 * limitations under the License.
15154 * File: OP_INVOKE_SUPER_QUICK.S
15156 * Code: Optimization for invoke-super and invoke-super/range
15158 * For: invoke-super/quick, invoke-super/quick-range
15162 FETCH 2, %edx # %edx<- GFED or CCCC
15163 movl rGLUE, %ecx # %ecx<- pMterpGlue
15164 movl offGlue_method(%ecx), %eax # %eax<- glue->method
15166 and $15, %edx # %edx<- D if not range
15168 FETCH 1, %ecx # %ecx<- method index
15169 movl offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
15170 movl offClassObject_super(%eax), %eax # %eax<- glue->method->clazz->super
15171 EXPORT_PC # must export for invoke
15172 movl offClassObject_vtable(%eax), %eax # %edx<- glue->method->clazz->super->vtable
15173 cmp $0, (rFP, %edx, 4) # check for null object
15174 movl (%eax, %ecx, 4), %ecx # %ecx<- vtable[methodIndex]
15175 je common_errNullObject # handle null object
15176 jmp common_invokeMethodNoRange # invoke method common code
15178 /* ------------------------------ */
15180 .L_OP_INVOKE_SUPER_QUICK_RANGE: /* 0xfb */
15181 /* File: x86-atom/OP_INVOKE_SUPER_QUICK_RANGE.S */
15182 /* Copyright (C) 2008 The Android Open Source Project
15184 * Licensed under the Apache License, Version 2.0 (the "License");
15185 * you may not use this file except in compliance with the License.
15186 * You may obtain a copy of the License at
15188 * http://www.apache.org/licenses/LICENSE-2.0
15190 * Unless required by applicable law or agreed to in writing, software
15191 * distributed under the License is distributed on an "AS IS" BASIS,
15192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15193 * See the License for the specific language governing permissions and
15194 * limitations under the License.
15198 * File: OP_INVOKE_SUPER_QUICK_RANGE.S
15201 /* File: x86-atom/OP_INVOKE_SUPER_QUICK.S */
15202 /* Copyright (C) 2008 The Android Open Source Project
15204 * Licensed under the Apache License, Version 2.0 (the "License");
15205 * you may not use this file except in compliance with the License.
15206 * You may obtain a copy of the License at
15208 * http://www.apache.org/licenses/LICENSE-2.0
15210 * Unless required by applicable law or agreed to in writing, software
15211 * distributed under the License is distributed on an "AS IS" BASIS,
15212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15213 * See the License for the specific language governing permissions and
15214 * limitations under the License.
15218 * File: OP_INVOKE_SUPER_QUICK.S
15220 * Code: Optimization for invoke-super and invoke-super/range
15222 * For: invoke-super/quick, invoke-super/quick-range
15226 FETCH 2, %edx # %edx<- GFED or CCCC
15227 movl rGLUE, %ecx # %ecx<- pMterpGlue
15228 movl offGlue_method(%ecx), %eax # %eax<- glue->method
15230 and $15, %edx # %edx<- D if not range
15232 FETCH 1, %ecx # %ecx<- method index
15233 movl offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
15234 movl offClassObject_super(%eax), %eax # %eax<- glue->method->clazz->super
15235 EXPORT_PC # must export for invoke
15236 movl offClassObject_vtable(%eax), %eax # %edx<- glue->method->clazz->super->vtable
15237 cmp $0, (rFP, %edx, 4) # check for null object
15238 movl (%eax, %ecx, 4), %ecx # %ecx<- vtable[methodIndex]
15239 je common_errNullObject # handle null object
15240 jmp common_invokeMethodRange # invoke method common code
15243 /* ------------------------------ */
15245 .L_OP_IPUT_OBJECT_VOLATILE: /* 0xfc */
15246 /* Copyright (C) 2008 The Android Open Source Project
15248 * Licensed under the Apache License, Version 2.0 (the "License");
15249 * you may not use this file except in compliance with the License.
15250 * You may obtain a copy of the License at
15252 * http://www.apache.org/licenses/LICENSE-2.0
15254 * Unless required by applicable law or agreed to in writing, software
15255 * distributed under the License is distributed on an "AS IS" BASIS,
15256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15257 * See the License for the specific language governing permissions and
15258 * limitations under the License.
15265 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
15266 pushl rGLUE # push parameter glue
15267 call dvmMterp_OP_IPUT_OBJECT_VOLATILE # call c-based implementation
15269 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
15270 FINISH_A # jump to next instruction
15271 /* ------------------------------ */
15273 .L_OP_SGET_OBJECT_VOLATILE: /* 0xfd */
15274 /* Copyright (C) 2008 The Android Open Source Project
15276 * Licensed under the Apache License, Version 2.0 (the "License");
15277 * you may not use this file except in compliance with the License.
15278 * You may obtain a copy of the License at
15280 * http://www.apache.org/licenses/LICENSE-2.0
15282 * Unless required by applicable law or agreed to in writing, software
15283 * distributed under the License is distributed on an "AS IS" BASIS,
15284 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15285 * See the License for the specific language governing permissions and
15286 * limitations under the License.
15293 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
15294 pushl rGLUE # push parameter glue
15295 call dvmMterp_OP_SGET_OBJECT_VOLATILE # call c-based implementation
15297 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
15298 FINISH_A # jump to next instruction
15299 /* ------------------------------ */
15301 .L_OP_SPUT_OBJECT_VOLATILE: /* 0xfe */
15302 /* Copyright (C) 2008 The Android Open Source Project
15304 * Licensed under the Apache License, Version 2.0 (the "License");
15305 * you may not use this file except in compliance with the License.
15306 * You may obtain a copy of the License at
15308 * http://www.apache.org/licenses/LICENSE-2.0
15310 * Unless required by applicable law or agreed to in writing, software
15311 * distributed under the License is distributed on an "AS IS" BASIS,
15312 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15313 * See the License for the specific language governing permissions and
15314 * limitations under the License.
15321 SAVE_PC_FP_TO_GLUE %edx # save program counter and frame pointer
15322 pushl rGLUE # push parameter glue
15323 call dvmMterp_OP_SPUT_OBJECT_VOLATILE # call c-based implementation
15325 LOAD_PC_FP_FROM_GLUE # restore program counter and frame pointer
15326 FINISH_A # jump to next instruction
15327 /* ------------------------------ */
15329 .L_OP_DISPATCH_FF: /* 0xff */
15330 /* File: x86-atom/OP_DISPATCH_FF.S */
15331 /* Copyright (C) 2008 The Android Open Source Project
15333 * Licensed under the Apache License, Version 2.0 (the "License");
15334 * you may not use this file except in compliance with the License.
15335 * You may obtain a copy of the License at
15337 * http://www.apache.org/licenses/LICENSE-2.0
15339 * Unless required by applicable law or agreed to in writing, software
15340 * distributed under the License is distributed on an "AS IS" BASIS,
15341 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15342 * See the License for the specific language governing permissions and
15343 * limitations under the License.
15347 * File: OP_DISPATCH_FF.S
15350 /* File: x86-atom/unused.S */
15351 /* Copyright (C) 2008 The Android Open Source Project
15353 * Licensed under the Apache License, Version 2.0 (the "License");
15354 * you may not use this file except in compliance with the License.
15355 * You may obtain a copy of the License at
15357 * http://www.apache.org/licenses/LICENSE-2.0
15359 * Unless required by applicable law or agreed to in writing, software
15360 * distributed under the License is distributed on an "AS IS" BASIS,
15361 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15362 * See the License for the specific language governing permissions and
15363 * limitations under the License.
15369 * Code: Common code for unused bytecodes. Uses no subtitutions.
15371 * For: all unused bytecodes
15373 * Description: aborts if executed.
15375 * Format: ØØ|op (10x)
15385 .size dvmAsmInstructionStart, .-dvmAsmInstructionStart
15386 .global dvmAsmInstructionEnd
15387 dvmAsmInstructionEnd:
15390 * ===========================================================================
15391 * Sister implementations
15392 * ===========================================================================
15394 .global dvmAsmSisterStart
15395 .type dvmAsmSisterStart, %function
15400 /* continuation for OP_CONST_STRING */
15404 * Continuation if the Class has not yet been resolved.
15405 * %ecx: BBBB (Class ref)
15406 * need: target register
15409 .LOP_CONST_STRING_resolve:
15411 movl offGlue_method(%edx), %edx # %edx<- glue->method
15412 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
15413 movl %ecx, -4(%esp) # push parameter class ref
15414 movl %edx, -8(%esp) # push parameter glue->method->clazz
15416 call dvmResolveString # resolve string reference
15417 # call: (const ClassObject* referrer, u4 stringIdx)
15418 # return: StringObject*
15420 cmp $0, %eax # check if resolved string failed
15421 je common_exceptionThrown # resolve failed; exception thrown
15422 SET_VREG %eax, rINST # vAA<- %eax; pResString[BBBB]
15423 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
15424 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
15426 /* continuation for OP_CONST_STRING_JUMBO */
15430 * Continuation if the Class has not yet been resolved.
15431 * %ecx: BBBB (Class ref)
15432 * need: target register
15434 .LOP_CONST_STRING_JUMBO_resolve:
15436 movl rGLUE, %edx # get MterpGlue pointer
15437 movl offGlue_method(%edx), %edx # %edx<- glue->method
15438 movl offMethod_clazz(%edx), %edx # %edx <- glue->method->clazz
15439 movl %ecx, -4(%esp) # push parameter class ref
15440 movl %edx, -8(%esp) # push parameter glue->method->clazz
15442 call dvmResolveString # resolve string reference
15443 # call: (const ClassObject* referrer, u4 stringIdx)
15444 # return: StringObject*
15446 cmp $0, %eax # check if resolved string failed
15447 je common_exceptionThrown # resolve failed; exception thrown
15448 SET_VREG %eax, rINST # vAA<- %eax; pResString[BBBB]
15449 FINISH 3 # jump to next instruction
15450 /* continuation for OP_CONST_CLASS */
15453 * Continuation if the Class has not yet been resolved.
15454 * %ecx: BBBB (Class ref)
15455 * need: target register
15458 .LOP_CONST_CLASS_resolve:
15460 movl offGlue_method(%edx), %edx # %edx<- glue->method
15461 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
15462 movl $1, -4(%esp) # push parameter true
15463 movl %ecx, -8(%esp) # push parameter
15464 movl %edx, -12(%esp) # push parameter glue->method->clazz
15465 lea -12(%esp), %esp
15466 call dvmResolveClass # resolve ClassObject pointer
15467 # class: (const ClassObject* referrer, u4 classIdx,
15468 # bool fromUnverifiedConstant)
15469 # return: ClassObject*
15471 cmp $0, %eax # check for null pointer
15472 je common_exceptionThrown # handle exception
15473 SET_VREG %eax, rINST # vAA<- resolved class
15474 FINISH 2 # jump to next instruction
15475 /* continuation for OP_CHECK_CAST */
15477 .LOP_CHECK_CAST_resolved:
15478 cmp %ecx, offObject_clazz(rINST) # check for same class
15479 jne .LOP_CHECK_CAST_fullcheck # not same class; do full check
15481 .LOP_CHECK_CAST_okay:
15482 FINISH 2 # jump to next instruction
15485 * Trivial test failed, need to perform full check.
15486 * offObject_clazz(rINST) holds obj->clazz
15487 * %ecx holds class resolved from BBBB
15488 * rINST holds object
15491 .LOP_CHECK_CAST_fullcheck:
15492 movl offObject_clazz(rINST), %eax # %eax<- obj->clazz
15493 movl %eax, -12(%esp) # push parameter obj->clazz
15494 movl %ecx, -8(%esp) # push parameter # push parameter resolved class
15495 lea -12(%esp), %esp
15496 call dvmInstanceofNonTrivial # call: (ClassObject* instance, ClassObject* clazz)
15499 cmp $0, %eax # failed?
15500 jne .LOP_CHECK_CAST_okay # success
15503 * A cast has failed. We need to throw a ClassCastException with the
15504 * class of the object that failed to be cast.
15507 EXPORT_PC # we will throw an exception
15508 movl $.LstrClassCastExceptionPtr, -8(%esp) # push parameter message
15509 movl offObject_clazz(rINST), rINST # rINST<- obj->clazz
15510 movl offClassObject_descriptor(rINST), rINST # rINST<- obj->clazz->descriptor
15511 movl rINST, -4(%esp) # push parameter obj->clazz->descriptor
15513 call dvmThrowExceptionWithClassMessage # call: (const char* exceptionDescriptor,
15514 # const char* messageDescriptor, Object* cause)
15517 jmp common_exceptionThrown
15520 * Resolution required. This is the least-likely path.
15522 * rINST holds object
15525 .LOP_CHECK_CAST_resolve:
15526 movl offGlue_method(%edx), %eax # %eax<- glue->method
15527 FETCH 1, %ecx # %ecx holds BBBB
15528 EXPORT_PC # in case we throw an exception
15529 movl $0, -8(%esp) # push parameter false
15530 movl offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
15531 movl %ecx, -12(%esp) # push parameter BBBB
15532 movl %eax, -16(%esp) # push parameter glue->method>clazz
15533 lea -16(%esp), %esp
15534 call dvmResolveClass # resolve ClassObject pointer
15535 # call: (const ClassObject* referrer, u4 classIdx,
15536 # bool fromUnverifiedConstant)
15537 # return ClassObject*
15539 cmp $0, %eax # check for null pointer
15540 je common_exceptionThrown # handle excpetion
15541 movl %eax, %ecx # %ecx<- resolved class
15542 jmp .LOP_CHECK_CAST_resolved
15544 .LstrClassCastExceptionPtr:
15545 .asciz "Ljava/lang/ClassCastException;"
15547 /* continuation for OP_INSTANCE_OF */
15549 .LOP_INSTANCE_OF_break:
15550 movl rGLUE, %ecx # %ecx<- pMterpGlue
15551 movl offGlue_methodClassDex(%ecx), %ecx # %ecx<- pDvmDex
15552 FETCH 1, %eax # %eax<- CCCC
15553 movl offDvmDex_pResClasses(%ecx), %ecx # %ecx<- pDvmDex->pResClasses
15554 movl (%ecx, %eax, 4), %ecx # %ecx<- resolved class
15555 movl offObject_clazz(%edx), %edx # %edx<- obj->clazz
15556 cmp $0, %ecx # check if already resovled
15557 je .LOP_INSTANCE_OF_resolve # not resolved before, so resolve now
15559 .LOP_INSTANCE_OF_resolved:
15560 cmp %ecx, %edx # check if same class
15561 je .LOP_INSTANCE_OF_trivial # yes, finish
15562 jmp .LOP_INSTANCE_OF_fullcheck # no, do full check
15565 * The trivial test failed, we need to perform a full check.
15566 * %edx holds obj->clazz
15567 * %ecx holds class resolved from BBBB
15570 .LOP_INSTANCE_OF_fullcheck:
15571 movl %edx, -8(%esp) # push parameter obj->clazz
15572 movl %ecx, -4(%esp) # push parameter resolved class
15574 call dvmInstanceofNonTrivial # perform full check
15575 # call: (ClassObject* instance, ClassObject* clazz)
15577 andl $15, rINST # rINST<- A
15578 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
15580 SET_VREG %eax, rINST # vA<- r0
15581 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
15584 * %edx holds boolean result
15587 .LOP_INSTANCE_OF_store:
15588 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
15589 andl $15, rINST # rINST<- A
15590 SET_VREG %edx, rINST # vA<- r0
15591 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15594 * Trivial test succeeded, save and bail.
15597 .LOP_INSTANCE_OF_trivial:
15598 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
15599 andl $15, rINST # rINST<- A
15600 SET_VREG $1, rINST # vA<- r0
15601 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15604 * Resolution required. This is the least-likely path.
15608 .LOP_INSTANCE_OF_resolve:
15610 movl rGLUE, %ecx # %ecx<- pMterpGlue
15612 movl offGlue_method(%ecx), %ecx # %ecx<- glue->method
15613 movl offMethod_clazz(%ecx), %ecx # %ecx<- glue->method->clazz
15614 movl %ecx, -12(%esp) # push parameter glue->method->clazz
15615 movl %eax, -8(%esp) # push parameter CCCC; type index
15616 movl $1, -4(%esp) # push parameter true
15617 lea -12(%esp), %esp
15618 call dvmResolveClass # call: (const ClassObject* referrer, u4 classIdx,
15619 # bool fromUnverifiedConstant)
15620 # return: ClassObject*
15622 cmp $0, %eax # check for null
15623 je common_exceptionThrown # handle exception
15624 movl rINST, %edx # %edx<- BA+
15625 shr $4, %edx # %edx<- B
15626 movl %eax, %ecx # need class in %ecx
15627 GET_VREG %edx # %edx<- vB
15628 movl offObject_clazz(%edx), %edx # %edx<- obj->clazz
15629 jmp .LOP_INSTANCE_OF_resolved # clazz resolved, continue
15631 /* continuation for OP_NEW_INSTANCE */
15633 .LOP_NEW_INSTANCE_finish:
15634 movl %edx, -8(%esp) # push parameter object
15635 movl %eax, -4(%esp) # push parameter flags
15637 call dvmAllocObject # call: (ClassObject* clazz, int flags)
15639 cmp $0, %eax # check for failure
15641 je common_exceptionThrown # handle exception
15642 SET_VREG %eax, rINST # vAA<- pObject
15643 FINISH 2 # jump to next instruction
15646 * Class initialization required.
15648 * %edx holds class object
15651 .LOP_NEW_INSTANCE_needinit:
15652 movl %edx, -4(%esp) # push parameter object
15654 call dvmInitClass # call: (ClassObject* clazz)
15657 cmp $0, %eax # check for failure
15658 movl -4(%esp), %edx # %edx<- object
15659 je common_exceptionThrown # handle exception
15660 testl $(ACC_INTERFACE|ACC_ABSTRACT), offClassObject_accessFlags(%edx)
15661 mov $ALLOC_DONT_TRACK, %eax # %eax<- flag for alloc call
15662 je .LOP_NEW_INSTANCE_finish # continue
15663 jmp .LOP_NEW_INSTANCE_abstract # handle abstract or interface
15666 * Resolution required. This is the least-likely path.
15671 .LOP_NEW_INSTANCE_resolve:
15674 movl rGLUE, %ecx # %ecx<- pMterpGlue
15675 FETCH 1, %eax # %eax<- BBBB
15676 movl offGlue_method(%ecx), %ecx # %ecx<- glue->method
15677 movl offMethod_clazz(%ecx), %ecx # %ecx<- glue->method->clazz
15678 movl %ecx, -12(%esp) # push parameter clazz
15679 movl $0, -4(%esp) # push parameter false
15680 movl %eax, -8(%esp) # push parameter BBBB
15681 lea -12(%esp), %esp
15682 call dvmResolveClass # call: (const ClassObject* referrer,
15683 # u4 classIdx, bool fromUnverifiedConstant)
15684 # return: ClassObject*
15686 movl %eax, %edx # %edx<- pObject
15687 cmp $0, %edx # check for failure
15688 jne .LOP_NEW_INSTANCE_resolved # continue
15689 jmp common_exceptionThrown # handle exception
15692 * We can't instantiate an abstract class or interface, so throw an
15693 * InstantiationError with the class descriptor as the message.
15695 * %edx holds class object
15698 .LOP_NEW_INSTANCE_abstract:
15699 movl offClassObject_descriptor(%edx), %ecx # %ecx<- descriptor
15700 movl %ecx, -4(%esp) # push parameter descriptor
15701 movl $.LstrInstantiationErrorPtr, -8(%esp) # push parameter message
15703 call dvmThrowExceptionWithClassMessage # call: (const char* exceptionDescriptor,
15704 # const char* messageDescriptor)
15706 jmp common_exceptionThrown # handle exception
15708 .LstrInstantiationErrorPtr:
15709 .asciz "Ljava/lang/InstantiationError;"
15711 /* continuation for OP_NEW_ARRAY */
15714 * Resolve class. (This is an uncommon case.)
15716 * %edx holds array length
15717 * %ecx holds class ref CCCC
15720 .LOP_NEW_ARRAY_resolve:
15721 movl rGLUE, %eax # %eax<- pMterpGlue
15722 movl offGlue_method(%eax), %eax # %eax<- glue->method
15723 movl %edx, -4(%esp) # save length
15724 movl $0, -8(%esp) # push parameter false
15725 movl %ecx, -12(%esp) # push parameter class ref
15726 movl offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
15727 movl %eax, -16(%esp) # push parameter clazz
15728 lea -16(%esp), %esp
15729 call dvmResolveClass # call: (const ClassObject* referrer,
15730 # u4 classIdx, bool fromUnverifiedConstant)
15731 # return: ClassObject*
15732 cmp $0, %eax # check for failure
15734 je common_exceptionThrown # handle exception
15735 movl -4(%esp), %edx # %edx<- length
15738 * Finish allocation.
15741 * %edx holds array length
15744 .LOP_NEW_ARRAY_finish:
15745 movl %eax, -12(%esp) # push parameter class
15746 movl %edx, -8(%esp) # push parameter length
15747 movl $ALLOC_DONT_TRACK, -4(%esp)
15748 lea -12(%esp), %esp
15749 call dvmAllocArrayByClass # call: (ClassObject* arrayClass,
15750 # size_t length, int allocFlags)
15751 # return: ArrayObject*
15752 and $15, rINST # rINST<- A
15753 cmp $0, %eax # check for allocation failure
15755 je common_exceptionThrown # handle exception
15756 SET_VREG %eax, rINST # vA<- pArray
15757 FINISH 2 # jump to next instruction
15759 /* continuation for OP_FILLED_NEW_ARRAY */
15761 .LOP_FILLED_NEW_ARRAY_break:
15762 movl $0, -8(%esp) # push parameter false
15763 movl %ecx, -12(%esp) # push parameter BBBB
15764 movl rGLUE, %edx # %edx<- MterpGlue pointer
15765 movl offGlue_method(%edx), %edx # %edx<- glue->method
15766 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
15767 movl %edx, -16(%esp) # push parameter glue->method->clazz
15768 lea -16(%esp), %esp
15769 call dvmResolveClass # call: (const ClassObject* referrer, u4 classIdx,
15770 # bool fromUnverifiedConstant)
15771 # return: ClassObject*
15773 cmp $0, %eax # check for null return
15774 je common_exceptionThrown # handle exception
15778 * %eax holds array class
15779 * rINST holds BA or AA
15782 .LOP_FILLED_NEW_ARRAY_continue:
15783 movl offClassObject_descriptor(%eax), %eax # %eax<- arrayClass->descriptor
15784 movzbl 1(%eax), %eax # %eax<- descriptor[1]
15785 cmp $'I', %eax # check if array of ints
15786 jne .LOP_FILLED_NEW_ARRAY_notimpl # jump to not implemented
15787 movl rINST, -12(%esp) # push parameter length
15788 movl %eax, -16(%esp) # push parameter descriptor[1]
15789 movl $ALLOC_DONT_TRACK, -8(%esp) # push parameter to allocate flags
15791 shrl $4, -12(%esp) # parameter length is B
15793 lea -16(%esp), %esp
15794 call dvmAllocPrimitiveArray # call: (char type, size_t length, int allocFlags)
15795 # return: ArrayObject*
15797 cmp $0, %eax # check for null return
15798 je common_exceptionThrown # handle exception
15800 FETCH 2, %edx # %edx<- FEDC or CCCC
15801 movl rGLUE, %ecx # %ecx<- MterpGlue pointer
15802 movl %eax, offGlue_retval(%ecx) # retval<- new array
15803 lea offArrayObject_contents(%eax), %eax # %eax<- newArray->contents
15804 subl $1, -12(%esp) # length--; check for negative
15805 js 2f # if length was zero, finish
15808 * copy values from registers into the array
15809 * %eax=array, %edx=CCCC/FEDC, -12(%esp)=length (from AA or B), rINST=AA/BA
15813 lea (rFP, %edx, 4), %ecx # %ecx<- &fpp[CCCC]
15815 movl (%ecx), %edx # %edx<- %ecx++
15816 lea 4(%ecx), %ecx # %ecx++
15817 movl %edx, (%eax) # *contents<- vX
15818 lea 4(%eax), %eax # %eax++; contents++
15819 subl $1, -12(%esp) # length--
15820 jns 1b # or continue at 2
15822 cmp $4, -12(%esp) # check length
15823 jne 1f # has four args
15824 and $15, rINST # rINST<- A
15825 GET_VREG rINST # rINST<- vA
15826 subl $1, -12(%esp) # count--
15827 movl rINST, 16(%eax) # contents[4]<- vA
15829 movl %edx, %ecx # %ecx<- %edx; ecx for temp
15830 andl $15, %ecx # %ecx<- G/F/E/D
15831 GET_VREG %ecx # %ecx<- vG/vF/vE/vD
15832 shr $4, %edx # %edx<- put next reg in low 4
15833 subl $1, -12(%esp) # count--
15834 movl %ecx, (%eax) # *contents<- vX
15835 lea 4(%eax), %eax # %eax++; contents++
15836 jns 1b # or continue at 2
15839 FINISH 3 # jump to next instruction
15842 * Throw an exception to indicate this mode of filled-new-array
15843 * has not been implemented.
15846 .LOP_FILLED_NEW_ARRAY_notimpl:
15847 movl $.LstrInternalError, -8(%esp)
15848 movl $.LstrFilledNewArrayNotImpl, -4(%esp)
15850 call dvmThrowException # call: (const char* exceptionDescriptor,
15854 jmp common_exceptionThrown
15856 .if (!0) # define in one or the other, not both
15857 .LstrFilledNewArrayNotImpl:
15858 .asciz "filled-new-array only implemented for 'int'"
15859 .LstrInternalError:
15860 .asciz "Ljava/lang/InternalError;"
15863 /* continuation for OP_FILLED_NEW_ARRAY_RANGE */
15865 .LOP_FILLED_NEW_ARRAY_RANGE_break:
15866 movl $0, -8(%esp) # push parameter false
15867 movl %ecx, -12(%esp) # push parameter BBBB
15868 movl rGLUE, %edx # %edx<- MterpGlue pointer
15869 movl offGlue_method(%edx), %edx # %edx<- glue->method
15870 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
15871 movl %edx, -16(%esp) # push parameter glue->method->clazz
15872 lea -16(%esp), %esp
15873 call dvmResolveClass # call: (const ClassObject* referrer, u4 classIdx,
15874 # bool fromUnverifiedConstant)
15875 # return: ClassObject*
15877 cmp $0, %eax # check for null return
15878 je common_exceptionThrown # handle exception
15882 * %eax holds array class
15883 * rINST holds BA or AA
15886 .LOP_FILLED_NEW_ARRAY_RANGE_continue:
15887 movl offClassObject_descriptor(%eax), %eax # %eax<- arrayClass->descriptor
15888 movzbl 1(%eax), %eax # %eax<- descriptor[1]
15889 cmp $'I', %eax # check if array of ints
15890 jne .LOP_FILLED_NEW_ARRAY_RANGE_notimpl # jump to not implemented
15891 movl rINST, -12(%esp) # push parameter length
15892 movl %eax, -16(%esp) # push parameter descriptor[1]
15893 movl $ALLOC_DONT_TRACK, -8(%esp) # push parameter to allocate flags
15895 shrl $4, -12(%esp) # parameter length is B
15897 lea -16(%esp), %esp
15898 call dvmAllocPrimitiveArray # call: (char type, size_t length, int allocFlags)
15899 # return: ArrayObject*
15901 cmp $0, %eax # check for null return
15902 je common_exceptionThrown # handle exception
15904 FETCH 2, %edx # %edx<- FEDC or CCCC
15905 movl rGLUE, %ecx # %ecx<- MterpGlue pointer
15906 movl %eax, offGlue_retval(%ecx) # retval<- new array
15907 lea offArrayObject_contents(%eax), %eax # %eax<- newArray->contents
15908 subl $1, -12(%esp) # length--; check for negative
15909 js 2f # if length was zero, finish
15912 * copy values from registers into the array
15913 * %eax=array, %edx=CCCC/FEDC, -12(%esp)=length (from AA or B), rINST=AA/BA
15917 lea (rFP, %edx, 4), %ecx # %ecx<- &fpp[CCCC]
15919 movl (%ecx), %edx # %edx<- %ecx++
15920 lea 4(%ecx), %ecx # %ecx++
15921 movl %edx, (%eax) # *contents<- vX
15922 lea 4(%eax), %eax # %eax++; contents++
15923 subl $1, -12(%esp) # length--
15924 jns 1b # or continue at 2
15926 cmp $4, -12(%esp) # check length
15927 jne 1f # has four args
15928 and $15, rINST # rINST<- A
15929 GET_VREG rINST # rINST<- vA
15930 subl $1, -12(%esp) # count--
15931 movl rINST, 16(%eax) # contents[4]<- vA
15933 movl %edx, %ecx # %ecx<- %edx; ecx for temp
15934 andl $15, %ecx # %ecx<- G/F/E/D
15935 GET_VREG %ecx # %ecx<- vG/vF/vE/vD
15936 shr $4, %edx # %edx<- put next reg in low 4
15937 subl $1, -12(%esp) # count--
15938 movl %ecx, (%eax) # *contents<- vX
15939 lea 4(%eax), %eax # %eax++; contents++
15940 jns 1b # or continue at 2
15943 FINISH 3 # jump to next instruction
15946 * Throw an exception to indicate this mode of filled-new-array
15947 * has not been implemented.
15950 .LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
15951 movl $.LstrInternalError, -8(%esp)
15952 movl $.LstrFilledNewArrayNotImpl, -4(%esp)
15954 call dvmThrowException # call: (const char* exceptionDescriptor,
15958 jmp common_exceptionThrown
15960 .if (!1) # define in one or the other, not both
15961 .LstrFilledNewArrayNotImpl:
15962 .asciz "filled-new-array only implemented for 'int'"
15963 .LstrInternalError:
15964 .asciz "Ljava/lang/InternalError;"
15967 /* continuation for OP_PACKED_SWITCH */
15968 .LOP_PACKED_SWITCH_finish:
15969 FINISH_RB %edx, %ecx # jump to next instruction
15971 /* continuation for OP_SPARSE_SWITCH */
15972 .LOP_SPARSE_SWITCH_finish:
15973 FINISH_RB %edx, %ecx # jump to next instruction
15975 /* continuation for OP_CMPL_FLOAT */
15976 .LOP_CMPL_FLOAT_greater:
15977 movl $0x1, (rFP, rINST, 4) # vAA<- greater than
15978 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15980 .LOP_CMPL_FLOAT_final:
15981 movl $0x0, (rFP, rINST, 4) # vAA<- equal
15982 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15984 .LOP_CMPL_FLOAT_finalNan:
15985 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- NaN
15986 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15988 /* continuation for OP_CMPG_FLOAT */
15989 .LOP_CMPG_FLOAT_greater:
15990 movl $0x1, (rFP, rINST, 4) # vAA<- greater than
15991 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15993 .LOP_CMPG_FLOAT_final:
15994 movl $0x0, (rFP, rINST, 4) # vAA<- equal
15995 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
15997 .LOP_CMPG_FLOAT_finalNan:
15998 movl $0x1, (rFP, rINST, 4) # vAA<- NaN
15999 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16001 /* continuation for OP_CMPL_DOUBLE */
16002 .LOP_CMPL_DOUBLE_greater:
16003 movl $0x1, (rFP, rINST, 4) # vAA<- greater than
16004 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16006 .LOP_CMPL_DOUBLE_final:
16007 movl $0x0, (rFP, rINST, 4) # vAA<- equal
16008 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16010 .LOP_CMPL_DOUBLE_finalNan:
16011 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- NaN
16012 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16014 /* continuation for OP_CMPG_DOUBLE */
16015 .LOP_CMPG_DOUBLE_greater:
16016 movl $0x1, (rFP, rINST, 4) # vAA<- greater than
16017 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16019 .LOP_CMPG_DOUBLE_final:
16020 movl $0x0, (rFP, rINST, 4) # vAA<- equal
16021 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16023 .LOP_CMPG_DOUBLE_finalNan:
16024 movl $0x1, (rFP, rINST, 4) # vAA<- NaN
16025 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16027 /* continuation for OP_CMP_LONG */
16029 .LOP_CMP_LONG_final:
16030 movl $0x0, (rFP, rINST, 4) # vAA<- equal
16031 FINISH 2 # jump to next instruction
16033 .LOP_CMP_LONG_less:
16034 movl $0xFFFFFFFF, (rFP, rINST, 4) # vAA<- less than
16035 FINISH 2 # jump to next instruction
16037 .LOP_CMP_LONG_greater:
16038 movl $0x1, (rFP, rINST, 4) # vAA<- greater than
16039 FINISH 2 # jump to next instruction
16041 /* continuation for OP_APUT_OBJECT */
16043 .LOP_APUT_OBJECT_finish:
16044 movl %edx, sReg0 # save &vBB[vCC]
16045 movl offObject_clazz(rINST), %edx # %edx<- obj->clazz
16046 movl %edx, -8(%esp) # push parameter obj->clazz
16047 movl offObject_clazz(%eax), %eax # %eax<- arrayObj->clazz
16048 movl %eax, -4(%esp) # push parameter arrayObj->clazz
16050 call dvmCanPutArrayElement # test object type vs. array type
16051 # call: ClassObject* elemClass, ClassObject* arrayClass)
16054 cmp $0, %eax # check for invalid array value
16055 je common_errArrayStore # handle invalid array value
16056 movl sReg0, %edx # restore &vBB[vCC]
16058 .LOP_APUT_OBJECT_skip_check:
16059 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16060 movl rINST, offArrayObject_contents(%edx)
16061 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16063 /* continuation for OP_IGET */
16066 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16067 # return: InstField*
16068 cmp $0, %eax # check if resolved
16070 je common_exceptionThrown # not resolved; handle exception
16073 * %eax holds resolved field
16077 movl rINST, %ecx # %ecx<- BA
16078 shr $4, %ecx # %ecx<- B
16079 and $15, rINST # rINST<- A
16081 GET_VREG %ecx # %ecx<- vB
16082 cmp $0, %ecx # check for null object
16083 je common_errNullObject # handle null object
16084 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16085 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16086 movl (%ecx, %edx), %edx # %edx<- object field
16087 SET_VREG %edx, rINST # vA<- %edx; object field
16088 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16090 /* continuation for OP_IGET_WIDE */
16092 .LOP_IGET_WIDE_finish2:
16094 call dvmResolveInstField # resolve InstField ptr
16095 # call: (const ClassObject* referrer, u4 ifieldIdx)
16096 # return: InstField*
16097 cmp $0, %eax # check if resolved
16099 movl %eax, %ecx # %ecx<- %eax; %ecx expected to hold field
16100 je common_exceptionThrown
16103 * %ecx holds resolved field
16106 .LOP_IGET_WIDE_finish:
16108 movl rINST, %edx # %edx<- BA
16109 shr $4, %edx # %edx<- B
16110 andl $15, rINST # rINST<- A
16111 GET_VREG %edx # %edx<- vB
16112 cmp $0, %edx # check for null object
16113 je common_errNullObject
16114 movl offInstField_byteOffset(%ecx), %ecx # %ecx<- field offset
16115 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16116 movq (%ecx, %edx), %xmm0 # %xmm0<- object field
16117 movq %xmm0, (rFP, rINST, 4) # vA<- %xmm0; object field
16118 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16120 /* continuation for OP_IGET_OBJECT */
16122 .LOP_IGET_OBJECT_finish:
16123 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16124 # return: InstField*
16125 cmp $0, %eax # check if resolved
16127 je common_exceptionThrown # not resolved; handle exception
16130 * %eax holds resolved field
16133 .LOP_IGET_OBJECT_finish2:
16134 movl rINST, %ecx # %ecx<- BA
16135 shr $4, %ecx # %ecx<- B
16136 and $15, rINST # rINST<- A
16138 GET_VREG %ecx # %ecx<- vB
16139 cmp $0, %ecx # check for null object
16140 je common_errNullObject # handle null object
16141 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16142 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16143 movl (%ecx, %edx), %edx # %edx<- object field
16144 SET_VREG %edx, rINST # vA<- %edx; object field
16145 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16147 /* continuation for OP_IGET_BOOLEAN */
16149 .LOP_IGET_BOOLEAN_finish:
16150 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16151 # return: InstField*
16152 cmp $0, %eax # check if resolved
16154 je common_exceptionThrown # not resolved; handle exception
16157 * %eax holds resolved field
16160 .LOP_IGET_BOOLEAN_finish2:
16161 movl rINST, %ecx # %ecx<- BA
16162 shr $4, %ecx # %ecx<- B
16163 and $15, rINST # rINST<- A
16165 GET_VREG %ecx # %ecx<- vB
16166 cmp $0, %ecx # check for null object
16167 je common_errNullObject # handle null object
16168 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16169 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16170 movl (%ecx, %edx), %edx # %edx<- object field
16171 SET_VREG %edx, rINST # vA<- %edx; object field
16172 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16174 /* continuation for OP_IGET_BYTE */
16176 .LOP_IGET_BYTE_finish:
16177 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16178 # return: InstField*
16179 cmp $0, %eax # check if resolved
16181 je common_exceptionThrown # not resolved; handle exception
16184 * %eax holds resolved field
16187 .LOP_IGET_BYTE_finish2:
16188 movl rINST, %ecx # %ecx<- BA
16189 shr $4, %ecx # %ecx<- B
16190 and $15, rINST # rINST<- A
16192 GET_VREG %ecx # %ecx<- vB
16193 cmp $0, %ecx # check for null object
16194 je common_errNullObject # handle null object
16195 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16196 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16197 movl (%ecx, %edx), %edx # %edx<- object field
16198 SET_VREG %edx, rINST # vA<- %edx; object field
16199 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16201 /* continuation for OP_IGET_CHAR */
16203 .LOP_IGET_CHAR_finish:
16204 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16205 # return: InstField*
16206 cmp $0, %eax # check if resolved
16208 je common_exceptionThrown # not resolved; handle exception
16211 * %eax holds resolved field
16214 .LOP_IGET_CHAR_finish2:
16215 movl rINST, %ecx # %ecx<- BA
16216 shr $4, %ecx # %ecx<- B
16217 and $15, rINST # rINST<- A
16219 GET_VREG %ecx # %ecx<- vB
16220 cmp $0, %ecx # check for null object
16221 je common_errNullObject # handle null object
16222 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16223 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16224 movl (%ecx, %edx), %edx # %edx<- object field
16225 SET_VREG %edx, rINST # vA<- %edx; object field
16226 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16228 /* continuation for OP_IGET_SHORT */
16230 .LOP_IGET_SHORT_finish:
16231 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16232 # return: InstField*
16233 cmp $0, %eax # check if resolved
16235 je common_exceptionThrown # not resolved; handle exception
16238 * %eax holds resolved field
16241 .LOP_IGET_SHORT_finish2:
16242 movl rINST, %ecx # %ecx<- BA
16243 shr $4, %ecx # %ecx<- B
16244 and $15, rINST # rINST<- A
16246 GET_VREG %ecx # %ecx<- vB
16247 cmp $0, %ecx # check for null object
16248 je common_errNullObject # handle null object
16249 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16250 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16251 movl (%ecx, %edx), %edx # %edx<- object field
16252 SET_VREG %edx, rINST # vA<- %edx; object field
16253 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16255 /* continuation for OP_IPUT */
16258 movl offGlue_method(%edx), %edx # %edx<- glue->method
16259 EXPORT_PC # in case an exception is thrown
16260 movl %ecx, -4(%esp) # push parameter CCCC; field ref
16261 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16263 movl %edx, (%esp) # push parameter method->clazz
16264 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16265 # return: InstField*
16267 cmp $0, %eax # check if resolved
16268 jne .LOP_IPUT_finish2
16269 jmp common_exceptionThrown # not resolved; handle exception
16272 movl rINST, %ecx # %ecx<- BA+
16273 shr $4, %ecx # %ecx<- B
16274 and $15, rINST # rINST<- A
16275 GET_VREG %ecx # %ecx<- vB
16276 cmp $0, %ecx # check for null object
16277 je common_errNullObject # handle null object
16278 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16279 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16280 GET_VREG rINST # rINST<- vA
16281 movl rINST, (%edx, %ecx) # object field<- vA
16282 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16284 /* continuation for OP_IPUT_WIDE */
16286 .LOP_IPUT_WIDE_finish2:
16288 call dvmResolveInstField # resolve InstField ptr
16289 cmp $0, %eax # check if resolved
16291 movl %eax, %ecx # %ecx<- %eax; %ecx expected to hold field
16292 jne .LOP_IPUT_WIDE_finish
16293 jmp common_exceptionThrown
16297 * %ecx holds resolved field
16298 * %edx does not hold object yet
16301 .LOP_IPUT_WIDE_finish:
16302 movl rINST, %edx # %edx<- BA
16303 shr $4, %edx # %edx<- B
16304 andl $15, rINST # rINST<- A
16305 GET_VREG %edx # %edx<- vB
16306 cmp $0, %edx # check for null object
16307 je common_errNullObject
16308 movl offInstField_byteOffset(%ecx), %ecx # %ecx<- field offset
16309 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16310 movq (rFP, rINST, 4), %xmm0 # %xmm0<- vA
16311 movq %xmm0, (%ecx, %edx) # object field<- %xmm0; vA
16312 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16314 /* continuation for OP_IPUT_OBJECT */
16316 .LOP_IPUT_OBJECT_finish:
16317 movl offGlue_method(%edx), %edx # %edx<- glue->method
16318 EXPORT_PC # in case an exception is thrown
16319 movl %ecx, -4(%esp) # push parameter CCCC; field ref
16320 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16322 movl %edx, (%esp) # push parameter method->clazz
16323 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16324 # return: InstField*
16326 cmp $0, %eax # check if resolved
16327 jne .LOP_IPUT_OBJECT_finish2
16328 jmp common_exceptionThrown # not resolved; handle exception
16330 .LOP_IPUT_OBJECT_finish2:
16331 movl rINST, %ecx # %ecx<- BA+
16332 shr $4, %ecx # %ecx<- B
16333 and $15, rINST # rINST<- A
16334 GET_VREG %ecx # %ecx<- vB
16335 cmp $0, %ecx # check for null object
16336 je common_errNullObject # handle null object
16337 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16338 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16339 GET_VREG rINST # rINST<- vA
16340 movl rINST, (%edx, %ecx) # object field<- vA
16341 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16343 /* continuation for OP_IPUT_BOOLEAN */
16345 .LOP_IPUT_BOOLEAN_finish:
16346 movl offGlue_method(%edx), %edx # %edx<- glue->method
16347 EXPORT_PC # in case an exception is thrown
16348 movl %ecx, -4(%esp) # push parameter CCCC; field ref
16349 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16351 movl %edx, (%esp) # push parameter method->clazz
16352 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16353 # return: InstField*
16355 cmp $0, %eax # check if resolved
16356 jne .LOP_IPUT_BOOLEAN_finish2
16357 jmp common_exceptionThrown # not resolved; handle exception
16359 .LOP_IPUT_BOOLEAN_finish2:
16360 movl rINST, %ecx # %ecx<- BA+
16361 shr $4, %ecx # %ecx<- B
16362 and $15, rINST # rINST<- A
16363 GET_VREG %ecx # %ecx<- vB
16364 cmp $0, %ecx # check for null object
16365 je common_errNullObject # handle null object
16366 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16367 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16368 GET_VREG rINST # rINST<- vA
16369 movl rINST, (%edx, %ecx) # object field<- vA
16370 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16372 /* continuation for OP_IPUT_BYTE */
16374 .LOP_IPUT_BYTE_finish:
16375 movl offGlue_method(%edx), %edx # %edx<- glue->method
16376 EXPORT_PC # in case an exception is thrown
16377 movl %ecx, -4(%esp) # push parameter CCCC; field ref
16378 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16380 movl %edx, (%esp) # push parameter method->clazz
16381 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16382 # return: InstField*
16384 cmp $0, %eax # check if resolved
16385 jne .LOP_IPUT_BYTE_finish2
16386 jmp common_exceptionThrown # not resolved; handle exception
16388 .LOP_IPUT_BYTE_finish2:
16389 movl rINST, %ecx # %ecx<- BA+
16390 shr $4, %ecx # %ecx<- B
16391 and $15, rINST # rINST<- A
16392 GET_VREG %ecx # %ecx<- vB
16393 cmp $0, %ecx # check for null object
16394 je common_errNullObject # handle null object
16395 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16396 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16397 GET_VREG rINST # rINST<- vA
16398 movl rINST, (%edx, %ecx) # object field<- vA
16399 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16401 /* continuation for OP_IPUT_CHAR */
16403 .LOP_IPUT_CHAR_finish:
16404 movl offGlue_method(%edx), %edx # %edx<- glue->method
16405 EXPORT_PC # in case an exception is thrown
16406 movl %ecx, -4(%esp) # push parameter CCCC; field ref
16407 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16409 movl %edx, (%esp) # push parameter method->clazz
16410 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16411 # return: InstField*
16413 cmp $0, %eax # check if resolved
16414 jne .LOP_IPUT_CHAR_finish2
16415 jmp common_exceptionThrown # not resolved; handle exception
16417 .LOP_IPUT_CHAR_finish2:
16418 movl rINST, %ecx # %ecx<- BA+
16419 shr $4, %ecx # %ecx<- B
16420 and $15, rINST # rINST<- A
16421 GET_VREG %ecx # %ecx<- vB
16422 cmp $0, %ecx # check for null object
16423 je common_errNullObject # handle null object
16424 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16425 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16426 GET_VREG rINST # rINST<- vA
16427 movl rINST, (%edx, %ecx) # object field<- vA
16428 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16430 /* continuation for OP_IPUT_SHORT */
16432 .LOP_IPUT_SHORT_finish:
16433 movl offGlue_method(%edx), %edx # %edx<- glue->method
16434 EXPORT_PC # in case an exception is thrown
16435 movl %ecx, -4(%esp) # push parameter CCCC; field ref
16436 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16438 movl %edx, (%esp) # push parameter method->clazz
16439 call dvmResolveInstField # call: (const ClassObject* referrer, u4 ifieldIdx)
16440 # return: InstField*
16442 cmp $0, %eax # check if resolved
16443 jne .LOP_IPUT_SHORT_finish2
16444 jmp common_exceptionThrown # not resolved; handle exception
16446 .LOP_IPUT_SHORT_finish2:
16447 movl rINST, %ecx # %ecx<- BA+
16448 shr $4, %ecx # %ecx<- B
16449 and $15, rINST # rINST<- A
16450 GET_VREG %ecx # %ecx<- vB
16451 cmp $0, %ecx # check for null object
16452 je common_errNullObject # handle null object
16453 movl offInstField_byteOffset(%eax), %edx # %edx<- field offset
16454 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16455 GET_VREG rINST # rINST<- vA
16456 movl rINST, (%edx, %ecx) # object field<- vA
16457 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16459 /* continuation for OP_SGET */
16462 movl offGlue_method(%edx), %edx # %edx <- glue->method
16463 EXPORT_PC # in case an exception is thrown
16464 movl %eax, -4(%esp) # push parameter CCCC; field ref
16465 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16466 movl %edx, -8(%esp) # push parameter method->clazz
16468 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16469 # return: StaticField*
16470 cmp $0, %eax # check if initalization failed
16472 je common_exceptionThrown # failed; handle exception
16473 mov %eax, %ecx # %ecx<- result
16476 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
16477 movl offStaticField_value(%ecx), %eax # %eax<- field value
16478 SET_VREG %eax, rINST # vAA<- field value
16479 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
16481 /* continuation for OP_SGET_WIDE */
16484 * Continuation if the field has not yet been resolved.
16485 * %edx: BBBB field ref
16488 .LOP_SGET_WIDE_resolve:
16489 movl offGlue_method(%eax), %eax # %eax <- glue->method
16490 EXPORT_PC # in case an exception is thrown
16491 movl %edx, -4(%esp) # push parameter CCCC; field ref
16492 movl offMethod_clazz(%eax), %eax # %eax<- method->clazz
16493 movl %eax, -8(%esp) # push parameter method->clazz
16495 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16496 # return: StaticField*
16498 cmp $0, %eax # check if initalization failed
16499 movl %eax, %ecx # %ecx<- result
16500 jne .LOP_SGET_WIDE_finish # success, continue
16501 jmp common_exceptionThrown # failed; handle exception
16503 /* continuation for OP_SGET_OBJECT */
16505 .LOP_SGET_OBJECT_resolve:
16506 movl offGlue_method(%edx), %edx # %edx <- glue->method
16507 EXPORT_PC # in case an exception is thrown
16508 movl %eax, -4(%esp) # push parameter CCCC; field ref
16509 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16510 movl %edx, -8(%esp) # push parameter method->clazz
16512 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16513 # return: StaticField*
16514 cmp $0, %eax # check if initalization failed
16516 je common_exceptionThrown # failed; handle exception
16517 mov %eax, %ecx # %ecx<- result
16519 .LOP_SGET_OBJECT_finish:
16520 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
16521 movl offStaticField_value(%ecx), %eax # %eax<- field value
16522 SET_VREG %eax, rINST # vAA<- field value
16523 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
16525 /* continuation for OP_SGET_BOOLEAN */
16527 .LOP_SGET_BOOLEAN_resolve:
16528 movl offGlue_method(%edx), %edx # %edx <- glue->method
16529 EXPORT_PC # in case an exception is thrown
16530 movl %eax, -4(%esp) # push parameter CCCC; field ref
16531 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16532 movl %edx, -8(%esp) # push parameter method->clazz
16534 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16535 # return: StaticField*
16536 cmp $0, %eax # check if initalization failed
16538 je common_exceptionThrown # failed; handle exception
16539 mov %eax, %ecx # %ecx<- result
16541 .LOP_SGET_BOOLEAN_finish:
16542 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
16543 movl offStaticField_value(%ecx), %eax # %eax<- field value
16544 SET_VREG %eax, rINST # vAA<- field value
16545 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
16547 /* continuation for OP_SGET_BYTE */
16549 .LOP_SGET_BYTE_resolve:
16550 movl offGlue_method(%edx), %edx # %edx <- glue->method
16551 EXPORT_PC # in case an exception is thrown
16552 movl %eax, -4(%esp) # push parameter CCCC; field ref
16553 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16554 movl %edx, -8(%esp) # push parameter method->clazz
16556 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16557 # return: StaticField*
16558 cmp $0, %eax # check if initalization failed
16560 je common_exceptionThrown # failed; handle exception
16561 mov %eax, %ecx # %ecx<- result
16563 .LOP_SGET_BYTE_finish:
16564 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
16565 movl offStaticField_value(%ecx), %eax # %eax<- field value
16566 SET_VREG %eax, rINST # vAA<- field value
16567 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
16569 /* continuation for OP_SGET_CHAR */
16571 .LOP_SGET_CHAR_resolve:
16572 movl offGlue_method(%edx), %edx # %edx <- glue->method
16573 EXPORT_PC # in case an exception is thrown
16574 movl %eax, -4(%esp) # push parameter CCCC; field ref
16575 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16576 movl %edx, -8(%esp) # push parameter method->clazz
16578 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16579 # return: StaticField*
16580 cmp $0, %eax # check if initalization failed
16582 je common_exceptionThrown # failed; handle exception
16583 mov %eax, %ecx # %ecx<- result
16585 .LOP_SGET_CHAR_finish:
16586 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
16587 movl offStaticField_value(%ecx), %eax # %eax<- field value
16588 SET_VREG %eax, rINST # vAA<- field value
16589 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
16591 /* continuation for OP_SGET_SHORT */
16593 .LOP_SGET_SHORT_resolve:
16594 movl offGlue_method(%edx), %edx # %edx <- glue->method
16595 EXPORT_PC # in case an exception is thrown
16596 movl %eax, -4(%esp) # push parameter CCCC; field ref
16597 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16598 movl %edx, -8(%esp) # push parameter method->clazz
16600 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16601 # return: StaticField*
16602 cmp $0, %eax # check if initalization failed
16604 je common_exceptionThrown # failed; handle exception
16605 mov %eax, %ecx # %ecx<- result
16607 .LOP_SGET_SHORT_finish:
16608 FFETCH_ADV 2, %edx # %edx<- next instruction hi; fetch, advance
16609 movl offStaticField_value(%ecx), %eax # %eax<- field value
16610 SET_VREG %eax, rINST # vAA<- field value
16611 FGETOP_JMP 2, %edx # jump to next instruction; getop, jmp
16613 /* continuation for OP_SPUT */
16616 movl offGlue_method(%edx), %edx # %edx <- glue->method
16617 EXPORT_PC # in case an exception is thrown
16618 movl %eax, -4(%esp) # push parameter CCCC; field ref
16619 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16620 movl %edx, -8(%esp) # push parameter method->clazz
16622 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16623 # return: StaticField*
16624 cmp $0, %eax # check if initalization failed
16626 je common_exceptionThrown # failed; handle exception
16627 movl %eax, %ecx # %ecx<- result
16630 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16631 GET_VREG rINST # rINST<- vAA
16632 movl rINST, offStaticField_value(%ecx) # field value<- vAA
16633 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16635 /* continuation for OP_SPUT_WIDE */
16638 * Continuation if the field has not yet been resolved.
16639 * %edx: BBBB field ref
16642 .LOP_SPUT_WIDE_resolve:
16643 movl offGlue_method(%eax), %eax # %eax <- glue->method
16644 EXPORT_PC # in case an exception is thrown
16645 movl %edx, -4(%esp) # push parameter CCCC; field ref
16646 movl offMethod_clazz(%eax), %eax # %eax<- method->clazz
16647 movl %eax, -8(%esp)
16649 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16650 # return: StaticField*
16652 cmp $0, %eax # check if initalization failed
16653 movl %eax, %ecx # %ecx<- result
16654 jne .LOP_SPUT_WIDE_finish # success, continue
16655 jmp common_exceptionThrown # failed; handle exception
16657 /* continuation for OP_SPUT_OBJECT */
16659 .LOP_SPUT_OBJECT_resolve:
16660 movl offGlue_method(%edx), %edx # %edx <- glue->method
16661 EXPORT_PC # in case an exception is thrown
16662 movl %eax, -4(%esp) # push parameter CCCC; field ref
16663 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
16664 movl %edx, -8(%esp) # push parameter method->clazz
16666 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16667 # return: StaticField*
16668 cmp $0, %eax # check if initalization failed
16670 je common_exceptionThrown # failed; handle exception
16671 movl %eax, %ecx # %ecx<- result
16673 .LOP_SPUT_OBJECT_finish:
16674 FFETCH_ADV 2, %eax # %eax<- next instruction hi; fetch, advance
16675 GET_VREG rINST # rINST<- vAA
16676 movl rINST, offStaticField_value(%ecx) # field value<- vAA
16677 FGETOP_JMP 2, %eax # jump to next instruction; getop, jmp
16679 /* continuation for OP_SPUT_BOOLEAN */
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
16688 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16689 # return: StaticField*
16690 cmp $0, %eax # check if initalization failed
16692 je common_exceptionThrown # failed; handle exception
16693 movl %eax, %ecx # %ecx<- result
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
16701 /* continuation for OP_SPUT_BYTE */
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
16710 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16711 # return: StaticField*
16712 cmp $0, %eax # check if initalization failed
16714 je common_exceptionThrown # failed; handle exception
16715 movl %eax, %ecx # %ecx<- result
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
16723 /* continuation for OP_SPUT_CHAR */
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
16732 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16733 # return: StaticField*
16734 cmp $0, %eax # check if initalization failed
16736 je common_exceptionThrown # failed; handle exception
16737 movl %eax, %ecx # %ecx<- result
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
16745 /* continuation for OP_SPUT_SHORT */
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
16754 call dvmResolveStaticField # call: (const ClassObject* referrer, u4 ifieldIdx)
16755 # return: StaticField*
16756 cmp $0, %eax # check if initalization failed
16758 je common_exceptionThrown # failed; handle exception
16759 movl %eax, %ecx # %ecx<- result
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
16767 /* continuation for OP_INVOKE_VIRTUAL */
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)
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
16789 * %eax = resolved base method
16790 * %edx = D or CCCC (index of first arg, which is the "this" ptr)
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
16803 /* continuation for OP_INVOKE_SUPER */
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
16815 * %ecx = resolved base method
16816 * %eax = method->clazz
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
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)
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
16845 * Throw a NoSuchMethodError with the method name as the message.
16846 * %ecx = resolved base method
16849 .LOP_INVOKE_SUPER_nsm:
16850 movl offMethod_name(%ecx), %edx # %edx<- method name
16851 jmp common_errNoSuchMethod
16853 /* continuation for OP_INVOKE_DIRECT */
16856 * %eax = reference (BBBB or CCCC)
16857 * -4(%esp) = "this" register
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)
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 /* continuation for OP_INVOKE_STATIC */
16882 .LOP_INVOKE_STATIC_break:
16883 movl offGlue_method(%edx), %edx # %edx<- glue->method
16884 movl $METHOD_STATIC, -4(%esp) # resolver method type
16885 movl %eax, -8(%esp) # push parameter method index
16886 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
16887 movl %edx, -12(%esp) # push parameter method
16888 lea -12(%esp), %esp
16889 call dvmResolveMethod # call: (const ClassObject* referrer,
16890 # u4 methodIdx, MethodType methodType)
16893 cmp $0, %eax # check for null method
16894 je common_exceptionThrown
16895 movl %eax, %ecx # %ecx<- method
16896 jmp common_invokeMethodNoRange # invoke method common code
16898 /* continuation for OP_INVOKE_INTERFACE */
16899 .LOP_INVOKE_INTERFACE_break:
16900 movl rGLUE, %ecx # %ecx<- pMterpGlue
16901 movl offGlue_method(%ecx), %ecx # %ecx<- glue->method
16902 movl %ecx, -8(%esp) # push parameter method
16903 movl offObject_clazz(%edx), %edx # %edx<- glue->method->clazz
16904 movl %edx, -16(%esp) # push parameter
16905 lea -16(%esp), %esp
16906 call dvmFindInterfaceMethodInCache # call: (ClassObject* thisClass, u4 methodIdx,
16907 # const Method* method, DvmDex* methodClassDex)
16910 cmp $0, %eax # check if find failed
16911 je common_exceptionThrown # handle exception
16912 movl %eax, %ecx # %ecx<- method
16913 jmp common_invokeMethodNoRange # invoke method common code
16915 /* continuation for OP_INVOKE_VIRTUAL_RANGE */
16917 .LOP_INVOKE_VIRTUAL_RANGE_break:
16918 movl rGLUE, %eax # %eax<- pMterpGlue
16919 movl %edx, -4(%esp) # save "this" pointer register
16920 movl offGlue_method(%eax), %eax # %eax<- glue->method
16921 movl $METHOD_VIRTUAL, -8(%esp) # push parameter method type
16922 movl %ecx, -12(%esp) # push paramter method index
16923 movl offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
16924 lea -16(%esp), %esp
16925 movl %eax, (%esp) # push parameter clazz
16926 call dvmResolveMethod # call: (const ClassObject* referrer,
16927 # u4 methodIdx, MethodType methodType)
16930 cmp $0, %eax # check for null method return
16931 movl -4(%esp), %edx # get "this" pointer register
16932 jne .LOP_INVOKE_VIRTUAL_RANGE_continue
16933 jmp common_exceptionThrown # null pointer; handle exception
16937 * %eax = resolved base method
16938 * %edx = D or CCCC (index of first arg, which is the "this" ptr)
16941 .LOP_INVOKE_VIRTUAL_RANGE_continue:
16942 GET_VREG %edx # %edx<- "this" ptr
16943 movzwl offMethod_methodIndex(%eax), %eax # %eax<- baseMethod->methodIndex
16944 cmp $0, %edx # %edx<- check for null "this"
16945 je common_errNullObject # handle null object
16946 movl offObject_clazz(%edx), %edx # %edx<- thisPtr->clazz
16947 movl offClassObject_vtable(%edx), %edx # %edx<- thisPtr->clazz->vtable
16948 movl (%edx, %eax, 4), %ecx # %ecx<- vtable[methodIndex]
16949 jmp common_invokeMethodRange # invoke method common code
16951 /* continuation for OP_INVOKE_SUPER_RANGE */
16953 .LOP_INVOKE_SUPER_RANGE_continue2:
16954 movl rGLUE, %eax # %eax<- pMterpGlue
16955 movl offGlue_method(%eax), %eax # %eax<- glue->method
16956 movl offMethod_clazz(%eax), %eax # %eax<- glue->method->clazz
16957 EXPORT_PC # must export for invoke
16958 cmp $0, %ecx # check if already resolved
16959 jne .LOP_INVOKE_SUPER_RANGE_continue
16960 jmp .LOP_INVOKE_SUPER_RANGE_resolve # handle resolve
16963 * %ecx = resolved base method
16964 * %eax = method->clazz
16967 .LOP_INVOKE_SUPER_RANGE_continue:
16968 movl offClassObject_super(%eax), %edx # %edx<- glue->method->clazz->super
16969 movzwl offMethod_methodIndex(%ecx), %ecx # %ecx<- baseMethod->methodIndex
16970 cmp offClassObject_vtableCount(%edx), %ecx # compare vtableCount with methodIndex
16971 EXPORT_PC # must export for invoke
16972 jnc .LOP_INVOKE_SUPER_RANGE_nsm # handle method not present
16973 movl offClassObject_vtable(%edx), %edx # %edx<- glue->method->clazz->super->vtable
16974 movl (%edx, %ecx, 4), %ecx # %ecx<- vtable[methodIndex]
16975 jmp common_invokeMethodRange # invoke method common code
16977 .LOP_INVOKE_SUPER_RANGE_resolve:
16978 movl %eax, -12(%esp) # push parameter clazz
16979 movl %edx, -8(%esp) # push parameter method index
16980 movl $METHOD_VIRTUAL, -4(%esp) # push parameter method type
16981 lea -12(%esp), %esp
16982 call dvmResolveMethod # call: (const ClassObject* referrer,
16983 # u4 methodIdx, MethodType methodType)
16986 movl %eax, %ecx # %ecx<- method
16987 cmp $0, %ecx # check for null method return
16988 movl -12(%esp), %eax # %eax<- glue->method->clazz
16989 jne .LOP_INVOKE_SUPER_RANGE_continue
16990 jmp common_exceptionThrown # null pointer; handle exception
16993 * Throw a NoSuchMethodError with the method name as the message.
16994 * %ecx = resolved base method
16997 .LOP_INVOKE_SUPER_RANGE_nsm:
16998 movl offMethod_name(%ecx), %edx # %edx<- method name
16999 jmp common_errNoSuchMethod
17001 /* continuation for OP_INVOKE_DIRECT_RANGE */
17004 * %eax = reference (BBBB or CCCC)
17005 * -4(%esp) = "this" register
17008 .LOP_INVOKE_DIRECT_RANGE_resolve:
17009 movl rGLUE, %edx # %edx<- pMterpGlue
17010 movl $METHOD_DIRECT, -8(%esp) # push parameter method type
17011 movl offGlue_method(%edx), %edx # %edx<- glue->method
17012 movl %eax, -12(%esp) # push parameter reference
17013 lea -16(%esp), %esp
17014 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
17015 movl %edx, (%esp) # push parameter clazz
17016 call dvmResolveMethod # call: (const ClassObject* referrer,
17017 # u4 methodIdx, MethodType methodType)
17020 cmp $0, %eax # check for null method return
17021 movl -4(%esp), %edx # get "this" pointer register
17022 GET_VREG %edx # get "this" pointer
17023 je common_exceptionThrown # null pointer; handle exception
17024 cmp $0, %edx # check for null "this"
17025 movl %eax, %ecx # %ecx<- method
17026 jne common_invokeMethodRange # invoke method common code
17027 jmp common_errNullObject # handle null object
17028 /* continuation for OP_INVOKE_STATIC_RANGE */
17030 .LOP_INVOKE_STATIC_RANGE_break:
17031 movl offGlue_method(%edx), %edx # %edx<- glue->method
17032 movl $METHOD_STATIC, -4(%esp) # resolver method type
17033 movl %eax, -8(%esp) # push parameter method index
17034 movl offMethod_clazz(%edx), %edx # %edx<- glue->method->clazz
17035 movl %edx, -12(%esp) # push parameter method
17036 lea -12(%esp), %esp
17037 call dvmResolveMethod # call: (const ClassObject* referrer,
17038 # u4 methodIdx, MethodType methodType)
17041 cmp $0, %eax # check for null method
17042 je common_exceptionThrown
17043 movl %eax, %ecx # %ecx<- method
17044 jmp common_invokeMethodRange # invoke method common code
17046 /* continuation for OP_INVOKE_INTERFACE_RANGE */
17047 .LOP_INVOKE_INTERFACE_RANGE_break:
17048 movl rGLUE, %ecx # %ecx<- pMterpGlue
17049 movl offGlue_method(%ecx), %ecx # %ecx<- glue->method
17050 movl %ecx, -8(%esp) # push parameter method
17051 movl offObject_clazz(%edx), %edx # %edx<- glue->method->clazz
17052 movl %edx, -16(%esp) # push parameter
17053 lea -16(%esp), %esp
17054 call dvmFindInterfaceMethodInCache # call: (ClassObject* thisClass, u4 methodIdx,
17055 # const Method* method, DvmDex* methodClassDex)
17058 cmp $0, %eax # check if find failed
17059 je common_exceptionThrown # handle exception
17060 movl %eax, %ecx # %ecx<- method
17061 jmp common_invokeMethodRange # invoke method common code
17063 /* continuation for OP_FLOAT_TO_INT */
17065 .LOP_FLOAT_TO_INT_break:
17066 fnstcw -2(%esp) # save control word
17067 orl $0xc00, -2(%esp) # reset control
17068 fldcw -2(%esp) # load control word
17069 xorl $0xc00, -2(%esp) # reset control
17070 fistpl (rFP, %edx, 4) # move converted int
17071 fldcw -2(%esp) # load saved control word
17072 FINISH 1 # jump to next instruction
17074 .LOP_FLOAT_TO_INT_nanInf:
17075 jnp .LOP_FLOAT_TO_INT_posInf # handle posInf
17076 fstps (rFP, %edx, 4) # pop floating point stack
17077 movl $0x00000000, (rFP, %edx, 4) # vA<- NaN
17078 FINISH 1 # jump to next instruction
17080 .LOP_FLOAT_TO_INT_posInf:
17081 fstps (rFP, %edx, 4) # pop floating point stack
17082 movl $0x7FFFFFFF, (rFP, %edx, 4) # vA<- posInf
17083 FINISH 1 # jump to next instruction
17085 .LOP_FLOAT_TO_INT_negInf:
17086 fstps (rFP, %edx, 4) # pop floating point stack
17087 fstps (rFP, %edx, 4) # pop floating point stack
17088 movl $0x80000000, (rFP, %edx, 4) # vA<- negInf
17089 FINISH 1 # jump to next instruction
17091 /* continuation for OP_FLOAT_TO_LONG */
17093 .LOP_FLOAT_TO_LONG_break:
17094 fnstcw -2(%esp) # save control word
17095 orl $0xc00, -2(%esp) # update control
17096 fldcw -2(%esp) # load control word
17097 xorl $0xc00, -2(%esp) # reset control
17098 fistpll (rFP, %edx, 4) # move converted int
17099 fldcw -2(%esp) # load saved control word
17100 FINISH 1 # jump to next instruction
17102 .LOP_FLOAT_TO_LONG_nanInf:
17103 jnp .LOP_FLOAT_TO_LONG_posInf
17104 fstpl (rFP, %edx, 4) # move converted int
17105 movq .LvalueNanLong, %xmm0 # %xmm0<- NaN
17106 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; NaN
17107 FINISH 1 # jump to next instruction
17109 .LOP_FLOAT_TO_LONG_posInf:
17110 fstpl (rFP, %edx, 4) # move converted int
17111 movq .LvaluePosInfLong, %xmm0 # %xmm0<- posInf
17112 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; posInf
17113 FINISH 1 # jump to next instruction
17115 .LOP_FLOAT_TO_LONG_negInf:
17116 fstpl (rFP, %edx, 4) # move converted int
17117 movq .LvalueNegInfLong, %xmm0 # %xmm0<- negInf
17118 fstpl (rFP, %edx, 4) # move converted int
17119 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; negInf
17120 FINISH 1 # jump to next instruction
17122 /* continuation for OP_DOUBLE_TO_INT */
17124 .LOP_DOUBLE_TO_INT_break:
17125 fnstcw -2(%esp) # save control word
17126 orl $0xc00, -2(%esp) # reset control
17127 fldcw -2(%esp) # load control word
17128 xorl $0xc00, -2(%esp) # reset control
17129 fistpl (rFP, %edx, 4) # move converted int
17130 fldcw -2(%esp) # load saved control word
17131 FINISH 1 # jump to next instruction
17133 .LOP_DOUBLE_TO_INT_nanInf:
17134 jnp .LOP_DOUBLE_TO_INT_posInf
17135 fstps (rFP, %edx, 4)
17136 movl $0x00000000, (rFP, %edx, 4) # vA<- NaN
17137 FINISH 1 # jump to next instruction
17139 .LOP_DOUBLE_TO_INT_posInf:
17140 fstps (rFP, %edx, 4)
17141 movl $0x7FFFFFFF, (rFP, %edx, 4) # vA<- posInf
17142 FINISH 1 # jump to next instruction
17144 .LOP_DOUBLE_TO_INT_negInf:
17145 fstps (rFP, %edx, 4)
17146 fstps (rFP, %edx, 4)
17147 movl $0x80000000, (rFP, %edx, 4) # vA<- negInf
17148 FINISH 1 # jump to next instruction
17150 /* continuation for OP_DOUBLE_TO_LONG */
17152 .LOP_DOUBLE_TO_LONG_break:
17153 fnstcw -2(%esp) # save control word
17154 orl $0xc00, -2(%esp) # reset control
17155 fldcw -2(%esp) # load control word
17156 xorl $0xc00, -2(%esp) # reset control
17157 fistpll (rFP, %edx, 4) # move converted int
17158 fldcw -2(%esp) # load saved control word
17159 FINISH 1 # jump to next instruction
17161 .LOP_DOUBLE_TO_LONG_nanInf:
17162 jnp .LOP_DOUBLE_TO_LONG_posInf
17163 fstpl (rFP, %edx, 4) # move converted int
17164 movq .LvalueNanLong, %xmm0 # %xmm0<- NaN
17165 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; NaN
17166 FINISH 1 # jump to next instruction
17168 .LOP_DOUBLE_TO_LONG_posInf:
17169 fstpl (rFP, %edx, 4) # move converted int
17170 movq .LvaluePosInfLong, %xmm0 # %xmm0<- posInf
17171 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; posInf
17172 FINISH 1 # jump to next instruction
17174 .LOP_DOUBLE_TO_LONG_negInf:
17175 fstpl (rFP, %edx, 4) # move converted int
17176 movq .LvalueNegInfLong, %xmm0 # %xmm0<- negInf
17177 fstpl (rFP, %edx, 4) # move converted int
17178 movq %xmm0, (rFP, %edx, 4) # vA<- %xmm0; negInf
17179 FINISH 1 # jump to next instruction
17181 /* continuation for OP_DIV_INT */
17182 .LOP_DIV_INT_break:
17185 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17187 movl $0, (rFP, rINST, 4) # vAA<- 0
17190 /* continuation for OP_REM_INT */
17191 .LOP_REM_INT_break:
17194 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17196 movl $0, (rFP, rINST, 4) # vAA<- 0
17199 /* continuation for OP_MUL_LONG */
17202 * X = (rFP, rINST, 4)
17203 * W = 4(rFP, rINST, 4)
17204 * Z = (rFP, %edx, 4)
17205 * Y = 4(rFP, %edx, 4)
17208 .LOP_MUL_LONG_finish:
17209 movl 4(rFP, rINST, 4), %ecx # %ecx<- W
17210 imull (rFP, %edx, 4), %ecx # %ecx<- WxZ
17211 mov 4(rFP, %edx, 4), %eax # %ecx<- Y
17212 imull (rFP, rINST, 4), %eax # %eax<- XxY
17213 addl %eax, %ecx # %ecx<- (WZ + XY)
17214 movl (rFP, %edx, 4), %eax # %eax<- Z
17215 mull (rFP, rINST, 4) # %edx:eax<- XZ
17216 movzbl -4(%esp), rINST # rINST<- AA
17217 addl %edx, %ecx # %ecx<- carry + (WZ + XY)
17218 movl %ecx, 4(rFP, rINST, 4) # vAA+1<- results hi
17219 movl %eax, (rFP, rINST, 4) # vAA<- results lo
17220 FINISH 2 # jump to next instruction
17222 /* continuation for OP_DIV_LONG */
17223 .LOP_DIV_LONG_finish:
17224 movq %xmm0, -16(%esp) # push arg vBB,vBB+1
17225 lea -16(%esp), %esp
17226 call __divdi3 # call func
17228 movl %eax, (rFP, rINST, 4) # vAA<- return low
17229 movl %edx, 4(rFP, rINST, 4) # vAA+1<- return high
17230 FINISH 2 # jump to next instruction
17232 /* continuation for OP_REM_LONG */
17233 .LOP_REM_LONG_finish:
17234 movq %xmm0, -16(%esp) # push arg vBB,vBB+1
17235 lea -16(%esp), %esp
17236 call __moddi3 # call func
17238 movl %eax, (rFP, rINST, 4) # vAA<- return low
17239 movl %edx, 4(rFP, rINST, 4) # vAA+1<- return high
17240 FINISH 2 # jump to next instruction
17242 /* continuation for OP_SHR_LONG */
17244 .LOP_SHR_LONG_finish:
17245 movq .Lvalue64, %xmm3 # %xmm3<- 64
17246 psubq %xmm0, %xmm3 # %xmm3<- 64 - shift amount
17247 movq .L64bits, %xmm4 # %xmm4<- lower 64 bits set
17248 psllq %xmm3, %xmm4 # %xmm4<- correct mask for sign bits
17249 por %xmm4, %xmm1 # %xmm1<- signed and shifted vBB
17251 .LOP_SHR_LONG_final:
17252 movq %xmm1, (rFP, rINST, 4) # vAA<- shifted vBB
17253 FINISH 2 # jump to next instruction
17255 /* continuation for OP_REM_DOUBLE */
17257 .LOP_REM_DOUBLE_break:
17258 call fmod # call: (long double x, long double y)
17261 fstpl (rFP, rINST, 4) # vAA<- remainder; return of fmod
17262 FINISH 2 # jump to next instruction
17264 /* continuation for OP_DIV_INT_2ADDR */
17265 .LOP_DIV_INT_2ADDR_break:
17266 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
17268 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17270 movl $0, (rFP, rINST, 4) # vAA<- 0
17272 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
17274 /* continuation for OP_REM_INT_2ADDR */
17275 .LOP_REM_INT_2ADDR_break:
17276 FFETCH_ADV 1, %edx # %ecx<- next instruction hi; fetch, advance
17278 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17280 movl $0, (rFP, rINST, 4) # vAA<- 0
17282 FGETOP_JMP 1, %edx # jump to next instruction; getop, jmp
17284 /* continuation for OP_MUL_LONG_2ADDR */
17287 * X = (rFP, rINST, 4)
17288 * W = 4(rFP, rINST, 4)
17289 * Z = (rFP, %edx, 4)
17290 * Y = 4(rFP, %edx, 4)
17293 .LOP_MUL_LONG_2ADDR_finish:
17294 movl 4(rFP, rINST, 4), %ecx # %ecx<- W
17295 imull (rFP, %edx, 4), %ecx # %ecx<- WxZ
17296 movl 4(rFP, %edx, 4), %eax # %eax<- Y
17297 imull (rFP, rINST, 4), %eax # %eax<- X*Y
17298 addl %eax, %ecx # %ecx<- (WZ + XY)
17299 movl (rFP, %edx, 4), %eax # %eax<- Z
17300 mull (rFP, rINST, 4) # %edx:eax<- XZ
17301 addl %edx, %ecx # %ecx<- carry + (WZ + XY)
17302 movl sReg0, %edx # %edx<- A
17303 movl %ecx, 4(rFP, %edx, 4) # vA+1<- results hi
17304 movl %eax, (rFP, %edx, 4) # vA<- results lo
17305 FINISH 1 # jump to next instruction
17307 /* continuation for OP_DIV_LONG_2ADDR */
17308 .LOP_DIV_LONG_2ADDR_break:
17309 movq %xmm0, -20(%esp) # push arg vA, vA+1
17310 lea -20(%esp), %esp
17311 call __divdi3 # call func
17313 movl %eax, (rFP, rINST, 4) # vA<- return low
17314 movl %edx, 4(rFP, rINST, 4) # vA<- return high
17315 FFETCH_ADV 1, %ecx # %ecx<- next instruction hi; fetch, advance
17316 FGETOP_JMP 1, %ecx # jump to next instruction; getop, jmp
17317 /* continuation for OP_REM_LONG_2ADDR */
17318 .LOP_REM_LONG_2ADDR_break:
17319 movq %xmm0, -20(%esp) # push arg vA, vA+1
17320 lea -20(%esp), %esp
17321 call __moddi3 # call func
17323 movl %eax, (rFP, rINST, 4) # vA<- return low
17324 movl %edx, 4(rFP, rINST, 4) # vA<- return high
17325 FFETCH_ADV 1, %ecx # %ecx<- next instruction hi; fetch, advance
17326 FGETOP_JMP 1, %ecx # jump to next instruction; getop, jmp
17327 /* continuation for OP_SHR_LONG_2ADDR */
17329 .LOP_SHR_LONG_2ADDR_finish:
17330 movq .Lvalue64, %xmm3 # %xmm3<- 64
17331 psubq %xmm0, %xmm3 # %xmm3<- 64 - shift amount
17332 movq .L64bits, %xmm4 # %xmm4<- lower 64 bits set
17333 psllq %xmm3, %xmm4 # %xmm4<- correct mask for sign bits
17334 por %xmm4, %xmm1 # %xmm1<- signed and shifted vBB
17336 .LOP_SHR_LONG_2ADDR_final:
17337 movq %xmm1, (rFP, rINST, 4) # vAA<- shifted vBB
17338 FINISH 1 # jump to next instruction
17340 /* continuation for OP_REM_DOUBLE_2ADDR */
17342 .LOP_REM_DOUBLE_2ADDR_break:
17343 call fmod # call: (long double x, long double y)
17346 fstpl (rFP, rINST, 4) # vAA<- remainder; return of fmod
17347 FINISH 1 # jump to next instruction
17349 /* continuation for OP_DIV_INT_LIT16 */
17350 .LOP_DIV_INT_LIT16_break:
17353 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17355 movl $0, (rFP, rINST, 4) # vAA<- 0
17357 movzbl 1(rPC), rINST
17358 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
17360 /* continuation for OP_REM_INT_LIT16 */
17361 .LOP_REM_INT_LIT16_break:
17364 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17366 movl $0, (rFP, rINST, 4) # vAA<- 0
17368 movzbl 1(rPC), rINST
17369 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
17371 /* continuation for OP_DIV_INT_LIT8 */
17372 .LOP_DIV_INT_LIT8_break:
17375 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17377 movl $0, (rFP, rINST, 4) # vAA<- 0
17379 movzbl 1(rPC), rINST
17380 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
17382 /* continuation for OP_REM_INT_LIT8 */
17383 .LOP_REM_INT_LIT8_break:
17386 movl $0x80000000, (rFP, rINST, 4) # vAA<- min int
17388 movl $0, (rFP, rINST, 4) # vAA<- 0
17390 movzbl 1(rPC), rINST
17391 jmp *dvmAsmInstructionJmpTable(, %edx, 4)
17393 /* continuation for OP_EXECUTE_INLINE */
17396 * Extract args, call function.
17397 * rINST = #of args (0-4)
17398 * %ecx = call index
17401 .LOP_EXECUTE_INLINE_continue:
17402 FETCH 2, %edx # %edx<- FEDC
17403 cmp $1, rINST # determine number of arguments
17404 jl 0f # handle zero args
17405 je 1f # handle one arg
17407 jl 2f # handle two args
17408 je 3f # handle three args
17410 movl %edx, rINST # rINST<- FEDC
17411 and $0xf000, rINST # isolate F
17413 movl (rFP, rINST), rINST # rINST<- vF
17414 movl rINST, 12(%esp) # push parameter vF
17416 movl %edx, rINST # rINST<- FEDC
17417 and $0x0f00, rINST # isolate E
17419 movl (rFP, rINST), rINST # rINST<- vE
17420 movl rINST, 8(%esp) # push parameter E
17422 movl %edx, rINST # rINST<- FEDC
17423 and $0x00f0, rINST # isolate D
17425 movl (rFP, rINST), rINST # rINST<- vD
17426 movl rINST, 4(%esp) # push parameter D
17428 and $0x000f, %edx # isolate C
17429 movl (rFP, %edx, 4), %edx # rINST<- vC
17430 movl %edx, (%esp) # push parameter C
17433 movl $gDvmInlineOpsTable, %eax # %eax<- address for table of inline operations
17434 call *(%eax, %ecx) # call function
17436 cmp $0, %eax # check boolean result of inline
17437 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
17438 lea 24(%esp), %esp # update stack pointer
17439 je common_exceptionThrown # handle exception
17440 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
17441 /* continuation for OP_EXECUTE_INLINE_RANGE */
17444 * Extract args, call function.
17445 * rINST = #of args (0-4)
17446 * %ecx = call index
17449 .LOP_EXECUTE_INLINE_RANGE_continue:
17450 FETCH 2, %edx # %edx<- FEDC
17451 cmp $1, rINST # determine number of arguments
17452 jl 0f # handle zero args
17453 je 1f # handle one arg
17455 jl 2f # handle two args
17456 je 3f # handle three args
17458 movl 12(rFP, %edx, 4), rINST # rINST<- vF
17459 movl rINST, 12(%esp) # push parameter vF
17461 movl 8(rFP, %edx, 4), rINST # rINST<- vE
17462 movl rINST, 8(%esp) # push parameter E
17464 movl 4(rFP, %edx, 4), rINST # rINST<- vD
17465 movl rINST, 4(%esp) # push parameter D
17467 movl (rFP, %edx, 4), %edx # rINST<- vC
17468 movl %edx, (%esp) # push parameter C
17471 movl $gDvmInlineOpsTable, %eax # %eax<- address for table of inline operations
17472 call *(%eax, %ecx) # call function
17474 cmp $0, %eax # check boolean result of inline
17475 FFETCH_ADV 3, %eax # %eax<- next instruction hi; fetch, advance
17476 lea 24(%esp), %esp # update stack pointer
17477 je common_exceptionThrown # handle exception
17478 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
17480 .size dvmAsmSisterStart, .-dvmAsmSisterStart
17481 .global dvmAsmSisterEnd
17484 /* File: x86-atom/entry.S */
17485 /* Copyright (C) 2008 The Android Open Source Project
17487 * Licensed under the Apache License, Version 2.0 (the "License");
17488 * you may not use this file except in compliance with the License.
17489 * You may obtain a copy of the License at
17491 * http://www.apache.org/licenses/LICENSE-2.0
17493 * Unless required by applicable law or agreed to in writing, software
17494 * distributed under the License is distributed on an "AS IS" BASIS,
17495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17496 * See the License for the specific language governing permissions and
17497 * limitations under the License.
17504 #define ASSIST_DEBUGGER 1
17507 .global dvmMterpStdRun
17508 .type dvmMterpStdRun, %function
17511 * Save registers, initialize sp and fp.
17513 * bool MterpGlue(glue *)
17517 movl 4(%esp), %ecx # get first argument
17518 movl %ebp, -4(%esp) # save caller base pointer
17519 movl %ebx, -8(%esp) # save %ebx
17520 movl %esi, -12(%esp) # save %esi
17521 movl %edi, -16(%esp) # save %edi
17522 lea -40(%esp), %ebp # set callee base pointer
17523 lea -40(%esp), %esp # set callee stack pointer
17527 * Restore registers.
17528 * This function returns a boolean "changeInterp" value.
17529 * The return value is from dvmMterpStdBail().
17533 #lea 40(%ebp), %esp # correct stack pointer
17534 #movl 24(%ebp), %edi # restore %edi
17535 #movl 28(%ebp), %esi # restore %esi
17536 #movl 32(%ebp), %ebx # restore %ebx
17537 #movl 36(%ebp), %ebp # restore caller base pointer
17540 lea 40(%esp), %esp # correct stack pointer
17541 movl -16(%esp), %edi # restore %edi
17542 movl -12(%esp), %esi # restore %esi
17543 movl -8(%esp), %ebx # restore %ebx
17544 movl -4(%esp), %ebp # restore caller base pointer
17549 * DvmMterpStdRun entry point: save stack pointer, setup memory locations, get
17550 * entry point, start executing instructions.
17555 movl %ecx, rGLUE # save value for pMterpGlue
17556 movl offGlue_pc(%ecx), rPC # get program counter
17557 cmp $kInterpEntryInstr, offGlue_entryPoint(%ecx) # check instruction
17558 movl offGlue_fp(%ecx), rFP # get frame pointer
17559 movl %esp, offGlue_bailPtr(%ecx) # save SP for eventual return
17560 FFETCH %edx # %edx<- opcode
17561 jne .Lnot_instr # no, handle it
17562 FGETOP_JMPa %edx # start executing the instruction at rPC
17565 * Not an instruction. Are we returning from a method?
17569 cmpl $kInterpEntryReturn, offGlue_entryPoint(%ecx)
17570 je common_returnFromMethod
17573 * No, are we throwing an exception?
17577 cmpl $kInterpEntryThrow, offGlue_entryPoint(%ecx)
17578 je common_exceptionThrown
17581 * No, then we must abort.
17585 pushl offGlue_entryPoint(%ecx)
17586 movl $.LstrBadEntryPoint, -4(%esp)
17590 call dvmAbort # call (void)
17593 * Restore the stack pointer and PC from the save point established on entry and
17594 * return to whoever called dvmMterpStdRun.
17597 * 4(%esp) MterpGlue* glue
17598 * 8(%esp) bool changeInterp
17601 .global dvmMterpStdBail
17602 .type dvmMterpStdBail, %function
17605 movl 4(%esp), %ecx # get first argument
17606 movl 8(%esp), %eax # get second argument
17607 movl offGlue_bailPtr(%ecx), %esp # sp <- saved SP
17611 * String references.
17614 .LstrBadEntryPoint:
17615 .asciz "Bad entry point %d\n"
17618 dvmAsmInstructionJmpTable = .LdvmAsmInstructionJmpTable
17619 .LdvmAsmInstructionJmpTable:
17622 .long .L_OP_MOVE_FROM16
17623 .long .L_OP_MOVE_16
17624 .long .L_OP_MOVE_WIDE
17625 .long .L_OP_MOVE_WIDE_FROM16
17626 .long .L_OP_MOVE_WIDE_16
17627 .long .L_OP_MOVE_OBJECT
17628 .long .L_OP_MOVE_OBJECT_FROM16
17629 .long .L_OP_MOVE_OBJECT_16
17630 .long .L_OP_MOVE_RESULT
17631 .long .L_OP_MOVE_RESULT_WIDE
17632 .long .L_OP_MOVE_RESULT_OBJECT
17633 .long .L_OP_MOVE_EXCEPTION
17634 .long .L_OP_RETURN_VOID
17636 .long .L_OP_RETURN_WIDE
17637 .long .L_OP_RETURN_OBJECT
17638 .long .L_OP_CONST_4
17639 .long .L_OP_CONST_16
17641 .long .L_OP_CONST_HIGH16
17642 .long .L_OP_CONST_WIDE_16
17643 .long .L_OP_CONST_WIDE_32
17644 .long .L_OP_CONST_WIDE
17645 .long .L_OP_CONST_WIDE_HIGH16
17646 .long .L_OP_CONST_STRING
17647 .long .L_OP_CONST_STRING_JUMBO
17648 .long .L_OP_CONST_CLASS
17649 .long .L_OP_MONITOR_ENTER
17650 .long .L_OP_MONITOR_EXIT
17651 .long .L_OP_CHECK_CAST
17652 .long .L_OP_INSTANCE_OF
17653 .long .L_OP_ARRAY_LENGTH
17654 .long .L_OP_NEW_INSTANCE
17655 .long .L_OP_NEW_ARRAY
17656 .long .L_OP_FILLED_NEW_ARRAY
17657 .long .L_OP_FILLED_NEW_ARRAY_RANGE
17658 .long .L_OP_FILL_ARRAY_DATA
17661 .long .L_OP_GOTO_16
17662 .long .L_OP_GOTO_32
17663 .long .L_OP_PACKED_SWITCH
17664 .long .L_OP_SPARSE_SWITCH
17665 .long .L_OP_CMPL_FLOAT
17666 .long .L_OP_CMPG_FLOAT
17667 .long .L_OP_CMPL_DOUBLE
17668 .long .L_OP_CMPG_DOUBLE
17669 .long .L_OP_CMP_LONG
17682 .long .L_OP_UNUSED_3E
17683 .long .L_OP_UNUSED_3F
17684 .long .L_OP_UNUSED_40
17685 .long .L_OP_UNUSED_41
17686 .long .L_OP_UNUSED_42
17687 .long .L_OP_UNUSED_43
17689 .long .L_OP_AGET_WIDE
17690 .long .L_OP_AGET_OBJECT
17691 .long .L_OP_AGET_BOOLEAN
17692 .long .L_OP_AGET_BYTE
17693 .long .L_OP_AGET_CHAR
17694 .long .L_OP_AGET_SHORT
17696 .long .L_OP_APUT_WIDE
17697 .long .L_OP_APUT_OBJECT
17698 .long .L_OP_APUT_BOOLEAN
17699 .long .L_OP_APUT_BYTE
17700 .long .L_OP_APUT_CHAR
17701 .long .L_OP_APUT_SHORT
17703 .long .L_OP_IGET_WIDE
17704 .long .L_OP_IGET_OBJECT
17705 .long .L_OP_IGET_BOOLEAN
17706 .long .L_OP_IGET_BYTE
17707 .long .L_OP_IGET_CHAR
17708 .long .L_OP_IGET_SHORT
17710 .long .L_OP_IPUT_WIDE
17711 .long .L_OP_IPUT_OBJECT
17712 .long .L_OP_IPUT_BOOLEAN
17713 .long .L_OP_IPUT_BYTE
17714 .long .L_OP_IPUT_CHAR
17715 .long .L_OP_IPUT_SHORT
17717 .long .L_OP_SGET_WIDE
17718 .long .L_OP_SGET_OBJECT
17719 .long .L_OP_SGET_BOOLEAN
17720 .long .L_OP_SGET_BYTE
17721 .long .L_OP_SGET_CHAR
17722 .long .L_OP_SGET_SHORT
17724 .long .L_OP_SPUT_WIDE
17725 .long .L_OP_SPUT_OBJECT
17726 .long .L_OP_SPUT_BOOLEAN
17727 .long .L_OP_SPUT_BYTE
17728 .long .L_OP_SPUT_CHAR
17729 .long .L_OP_SPUT_SHORT
17730 .long .L_OP_INVOKE_VIRTUAL
17731 .long .L_OP_INVOKE_SUPER
17732 .long .L_OP_INVOKE_DIRECT
17733 .long .L_OP_INVOKE_STATIC
17734 .long .L_OP_INVOKE_INTERFACE
17735 .long .L_OP_UNUSED_73
17736 .long .L_OP_INVOKE_VIRTUAL_RANGE
17737 .long .L_OP_INVOKE_SUPER_RANGE
17738 .long .L_OP_INVOKE_DIRECT_RANGE
17739 .long .L_OP_INVOKE_STATIC_RANGE
17740 .long .L_OP_INVOKE_INTERFACE_RANGE
17741 .long .L_OP_UNUSED_79
17742 .long .L_OP_UNUSED_7A
17743 .long .L_OP_NEG_INT
17744 .long .L_OP_NOT_INT
17745 .long .L_OP_NEG_LONG
17746 .long .L_OP_NOT_LONG
17747 .long .L_OP_NEG_FLOAT
17748 .long .L_OP_NEG_DOUBLE
17749 .long .L_OP_INT_TO_LONG
17750 .long .L_OP_INT_TO_FLOAT
17751 .long .L_OP_INT_TO_DOUBLE
17752 .long .L_OP_LONG_TO_INT
17753 .long .L_OP_LONG_TO_FLOAT
17754 .long .L_OP_LONG_TO_DOUBLE
17755 .long .L_OP_FLOAT_TO_INT
17756 .long .L_OP_FLOAT_TO_LONG
17757 .long .L_OP_FLOAT_TO_DOUBLE
17758 .long .L_OP_DOUBLE_TO_INT
17759 .long .L_OP_DOUBLE_TO_LONG
17760 .long .L_OP_DOUBLE_TO_FLOAT
17761 .long .L_OP_INT_TO_BYTE
17762 .long .L_OP_INT_TO_CHAR
17763 .long .L_OP_INT_TO_SHORT
17764 .long .L_OP_ADD_INT
17765 .long .L_OP_SUB_INT
17766 .long .L_OP_MUL_INT
17767 .long .L_OP_DIV_INT
17768 .long .L_OP_REM_INT
17769 .long .L_OP_AND_INT
17771 .long .L_OP_XOR_INT
17772 .long .L_OP_SHL_INT
17773 .long .L_OP_SHR_INT
17774 .long .L_OP_USHR_INT
17775 .long .L_OP_ADD_LONG
17776 .long .L_OP_SUB_LONG
17777 .long .L_OP_MUL_LONG
17778 .long .L_OP_DIV_LONG
17779 .long .L_OP_REM_LONG
17780 .long .L_OP_AND_LONG
17781 .long .L_OP_OR_LONG
17782 .long .L_OP_XOR_LONG
17783 .long .L_OP_SHL_LONG
17784 .long .L_OP_SHR_LONG
17785 .long .L_OP_USHR_LONG
17786 .long .L_OP_ADD_FLOAT
17787 .long .L_OP_SUB_FLOAT
17788 .long .L_OP_MUL_FLOAT
17789 .long .L_OP_DIV_FLOAT
17790 .long .L_OP_REM_FLOAT
17791 .long .L_OP_ADD_DOUBLE
17792 .long .L_OP_SUB_DOUBLE
17793 .long .L_OP_MUL_DOUBLE
17794 .long .L_OP_DIV_DOUBLE
17795 .long .L_OP_REM_DOUBLE
17796 .long .L_OP_ADD_INT_2ADDR
17797 .long .L_OP_SUB_INT_2ADDR
17798 .long .L_OP_MUL_INT_2ADDR
17799 .long .L_OP_DIV_INT_2ADDR
17800 .long .L_OP_REM_INT_2ADDR
17801 .long .L_OP_AND_INT_2ADDR
17802 .long .L_OP_OR_INT_2ADDR
17803 .long .L_OP_XOR_INT_2ADDR
17804 .long .L_OP_SHL_INT_2ADDR
17805 .long .L_OP_SHR_INT_2ADDR
17806 .long .L_OP_USHR_INT_2ADDR
17807 .long .L_OP_ADD_LONG_2ADDR
17808 .long .L_OP_SUB_LONG_2ADDR
17809 .long .L_OP_MUL_LONG_2ADDR
17810 .long .L_OP_DIV_LONG_2ADDR
17811 .long .L_OP_REM_LONG_2ADDR
17812 .long .L_OP_AND_LONG_2ADDR
17813 .long .L_OP_OR_LONG_2ADDR
17814 .long .L_OP_XOR_LONG_2ADDR
17815 .long .L_OP_SHL_LONG_2ADDR
17816 .long .L_OP_SHR_LONG_2ADDR
17817 .long .L_OP_USHR_LONG_2ADDR
17818 .long .L_OP_ADD_FLOAT_2ADDR
17819 .long .L_OP_SUB_FLOAT_2ADDR
17820 .long .L_OP_MUL_FLOAT_2ADDR
17821 .long .L_OP_DIV_FLOAT_2ADDR
17822 .long .L_OP_REM_FLOAT_2ADDR
17823 .long .L_OP_ADD_DOUBLE_2ADDR
17824 .long .L_OP_SUB_DOUBLE_2ADDR
17825 .long .L_OP_MUL_DOUBLE_2ADDR
17826 .long .L_OP_DIV_DOUBLE_2ADDR
17827 .long .L_OP_REM_DOUBLE_2ADDR
17828 .long .L_OP_ADD_INT_LIT16
17829 .long .L_OP_RSUB_INT
17830 .long .L_OP_MUL_INT_LIT16
17831 .long .L_OP_DIV_INT_LIT16
17832 .long .L_OP_REM_INT_LIT16
17833 .long .L_OP_AND_INT_LIT16
17834 .long .L_OP_OR_INT_LIT16
17835 .long .L_OP_XOR_INT_LIT16
17836 .long .L_OP_ADD_INT_LIT8
17837 .long .L_OP_RSUB_INT_LIT8
17838 .long .L_OP_MUL_INT_LIT8
17839 .long .L_OP_DIV_INT_LIT8
17840 .long .L_OP_REM_INT_LIT8
17841 .long .L_OP_AND_INT_LIT8
17842 .long .L_OP_OR_INT_LIT8
17843 .long .L_OP_XOR_INT_LIT8
17844 .long .L_OP_SHL_INT_LIT8
17845 .long .L_OP_SHR_INT_LIT8
17846 .long .L_OP_USHR_INT_LIT8
17847 .long .L_OP_UNUSED_E3
17848 .long .L_OP_UNUSED_E4
17849 .long .L_OP_UNUSED_E5
17850 .long .L_OP_UNUSED_E6
17851 .long .L_OP_UNUSED_E7
17852 .long .L_OP_IGET_WIDE_VOLATILE
17853 .long .L_OP_IPUT_WIDE_VOLATILE
17854 .long .L_OP_SGET_WIDE_VOLATILE
17855 .long .L_OP_SPUT_WIDE_VOLATILE
17856 .long .L_OP_BREAKPOINT
17857 .long .L_OP_THROW_VERIFICATION_ERROR
17858 .long .L_OP_EXECUTE_INLINE
17859 .long .L_OP_EXECUTE_INLINE_RANGE
17860 .long .L_OP_INVOKE_DIRECT_EMPTY
17861 .long .L_OP_UNUSED_F1
17862 .long .L_OP_IGET_QUICK
17863 .long .L_OP_IGET_WIDE_QUICK
17864 .long .L_OP_IGET_OBJECT_QUICK
17865 .long .L_OP_IPUT_QUICK
17866 .long .L_OP_IPUT_WIDE_QUICK
17867 .long .L_OP_IPUT_OBJECT_QUICK
17868 .long .L_OP_INVOKE_VIRTUAL_QUICK
17869 .long .L_OP_INVOKE_VIRTUAL_QUICK_RANGE
17870 .long .L_OP_INVOKE_SUPER_QUICK
17871 .long .L_OP_INVOKE_SUPER_QUICK_RANGE
17872 .long .L_OP_UNUSED_FC
17873 .long .L_OP_UNUSED_FD
17874 .long .L_OP_UNUSED_FE
17875 .long .L_OP_DISPATCH_FF
17877 /* File: x86-atom/footer.S */
17878 /* Copyright (C) 2008 The Android Open Source Project
17880 * Licensed under the Apache License, Version 2.0 (the "License");
17881 * you may not use this file except in compliance with the License.
17882 * You may obtain a copy of the License at
17884 * http://www.apache.org/licenses/LICENSE-2.0
17886 * Unless required by applicable law or agreed to in writing, software
17887 * distributed under the License is distributed on an "AS IS" BASIS,
17888 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17889 * See the License for the specific language governing permissions and
17890 * limitations under the License.
17901 * Check to see if the thread needs to be suspended or debugger/profiler
17902 * activity has begun.
17905 * %ecx is reentry type, e.g. kInterpEntryInstr
17906 * %edx is PC adjustment in bytes
17909 common_periodicChecks:
17910 movl %edx, -8(%esp) # save pc adjustments
17911 movl rGLUE, %edx # %edx<- pMterpGlue
17912 movl %ebx, -4(%esp) # save %ebx to the stack
17913 movl offGlue_pSelfSuspendCount(%edx), %ebx # %ebx<- pSuspendCount (int)
17914 #if defined(WITH_DEBUGGER)
17915 movl offGlue_pDebuggerActive(%edx), %eax # %eax<- pDebuggerActive
17916 movl (%eax), %eax # %eax<- get debuggerActive (boolean)
17917 and $7, %eax # %eax<- mask for boolean (just how many bits does it take?)
17919 cmp $0, (%ebx) # check if suspend is pending
17920 jne 2f # handle suspend
17921 #if defined(WITH_DEBUGGER) || defined(WITH_PROFILER)
17922 #if defined(WITH_PROFILER)
17923 movl offGlue_pActiveProfilers(%edx), %ebx # %ebx<- activeProfilers (int)
17924 or (%ebx), %eax # %eax<- merge activeProfilers and debuggerActive
17926 cmp $0, %eax # check for debuggerActive
17928 jne 3f # debugger or profiler active; switch interp
17930 movl -8(%esp), %edx # %edx<- restore %edx
17931 movl -4(%esp), %ebx # %ebx<- restore %ebx
17933 2: # check suspended
17934 movl offGlue_self(%edx), %eax # %eax<- glue->self
17935 movl %eax, -12(%esp) # push parameter boolean
17936 lea -12(%esp), %esp
17937 call dvmCheckSuspendPending # call: (Thread* self)
17939 movl 4(%esp), %edx # %edx<- restore %edx
17940 movl 8(%esp), %ebx # %ebx<- restore %ebx
17943 3: # debugger/profiler enabled, bail out
17944 add -8(%esp), rPC # rPC<- pc adjustments
17945 movl %ecx, offGlue_entryPoint(%edx) # glue->entryPoint<- reentry type
17946 movl $1, %edx # switch to interp == true
17947 jmp common_gotoBail # bail
17950 * Check to see if the thread needs to be suspended or debugger/profiler
17951 * activity has begun. With this variant, the reentry type is hard coded
17952 * as kInterpEntryInstr.
17955 * %edx is PC adjustment in bytes
17958 common_periodicChecks2:
17959 movl rGLUE, %ecx # %ecx<- pMterpGlue
17960 movl offGlue_pSelfSuspendCount(%ecx), rINST # %ebx<- pSuspendCount (int)
17961 #if defined(WITH_DEBUGGER)
17962 movl offGlue_pDebuggerActive(%ecx), %eax # %eax<- pDebuggerActive
17963 movl (%eax), %eax # %eax<- get debuggerActive (boolean)
17964 and $7, %eax # %eax<- mask for boolean (just how many bits does it take?)
17966 cmp $0, (rINST) # check if suspend is pending
17967 jne 2f # handle suspend
17968 #if defined(WITH_DEBUGGER) || defined(WITH_PROFILER)
17969 #if defined(WITH_PROFILER)
17970 movl offGlue_pActiveProfilers(%ecx), rINST # %edx<- activeProfilers (int)
17971 or (rINST), %eax # %eax<- merge activeProfilers and debuggerActive
17973 cmp $0, %eax # check for debuggerActive
17975 jne 3f # debugger or profiler active; switch interp
17977 FINISH_RB %edx, %ecx # jump to next instruction
17978 2: # check suspended
17979 movl offGlue_self(%ecx), %eax# %eax<- glue->self
17981 movl %eax, -12(%esp) # push parameter boolean
17982 lea -12(%esp), %esp
17983 call dvmCheckSuspendPending # call: (Thread* self)
17985 movl rINST, %edx # %edx<- restore %edx
17987 FINISH_RB %edx, %ecx # jump to next instruction
17989 3: # debugger/profiler enabled, bail out
17990 add -8(%esp), rPC # rPC<- pc adjustments
17991 movl $kInterpEntryInstr, offGlue_entryPoint(%ecx) # glue->entryPoint<- reentry type
17992 movl $1, %edx # switch to interp<- true
17993 jmp common_gotoBail # bail
17997 * The equivalent of "goto bail", this calls through the "bail handler".
17998 * State registers will be saved to the "glue" area before bailing.
18001 * %edx is "bool changeInterp", indicating if we want to switch to the
18002 * other interpreter or just bail all the way out
18006 SAVE_PC_FP_TO_GLUE %ecx # save program counter and frame pointer
18009 * Inlined dvmMterpStdBail
18014 movl 24(%ebp), %edi
18015 movl 28(%ebp), %esi
18016 movl 32(%ebp), %ebx
18017 movl 36(%ebp), %ebp
18021 * Common code for method invocation with range.
18024 * %ecx is "Method* methodToCall", the method we're trying to call
18027 common_invokeMethodRange:
18031 * prepare to copy args to "outs" area of current frame
18034 SAVEAREA_FROM_FP %eax # %eax<- &outs; &StackSaveArea
18035 test rINST, rINST # test for no args
18036 movl rINST, sReg0 # sReg0<- AA
18037 jz .LinvokeArgsDone # no args; jump to args done
18038 FETCH 2, %edx # %edx<- CCCC
18041 * %ecx=methodToCall, %edx=CCCC, sReg0=count, %eax=&outs (&stackSaveArea)
18042 * (very few methods have > 10 args; could unroll for common cases)
18045 movl %ebx, sReg1 # sReg1<- save %ebx
18046 lea (rFP, %edx, 4), %edx # %edx<- &vCCCC
18047 shll $2, sReg0 # sReg0<- offset
18048 subl sReg0, %eax # %eax<- update &outs
18049 shrl $2, sReg0 # sReg0<- offset
18051 movl (%edx), %ebx # %ebx<- vCCCC
18052 lea 4(%edx), %edx # %edx<- &vCCCC++
18053 subl $1, sReg0 # sReg<- sReg--
18054 movl %ebx, (%eax) # *outs<- vCCCC
18055 lea 4(%eax), %eax # outs++
18056 jne 1b # loop if count (sReg0) not zero
18057 movl sReg1, %ebx # %ebx<- restore %ebx
18058 jmp .LinvokeArgsDone # continue
18061 * %ecx is "Method* methodToCall", the method we're trying to call
18062 * prepare to copy args to "outs" area of current frame
18065 common_invokeMethodNoRange:
18066 .LinvokeNewNoRange:
18067 movl rINST, sReg0 # sReg0<- BA
18068 shrl $4, sReg0 # sReg0<- B
18069 je .LinvokeArgsDone # no args; jump to args done
18070 SAVEAREA_FROM_FP %eax # %eax<- &outs; &StackSaveArea
18071 FETCH 2, %edx # %edx<- GFED
18074 * %ecx=methodToCall, %edx=GFED, sReg0=count, %eax=outs
18078 cmp $2, sReg0 # compare sReg0 to 2
18079 movl %edx, sReg1 # sReg1<- GFED
18080 jl 1f # handle 1 arg
18081 je 2f # handle 2 args
18082 cmp $4, sReg0 # compare sReg0 to 4
18083 jl 3f # handle 3 args
18084 je 4f # handle 4 args
18086 andl $15, rINST # rINST<- A
18087 lea -4(%eax), %eax # %eax<- update &outs; &outs--
18088 movl (rFP, rINST, 4), %edx # %edx<- vA
18089 movl %edx, (%eax) # *outs<- vA
18090 movl sReg1, %edx # %edx<- GFED
18092 shr $12, %edx # %edx<- G
18093 lea -4(%eax), %eax # %eax<- update &outs; &outs--
18094 movl (rFP, %edx, 4), %edx # %edx<- vG
18095 movl %edx, (%eax) # *outs<- vG
18096 movl sReg1, %edx # %edx<- GFED
18098 and $0x0f00, %edx # %edx<- 0F00
18099 shr $6, %edx # %edx<- F at correct offset
18100 lea -4(%eax), %eax # %eax<- update &outs; &outs--
18101 movl (rFP, %edx), %edx # %edx<- vF
18102 movl %edx, (%eax) # *outs<- vF
18103 movl sReg1, %edx # %edx<- GFED
18105 and $0x00f0, %edx # %edx<- 00E0
18106 shr $2, %edx # %edx<- E at correct offset
18107 lea -4(%eax), %eax # %eax<- update &outs; &outs--
18108 movl (rFP, %edx), %edx # %edx<- vE
18109 movl %edx, (%eax) # *outs<- vE
18110 movl sReg1, %edx # %edx<- GFED
18112 and $0x000f, %edx # %edx<- 000D
18113 movl (rFP, %edx, 4), %edx # %edx<- vD
18114 movl %edx, -4(%eax) # *--outs<- vD
18118 * %ecx is "Method* methodToCall", the method we're trying to call
18119 * find space for the new stack frame, check for overflow
18123 movzwl offMethod_registersSize(%ecx), %eax # %eax<- methodToCall->regsSize
18124 movzwl offMethod_outsSize(%ecx), %edx # %edx<- methodToCall->outsSize
18125 movl %ecx, sReg0 # sReg<- methodToCall
18126 shl $2, %eax # %eax<- update offset
18127 SAVEAREA_FROM_FP %ecx # %ecx<- &outs; &StackSaveArea
18128 subl %eax, %ecx # %ecx<- newFP; (old savearea - regsSize)
18129 movl rGLUE, %eax # %eax<- pMterpGlue
18130 movl %ecx, sReg1 # sReg1<- &outs
18131 subl $sizeofStackSaveArea, %ecx # %ecx<- newSaveArea (stack save area using newFP)
18132 movl offGlue_interpStackEnd(%eax), %eax # %eax<- glue->interpStackEnd
18133 movl %eax, sReg2 # sReg2<- glue->interpStackEnd
18134 shl $2, %edx # %edx<- update offset for outsSize
18135 movl %ecx, %eax # %eax<- newSaveArea
18136 sub %edx, %ecx # %ecx<- bottom; (newSaveArea - outsSize)
18137 cmp sReg2, %ecx # compare interpStackEnd and bottom
18138 movl sReg0, %ecx # %ecx<- restore methodToCall
18139 jl .LstackOverflow # handle frame overflow
18142 * set up newSaveArea
18146 SAVEAREA_FROM_FP %edx # %edx<- &outs; &StackSaveArea
18147 movl %edx, offStackSaveArea_prevSave(%eax) # newSaveArea->prevSave<- &outs
18149 movl rFP, offStackSaveArea_prevFrame(%eax) # newSaveArea->prevFrame<- rFP
18150 movl rPC, offStackSaveArea_savedPc(%eax) # newSaveArea->savedPc<- rPC
18151 testl $ACC_NATIVE, offMethod_accessFlags(%ecx) # check for native call
18152 movl %ecx, offStackSaveArea_method(%eax) # newSaveArea->method<- method to call
18153 jne .LinvokeNative # handle native call
18156 * Update "glue" values for the new method
18157 * %ecx=methodToCall, sReg1=newFp
18160 movl offMethod_clazz(%ecx), %edx # %edx<- method->clazz
18161 movl rGLUE, %eax # %eax<- pMterpGlue
18162 movl %ecx, offGlue_method(%eax) # glue->method<- methodToCall
18163 movl offClassObject_pDvmDex(%edx), %edx # %edx<- method->clazz->pDvmDex
18164 movl offMethod_insns(%ecx), rPC # rPC<- methodToCall->insns
18165 movl %edx, offGlue_methodClassDex(%eax) # glue->methodClassDex<- method->clazz->pDvmDex
18166 movl offGlue_self(%eax), %ecx # %ecx<- glue->self
18167 movl sReg1, rFP # rFP<- newFP
18168 movl rFP, offThread_curFrame(%ecx) # glue->self->curFrame<- newFP
18169 FINISH_A # jump to methodToCall->insns
18172 * Prep for the native call
18173 * %ecx=methodToCall, sReg1=newFP, %eax=newSaveArea
18177 movl rGLUE, %edx # %edx<- pMterpGlue
18178 movl %ecx, -20(%esp) # push parameter methodToCall
18179 movl offGlue_self(%edx), %edx # %edx<- glue->self
18180 movl offThread_jniLocal_topCookie(%edx), %ecx # %ecx<- glue->self->thread->refNext
18181 movl %ecx, offStackSaveArea_localRefCookie(%eax) # newSaveArea->localRefCookie<- refNext
18182 movl %eax, -4(%esp) # save newSaveArea
18183 movl sReg1, %eax # %eax<- newFP
18184 movl %eax, offThread_curFrame(%edx) # glue->self->curFrame<- newFP
18185 movl %edx, -8(%esp) # save glue->self
18186 movl %edx, -16(%esp) # push parameter glue->self
18187 movl rGLUE, %edx # %edx<- pMterpGlue
18188 movl -20(%esp), %ecx # %ecx<- methodToCall
18189 lea offGlue_retval(%edx), %edx # %edx<- &retval
18190 movl %edx, -24(%esp) # push parameter pMterpGlue
18191 movl %eax, -28(%esp) # push parameter newFP
18192 lea -28(%esp), %esp
18194 #ifdef ASSIST_DEBUGGER
18196 .type dalvik_mterp, %function
18201 call *offMethod_nativeFunc(%ecx) # call methodToCall->nativeFunc
18203 movl -4(%esp), %edx # %edx<- newSaveArea
18204 movl -8(%esp), %ecx # %ecx<- glue->self
18205 movl offStackSaveArea_localRefCookie(%edx), %eax # %eax<- newSaveArea->localRefCookie
18206 FFETCH_ADV 3, %edx # %edx<- next instruction hi; fetch, advance
18207 cmp $0, offThread_exception(%ecx) # check for exception
18208 movl rFP, offThread_curFrame(%ecx) # glue->self->curFrame<- rFP
18209 movl %eax, offThread_jniLocal_topCookie(%ecx) # glue->self<- newSaveArea->localRefCookie
18210 jne common_exceptionThrown # handle exception
18211 FGETOP_JMP 3, %edx # jump to next instruction; getop, jmp
18213 .LstackOverflow: # %ecx=methodToCall
18214 movl %ecx, -4(%esp) # push parameter method to call
18215 movl rGLUE, %ecx # %ecx<- pMterpGlue
18216 movl offGlue_self(%ecx), %ecx # %ecx<- glue->self
18217 movl %ecx, -8(%esp) # push parameter self
18219 call dvmHandleStackOverflow # call: (Thread* self, Method* method)
18222 jmp common_exceptionThrown # handle exception
18223 #ifdef ASSIST_DEBUGGER
18227 * Common code for handling a return instruction.
18229 * This does not return.
18232 common_returnFromMethod:
18236 * Inline common periodic checks
18239 movl rGLUE, rINST # %ecx<- pMterpGlue
18240 movl offGlue_pSelfSuspendCount(rINST), %edx # %ebx<- pSuspendCount (int)
18241 #if defined(WITH_DEBUGGER)
18242 movl offGlue_pDebuggerActive(rINST), %eax # %eax<- pDebuggerActive
18243 movl (%eax), %eax # %eax<- get debuggerActive (boolean)
18244 and $7, %eax # %eax<- mask for boolean (just how many bits does it take?)
18246 cmp $0, (%edx) # check if suspend is pending
18247 jne 2f # handle suspend
18248 #if defined(WITH_DEBUGGER) || defined(WITH_PROFILER)
18249 #if defined(WITH_PROFILER)
18250 movl offGlue_pActiveProfilers(rINST), %edx # %edx<- activeProfilers (int)
18251 or (%edx), %eax # %eax<- merge activeProfilers and debuggerActive
18253 cmp $0, %eax # check for debuggerActive
18255 jne 3f # debugger or profiler active; switch interp
18258 2: # check suspended
18259 movl offGlue_self(rINST), %eax# %eax<- glue->self
18260 movl %eax, -12(%esp) # push parameter boolean
18261 lea -12(%esp), %esp
18262 call dvmCheckSuspendPending # call: (Thread* self)
18266 3: # debugger/profiler enabled, bail out
18267 movl $kInterpEntryInstr, offGlue_entryPoint(rINST) # glue->entryPoint<- reentry type
18268 movl $1, %edx # switch to interp<- true
18269 jmp common_gotoBail # bail
18273 * Get save area; rGLUE is %ebx, rFP is %eax
18276 SAVEAREA_FROM_FP %ecx # %ecx<- saveArea(old)
18277 movl offStackSaveArea_prevFrame(%ecx), rFP # rFP<- saveArea->PrevFrame
18278 movl (offStackSaveArea_method - sizeofStackSaveArea)(rFP), %edx # %edx<- method we are returning to
18279 cmpl $0, %edx # check for break frame
18280 je common_gotoBail # bail if break frame
18281 movl offStackSaveArea_savedPc(%ecx), rPC # rPC<- saveAreaOld->savedPc
18282 movl offGlue_self(rINST), %ecx # %eax<- glue->self
18283 movl %edx, offGlue_method(rINST) # glue->method<- newSave->method
18284 movl offMethod_clazz(%edx), %edx # %edx<- method->clazz
18285 FFETCH_ADV 3, %eax # %ecx<- next instruction hi; fetch, advance
18286 movl rFP, offThread_curFrame(%ecx) # glue->self->curFrame<- rFP
18287 movl offClassObject_pDvmDex(%edx), %edx # %edx<- method->clazz->pDvmDex
18288 movl %edx, offGlue_methodClassDex(rINST) # glue->pDvmDex<- method->clazz->pDvmDex
18289 FGETOP_JMP 3, %eax # jump to next instruction; getop, jmp
18292 * Handle thrown an exception. If the exception processing code
18293 * returns to us (instead of falling out of the interpreter),
18294 * continue with whatever the next instruction now happens to be.
18295 * This does not return.
18298 common_exceptionThrown:
18300 movl $kInterpEntryThrow, %ecx # %ecx<- reentry type
18301 movl $0, %edx # %edx<- pc adjustment
18302 call common_periodicChecks
18303 movl rGLUE, %eax # %eax<- pMterpGlue
18304 movl offGlue_self(%eax), %edx # %edx<- glue->self
18305 movl offThread_exception(%edx), %ecx # %ecx<- pMterpGlue->self->exception
18306 movl %edx, -4(%esp) # push parameter self
18307 movl %ecx, -8(%esp) # push parameter obj
18309 call dvmAddTrackedAlloc # don't allow the exception to be GC'd
18310 # call: (Object* obj, Thread* self)
18312 movl 4(%esp), %edx # %edx<- glue->self
18313 movl $0, offThread_exception(%edx) # glue->self->exception<- NULL
18316 * set up args and a local for &fp
18319 movl rFP, -4(%esp) # move fp to stack
18320 lea -4(%esp), %esp # update %esp
18321 movl %esp, -4(%esp) # push parameter 4<- &fp
18322 movl $0, -8(%esp) # push parameter 3<- false
18324 movl %edx, -12(%esp) # push parameter 2<- glue->self->exception
18325 movl rGLUE, %eax # %eax<- pMterpGlue
18326 movl offGlue_method(%eax), %edx # %edx<- glue->method
18327 movl offMethod_insns(%edx), %edx # %edx<- glue->method->insns
18328 movl rPC, %ecx # %ecx<- rPC
18329 subl %edx, %ecx # %ecx<- pc - glue->method->insns
18330 sar $1, %ecx # %ecx<- adjust %ecx for offset
18331 movl %ecx, -16(%esp) # push parameter 1<- glue->method->insns
18333 movl %edx, -20(%esp) # push parameter 0<- glue->self
18334 lea -20(%esp), %esp
18337 * call dvmFindCatchBlock, %eax gets catchRelPc (a code-unit offset)
18340 call dvmFindCatchBlock # call: (Thread* self, int relPc, Object* exception,
18341 # bool doUnroll, void** newFrame)
18344 movl -12(%esp), rFP # rFP<- updated rFP
18345 cmp $0, %eax # check for catchRelPc < 0
18346 jl .LnotCaughtLocally # handle not caught locally
18349 * fix stack overflow if necessary
18352 movl -4(%esp), %ecx # %ecx<- glue->self
18353 cmp $0, offThread_stackOverflowed(%ecx)
18355 movl %eax, -4(%esp) # save %eax for later
18356 movl %ecx, -12(%esp) # push parameter 2 glue->self
18357 lea -12(%esp), %esp
18358 call dvmCleanupStackOverflow # call: (Thread* self, Object* exception)
18361 movl -4(%esp), %eax # %eax<- restore %eax
18364 movl %ecx, -12(%esp) # push parameter 2 glue->self
18368 * adjust locals to match self->curFrame and updated PC
18372 SAVEAREA_FROM_FP %edx # %edx<- get newSaveArea
18373 movl rGLUE, %ecx # %ecx<- pMterpGlue
18374 movl offStackSaveArea_method(%edx), rPC # rPC<- newMethod
18375 movl rPC, offGlue_method(%ecx) # glue->method<- newMethod
18376 movl offMethod_clazz(rPC), %edx # %edx<- method->clazz
18377 movl offMethod_insns(rPC), rPC # rPC<- method->insns
18378 movl offClassObject_pDvmDex(%edx), %edx # %edx<- method->clazz->pDvmDex
18379 lea (rPC, %eax, 2), rPC # rPC<- method->insns + catchRelPc
18380 movl %edx, offGlue_methodClassDex(%ecx) # glue->pDvmDex<- method->clazz->pDvmDex
18381 movl -8(%esp), %eax
18382 movl %eax, -16(%esp) # push parameter 1 obj
18383 lea -16(%esp), %esp
18384 call dvmReleaseTrackedAlloc # call: (Object* obj, Thread* self)
18388 cmp $OP_MOVE_EXCEPTION, %eax # is it a move exception
18390 movl -12(%esp), %edx # %edx<- glue->self
18391 movl -8(%esp), %ecx # %ecx<- exception
18392 movl %ecx, offThread_exception(%edx) # restore the exception
18397 * -8(%esp) = exception, -4(%esp) = self
18400 .LnotCaughtLocally:
18401 movl -4(%esp), %edx # %edx<- glue->self
18402 movzb offThread_stackOverflowed(%edx), %eax # %eax<- self->stackOverflowed
18403 cmp $0, %eax # check for stack overflow;
18404 # maybe should use cmpb
18406 movl %edx, -12(%esp) # push parameter 1 glue->self
18407 lea -12(%esp), %esp
18408 call dvmCleanupStackOverflow # call: (Thread* self, Object* exception)
18413 * Release the exception
18414 * -8(%esp) = exception, -4(%esp) = self
18417 movl -8(%esp), %ecx # %ecx<- exception
18418 movl -4(%esp), %edx # %edx<- glue->self
18419 movl %ecx, offThread_exception(%edx) # glue->self<- exception
18421 call dvmReleaseTrackedAlloc # call: (Object* obj, Thread* self)
18424 movl $0, %edx # switch to interp<- false
18425 jmp common_gotoBail # bail
18428 * After returning from a "glued" function, pull out the updated
18429 * values and start executing at the next instruction.
18432 common_resumeAfterGlueCall:
18433 LOAD_PC_FP_FROM_GLUE # pull rPC and rFP out of glue
18434 FINISH_A # jump to next instruction
18437 * For debugging, cause an immediate fault.
18447 * Invalid array index.
18450 common_errArrayIndex:
18452 movl $.LstrArrayIndexException, -8(%esp) # push parameter description
18453 movl $0, -4(%esp) # push parameter msg paramter
18455 call dvmThrowException # call: (const char* exceptionDescriptor, const char* msg)
18458 jmp common_exceptionThrown # handle exception
18461 * Invalid array value.
18464 common_errArrayStore:
18466 movl $.LstrArrayStoreException, -8(%esp) # push parameter description
18467 movl $0, -4(%esp) # push parameter msg paramter
18469 call dvmThrowException # call: (const char* exceptionDescriptor, const char* msg)
18472 jmp common_exceptionThrown # handle exception
18475 * Integer divide or mod by zero.
18478 common_errDivideByZero:
18480 movl $.LstrArithmeticException, -8(%esp) # push parameter description
18481 movl $.LstrDivideByZero, -4(%esp) # push parameter msg paramter
18483 call dvmThrowException # call: (const char* exceptionDescriptor, const char* msg)
18486 jmp common_exceptionThrown # handle exception
18489 * Attempt to allocate an array with a negative size.
18492 common_errNegativeArraySize:
18494 movl $.LstrNegativeArraySizeException, -8(%esp) # push parameter description
18495 movl $0, -4(%esp) # push parameter msg paramter
18497 call dvmThrowException # call: (const char* exceptionDescriptor, const char* msg)
18500 jmp common_exceptionThrown # handle exception
18503 * Invocation of a non-existent method.
18506 common_errNoSuchMethod:
18508 movl $.LstrNoSuchMethodError, -8(%esp) # push parameter description
18509 movl $0, -4(%esp) # push parameter msg paramter
18511 call dvmThrowException # call: (const char* exceptionDescriptor, const char* msg)
18514 jmp common_exceptionThrown # handle exception
18517 * Unexpected null object.
18520 common_errNullObject:
18522 movl $.LstrNullPointerException, -8(%esp) # push parameter description
18523 movl $0, -4(%esp) # push parameter msg paramter
18525 call dvmThrowException # call: (const char* exceptionDescriptor, const char* msg)
18528 jmp common_exceptionThrown # handle exception
18531 * String references
18536 .LstrArithmeticException:
18537 .asciz "Ljava/lang/ArithmeticException;"
18538 .LstrArrayIndexException:
18539 .asciz "Ljava/lang/ArrayIndexOutOfBoundsException;"
18540 .LstrArrayStoreException:
18541 .asciz "Ljava/lang/ArrayStoreException;"
18542 .LstrClassCastException:
18543 .asciz "Ljava/lang/ClassCastException;"
18545 .asciz "divide by zero"
18546 .LstrInstantiationError:
18547 .asciz "Ljava/lang/InstantiationError;"
18548 .LstrNegativeArraySizeException:
18549 .asciz "Ljava/lang/NegativeArraySizeException;"
18550 .LstrNoSuchMethodError:
18551 .asciz "Ljava/lang/NoSuchMethodError;"
18552 .LstrNullPointerException:
18553 .asciz "Ljava/lang/NullPointerException;"
18554 .LstrExceptionNotCaughtLocally:
18555 .asciz "Exception %s from %s:%d not caught locally\n"