1a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
2a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * This file was generated automatically by gen-mterp.py for 'mips'.
3a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
4a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * --> DO NOT EDIT <--
5a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
6a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/header.S */
8a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#include "../common/asm-constants.h"
9a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#include "../common/mips-defines.h"
10a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#include <asm/regdef.h>
11a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#include <asm/fpregdef.h>
12a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef __mips_hard_float
14a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define HARD_FLOAT
15a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
16a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SOFT_FLOAT
17a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
18a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
19a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if (__mips==32) && (__mips_isa_rev>=2)
20a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define MIPS32R2
21a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
22a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
23a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* MIPS definitions and declarations
24a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
25a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham   reg	nick		purpose
26a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham   s0	rPC		interpreted program counter, used for fetching instructions
27a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham   s1	rFP		interpreted frame pointer, used for accessing locals and args
28a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham   s2	rSELF		self (Thread) pointer
29a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham   s3	rIBASE		interpreted instruction base pointer, used for computed goto
30a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham   s4	rINST		first 16-bit code unit of current instruction
31a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham*/
32a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
33a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
34a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* single-purpose registers, given names for clarity */
35a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rPC s0
36a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rFP s1
37a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rSELF s2
38a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rIBASE s3
39a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rINST s4
40a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rOBJ s5
41a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rBIX s6
42a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rTEMP s7
43a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
44a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* The long arguments sent to function calls in Big-endian mode should be register
45a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandhamswapped when sent to functions in little endian mode. In other words long variable
46a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandhamsent as a0(MSW), a1(LSW) for a function call in LE mode should be sent as a1, a0 in
47a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu GandhamBig Endian mode */
48a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
49a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
50a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG0 a0
51a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG1 a1
52a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG2 a2
53a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG3 a3
54a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rRESULT0 v0
55a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rRESULT1 v1
56a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
57a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG0 a1
58a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG1 a0
59a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG2 a3
60a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rARG3 a2
61a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rRESULT0 v1
62a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define rRESULT1 v0
63a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
64a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
65a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
66a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* save/restore the PC and/or FP from the glue struct */
67a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_PC_FROM_SELF() lw rPC, offThread_pc(rSELF)
68a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SAVE_PC_TO_SELF() sw rPC, offThread_pc(rSELF)
69a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_FP_FROM_SELF() lw rFP, offThread_curFrame(rSELF)
70a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SAVE_FP_TO_SELF() sw rFP, offThread_curFrame(rSELF)
71a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_PC_FP_FROM_SELF() \
72a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham	LOAD_PC_FROM_SELF();   \
73a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham	LOAD_FP_FROM_SELF()
74a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SAVE_PC_FP_TO_SELF()   \
75a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham	SAVE_PC_TO_SELF();     \
76a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham	SAVE_FP_TO_SELF()
77a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
78a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define EXPORT_PC() \
79a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rPC, (offStackSaveArea_currentPc - sizeofStackSaveArea)(rFP)
80a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
81a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SAVEAREA_FROM_FP(rd, _fpreg) \
82a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu      rd, _fpreg, sizeofStackSaveArea
83a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
84a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_INST() lhu rINST, (rPC)
85a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
86a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_ADVANCE_INST(_count) lhu rINST, ((_count)*2)(rPC); \
87a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      rPC, rPC, ((_count) * 2)
88a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
89a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define PREFETCH_ADVANCE_INST(_dreg, _sreg, _count) \
90a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu       _dreg, ((_count)*2)(_sreg) ;            \
91a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      _sreg, _sreg, (_count)*2
92a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
93a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_ADVANCE_INST_RB(rd) addu rPC, rPC, rd; \
94a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu       rINST, (rPC)
95a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
96a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH(rd, _count) lhu rd, ((_count) * 2)(rPC)
97a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_S(rd, _count) lh rd, ((_count) * 2)(rPC)
98a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
99a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_B(rd, _count) lbu rd, ((_count) * 2)(rPC)
102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_C(rd, _count) lbu rd, ((_count) * 2 + 1)(rPC)
103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_B(rd, _count) lbu rd, ((_count) * 2 + 1)(rPC)
107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define FETCH_C(rd, _count) lbu rd, ((_count) * 2)(rPC)
108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_INST_OPCODE(rd) and rd, rINST, 0xFF
112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Put the prefetched instruction's opcode field into the specified register.
115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_PREFETCHED_OPCODE(dreg, sreg)   andi     dreg, sreg, 255
118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GOTO_OPCODE(rd) sll rd, rd, 7; \
120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      rd, rIBASE, rd; \
121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr        rd
122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GOTO_OPCODE_BASE(_base, rd)  sll rd, rd, 7; \
124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      rd, _base, rd; \
125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr        rd
126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_VREG(rd, rix) LOAD_eas2(rd, rFP, rix)
128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_VREG_F(rd, rix) EAS2(AT, rFP, rix); \
130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set noat; l.s rd, (AT); .set at
131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SET_VREG(rd, rix) STORE_eas2(rd, rFP, rix)
133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SET_VREG_GOTO(rd, rix, dst) .set noreorder; \
135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       dst, dst, 7; \
136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      dst, rIBASE, dst; \
137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       t8, rix, 2; \
138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t8, t8, rFP; \
139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr        dst; \
140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rd, 0(t8); \
141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set reorder
142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SET_VREG_F(rd, rix) EAS2(AT, rFP, rix); \
144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set noat; s.s rd, (AT); .set at
145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_OPA(rd) srl rd, rINST, 8
148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifndef MIPS32R2
149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_OPA4(rd) GET_OPA(rd); and rd, 0xf
150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_OPA4(rd) ext rd, rINST, 8, 4
152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define GET_OPB(rd) srl rd, rINST, 12
154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_OFF(rd, off) lw rd, offThread_##off## (rSELF)
156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_method(rd) LOAD_rSELF_OFF(rd, method)
158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_methodClassDex(rd) LOAD_rSELF_OFF(rd, methodClassDex)
159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_interpStackEnd(rd) LOAD_rSELF_OFF(rd, interpStackEnd)
160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_retval(rd) LOAD_rSELF_OFF(rd, retval)
161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_pActiveProfilers(rd) LOAD_rSELF_OFF(rd, pActiveProfilers)
162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_bailPtr(rd) LOAD_rSELF_OFF(rd, bailPtr)
163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_rSELF_SelfSuspendCount(rd) LOAD_rSELF_OFF(rd, SelfSuspendCount)
164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Form an Effective Address rd = rbase + roff<<n;
168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Uses reg AT
169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define EASN(rd, rbase, roff, rshift) .set noat; \
171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       AT, roff, rshift; \
172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      rd, rbase, AT; \
173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set at
174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define EAS1(rd, rbase, roff) EASN(rd, rbase, roff, 1)
176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define EAS2(rd, rbase, roff) EASN(rd, rbase, roff, 2)
177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define EAS3(rd, rbase, roff) EASN(rd, rbase, roff, 3)
178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define EAS4(rd, rbase, roff) EASN(rd, rbase, roff, 4)
179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Form an Effective Shift Right rd = rbase + roff>>n;
182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Uses reg AT
183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define ESRN(rd, rbase, roff, rshift) .set noat; \
185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       AT, roff, rshift; \
186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      rd, rbase, AT; \
187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set at
188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_eas2(rd, rbase, roff) EAS2(AT, rbase, roff); \
190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set noat; lw rd, 0(AT); .set at
191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE_eas2(rd, rbase, roff) EAS2(AT, rbase, roff); \
193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set noat; sw rd, 0(AT); .set at
194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_RB_OFF(rd, rbase, off) lw rd, off(rbase)
196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOADu2_RB_OFF(rd, rbase, off) lhu rd, off(rbase)
197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE_RB_OFF(rd, rbase, off) sw rd, off(rbase)
198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_off(rlo, rhi, rbase, off) sw rlo, off(rbase); \
202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rhi, (off+4)(rbase)
203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD64_off(rlo, rhi, rbase, off) lw rlo, off(rbase); \
204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rhi, (off+4)(rbase)
205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define vSTORE64_off(rlo, rhi, rbase, off) sw rlo, off(rbase); \
207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rhi, (off+4)(rbase)
208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define vLOAD64_off(rlo, rhi, rbase, off) lw rlo, off(rbase); \
209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rhi, (off+4)(rbase)
210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_off_F(rlo, rhi, rbase, off) s.s rlo, off(rbase); \
212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    s.s       rhi, (off+4)(rbase)
213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD64_off_F(rlo, rhi, rbase, off) l.s rlo, off(rbase); \
214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    l.s       rhi, (off+4)(rbase)
215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_off(rlo, rhi, rbase, off) sw rlo, (off+4)(rbase); \
218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rhi, (off)(rbase)
219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD64_off(rlo, rhi, rbase, off) lw rlo, (off+4)(rbase); \
220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rhi, (off)(rbase)
221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define vSTORE64_off(rlo, rhi, rbase, off) sw rlo, (off+4)(rbase); \
222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rhi, (off)(rbase)
223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define vLOAD64_off(rlo, rhi, rbase, off) lw rlo, (off+4)(rbase); \
224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rhi, (off)(rbase)
225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_off_F(rlo, rhi, rbase, off) s.s rlo, (off+4)(rbase); \
226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    s.s       rhi, (off)(rbase)
227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD64_off_F(rlo, rhi, rbase, off) l.s rlo, (off+4)(rbase); \
228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    l.s       rhi, (off)(rbase)
229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64(rlo, rhi, rbase) STORE64_off(rlo, rhi, rbase, 0)
232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD64(rlo, rhi, rbase) LOAD64_off(rlo, rhi, rbase, 0)
233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define vSTORE64(rlo, rhi, rbase) vSTORE64_off(rlo, rhi, rbase, 0)
235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define vLOAD64(rlo, rhi, rbase) vLOAD64_off(rlo, rhi, rbase, 0)
236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_F(rlo, rhi, rbase) STORE64_off_F(rlo, rhi, rbase, 0)
238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD64_F(rlo, rhi, rbase) LOAD64_off_F(rlo, rhi, rbase, 0)
239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_lo(rd, rbase) sw rd, 0(rbase)
241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE64_hi(rd, rbase) sw rd, 4(rbase)
242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_offThread_exception(rd, rbase) LOAD_RB_OFF(rd, rbase, offThread_exception)
245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offArrayObject_length(rd, rbase) LOAD_RB_OFF(rd, rbase, offArrayObject_length)
246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offClassObject_accessFlags(rd, rbase) LOAD_RB_OFF(rd, rbase, offClassObject_accessFlags)
247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offClassObject_descriptor(rd, rbase) LOAD_RB_OFF(rd, rbase, offClassObject_descriptor)
248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offClassObject_super(rd, rbase) LOAD_RB_OFF(rd, rbase, offClassObject_super)
249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offClassObject_vtable(rd, rbase) LOAD_RB_OFF(rd, rbase, offClassObject_vtable)
251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offClassObject_vtableCount(rd, rbase) LOAD_RB_OFF(rd, rbase, offClassObject_vtableCount)
252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offDvmDex_pResClasses(rd, rbase) LOAD_RB_OFF(rd, rbase, offDvmDex_pResClasses)
253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offDvmDex_pResFields(rd, rbase) LOAD_RB_OFF(rd, rbase, offDvmDex_pResFields)
254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offDvmDex_pResMethods(rd, rbase) LOAD_RB_OFF(rd, rbase, offDvmDex_pResMethods)
256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offDvmDex_pResStrings(rd, rbase) LOAD_RB_OFF(rd, rbase, offDvmDex_pResStrings)
257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offInstField_byteOffset(rd, rbase) LOAD_RB_OFF(rd, rbase, offInstField_byteOffset)
258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offStaticField_value(rd, rbase) LOAD_RB_OFF(rd, rbase, offStaticField_value)
259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offMethod_clazz(rd, rbase) LOAD_RB_OFF(rd, rbase, offMethod_clazz)
260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offMethod_name(rd, rbase) LOAD_RB_OFF(rd, rbase, offMethod_name)
262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_base_offObject_clazz(rd, rbase) LOAD_RB_OFF(rd, rbase, offObject_clazz)
263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOADu2_offMethod_methodIndex(rd, rbase) LOADu2_RB_OFF(rd, rbase, offMethod_methodIndex)
265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STORE_offThread_exception(rd, rbase) STORE_RB_OFF(rd, rbase, offThread_exception)
268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_STORE(rd, off) sw rd, off(sp)
271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_LOAD(rd, off) lw rd, off(sp)
272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define CREATE_STACK(n) subu sp, sp, n
273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define DELETE_STACK(n) addu sp, sp, n
274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SAVE_RA(offset) STACK_STORE(ra, offset)
276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_RA(offset) STACK_LOAD(ra, offset)
277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_ADDR(dest, addr) la dest, addr
279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define LOAD_IMM(dest, imm) li dest, imm
280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define MOVE_REG(dest, src) move dest, src
281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define RETURN jr ra
282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_SIZE 128
283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_ARG04 16
285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_ARG05 20
286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_ARG06 24
287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_ARG07 28
288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_SCR   32
289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_SCRMX 80
290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_GP    84
291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_OFFSET_rFP   112
292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define JAL(n) jal n
294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define BAL(n) bal n
295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_STORE_RA() CREATE_STACK(STACK_SIZE); \
297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(gp, STACK_OFFSET_GP); \
298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(ra, 124)
299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_STORE_S0() STACK_STORE_RA(); \
301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s0, 116)
302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_STORE_S0S1() STACK_STORE_S0(); \
304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s1, STACK_OFFSET_rFP)
305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_LOAD_RA() STACK_LOAD(ra, 124); \
307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(gp, STACK_OFFSET_GP); \
308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    DELETE_STACK(STACK_SIZE)
309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_LOAD_S0() STACK_LOAD(s0, 116); \
311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD_RA()
312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_LOAD_S0S1() STACK_LOAD(s1, STACK_OFFSET_rFP); \
314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD_S0()
315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_STORE_FULL() CREATE_STACK(STACK_SIZE); \
317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(ra, 124); \
318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(fp, 120); \
319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s0, 116); \
320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s1, STACK_OFFSET_rFP); \
321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s2, 108); \
322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s3, 104); \
323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s4, 100); \
324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s5, 96); \
325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s6, 92); \
326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(s7, 88);
327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define STACK_LOAD_FULL() STACK_LOAD(gp, STACK_OFFSET_GP); \
329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s7, 88); \
330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s6, 92); \
331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s5, 96); \
332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s4, 100); \
333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s3, 104); \
334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s2, 108); \
335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s1, STACK_OFFSET_rFP); \
336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(s0, 116); \
337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(fp, 120); \
338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(ra, 124); \
339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    DELETE_STACK(STACK_SIZE)
340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * first 8 words are reserved for function calls
343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Maximum offset is STACK_OFFSET_SCRMX-STACK_OFFSET_SCR
344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SCRATCH_STORE(r,off) \
346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE(r, STACK_OFFSET_SCR+off);
347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define SCRATCH_LOAD(r,off) \
348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD(r, STACK_OFFSET_SCR+off);
349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#include "../common/jit-config.h"
352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/platform.S */
355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * ===========================================================================
357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *  CPU-version-specific defines
358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * ===========================================================================
359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if !defined(ANDROID_SMP)
362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham# error "Must define ANDROID_SMP"
363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Macro for data memory barrier.
367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.macro SMP_DMB
369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if ANDROID_SMP != 0
370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sync
371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* not SMP */
373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.endm
375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Macro for data memory barrier (store/store variant).
378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.macro  SMP_DMB_ST
380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if ANDROID_SMP != 0
381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    // FIXME: Is this really needed?
382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sync
383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* not SMP */
385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.endm
387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/entry.S */
389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Copyright (C) 2008 The Android Open Source Project
392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Licensed under the Apache License, Version 2.0 (the "License");
394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * you may not use this file except in compliance with the License.
395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * You may obtain a copy of the License at
396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *      http://www.apache.org/licenses/LICENSE-2.0
398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Unless required by applicable law or agreed to in writing, software
400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * distributed under the License is distributed on an "AS IS" BASIS,
401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * See the License for the specific language governing permissions and
403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * limitations under the License.
404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Interpreter entry point.
407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#define ASSIST_DEBUGGER 1
410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .text
412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .align 2
413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .global dvmMterpStdRun
414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .ent dvmMterpStdRun
415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .frame sp, STACK_SIZE, ra
416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * On entry:
418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *  r0  Thread* self
419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * The return comes via a call to dvmMterpStdBail().
421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu GandhamdvmMterpStdRun:
424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set noreorder
425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .cpload t9
426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .set reorder
427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* Save to the stack. Frame size = STACK_SIZE */
428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_STORE_FULL()
429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* This directive will make sure all subsequent jal restore gp at a known offset */
430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .cprestore STACK_OFFSET_GP
431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      fp, sp, STACK_SIZE           #  Move Frame Pointer to the base of frame
433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* save stack pointer, add magic word for debuggerd */
434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        sp, offThread_bailPtr(a0)      # Save SP
435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* set up "named" registers, figure out entry point */
437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      rSELF, a0                    #  set rSELF
438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_PC_FROM_SELF()
439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_FP_FROM_SELF()
440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)
441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LentryInstr:
444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* Entry is always a possible trace start */
445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_INST()                           #  load rINST from rPC
447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        zero, offThread_inJitCodeCache(rSELF)
448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if !defined(WITH_SELF_VERIFICATION)
449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     # profiling is enabled
450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw       a2, offThread_shadowSpace(rSELF) # to find out the jit exit state
452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz     a0, 1f                        # profiling is disabled
453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw       a3, offShadowSpace_jitExitState(a2) # jit exit state
454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li	     t0, kSVSTraceSelect
455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bne      a3, t0, 2f
456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li       a2, kJitTSelectRequestHot     # ask for trace selection
457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        common_selectTrace            # go build the trace
458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li       a4, kSVSNoProfile
460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beq      a3, a4, 1f                    # don't profile the next instruction?
461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        common_updateProfile          # collect profiles
462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* start executing the instruction at rPC */
468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_INST()                           #  load rINST from rPC
469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.Lbad_arg:
474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    la        a0, .LstrBadEntryPoint
475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    #a1 holds value of entryPoint
476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(printf)
477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmAbort)
478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .end dvmMterpStdRun
480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .global dvmMterpStdBail
482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .ent dvmMterpStdBail
483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* Restore the stack pointer and all the registers stored at sp from the save
485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * point established  on entry. Return to whoever called dvmMterpStdRun.
486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * On entry:
488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *   a0    Thread* self
489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu GandhamdvmMterpStdBail:
491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        sp, offThread_bailPtr(a0)      #  Restore sp
492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STACK_LOAD_FULL()
493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr        ra
494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .end dvmMterpStdBail
496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .global dvmAsmInstructionStart
499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .type   dvmAsmInstructionStart, %function
500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu GandhamdvmAsmInstructionStart = .L_OP_NOP
501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .text
502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NOP: /* 0x00 */
506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NOP.S */
507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance to next instr, load rINST
508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)
509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  execute it
510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef ASSIST_DEBUGGER
512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* insert fake function header to help gdb find the stack frame */
513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .type dalvik_inst, @function
514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandhamdalvik_inst:
515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .ent dalvik_inst
516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .end dalvik_inst
517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE: /* 0x01 */
523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE.S */
524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for move, move-object, long-to-int */
525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vA, vB */
526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B from 15:12
527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A from 11:8
528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[B]
530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  t0 <- opcode from rINST
531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[A] <- a2
532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_FROM16: /* 0x02 */
537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_FROM16.S */
538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for: move/from16, move-object/from16 */
539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBBBB */
540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[BBBB]
544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[AA] <- a2
546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_16: /* 0x03 */
551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_16.S */
552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for: move/16, move-object/16 */
553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAAAA, vBBBB */
554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB
555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- AAAA
556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[BBBB]
558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[AAAA] <- a2 and jump
560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_WIDE: /* 0x04 */
565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_WIDE.S */
566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* move-wide vA, vB */
567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* NOTE: regs can overlap, e.g. "move v6, v7" or "move v7, v6" */
568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A(+)
569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[A]
572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- fp[B]
573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a2)                    #  fp[A] <- a0/a1
576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_WIDE_FROM16: /* 0x05 */
582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_WIDE_FROM16.S */
583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* move-wide/from16 vAA, vBBBB */
584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* NOTE: regs can overlap, e.g. "move v6, v7" or "move v7, v6" */
585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 1)                           #  a3 <- BBBB
586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[BBBB]
588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[AA]
589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- fp[BBBB]
590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a2)                    #  fp[AA] <- a0/a1
593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_WIDE_16: /* 0x06 */
599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_WIDE_16.S */
600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* move-wide/16 vAAAA, vBBBB */
601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* NOTE: regs can overlap, e.g. "move v6, v7" or "move v7, v6" */
602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 2)                           #  a3 <- BBBB
603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 1)                           #  a2 <- AAAA
604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[BBBB]
605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[AAAA]
606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- fp[BBBB]
607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a2)                    #  fp[AAAA] <- a0/a1
610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_OBJECT: /* 0x07 */
616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_OBJECT.S */
617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE.S */
618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for move, move-object, long-to-int */
619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vA, vB */
620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B from 15:12
621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A from 11:8
622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[B]
624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  t0 <- opcode from rINST
625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[A] <- a2
626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_OBJECT_FROM16: /* 0x08 */
632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_OBJECT_FROM16.S */
633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_FROM16.S */
634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for: move/from16, move-object/from16 */
635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBBBB */
636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[BBBB]
640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[AA] <- a2
642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_OBJECT_16: /* 0x09 */
648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_OBJECT_16.S */
649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_16.S */
650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for: move/16, move-object/16 */
651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAAAA, vBBBB */
652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB
653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- AAAA
654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[BBBB]
656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[AAAA] <- a2 and jump
658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_RESULT: /* 0x0a */
664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_RESULT.S */
665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for: move-result, move-result-object */
666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA */
667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_retval(a0)                  #  a0 <- self->retval.i
670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, a2, t0)              #  fp[AA] <- a0
672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_RESULT_WIDE: /* 0x0b */
677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_RESULT_WIDE.S */
678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* move-result-wide vAA */
679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a3, rSELF, offThread_retval  #  a3 <- &self->retval
681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[AA]
682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- retval.j
683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a2)                    #  fp[AA] <- a0/a1
686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_RESULT_OBJECT: /* 0x0c */
692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_RESULT_OBJECT.S */
693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_RESULT.S */
694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* for: move-result, move-result-object */
695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA */
696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_retval(a0)                  #  a0 <- self->retval.i
699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, a2, t0)              #  fp[AA] <- a0
701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MOVE_EXCEPTION: /* 0x0d */
707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MOVE_EXCEPTION.S */
708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* move-exception vAA */
709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_offThread_exception(a3, rSELF)    #  a3 <- dvmGetException bypass
711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 0                        #  a1 <- 0
712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(a3, a2)                       #  fp[AA] <- exception obj
714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE_offThread_exception(a1, rSELF)   #  dvmClearException bypass
716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RETURN_VOID: /* 0x0e */
722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RETURN_VOID.S */
723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_returnFromMethod
724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RETURN: /* 0x0f */
729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RETURN.S */
730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Return a 32-bit value.  Copies the return value into the "thread"
732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * structure, then jumps to the return handler.
733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: return, return-object
735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA */
737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vAA
739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        a0, offThread_retval(rSELF)  #  retval.i <- vAA
740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_returnFromMethod
741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RETURN_WIDE: /* 0x10 */
746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RETURN_WIDE.S */
747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Return a 64-bit value.  Copies the return value into the "thread"
749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * structure, then jumps to the return handler.
750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* return-wide vAA */
752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[AA]
754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a3, rSELF, offThread_retval  #  a3 <- &self->retval
755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)                     #  a0/a1 <- vAA/vAA+1
756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a3)                    #  retval <- a0/a1
757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_returnFromMethod
758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RETURN_OBJECT: /* 0x11 */
763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RETURN_OBJECT.S */
764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RETURN.S */
765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Return a 32-bit value.  Copies the return value into the "thread"
767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * structure, then jumps to the return handler.
768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: return, return-object
770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA */
772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vAA
774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        a0, offThread_retval(rSELF)  #  retval.i <- vAA
775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_returnFromMethod
776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_4: /* 0x12 */
782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_4.S */
783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const/4 vA,                          /* +B */
784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, rINST, 16                #  a1 <- Bxxx0000
785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- A+
786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a1, 28                   #  a1 <- sssssssB (sign-extended)
788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a0, a0, 15
789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  ip <- opcode from rINST
790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a1, a0, t0)              #  fp[A] <- a1
791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_16: /* 0x13 */
796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_16.S */
797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const/16 vAA,                        /* +BBBB */
798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a0, 1)                         #  a0 <- ssssBBBB (sign-extended)
799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, a3, t0)              #  vAA <- a0
803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST: /* 0x14 */
808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST.S */
809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const vAA,                           /* +BBBBbbbb */
810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- bbbb (low)
812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB (high)
813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, a1, 16
815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a0, a1, a0                   #  a0 <- BBBBbbbb
816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, a3, t0)              #  vAA <- a0
818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_HIGH16: /* 0x15 */
823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_HIGH16.S */
824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const/high16 vAA,                    /* +BBBB0000 */
825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- 0000BBBB (zero-extended)
826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a0, a0, 16                   #  a0 <- BBBB0000
828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, a3, t0)              #  vAA <- a0
831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_WIDE_16: /* 0x16 */
836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_WIDE_16.S */
837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const-wide/16 vAA,                   /* +BBBB */
838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a0, 1)                         #  a0 <- ssssBBBB (sign-extended)
839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a0, 31                   #  a1 <- ssssssss
841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[AA]
843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a3)                    #  vAA <- a0/a1
845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_WIDE_32: /* 0x17 */
851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_WIDE_32.S */
852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const-wide/32 vAA,                   /* +BBBBbbbb */
853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- 0000bbbb (low)
854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a2, 2)                         #  a2 <- ssssBBBB (high)
856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a2, a2, 16
858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a0, a0, a2                   #  a0 <- BBBBbbbb
859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[AA]
860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a0, 31                   #  a1 <- ssssssss
861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a3)                    #  vAA <- a0/a1
863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_WIDE: /* 0x18 */
869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_WIDE.S */
870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const-wide vAA,                      /* +HHHHhhhhBBBBbbbb */
871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- bbbb (low)
872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB (low middle)
873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 3)                           #  a2 <- hhhh (high middle)
874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, 16 #
875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a0, a1                       #  a0 <- BBBBbbbb (low word)
876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 4)                           #  a3 <- HHHH (high)
877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t1)                            #  t1 <- AA
878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a3, 16
879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a1, a3, a2                   #  a1 <- HHHHhhhh (high word)
880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(5)                  #  advance rPC, load rINST
881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, t1)                      #  t1 <- &fp[AA]
882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, t1)                    #  vAA <- a0/a1
884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_WIDE_HIGH16: /* 0x19 */
890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_WIDE_HIGH16.S */
891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const-wide/high16 vAA,               /* +BBBB000000000000 */
892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- 0000BBBB (zero-extended)
893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a0, 0                        #  a0 <- 00000000
895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, 16                       #  a1 <- BBBB0000
896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[AA]
898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a3)                    #  vAA <- a0/a1
900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_STRING: /* 0x1a */
906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_STRING.S */
907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const/string vAA, String             /* BBBB */
908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- self->methodClassDex
910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResStrings(a2, a2) #  a2 <- dvmDex->pResStrings
912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(v0, a2, a1)                  #  v0 <- pResStrings[BBBB]
913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # not yet resolved?
914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_CONST_STRING_resolve
915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the String has not yet been resolved.
917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:   BBBB (String ref)
918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rOBJ: target register
919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a0)                  #  a0 <- self->method
922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a0)      #  a0 <- method->clazz
923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveString)                  #  v0 <- String reference
924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yup, handle the exception
926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CONST_STRING_resolve:
928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(v0, rOBJ, t0)            #  vAA <- v0
931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_STRING_JUMBO: /* 0x1b */
940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_STRING_JUMBO.S */
941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const/string vAA, String             /* BBBBBBBB */
942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- bbbb (low)
943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB (high)
944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- self->methodClassDex
945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResStrings(a2, a2) #  a2 <- dvmDex->pResStrings
947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, a1, 16
948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a1, a1, a0                   #  a1 <- BBBBbbbb
949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(v0, a2, a1)                  #  v0 <- pResStrings[BBBB]
950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_CONST_STRING_JUMBO_resolve
951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the String has not yet been resolved.
954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1: BBBBBBBB (String ref)
955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rOBJ: target register
956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a0)                  #  a0 <- self->method
959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a0)      #  a0 <- method->clazz
960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveString)                  #  v0 <- String reference
961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yup, handle the exception
963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CONST_STRING_JUMBO_resolve:
965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(v0, rOBJ, t1)            #  vAA <- v0
968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CONST_CLASS: /* 0x1c */
973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CONST_CLASS.S */
974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # const/class vAA, Class               /* BBBB */
975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- self->methodClassDex
977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a2, a2) #  a2 <- dvmDex->pResClasses
979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(v0, a2, a1)                  #  v0 <- pResClasses[BBBB]
980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_CONST_CLASS_resolve      #  v0!=0 => resolved-ok
982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the Class has not yet been resolved.
984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1: BBBB (Class ref)
985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rOBJ: target register
986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a0)                  #  a0 <- self->method
989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, 1                        #  a2 <- true
990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a0)      #  a0 <- method->clazz
991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveClass)                   #  v0 <- Class reference
992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed==0?
993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yup, handle the exception
994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CONST_CLASS_resolve:
996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(v0, rOBJ, t0)            #  vAA <- v0
999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MONITOR_ENTER: /* 0x1d */
1005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MONITOR_ENTER.S */
1006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Synchronize on an object.
1008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* monitor-enter vAA */
1010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
1011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a2)                       #  a1 <- vAA (object)
1012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rSELF                    #  a0 <- self
1013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  export PC so we can grab stack trace
1014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null object?
1015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errNullObject     #  null object, throw an exception
1016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
1017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmLockObject)                     #  call(self, obj)
1018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MONITOR_EXIT: /* 0x1e */
1025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MONITOR_EXIT.S */
1026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Unlock an object.
1028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Exceptions that occur when unlocking a monitor need to appear as
1030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * if they happened at the following instruction.  See the Dalvik
1031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instruction spec.
1032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* monitor-exit vAA */
1034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
1035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  before fetch: export the PC
1036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a2)                       #  a1 <- vAA (object)
1037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null object?
1038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, 1f
1039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rSELF                    #  a0 <- self
1040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmUnlockObject)                   #  v0 <- success for unlock(self, obj)
1041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
1042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  before throw: advance rPC, load rINST
1043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, exception is pending
1044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  before throw: advance rPC, load rINST
1048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_errNullObject
1049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CHECK_CAST: /* 0x1f */
1053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CHECK_CAST.S */
1054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Check to see if a cast from one class to another is allowed.
1056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check-cast vAA, class                /* BBBB */
1058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
1059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 1)                           #  a2 <- BBBB
1060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a3)                     #  rOBJ <- object
1061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a0)          #  a0 <- pDvmDex
1062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a0, a0) #  a0 <- pDvmDex->pResClasses
1063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is object null?
1064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, .LOP_CHECK_CAST_okay       #  null obj, cast always succeeds
1065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a1, a0, a2)                  #  a1 <- resolved class
1066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a0, rOBJ)    #  a0 <- obj->clazz
1067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # have we resolved this before?
1068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, .LOP_CHECK_CAST_resolve      #  not resolved, do it now
1069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CHECK_CAST_resolved:
1070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # same class (trivial success)?
1071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bne       a0, a1, .LOP_CHECK_CAST_fullcheck #  no, do full check
1072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CHECK_CAST_okay:
1073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
1074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Trivial test failed, need to perform full check.  This is common.
1079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a0 holds obj->clazz
1080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1 holds class resolved from BBBB
1081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rOBJ holds object
1082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CHECK_CAST_fullcheck:
1084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      rBIX,a1                      #  avoid ClassObject getting clobbered
1085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmInstanceofNonTrivial)           #  v0 <- boolean result
1086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
1087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_CHECK_CAST_okay         #  no, success
1088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_CHECK_CAST_castfailure
1089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INSTANCE_OF: /* 0x20 */
1093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INSTANCE_OF.S */
1094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Check to see if an object reference is an instance of a class.
1096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Most common situation is a non-null object, being compared against
1098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * an already-resolved class.
1099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # instance-of vA, vB, class            /* CCCC */
1101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
1102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
1103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB (object)
1104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- pDvmDex
1105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is object null?
1106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, .LOP_INSTANCE_OF_store        #  null obj, not an instance, store a0
1107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 1)                           #  a3 <- CCCC
1108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a2, a2) #  a2 <- pDvmDex->pResClasses
1109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a1, a2, a3)                  #  a1 <- resolved class
1110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a0, a0)      #  a0 <- obj->clazz
1111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # have we resolved this before?
1112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, .LOP_INSTANCE_OF_resolve      #  not resolved, do it now
1113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INSTANCE_OF_resolved:                   #  a0=obj->clazz, a1=resolved class
1114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # same class (trivial success)?
1115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beq       a0, a1, .LOP_INSTANCE_OF_trivial  #  yes, trivial finish
1116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_INSTANCE_OF_fullcheck        #  no, do full check
1117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Trivial test succeeded, save and bail.
1120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rOBJ holds A
1121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INSTANCE_OF_trivial:
1123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a0, 1                        #  indicate success
1124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # fall thru
1125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * a0   holds boolean result
1127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * rOBJ holds A
1128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INSTANCE_OF_store:
1130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
1131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(a0, rOBJ)                     #  vA <- a0
1132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ARRAY_LENGTH: /* 0x21 */
1139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ARRAY_LENGTH.S */
1140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Return the length of an array.
1142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A+
1145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a1)                       #  a0 <- vB (object ref)
1146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is object null?
1147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yup, fail
1148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
1149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- array length
1150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a3, a2, t0)              #  vA <- length
1152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NEW_INSTANCE: /* 0x22 */
1157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NEW_INSTANCE.S */
1158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Create a new instance of a class.
1160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # new-instance vAA, class              /* BBBB */
1162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
1163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
1164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a3, a3) #  a3 <- pDvmDex->pResClasses
1165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved class
1166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, a3, a1)                     #  rBIX <- &resolved_class
1168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  req'd for init, resolve, alloc
1170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
1171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, .LOP_NEW_INSTANCE_resolve      #  no, resolve it now
1172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_NEW_INSTANCE_resolved:                      #  a0=class
1173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu       a1, offClassObject_status(a0) #  a1 <- ClassStatus enum
1174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # has class been initialized?
1175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        t0, CLASS_INITIALIZED
1176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      rOBJ, a0                     #  save a0
1177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bne       a1, t0, .LOP_NEW_INSTANCE_needinit #  no, init class now
1178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_NEW_INSTANCE_initialized:                   #  a0=class
1180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_accessFlags(a3, a0) #  a3 <- clazz->accessFlags
1181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, ALLOC_DONT_TRACK         #  flags for alloc call
1182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a0=class
1183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmAllocObject)                    #  v0 <- new object
1184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
1185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The JIT needs the class to be fully resolved before it can
1188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * include this instruction in a trace.
1189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu       a1, offThread_subMode(rSELF)
1191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle the exception
1192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a1, kSubModeJitTraceBuild    #  under construction?
1193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a1, .LOP_NEW_INSTANCE_jitCheck
1194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
1196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle the exception
1197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_NEW_INSTANCE_continue
1199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NEW_ARRAY: /* 0x23 */
1204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NEW_ARRAY.S */
1205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Allocate an array of objects, specified with the array class
1207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * and a count.
1208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The verifier guarantees that this is an array class, so we don't
1210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * check for it here.
1211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* new-array vA, vB, class@CCCC */
1213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
1214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 1)                           #  a2 <- CCCC
1215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
1216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a0)                       #  a1 <- vB (array length)
1217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a3, a3) #  a3 <- pDvmDex->pResClasses
1218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a2)                  #  a0 <- resolved class
1219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check length
1220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      a1, common_errNegativeArraySize #  negative length, bail - len in a1
1221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  req'd for resolve, alloc
1222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
1223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, .LOP_NEW_ARRAY_resolve
1224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Finish allocation.
1227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a0 holds class
1229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1 holds array length
1230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_NEW_ARRAY_finish:
1232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, ALLOC_DONT_TRACK         #  don't track in local refs table
1233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmAllocArrayByClass)              #  v0 <- call(clazz, length, flags)
1234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A+
1235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
1236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle the exception
1237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
1238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, a2)                       #  vA <- v0
1240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_FILLED_NEW_ARRAY: /* 0x24 */
1245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FILLED_NEW_ARRAY.S */
1246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Create a new array with elements filled from registers.
1248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: filled-new-array, filled-new-array/range
1250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
1252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op {vCCCC..v(CCCC+AA-1)}, type       /* BBBB */
1253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
1254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
1255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a3, a3) #  a3 <- pDvmDex->pResClasses
1256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  need for resolve and alloc
1257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved class
1258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA or BA
1259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
1260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_FILLED_NEW_ARRAY_continue     #  yes, continue on
1261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a3)                  #  a3 <- self->method
1262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, 0                        #  a2 <- false
1263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
1264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveClass)                   #  v0 <- call(clazz, ref)
1265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
1266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
1267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
1268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_FILLED_NEW_ARRAY_continue
1269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_FILLED_NEW_ARRAY_RANGE: /* 0x25 */
1273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FILLED_NEW_ARRAY_RANGE.S */
1274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FILLED_NEW_ARRAY.S */
1275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Create a new array with elements filled from registers.
1277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: filled-new-array, filled-new-array/range
1279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
1281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op {vCCCC..v(CCCC+AA-1)}, type       /* BBBB */
1282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
1283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
1284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResClasses(a3, a3) #  a3 <- pDvmDex->pResClasses
1285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  need for resolve and alloc
1286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved class
1287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA or BA
1288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
1289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_FILLED_NEW_ARRAY_RANGE_continue     #  yes, continue on
1290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a3)                  #  a3 <- self->method
1291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, 0                        #  a2 <- false
1292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
1293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveClass)                   #  v0 <- call(clazz, ref)
1294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
1295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
1296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
1297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_FILLED_NEW_ARRAY_RANGE_continue
1298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_FILL_ARRAY_DATA: /* 0x26 */
1303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FILL_ARRAY_DATA.S */
1304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* fill-array-data vAA, +BBBBBBBB */
1305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- bbbb (lo)
1306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB (hi)
1307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
1308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, a1, 16                   #  a1 <- BBBBbbbb
1309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a1, a0, a1                   #  a1 <- BBBBbbbb
1310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vAA (array object)
1311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS1(a1, rPC, a1)                      #  a1 <- PC + BBBBbbbb*2 (array data off.)
1312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
1313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmInterpHandleFillArrayData)      #  fill the array with predefined data
1314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # 0 means an exception is thrown
1315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  has exception
1316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
1317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_THROW: /* 0x27 */
1323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_THROW.S */
1324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Throw an exception object in the current thread.
1326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* throw vAA */
1328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a2)                            #  a2 <- AA
1329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a2)                       #  a1 <- vAA (exception object)
1330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  exception handler can throw
1331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null object?
1332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errNullObject     #  yes, throw an NPE instead
1333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # bypass dvmSetException, just store it
1334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE_offThread_exception(a1, rSELF)   #  thread->exception <- obj
1335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
1336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_GOTO: /* 0x28 */
1341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_GOTO.S */
1342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Unconditional branch, 8-bit offset.
1344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The branch distance is a signed code-unit offset, which we need to
1346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * double to get a byte offset.
1347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* goto +AA */
1349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a0, rINST, 16                #  a0 <- AAxx0000
1350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a0, 24                   #  a1 <- ssssssAA (sign-extended)
1351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  a2 <- byte offset
1352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* If backwards branch refresh rBASE */
1353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 1f
1354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF) #  refresh handler base
1355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      a1, common_testUpdateProfile #  (a0) check for trace hotness
1360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_GOTO_16: /* 0x29 */
1367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_GOTO_16.S */
1368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Unconditional branch, 16-bit offset.
1370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The branch distance is a signed code-unit offset, which we need to
1372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * double to get a byte offset.
1373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* goto/16 +AAAA */
1375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a0, 1)                         #  a0 <- ssssAAAA (sign-extended)
1376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a0, a0                   #  a1 <- byte offset, flags set
1377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
1378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 1f
1379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF) #  refresh handler base
1380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      a1, common_testUpdateProfile #  (a0) hot trace head?
1384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_GOTO_32: /* 0x2a */
1391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_GOTO_32.S */
1392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Unconditional branch, 32-bit offset.
1394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The branch distance is a signed code-unit offset, which we need to
1396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * double to get a byte offset.
1397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Unlike most opcodes, this one is allowed to branch to itself, so
1399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * our "backward branch" test must be "<=0" instead of "<0".
1400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* goto/32 +AAAAAAAA */
1402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- aaaa (lo)
1403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- AAAA (hi)
1404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, a1, 16
1405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a0, a0, a1                   #  a0 <- AAAAaaaa
1406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a0, a0                   #  a1 <- byte offset
1407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgtz      a1, 1f
1410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF) #  refresh handler base
1411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
1413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    blez      a1, common_testUpdateProfile # (a0) hot trace head?
1414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
1416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgtz      a0, 2f
1417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF) #  refresh handler base
1418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_PACKED_SWITCH: /* 0x2b */
1426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_PACKED_SWITCH.S */
1427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a packed-switch or sparse-switch instruction.  In both cases
1429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * we decode it and hand it off to a helper function.
1430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * We don't really expect backward branches in a switch statement, but
1432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * they're perfectly legal, so we check for them here.
1433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * When the JIT is present, all targets are considered treated as
1435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * a potential trace heads regardless of branch direction.
1436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: packed-switch, sparse-switch
1438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, +BBBB */
1440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- bbbb (lo)
1441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB (hi)
1442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
1443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       t0, a1, 16
1444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a0, a0, t0                   #  a0 <- BBBBbbbb
1445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vAA
1446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS1(a0, rPC, a0)                      #  a0 <- PC + BBBBbbbb*2
1447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmInterpHandlePackedSwitch)                             #  a0 <- code-unit branch offset
1448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, v0, v0                   #  a1 <- byte offset
1449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgtz      a1, 1f
1450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF) #  refresh handler base
1451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
1453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPARSE_SWITCH: /* 0x2c */
1463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPARSE_SWITCH.S */
1464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_PACKED_SWITCH.S */
1465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a packed-switch or sparse-switch instruction.  In both cases
1467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * we decode it and hand it off to a helper function.
1468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * We don't really expect backward branches in a switch statement, but
1470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * they're perfectly legal, so we check for them here.
1471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * When the JIT is present, all targets are considered treated as
1473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * a potential trace heads regardless of branch direction.
1474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: packed-switch, sparse-switch
1476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, +BBBB */
1478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- bbbb (lo)
1479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                           #  a1 <- BBBB (hi)
1480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a3)                            #  a3 <- AA
1481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       t0, a1, 16
1482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        a0, a0, t0                   #  a0 <- BBBBbbbb
1483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vAA
1484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS1(a0, rPC, a0)                      #  a0 <- PC + BBBBbbbb*2
1485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmInterpHandleSparseSwitch)                             #  a0 <- code-unit branch offset
1486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, v0, v0                   #  a1 <- byte offset
1487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgtz      a1, 1f
1488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF) #  refresh handler base
1489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
1491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CMPL_FLOAT: /* 0x2d */
1502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMPL_FLOAT.S */
1503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Compare two floating-point values.  Puts 0, 1, or -1 into the
1505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * destination register based on the results of the comparison.
1506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Provide a "naninst" instruction that puts 1 or -1 into a1 depending
1508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * on what value we'd like to return when one of the operands is NaN.
1509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The operation we're implementing is:
1511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   if (x == y)
1512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return 0;
1513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   else if (x < y)
1514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return -1;
1515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   else if (x > y)
1516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return 1;
1517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   else
1518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return {-1,1};  // one or both operands was NaN
1519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: cmpl-float, cmpg-float
1521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
1523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* "clasic" form */
1525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
1526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
1527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8
1528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
1529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a2)                     #  rOBJ <- vBB
1530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rBIX, a3)                     #  rBIX <- vCC
1531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rOBJ                     #  a0 <- vBB
1532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a1, rBIX                     #  a1 <- vCC
1533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__eqsf2)                           #  a0 <- (vBB == vCC)
1534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0                     # set rTEMP to 0
1535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, OP_CMPL_FLOAT_finish
1536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rOBJ                     #  a0 <- vBB
1537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a1, rBIX                     #  a1 <- vCC
1538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__ltsf2)                           #  a0 <- (vBB < vCC)
1539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      v0, OP_CMPL_FLOAT_finish
1541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rOBJ                     #  a0 <- vBB
1542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a1, rBIX                     #  a1 <- vCC
1543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPL_FLOAT_continue
1544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
15456e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    GET_VREG_F(ft0, a2)
15466e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    GET_VREG_F(ft1, a3)
15476e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.s   fcc0, ft0, ft1               # Is ft0 < ft1
1548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPL_FLOAT_finish
15506e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.s   fcc0, ft1, ft0
1551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 1
1552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPL_FLOAT_finish
15536e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.eq.s    fcc0, ft0, ft1
1554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0
1555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPL_FLOAT_finish
1556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPL_FLOAT_nan
1557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CMPG_FLOAT: /* 0x2e */
1564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMPG_FLOAT.S */
1565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMPL_FLOAT.S */
1566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Compare two floating-point values.  Puts 0, 1, or -1 into the
1568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * destination register based on the results of the comparison.
1569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Provide a "naninst" instruction that puts 1 or -1 into a1 depending
1571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * on what value we'd like to return when one of the operands is NaN.
1572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The operation we're implementing is:
1574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   if (x == y)
1575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return 0;
1576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   else if (x < y)
1577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return -1;
1578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   else if (x > y)
1579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return 1;
1580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   else
1581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *     return {-1,1};  // one or both operands was NaN
1582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: cmpl-float, cmpg-float
1584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
1586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* "clasic" form */
1588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
1589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
1590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8
1591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
1592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a2)                     #  rOBJ <- vBB
1593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rBIX, a3)                     #  rBIX <- vCC
1594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rOBJ                     #  a0 <- vBB
1595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a1, rBIX                     #  a1 <- vCC
1596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__eqsf2)                           #  a0 <- (vBB == vCC)
1597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0                     # set rTEMP to 0
1598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, OP_CMPG_FLOAT_finish
1599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rOBJ                     #  a0 <- vBB
1600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a1, rBIX                     #  a1 <- vCC
1601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__ltsf2)                           #  a0 <- (vBB < vCC)
1602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      v0, OP_CMPG_FLOAT_finish
1604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rOBJ                     #  a0 <- vBB
1605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a1, rBIX                     #  a1 <- vCC
1606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPG_FLOAT_continue
1607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
16086e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    GET_VREG_F(ft0, a2)
16096e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    GET_VREG_F(ft1, a3)
16106e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.s   fcc0, ft0, ft1               # Is ft0 < ft1
1611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPG_FLOAT_finish
16136e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.s   fcc0, ft1, ft0
1614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 1
1615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPG_FLOAT_finish
16166e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.eq.s    fcc0, ft0, ft1
1617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0
1618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPG_FLOAT_finish
1619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPG_FLOAT_nan
1620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CMPL_DOUBLE: /* 0x2f */
1628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMPL_DOUBLE.S */
1629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Compare two floating-point values.  Puts 0, 1, or -1 into the
1631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * destination register based on the results of the comparison.
1632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Provide a "naninst" instruction that puts 1 or -1 into a1 depending
1634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * on what value we'd like to return when one of the operands is NaN.
1635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * See OP_CMPL_FLOAT for an explanation.
1637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: cmpl-double, cmpg-double
1639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
1641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
1643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, a0, 255                #  s0 <- BB
1644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       rBIX, a0, 8                  #  t0 <- CC
1645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s0 <- &fp[BB]
1646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rFP, rBIX)                  #  t0 <- &fp[CC]
1647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
1648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vBB/vBB+1
1649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, rBIX)             #  a2/a3 <- vCC/vCC+1
1650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__eqdf2)                           #  cmp <=: C clear if <, Z set if eq
1651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0
1652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, OP_CMPL_DOUBLE_finish
1653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vBB/vBB+1
1655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, rBIX)             #  a2/a3 <- vCC/vCC+1
1656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__ltdf2)
1657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      v0, OP_CMPL_DOUBLE_finish
1659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vBB/vBB+1
1660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPL_DOUBLE_continue
1661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
16626e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    LOAD64_F(ft0, ft0f, rOBJ)
16636e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    LOAD64_F(ft1, ft1f, rBIX)
16646e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.d   fcc0, ft0, ft1
1665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPL_DOUBLE_finish
16676e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.d   fcc0, ft1, ft0
1668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 1
1669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPL_DOUBLE_finish
16706e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.eq.d    fcc0, ft0, ft1
1671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0
1672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPL_DOUBLE_finish
1673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPL_DOUBLE_nan
1674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CMPG_DOUBLE: /* 0x30 */
1679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMPG_DOUBLE.S */
1680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMPL_DOUBLE.S */
1681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Compare two floating-point values.  Puts 0, 1, or -1 into the
1683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * destination register based on the results of the comparison.
1684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Provide a "naninst" instruction that puts 1 or -1 into a1 depending
1686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * on what value we'd like to return when one of the operands is NaN.
1687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * See OP_CMPL_FLOAT for an explanation.
1689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: cmpl-double, cmpg-double
1691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
1693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
1695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, a0, 255                #  s0 <- BB
1696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       rBIX, a0, 8                  #  t0 <- CC
1697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s0 <- &fp[BB]
1698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rFP, rBIX)                  #  t0 <- &fp[CC]
1699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
1700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vBB/vBB+1
1701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, rBIX)             #  a2/a3 <- vCC/vCC+1
1702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__eqdf2)                           #  cmp <=: C clear if <, Z set if eq
1703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0
1704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, OP_CMPG_DOUBLE_finish
1705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vBB/vBB+1
1707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, rBIX)             #  a2/a3 <- vCC/vCC+1
1708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__ltdf2)
1709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bltz      v0, OP_CMPG_DOUBLE_finish
1711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vBB/vBB+1
1712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPG_DOUBLE_continue
1713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
17146e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    LOAD64_F(ft0, ft0f, rOBJ)
17156e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    LOAD64_F(ft1, ft1f, rBIX)
17166e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.d   fcc0, ft0, ft1
1717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, -1
1718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPG_DOUBLE_finish
17196e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.olt.d   fcc0, ft1, ft0
1720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 1
1721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPG_DOUBLE_finish
17226e3967d1cca2f8baee1fa6e90f511553dd8651e5Douglas Leung    c.eq.d    fcc0, ft0, ft1
1723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        rTEMP, 0
1724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, OP_CMPG_DOUBLE_finish
1725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         OP_CMPG_DOUBLE_nan
1726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_CMP_LONG: /* 0x31 */
1732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_CMP_LONG.S */
1733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Compare two 64-bit values
1735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *    x = y     return  0
1736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *    x < y     return -1
1737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *    x > y     return  1
1738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * I think I can improve on the ARM code by the following observation
1740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *    slt   t0,  x.hi, y.hi;	# (x.hi < y.hi) ? 1:0
1741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *    sgt   t1,  x.hi, y.hi;	# (y.hi > x.hi) ? 1:0
1742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *    subu  v0, t0, t1              # v0= -1:1:0 for [ < > = ]
1743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* cmp-long vAA, vBB, vCC */
1745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
1746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
1747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
1748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
1749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
1750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[CC]
1751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)                     #  a0/a1 <- vBB/vBB+1
1752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a3)                     #  a2/a3 <- vCC/vCC+1
1753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
1755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    slt       t0, a1, a3                   #  compare hi
1756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sgt       t1, a1, a3
1757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu      v0, t1, t0                   #  v0 <- (-1, 1, 0)
1758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_CMP_LONG_finish
1759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # at this point x.hi==y.hi
1760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sltu      t0, a0, a2                   #  compare lo
1761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sgtu      t1, a0, a2
1762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu      v0, t1, t0                   #  v0 <- (-1, 1, 0) for [< > =]
1763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_CMP_LONG_finish:
1765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- v0
1766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_EQ: /* 0x32 */
1773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_EQ.S */
1774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/bincmp.S */
1775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic two-operand compare-and-branch operation.  Provide a "revcmp"
1777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
1778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
1779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
1781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vA, vB, +CCCC */
1783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A+
1784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a1)                       #  a3 <- vB
1786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vA
1787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bne a2, a3, 1f                  #  branch to 1 if comparison failed
1788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1<- branch offset, in code units
1789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
1790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
1792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  convert to bytes
1794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 3f
1798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
1800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 4f
1803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
1805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_NE: /* 0x33 */
1813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_NE.S */
1814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/bincmp.S */
1815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic two-operand compare-and-branch operation.  Provide a "revcmp"
1817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
1818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
1819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
1821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vA, vB, +CCCC */
1823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A+
1824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a1)                       #  a3 <- vB
1826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vA
1827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beq a2, a3, 1f                  #  branch to 1 if comparison failed
1828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1<- branch offset, in code units
1829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
1830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
1832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  convert to bytes
1834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 3f
1838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
1840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 4f
1843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
1845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_LT: /* 0x34 */
1853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_LT.S */
1854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/bincmp.S */
1855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic two-operand compare-and-branch operation.  Provide a "revcmp"
1857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
1858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
1859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
1861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vA, vB, +CCCC */
1863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A+
1864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a1)                       #  a3 <- vB
1866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vA
1867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bge a2, a3, 1f                  #  branch to 1 if comparison failed
1868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1<- branch offset, in code units
1869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
1870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
1872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  convert to bytes
1874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 3f
1878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
1880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 4f
1883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
1885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_GE: /* 0x35 */
1893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_GE.S */
1894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/bincmp.S */
1895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic two-operand compare-and-branch operation.  Provide a "revcmp"
1897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
1898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
1899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
1901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vA, vB, +CCCC */
1903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A+
1904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a1)                       #  a3 <- vB
1906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vA
1907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    blt a2, a3, 1f                  #  branch to 1 if comparison failed
1908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1<- branch offset, in code units
1909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
1910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
1912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  convert to bytes
1914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 3f
1918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
1920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 4f
1923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
1925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_GT: /* 0x36 */
1933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_GT.S */
1934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/bincmp.S */
1935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic two-operand compare-and-branch operation.  Provide a "revcmp"
1937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
1938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
1939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
1941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vA, vB, +CCCC */
1943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A+
1944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a1)                       #  a3 <- vB
1946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vA
1947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    ble a2, a3, 1f                  #  branch to 1 if comparison failed
1948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1<- branch offset, in code units
1949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
1950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
1952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  convert to bytes
1954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 3f
1958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
1960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
1961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
1962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 4f
1963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
1965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
1966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
1967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
1968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
1970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
1971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
1972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_LE: /* 0x37 */
1973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_LE.S */
1974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/bincmp.S */
1975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
1976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic two-operand compare-and-branch operation.  Provide a "revcmp"
1977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
1978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
1979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
1980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: if-eq, if-ne, if-lt, if-ge, if-gt, if-le
1981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
1982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vA, vB, +CCCC */
1983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A+
1984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
1985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a1)                       #  a3 <- vB
1986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vA
1987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgt a2, a3, 1f                  #  branch to 1 if comparison failed
1988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1<- branch offset, in code units
1989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
1990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
1991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
1992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
1993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a1, a1                   #  convert to bytes
1994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a2)              #  update rPC, load rINST
1995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
1996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
1997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 3f
1998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
1999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile
2001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a2, 4f
2003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rIBASE
2004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_EQZ: /* 0x38 */
2013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_EQZ.S */
2014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/zcmp.S */
2015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic one-operand compare-and-branch operation.  Provide a "revcmp"
2017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
2018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
2019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
2021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vAA, +BBBB */
2023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
2024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vAA
2025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- branch offset, in code units
2026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bne a2, zero, 1f                #  branch to 1 if comparison failed
2027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
2028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
2029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
2030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
2031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, a1                   #  convert to bytes
2032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
2033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
2034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
2035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 3f
2036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh table base
2037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     #  test for JIT off at target
2039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 4f
2041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rtable base
2042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_NEZ: /* 0x39 */
2051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_NEZ.S */
2052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/zcmp.S */
2053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic one-operand compare-and-branch operation.  Provide a "revcmp"
2055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
2056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
2057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
2059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vAA, +BBBB */
2061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
2062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vAA
2063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- branch offset, in code units
2064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beq a2, zero, 1f                #  branch to 1 if comparison failed
2065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
2066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
2067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
2068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
2069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, a1                   #  convert to bytes
2070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
2071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
2072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
2073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 3f
2074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh table base
2075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     #  test for JIT off at target
2077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 4f
2079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rtable base
2080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_LTZ: /* 0x3a */
2089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_LTZ.S */
2090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/zcmp.S */
2091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic one-operand compare-and-branch operation.  Provide a "revcmp"
2093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
2094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
2095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
2097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vAA, +BBBB */
2099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
2100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vAA
2101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- branch offset, in code units
2102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bge a2, zero, 1f                #  branch to 1 if comparison failed
2103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
2104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
2105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
2106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
2107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, a1                   #  convert to bytes
2108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
2109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
2110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
2111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 3f
2112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh table base
2113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     #  test for JIT off at target
2115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 4f
2117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rtable base
2118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_GEZ: /* 0x3b */
2127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_GEZ.S */
2128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/zcmp.S */
2129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic one-operand compare-and-branch operation.  Provide a "revcmp"
2131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
2132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
2133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
2135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vAA, +BBBB */
2137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
2138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vAA
2139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- branch offset, in code units
2140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    blt a2, zero, 1f                #  branch to 1 if comparison failed
2141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
2142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
2143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
2144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
2145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, a1                   #  convert to bytes
2146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
2147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
2148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
2149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 3f
2150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh table base
2151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     #  test for JIT off at target
2153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 4f
2155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rtable base
2156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_GTZ: /* 0x3c */
2165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_GTZ.S */
2166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/zcmp.S */
2167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic one-operand compare-and-branch operation.  Provide a "revcmp"
2169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
2170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
2171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
2173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vAA, +BBBB */
2175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
2176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vAA
2177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- branch offset, in code units
2178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    ble a2, zero, 1f                #  branch to 1 if comparison failed
2179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
2180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
2181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
2182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
2183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, a1                   #  convert to bytes
2184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
2185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
2186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
2187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 3f
2188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh table base
2189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     #  test for JIT off at target
2191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 4f
2193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rtable base
2194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IF_LEZ: /* 0x3d */
2203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IF_LEZ.S */
2204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/zcmp.S */
2205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic one-operand compare-and-branch operation.  Provide a "revcmp"
2207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * fragment that specifies the *reverse* comparison to perform, e.g.
2208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for "if-le" you would use "gt".
2209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
2211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* if-cmp vAA, +BBBB */
2213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
2214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vAA
2215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- branch offset, in code units
2216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgt a2, zero, 1f                #  branch to 1 if comparison failed
2217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b 2f
2218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
2219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a1, 2                        #  a1- BYTE branch dist for not-taken
2220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham2:
2221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, a1                   #  convert to bytes
2222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST_RB(a1)              #  update rPC, load rINST
2223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
2224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, offThread_pJitProfTable(rSELF)
2225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 3f
2226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh table base
2227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham3:
2228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_updateProfile     #  test for JIT off at target
2229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
2230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgez      a1, 4f
2231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        rIBASE, offThread_curHandlerTable(rSELF)  # refresh rtable base
2232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham4:
2233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
2234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_3E: /* 0x3e */
2241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_3E.S */
2242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
2243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
2244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_3F: /* 0x3f */
2250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_3F.S */
2251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
2252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
2253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_40: /* 0x40 */
2259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_40.S */
2260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
2261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
2262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_41: /* 0x41 */
2268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_41.S */
2269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
2270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
2271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_42: /* 0x42 */
2277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_42.S */
2278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
2279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
2280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_43: /* 0x43 */
2286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_43.S */
2287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
2288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
2289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET: /* 0x44 */
2295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET.S */
2296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 32 bits or less.  vAA <- vBB[vCC].
2298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Note: using the usual FETCH/and/shift stuff, this fits in exactly 17
2300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instructions.  We use a pair of FETCH_Bs instead.
2301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
2303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 2
2314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 2)               #  a0 <- arrayObj + index*width
2315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a1 >= a3; compare unsigned index
2319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw a2, offArrayObject_contents(a0)  #  a2 <- vBB[vCC]
2322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, rOBJ, t0)            #  vAA <- a2
2324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET_WIDE: /* 0x45 */
2329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET_WIDE.S */
2330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 64 bits.  vAA <- vBB[vCC].
2332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Arrays of long/double are 64-bit aligned.
2334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* aget-wide vAA, vBB, vCC */
2336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
2337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
2339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
2340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS3(a0, a0, a1)                       #  a0 <- arrayObj + index*width
2346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_AGET_WIDE_finish:
2349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_off(a2, a3, a0, offArrayObject_contents)
2351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
2352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a2, a3, rOBJ)                  #  vAA/vAA+1 <- a2/a3
2354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET_OBJECT: /* 0x46 */
2360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET_OBJECT.S */
2361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET.S */
2362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 32 bits or less.  vAA <- vBB[vCC].
2364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Note: using the usual FETCH/and/shift stuff, this fits in exactly 17
2366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instructions.  We use a pair of FETCH_Bs instead.
2367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
2369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 2
2380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 2)               #  a0 <- arrayObj + index*width
2381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a1 >= a3; compare unsigned index
2385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw a2, offArrayObject_contents(a0)  #  a2 <- vBB[vCC]
2388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, rOBJ, t0)            #  vAA <- a2
2390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET_BOOLEAN: /* 0x47 */
2396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET_BOOLEAN.S */
2397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET.S */
2398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 32 bits or less.  vAA <- vBB[vCC].
2400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Note: using the usual FETCH/and/shift stuff, this fits in exactly 17
2402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instructions.  We use a pair of FETCH_Bs instead.
2403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
2405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
2416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 0)               #  a0 <- arrayObj + index*width
2417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a1 >= a3; compare unsigned index
2421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu a2, offArrayObject_contents(a0)  #  a2 <- vBB[vCC]
2424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, rOBJ, t0)            #  vAA <- a2
2426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET_BYTE: /* 0x48 */
2432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET_BYTE.S */
2433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET.S */
2434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 32 bits or less.  vAA <- vBB[vCC].
2436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Note: using the usual FETCH/and/shift stuff, this fits in exactly 17
2438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instructions.  We use a pair of FETCH_Bs instead.
2439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
2441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
2452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 0)               #  a0 <- arrayObj + index*width
2453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a1 >= a3; compare unsigned index
2457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lb a2, offArrayObject_contents(a0)  #  a2 <- vBB[vCC]
2460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, rOBJ, t0)            #  vAA <- a2
2462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET_CHAR: /* 0x49 */
2468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET_CHAR.S */
2469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET.S */
2470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 32 bits or less.  vAA <- vBB[vCC].
2472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Note: using the usual FETCH/and/shift stuff, this fits in exactly 17
2474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instructions.  We use a pair of FETCH_Bs instead.
2475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
2477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
2488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 1)               #  a0 <- arrayObj + index*width
2489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a1 >= a3; compare unsigned index
2493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu a2, offArrayObject_contents(a0)  #  a2 <- vBB[vCC]
2496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, rOBJ, t0)            #  vAA <- a2
2498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AGET_SHORT: /* 0x4a */
2504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET_SHORT.S */
2505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AGET.S */
2506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array get, 32 bits or less.  vAA <- vBB[vCC].
2508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Note: using the usual FETCH/and/shift stuff, this fits in exactly 17
2510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * instructions.  We use a pair of FETCH_Bs instead.
2511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
2513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
2524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 1)               #  a0 <- arrayObj + index*width
2525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # a1 >= a3; compare unsigned index
2529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lh a2, offArrayObject_contents(a0)  #  a2 <- vBB[vCC]
2532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, rOBJ, t0)            #  vAA <- a2
2534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT: /* 0x4b */
2540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT.S */
2541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array put, 32 bits or less.  vBB[vCC] <- vAA.
2543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aput, aput-boolean, aput-byte, aput-char, aput-short
2544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 2
2555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 2)               #  a0 <- arrayObj + index*width
2556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, rOBJ)                     #  a2 <- vAA
2562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw a2, offArrayObject_contents(a0) #  vBB[vCC] <- a2
2564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT_WIDE: /* 0x4c */
2570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT_WIDE.S */
2571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array put, 64 bits.  vBB[vCC] <- vAA.
2573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Arrays of long/double are 64-bit aligned, so it's okay to use STRD.
2575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* aput-wide vAA, vBB, vCC */
2577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
2578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t0)                            #  t0 <- AA
2579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
2580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
2581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS3(a0, a0, a1)                       #  a0 <- arrayObj + index*width
2587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t0)                    #  rOBJ <- &fp[AA]
2588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # compare unsigned index, length
2589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, rOBJ)                   #  a2/a3 <- vAA/vAA+1
2593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_off(a2, a3, a0, offArrayObject_contents) #  a2/a3 <- vBB[vCC]
2595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT_OBJECT: /* 0x4d */
2601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT_OBJECT.S */
2602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Store an object into an array.  vBB[vCC] <- vAA.
2604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
2608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t1)                            #  t1 <- AA
2609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
2610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
2611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rINST, a2)                    #  rINST <- vBB (array object)
2612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rBIX, t1)                     #  rBIX <- vAA
2614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rINST, common_errNullObject  #  yes, bail
2616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, rINST) #  a3 <- arrayObj->length
2618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rINST, a1)                  #  rOBJ <- arrayObj + index*width
2619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # compare unsigned index, length
2620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * On entry:
2623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rINST = vBB (arrayObj)
2624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX = vAA (obj)
2625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rOBJ = offset into array (vBB + vCC * width)
2626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      rBIX, .LOP_APUT_OBJECT_checks     #  yes, skip type checks
2628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_APUT_OBJECT_finish:
2629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        rBIX, offArrayObject_contents(rOBJ) #  vBB[vCC] <- vAA
2632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT_BOOLEAN: /* 0x4e */
2638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT_BOOLEAN.S */
2639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT.S */
2640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array put, 32 bits or less.  vBB[vCC] <- vAA.
2642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aput, aput-boolean, aput-byte, aput-char, aput-short
2643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
2654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 0)               #  a0 <- arrayObj + index*width
2655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, rOBJ)                     #  a2 <- vAA
2661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sb a2, offArrayObject_contents(a0) #  vBB[vCC] <- a2
2663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT_BYTE: /* 0x4f */
2670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT_BYTE.S */
2671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT.S */
2672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array put, 32 bits or less.  vBB[vCC] <- vAA.
2674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aput, aput-boolean, aput-byte, aput-char, aput-short
2675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
2686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 0)               #  a0 <- arrayObj + index*width
2687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, rOBJ)                     #  a2 <- vAA
2693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sb a2, offArrayObject_contents(a0) #  vBB[vCC] <- a2
2695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT_CHAR: /* 0x50 */
2702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT_CHAR.S */
2703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT.S */
2704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array put, 32 bits or less.  vBB[vCC] <- vAA.
2706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aput, aput-boolean, aput-byte, aput-char, aput-short
2707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
2718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 1)               #  a0 <- arrayObj + index*width
2719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, rOBJ)                     #  a2 <- vAA
2725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sh a2, offArrayObject_contents(a0) #  vBB[vCC] <- a2
2727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_APUT_SHORT: /* 0x51 */
2734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT_SHORT.S */
2735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_APUT.S */
2736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Array put, 32 bits or less.  vBB[vCC] <- vAA.
2738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: aput, aput-boolean, aput-byte, aput-char, aput-short
2739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, vBB, vCC */
2741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_B(a2, 1)                         #  a2 <- BB
2742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
2743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_C(a3, 1)                         #  a3 <- CC
2744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB (array object)
2745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC (requested index)
2746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null array object?
2747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, common_errNullObject     #  yes, bail
2748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offArrayObject_length(a3, a0) #  a3 <- arrayObj->length
2749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
2750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EASN(a0, a0, a1, 1)               #  a0 <- arrayObj + index*width
2751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
2752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a0, a0, a1
2753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
2754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bgeu      a1, a3, common_errArrayIndex #  index >= length, bail
2755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
2756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, rOBJ)                     #  a2 <- vAA
2757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
2758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sh a2, offArrayObject_contents(a0) #  vBB[vCC] <- a2
2759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
2760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET: /* 0x52 */
2766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
2767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
2769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
2771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_finish       #  no, already resolved
2781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
2786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_finish
2788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_WIDE: /* 0x53 */
2793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_WIDE.S */
2794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Wide 32-bit instance field get.
2796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # iget-wide vA, vB, field              /* CCCC */
2798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pResFields
2802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_WIDE_finish       #  no, already resolved
2806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test return code
2811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_WIDE_finish
2813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_OBJECT: /* 0x54 */
2818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_OBJECT.S */
2819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
2820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
2822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
2824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_OBJECT_finish       #  no, already resolved
2834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
2839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_OBJECT_finish
2841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_BOOLEAN: /* 0x55 */
2847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_BOOLEAN.S */
2848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
2849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
2851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
2853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_BOOLEAN_finish       #  no, already resolved
2863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
2868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_BOOLEAN_finish
2870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_BYTE: /* 0x56 */
2876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_BYTE.S */
2877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
2878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
2880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
2882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_BYTE_finish       #  no, already resolved
2892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
2897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_BYTE_finish
2899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_CHAR: /* 0x57 */
2905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_CHAR.S */
2906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
2907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
2909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
2911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_CHAR_finish       #  no, already resolved
2921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
2926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_CHAR_finish
2928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_SHORT: /* 0x58 */
2934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_SHORT.S */
2935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
2936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
2938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
2940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_SHORT_finish       #  no, already resolved
2950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
2955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_SHORT_finish
2957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT: /* 0x59 */
2963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT.S */
2964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
2965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field put.
2966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
2967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short
2968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
2969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
2970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
2974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_finish       #  no, already resolved
2978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
2979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
2980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
2981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
2982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
2983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
2984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_finish       #  yes, finish up
2985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
2986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
2987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
2988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
2989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_WIDE: /* 0x5a */
2990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_WIDE.S */
2991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # iput-wide vA, vB, field              /* CCCC */
2992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
2993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
2994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
2995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pResFields
2996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
2997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
2998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
2999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_WIDE_finish       #  no, already resolved
3000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
3002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
3004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_WIDE_finish       #  yes, finish up
3007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
3008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_OBJECT: /* 0x5b */
3012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_OBJECT.S */
3013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 32-bit instance field put.
3015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput-object, iput-object-volatile
3017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
3019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
3020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
3021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
3022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
3023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
3024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
3025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_OBJECT_finish       #  no, already resolved
3027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
3029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
3031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_OBJECT_finish       #  yes, finish up
3034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
3035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_BOOLEAN: /* 0x5c */
3039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_BOOLEAN.S */
3040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT.S */
3041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field put.
3043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short
3045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
3047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
3048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
3049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
3050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
3051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
3052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
3053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_BOOLEAN_finish       #  no, already resolved
3055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
3057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
3059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_BOOLEAN_finish       #  yes, finish up
3062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
3063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_BYTE: /* 0x5d */
3068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_BYTE.S */
3069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT.S */
3070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field put.
3072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short
3074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
3076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
3077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
3078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
3079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
3080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
3081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
3082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_BYTE_finish       #  no, already resolved
3084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
3086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
3088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_BYTE_finish       #  yes, finish up
3091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
3092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_CHAR: /* 0x5e */
3097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_CHAR.S */
3098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT.S */
3099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field put.
3101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short
3103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
3105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
3106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
3107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
3108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
3109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
3110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
3111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_CHAR_finish       #  no, already resolved
3113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
3115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
3117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_CHAR_finish       #  yes, finish up
3120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
3121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_SHORT: /* 0x5f */
3126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_SHORT.S */
3127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT.S */
3128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field put.
3130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short
3132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
3134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
3135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
3136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
3137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
3138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
3139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
3140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_SHORT_finish       #  no, already resolved
3142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
3144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
3146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_SHORT_finish       #  yes, finish up
3149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
3150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET: /* 0x60 */
3155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
3156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
3158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
3160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
3167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_finish
3168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_finish            # resume
3192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_WIDE: /* 0x61 */
3196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_WIDE.S */
3197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 64-bit SGET handler.
3199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # sget-wide vAA, field                 /* BBBB */
3201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_WIDE_finish
3207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Returns StaticField pointer in v0.
3214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_WIDE_finish            # resume
3234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_OBJECT: /* 0x62 */
3238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_OBJECT.S */
3239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
3240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
3242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
3244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
3251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_OBJECT_finish
3252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_OBJECT_finish            # resume
3276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_BOOLEAN: /* 0x63 */
3281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_BOOLEAN.S */
3282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
3283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
3285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
3287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
3294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_BOOLEAN_finish
3295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_BOOLEAN_finish            # resume
3319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_BYTE: /* 0x64 */
3324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_BYTE.S */
3325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
3326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
3328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
3330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
3337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_BYTE_finish
3338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_BYTE_finish            # resume
3362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_CHAR: /* 0x65 */
3367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_CHAR.S */
3368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
3369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
3371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
3373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
3380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_CHAR_finish
3381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_CHAR_finish            # resume
3405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_SHORT: /* 0x66 */
3410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_SHORT.S */
3411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
3412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
3414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
3416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
3423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_SHORT_finish
3424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
3435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
3439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
3440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_SHORT_finish            # resume
3448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT: /* 0x67 */
3453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT.S */
3454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
3456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput, sput-object, sput-boolean, sput-byte, sput-char, sput-short
3458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_finish       #  is resolved entry null?
3465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
3475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
3479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SPUT_finish            # resume
3487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_WIDE: /* 0x68 */
3491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_WIDE.S */
3492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 64-bit SPUT handler.
3494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # sput-wide vAA, field                 /* BBBB */
3496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t0)                            #  t0 <- AA
3500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a2, rBIX, a1)                #  a2 <- resolved StaticField ptr
3501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t0)                    #  rOBJ<- &fp[AA]
3502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
3503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a2, .LOP_SPUT_WIDE_resolve      #  yes, do resolve
3504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_SPUT_WIDE_finish:                        #  field ptr in a2, AA in rOBJ
3505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
3506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)                   #  a0/a1 <- vAA/vAA+1
3507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(rBIX)                  #  extract opcode from rINST
3508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
3509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu    a2, offStaticField_value       #  a2<- pointer to data
3510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmQuasiAtomicSwap64Sync)          #  stores a0/a1 into addr a2
3511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
3512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_off(a0, a1, a2, offStaticField_value) #  field <- vAA/vAA+1
3513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(rBIX)                      #  jump to next instruction
3515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_OBJECT: /* 0x69 */
3519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_OBJECT.S */
3520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
3522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput-object, sput-object-volatile
3524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, field@BBBB */
3526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_OBJECT_finish       #  is resolved entry null?
3531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* Continuation if the field has not yet been resolved.
3533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * a1:  BBBB field ref
3534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * rBIX: dvmDex->pResFields
3535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
3541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
3545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b       .LOP_SPUT_OBJECT_finish             # resume
3553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_BOOLEAN: /* 0x6a */
3558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_BOOLEAN.S */
3559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT.S */
3560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
3562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput, sput-object, sput-boolean, sput-byte, sput-char, sput-short
3564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_BOOLEAN_finish       #  is resolved entry null?
3571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
3581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
3585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SPUT_BOOLEAN_finish            # resume
3593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_BYTE: /* 0x6b */
3598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_BYTE.S */
3599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT.S */
3600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
3602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput, sput-object, sput-boolean, sput-byte, sput-char, sput-short
3604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_BYTE_finish       #  is resolved entry null?
3611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
3621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
3625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SPUT_BYTE_finish            # resume
3633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_CHAR: /* 0x6c */
3638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_CHAR.S */
3639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT.S */
3640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
3642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput, sput-object, sput-boolean, sput-byte, sput-char, sput-short
3644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_CHAR_finish       #  is resolved entry null?
3651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
3661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
3665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SPUT_CHAR_finish            # resume
3673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_SHORT: /* 0x6d */
3678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_SHORT.S */
3679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT.S */
3680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
3682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput, sput-object, sput-boolean, sput-byte, sput-char, sput-short
3684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
3686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
3687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
3688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
3689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
3690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_SHORT_finish       #  is resolved entry null?
3691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
3693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
3694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
3695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
3697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
3699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
3701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
3702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
3703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
3705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
3708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
3709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
3711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SPUT_SHORT_finish            # resume
3713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_VIRTUAL: /* 0x6e */
3718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_VIRTUAL.S */
3719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a virtual method call.
3721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-virtual, invoke-virtual/range
3723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
3726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(rBIX, 2)                         #  rBIX <- GFED or CCCC
3730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved baseMethod
3731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!0)
3732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rBIX, rBIX, 15               #  rBIX <- D (or stays CCCC)
3733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
3736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_INVOKE_VIRTUAL_continue     #  yes, continue on
3737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a3)                  #  a3 <- self->method
3739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
3740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, METHOD_VIRTUAL           #  resolver method type
3741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
3742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
3744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_INVOKE_VIRTUAL_continue     #  no, continue
3745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown       #  yes, handle exception
3746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_SUPER: /* 0x6f */
3750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_SUPER.S */
3751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a "super" method call.
3753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-super, invoke-super/range
3755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
3758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(t0, 2)                           #  t0 <- GFED or CCCC
3759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!0)
3761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       t0, t0, 15                   #  t0 <- D (or stays CCCC)
3762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, t0)                     #  rOBJ <- "this" ptr
3766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved baseMethod
3767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null "this"?
3768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(t1)                  #  t1 <- current method
3769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  null "this", throw exception
3770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a0, 0; already resolved?
3771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(rBIX, t1)    #  rBIX <- method->clazz
3772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_INVOKE_SUPER_continue     #  resolved, continue on
3774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rBIX                     #  a0 <- method->clazz
3776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, METHOD_VIRTUAL           #  resolver method type
3777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
3778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
3780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
3781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_INVOKE_SUPER_continue
3782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_DIRECT: /* 0x70 */
3786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_DIRECT.S */
3787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a direct method call.
3789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * (We could defer the "is 'this' pointer null" test to the common
3791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * method invocation code, and use a flag to indicate that static
3792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * calls don't count.  If we do this as part of copying the arguments
3793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * out we could avoiding loading the first arg twice.)
3794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-direct, invoke-direct/range
3796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op {vCCCC..v(CCCC+AA-1)}, meth       /* BBBB */
3799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(rBIX, 2)                         #  rBIX <- GFED or CCCC
3803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved methodToCall
3804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!0)
3805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rBIX, rBIX, 15               #  rBIX <- D (or stays CCCC)
3806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, rBIX)                   #  rOBJ <- "this" ptr
3809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
3810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, 1f                       #  resolved, call the function
3811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a3, offThread_method(rSELF)  #  a3 <- self->method
3813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
3814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, METHOD_DIRECT            #  resolver method type
3815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
3816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
3818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
3819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
3821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      rOBJ, common_invokeMethodNoRange #  a0=method, rOBJ="this"
3822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_errNullObject         #  yes, throw exception
3823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_STATIC: /* 0x71 */
3830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_STATIC.S */
3831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a static method call.
3833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-static, invoke-static/range
3835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op {vCCCC..v(CCCC+AA-1)}, meth       /* BBBB */
3838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li      rOBJ, 0                        #  null "this" in delay slot
3842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved methodToCall
3843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
3844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, a3, a1)                     #  rBIX<- &resolved_metherToCall
3845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
3846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
3848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_invokeMethodNoRange #  yes, continue on
3849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_INVOKE_STATIC_resolve
3850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_INTERFACE: /* 0x72 */
3854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_INTERFACE.S */
3855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle an interface method call.
3857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-interface, invoke-interface/range
3859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vB, {vD, vE, vF, vG, vA}, class@CCCC */
3861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op {vCCCC..v(CCCC+AA-1)}, meth@BBBB */
3862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 2)                           #  a2 <- FEDC or CCCC
3863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!0)
3865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, 15                       #  a2 <- C (or stays CCCC)
3866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a2)                     #  rOBJ <- first arg ("this")
3869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- methodClassDex
3870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- method
3871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null obj?
3872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  yes, fail
3873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a0, rOBJ)      #  a0 <- thisPtr->clazz
3874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmFindInterfaceMethodInCache)     #  v0 <- call(class, ref, method, dex)
3875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
3877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
3878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_invokeMethodNoRange #  (a0=method, rOBJ="this")
3879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_73: /* 0x73 */
3883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_73.S */
3884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
3885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
3886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_VIRTUAL_RANGE: /* 0x74 */
3892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_VIRTUAL_RANGE.S */
3893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_VIRTUAL.S */
3894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a virtual method call.
3896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-virtual, invoke-virtual/range
3898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
3901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(rBIX, 2)                         #  rBIX <- GFED or CCCC
3905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved baseMethod
3906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!1)
3907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rBIX, rBIX, 15               #  rBIX <- D (or stays CCCC)
3908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
3911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_INVOKE_VIRTUAL_RANGE_continue     #  yes, continue on
3912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a3)                  #  a3 <- self->method
3914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
3915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, METHOD_VIRTUAL           #  resolver method type
3916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
3917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
3919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_INVOKE_VIRTUAL_RANGE_continue     #  no, continue
3920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown       #  yes, handle exception
3921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_SUPER_RANGE: /* 0x75 */
3926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_SUPER_RANGE.S */
3927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_SUPER.S */
3928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a "super" method call.
3930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-super, invoke-super/range
3932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
3935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(t0, 2)                           #  t0 <- GFED or CCCC
3936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!1)
3938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       t0, t0, 15                   #  t0 <- D (or stays CCCC)
3939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, t0)                     #  rOBJ <- "this" ptr
3943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved baseMethod
3944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null "this"?
3945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(t1)                  #  t1 <- current method
3946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  null "this", throw exception
3947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a0, 0; already resolved?
3948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(rBIX, t1)    #  rBIX <- method->clazz
3949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_INVOKE_SUPER_RANGE_continue     #  resolved, continue on
3951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, rBIX                     #  a0 <- method->clazz
3953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, METHOD_VIRTUAL           #  resolver method type
3954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
3955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
3957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
3958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_INVOKE_SUPER_RANGE_continue
3959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
3962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
3963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_DIRECT_RANGE: /* 0x76 */
3964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_DIRECT_RANGE.S */
3965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_DIRECT.S */
3966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
3967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a direct method call.
3968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * (We could defer the "is 'this' pointer null" test to the common
3970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * method invocation code, and use a flag to indicate that static
3971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * calls don't count.  If we do this as part of copying the arguments
3972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * out we could avoiding loading the first arg twice.)
3973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
3974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-direct, invoke-direct/range
3975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
3976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
3977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op {vCCCC..v(CCCC+AA-1)}, meth       /* BBBB */
3978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
3979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
3980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
3981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(rBIX, 2)                         #  rBIX <- GFED or CCCC
3982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved methodToCall
3983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!1)
3984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rBIX, rBIX, 15               #  rBIX <- D (or stays CCCC)
3985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
3986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
3987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, rBIX)                   #  rOBJ <- "this" ptr
3988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
3989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, 1f                       #  resolved, call the function
3990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a3, offThread_method(rSELF)  #  a3 <- self->method
3992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
3993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, METHOD_DIRECT            #  resolver method type
3994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
3995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
3996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
3997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
3998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
3999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
4000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      rOBJ, common_invokeMethodRange #  a0=method, rOBJ="this"
4001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_errNullObject         #  yes, throw exception
4002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_STATIC_RANGE: /* 0x77 */
4010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_STATIC_RANGE.S */
4011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_STATIC.S */
4012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a static method call.
4014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-static, invoke-static/range
4016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
4018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op {vCCCC..v(CCCC+AA-1)}, meth       /* BBBB */
4019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- pDvmDex
4020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
4021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResMethods(a3, a3) #  a3 <- pDvmDex->pResMethods
4022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li      rOBJ, 0                        #  null "this" in delay slot
4023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a3, a1)                  #  a0 <- resolved methodToCall
4024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
4025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, a3, a1)                     #  rBIX<- &resolved_metherToCall
4026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
4028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # already resolved?
4029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, common_invokeMethodRange #  yes, continue on
4030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_INVOKE_STATIC_RANGE_resolve
4031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_INTERFACE_RANGE: /* 0x78 */
4036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_INTERFACE_RANGE.S */
4037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_INTERFACE.S */
4038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle an interface method call.
4040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: invoke-interface, invoke-interface/range
4042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vB, {vD, vE, vF, vG, vA}, class@CCCC */
4044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op {vCCCC..v(CCCC+AA-1)}, meth@BBBB */
4045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 2)                           #  a2 <- FEDC or CCCC
4046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
4047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!1)
4048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, 15                       #  a2 <- C (or stays CCCC)
4049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
4051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a2)                     #  rOBJ <- first arg ("this")
4052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- methodClassDex
4053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- method
4054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # null obj?
4055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  yes, fail
4056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a0, rOBJ)      #  a0 <- thisPtr->clazz
4057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmFindInterfaceMethodInCache)     #  v0 <- call(class, ref, method, dex)
4058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
4059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # failed?
4060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  yes, handle exception
4061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_invokeMethodRange #  (a0=method, rOBJ="this")
4062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_79: /* 0x79 */
4067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_79.S */
4068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
4069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
4070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_UNUSED_7A: /* 0x7a */
4076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_UNUSED_7A.S */
4077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unused.S */
4078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(common_abort)
4079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NEG_INT: /* 0x7b */
4085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NEG_INT.S */
4086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unop.S */
4087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: neg-int, not-int, neg-float, int-to-float, float-to-int,
4093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      int-to-byte, int-to-char, int-to-short
4094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
4098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    negu a0, a0                                 #  a0 <- op, a0-a3 changed
4102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, t0, t1)        #  vAA <- result0
4104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NOT_INT: /* 0x7c */
4110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NOT_INT.S */
4111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unop.S */
4112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: neg-int, not-int, neg-float, int-to-float, float-to-int,
4118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      int-to-byte, int-to-char, int-to-short
4119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
4123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not a0, a0                                 #  a0 <- op, a0-a3 changed
4127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, t0, t1)        #  vAA <- result0
4129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NEG_LONG: /* 0x7d */
4135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NEG_LONG.S */
4136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopWide.S */
4137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit unary operation.  Provide an "instr" line that
4139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0/a1".
4140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be MIPS instruction or a function call.
4141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: neg-long, not-long, neg-double, long-to-double, double-to-long
4143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t1)                           #  t1 <- A+
4146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t1)                    #  rOBJ <- &fp[A]
4149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- vAA
4150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    negu v0, a0                              #  optional op
4152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    negu v1, a1; sltu a0, zero, v0; subu v1, v1, a0                                 #  a0/a1 <- op, a2-a3 changed
4153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA <- a0/a1
4155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-13 instructions */
4157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NOT_LONG: /* 0x7e */
4164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NOT_LONG.S */
4165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopWide.S */
4166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit unary operation.  Provide an "instr" line that
4168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0/a1".
4169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be MIPS instruction or a function call.
4170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: neg-long, not-long, neg-double, long-to-double, double-to-long
4172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t1)                           #  t1 <- A+
4175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t1)                    #  rOBJ <- &fp[A]
4178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- vAA
4179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not a0, a0                              #  optional op
4181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not a1, a1                                 #  a0/a1 <- op, a2-a3 changed
4182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA <- a0/a1
4184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-13 instructions */
4186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NEG_FLOAT: /* 0x7f */
4192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NEG_FLOAT.S */
4193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unop.S */
4194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: neg-int, not-int, neg-float, int-to-float, float-to-int,
4200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      int-to-byte, int-to-char, int-to-short
4201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
4205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a0, a0, 0x80000000                                 #  a0 <- op, a0-a3 changed
4209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, t0, t1)        #  vAA <- result0
4211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_NEG_DOUBLE: /* 0x80 */
4217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_NEG_DOUBLE.S */
4218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopWide.S */
4219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit unary operation.  Provide an "instr" line that
4221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0/a1".
4222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be MIPS instruction or a function call.
4223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: neg-long, not-long, neg-double, long-to-double, double-to-long
4225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t1)                           #  t1 <- A+
4228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t1)                    #  rOBJ <- &fp[A]
4231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- vAA
4232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a1, a1, 0x80000000                                 #  a0/a1 <- op, a2-a3 changed
4235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA <- a0/a1
4237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-13 instructions */
4239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INT_TO_LONG: /* 0x81 */
4245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INT_TO_LONG.S */
4246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopWider.S */
4247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32bit-to-64bit unary operation.  Provide an "instr" line
4249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0", where
4250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 64-bit quantity in a0/a1.
4251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: int-to-long, int-to-double, float-to-long, float-to-double
4253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t1)                           #  t1 <- A+
4256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t1)                    #  rOBJ <- &fp[A]
4259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra a1, a0, 31                                 #  result <- op, a0-a3 changed
4262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vA/vA+1 <- a0/a1
4264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INT_TO_FLOAT: /* 0x82 */
4271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INT_TO_FLOAT.S */
4272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflop.S */
4273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: int-to-float, float-to-int
4279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t0 <- A+
4283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a3)
4287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__floatsisf)                                 #  a0 <- op, a0-a3 changed
4292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INT_TO_FLOAT_set_vreg:
4294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result0
4295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    cvt.s.w fv0, fa0
4297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INT_TO_FLOAT_set_vreg_f:
4299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)
4300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t1)                        #  jump to next instruction
4303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INT_TO_DOUBLE: /* 0x83 */
4309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INT_TO_DOUBLE.S */
4310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflopWider.S */
4311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32bit-to-64bit unary operation.  Provide an "instr" line
4313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0", where
4314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 64-bit quantity in a0/a1.
4315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: int-to-double, float-to-long, float-to-double
4317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
4320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a3)
4325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
4327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__floatsidf)                                 #  result <- op, a0-a3 changed
4331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INT_TO_DOUBLE_set_vreg:
4333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)      #  vA/vA+1 <- a0/a1
4334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    cvt.d.w fv0, fa0
4336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INT_TO_DOUBLE_set_vreg:
4338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)                             #  vA/vA+1 <- a0/a1
4339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_LONG_TO_INT: /* 0x84 */
4348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_LONG_TO_INT.S */
4349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B from 15:12
4350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A from 11:8
4351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_BIG_ENDIAN
4353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, a1, 1
4354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[B]
4356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  t0 <- opcode from rINST
4357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a2, a0, t0)              #  fp[A] <- a2
4358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_LONG_TO_FLOAT: /* 0x85 */
4362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_LONG_TO_FLOAT.S */
4363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopNarrower.S */
4364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64bit-to-32bit unary operation.  Provide an "instr" line
4366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0/a1", where
4367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 32-bit quantity in a0.
4368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: long-to-float, double-to-int, double-to-float
4370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If hard floating point support is available, use fa0 as the parameter, except for
4371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * long-to-float opcode.
4372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * (This would work for long-to-int, but that instruction is actually
4373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * an exact match for OP_MOVE.)
4374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
4378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)               #  a0/a1 <- vB/vB+1
4381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)
4383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__floatdisf)                                 #  a0 <- op, a0-a3 changed
4388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_LONG_TO_FLOAT_set_vreg:
4390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vA <- result0
4391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__floatdisf)
4393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_LONG_TO_FLOAT_set_vreg_f:
4395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vA <- result0
4396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_LONG_TO_DOUBLE: /* 0x86 */
4405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_LONG_TO_DOUBLE.S */
4406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflopWide.S */
4407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit unary operation.  Provide an "instr" line that
4409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0/a1".
4410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * long-to-double, double-to-long
4413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
4416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  t1 <- &fp[A]
4419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)               #  a0/a1 <- vAA
4421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)
4423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__floatdidf)                                 #  a0/a1 <- op, a2-a3 changed
4427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_LONG_TO_DOUBLE_set_vreg:
4429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)      #  vAA <- a0/a1
4431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)                             #  vAA <- a0/a1
4433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-13 instructions */
4437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_FLOAT_TO_INT: /* 0x87 */
4443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FLOAT_TO_INT.S */
4444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflop.S */
4445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: int-to-float, float-to-int
4451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t0 <- A+
4455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a3)
4459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b f2i_doconv                                 #  a0 <- op, a0-a3 changed
4464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_FLOAT_TO_INT_set_vreg:
4466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result0
4467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b f2i_doconv
4469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_FLOAT_TO_INT_set_vreg_f:
4471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)
4472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t1)                        #  jump to next instruction
4475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_FLOAT_TO_LONG: /* 0x88 */
4481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FLOAT_TO_LONG.S */
4482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflopWider.S */
4483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32bit-to-64bit unary operation.  Provide an "instr" line
4485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0", where
4486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 64-bit quantity in a0/a1.
4487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: int-to-double, float-to-long, float-to-double
4489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
4492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a3)
4497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
4499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b f2l_doconv                                 #  result <- op, a0-a3 changed
4503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_FLOAT_TO_LONG_set_vreg:
4505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)      #  vA/vA+1 <- a0/a1
4506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b f2l_doconv
4508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_FLOAT_TO_LONG_set_vreg:
4510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)                             #  vA/vA+1 <- a0/a1
4511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_FLOAT_TO_DOUBLE: /* 0x89 */
4520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_FLOAT_TO_DOUBLE.S */
4521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflopWider.S */
4522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32bit-to-64bit unary operation.  Provide an "instr" line
4524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0", where
4525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 64-bit quantity in a0/a1.
4526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: int-to-double, float-to-long, float-to-double
4528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
4531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a3)
4536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
4538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__extendsfdf2)                                 #  result <- op, a0-a3 changed
4542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_FLOAT_TO_DOUBLE_set_vreg:
4544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)      #  vA/vA+1 <- a0/a1
4545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    cvt.d.s fv0, fa0
4547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_FLOAT_TO_DOUBLE_set_vreg:
4549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)                             #  vA/vA+1 <- a0/a1
4550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DOUBLE_TO_INT: /* 0x8a */
4559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DOUBLE_TO_INT.S */
4560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopNarrower.S */
4561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64bit-to-32bit unary operation.  Provide an "instr" line
4563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0/a1", where
4564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 32-bit quantity in a0.
4565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: long-to-float, double-to-int, double-to-float
4567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If hard floating point support is available, use fa0 as the parameter, except for
4568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * long-to-float opcode.
4569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * (This would work for long-to-int, but that instruction is actually
4570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * an exact match for OP_MOVE.)
4571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
4575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)               #  a0/a1 <- vB/vB+1
4578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a3)
4580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b d2i_doconv                                 #  a0 <- op, a0-a3 changed
4585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_DOUBLE_TO_INT_set_vreg:
4587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vA <- result0
4588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b d2i_doconv
4590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_DOUBLE_TO_INT_set_vreg_f:
4592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vA <- result0
4593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
4599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Convert the double in a0/a1 to an int in a0.
4600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *
4601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * We have to clip values to int min/max per the specification.  The
4602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * expected common case is a "reasonable" value that converts directly
4603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * to modest integer.  The EABI convert function isn't doing this for us.
4604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Use rBIX / rTEMP as global to hold arguments (they are not bound to a global var)
4605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
4606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DOUBLE_TO_LONG: /* 0x8b */
4610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DOUBLE_TO_LONG.S */
4611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unflopWide.S */
4612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit unary operation.  Provide an "instr" line that
4614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0/a1".
4615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * long-to-double, double-to-long
4618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
4621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  t1 <- &fp[A]
4624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)               #  a0/a1 <- vAA
4626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a3)
4628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b d2l_doconv                                 #  a0/a1 <- op, a2-a3 changed
4632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_DOUBLE_TO_LONG_set_vreg:
4634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)      #  vAA <- a0/a1
4636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)                             #  vAA <- a0/a1
4638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-13 instructions */
4642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DOUBLE_TO_FLOAT: /* 0x8c */
4648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DOUBLE_TO_FLOAT.S */
4649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unopNarrower.S */
4650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64bit-to-32bit unary operation.  Provide an "instr" line
4652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = op a0/a1", where
4653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "result" is a 32-bit quantity in a0.
4654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: long-to-float, double-to-int, double-to-float
4656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If hard floating point support is available, use fa0 as the parameter, except for
4657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * long-to-float opcode.
4658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * (This would work for long-to-int, but that instruction is actually
4659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * an exact match for OP_MOVE.)
4660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
4664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[B]
4665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a3)               #  a0/a1 <- vB/vB+1
4667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a3)
4669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
4673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__truncdfsf2)                                 #  a0 <- op, a0-a3 changed
4674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_DOUBLE_TO_FLOAT_set_vreg:
4676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vA <- result0
4677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
4678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    cvt.s.d fv0, fa0
4679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_DOUBLE_TO_FLOAT_set_vreg_f:
4681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vA <- result0
4682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
4683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
4685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-11 instructions */
4686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INT_TO_BYTE: /* 0x8d */
4691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INT_TO_BYTE.S */
4692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unop.S */
4693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: neg-int, not-int, neg-float, int-to-float, float-to-int,
4699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      int-to-byte, int-to-char, int-to-short
4700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
4704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll a0, a0, 24                              #  optional op
4707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra a0, a0, 24                                 #  a0 <- op, a0-a3 changed
4708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, t0, t1)        #  vAA <- result0
4710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INT_TO_CHAR: /* 0x8e */
4716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INT_TO_CHAR.S */
4717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unop.S */
4718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: neg-int, not-int, neg-float, int-to-float, float-to-int,
4724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      int-to-byte, int-to-char, int-to-short
4725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
4729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, 0xffff                                 #  a0 <- op, a0-a3 changed
4733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, t0, t1)        #  vAA <- result0
4735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INT_TO_SHORT: /* 0x8f */
4741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INT_TO_SHORT.S */
4742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/unop.S */
4743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit unary operation.  Provide an "instr" line that
4745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = op a0".
4746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.
4747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: neg-int, not-int, neg-float, int-to-float, float-to-int,
4749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      int-to-byte, int-to-char, int-to-short
4750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* unop vA, vB */
4752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
4753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
4754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a3)                       #  a0 <- vB
4755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
4756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll a0, 16                              #  optional op
4757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra a0, 16                                 #  a0 <- op, a0-a3 changed
4758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
4759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, t0, t1)        #  vAA <- result0
4760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 9-10 instructions */
4761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_INT: /* 0x90 */
4766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_INT.S */
4767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
4768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
4770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
4771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
4772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
4773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
4775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
4776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
4777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
4778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
4780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
4781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
4783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
4784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
4785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
4786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
4787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
4788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
4789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
4790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
4791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
4792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
4795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a0, a0, a1                                 #  a0 <- op, a0-a3 changed
4797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
4799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
4800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_INT: /* 0x91 */
4806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_INT.S */
4807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
4808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
4810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
4811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
4812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
4813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
4815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
4816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
4817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
4818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
4820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
4821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
4823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
4824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
4825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
4826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
4827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
4828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
4829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
4830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
4831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
4832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
4835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu a0, a0, a1                                 #  a0 <- op, a0-a3 changed
4837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
4839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
4840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_INT: /* 0x92 */
4846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_INT.S */
4847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
4848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
4850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
4851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
4852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
4853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
4855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
4856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
4857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
4858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
4860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
4861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
4863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
4864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
4865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
4866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
4867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
4868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
4869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
4870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
4871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
4872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
4875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul a0, a0, a1                                 #  a0 <- op, a0-a3 changed
4877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
4879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
4880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_INT: /* 0x93 */
4886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_INT.S */
4887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
4888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
4890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
4891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
4892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
4893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
4895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
4896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
4897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
4898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
4900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
4901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
4903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
4904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
4905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
4906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
4907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
4908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
4909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
4910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
4911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
4912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
4915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mflo a0                                 #  a0 <- op, a0-a3 changed
4917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
4919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
4920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_INT: /* 0x94 */
4926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_INT.S */
4927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
4928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
4930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
4931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
4932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
4933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
4935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
4936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
4937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
4938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
4940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
4941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
4943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
4944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
4945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
4946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
4947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
4948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
4949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
4950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
4951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
4952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
4955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mfhi a0                                 #  a0 <- op, a0-a3 changed
4957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
4959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
4960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
4964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
4965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AND_INT: /* 0x95 */
4966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AND_INT.S */
4967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
4968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
4969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
4970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
4971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
4972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
4973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
4975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
4976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
4977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
4978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
4979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
4980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
4981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
4982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
4983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
4984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
4985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
4986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
4987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
4988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
4989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
4990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
4991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
4992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
4993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
4994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
4995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
4996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, a0, a1                                 #  a0 <- op, a0-a3 changed
4997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
4998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
4999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_OR_INT: /* 0x96 */
5006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_OR_INT.S */
5007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
5008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
5010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
5011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
5016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
5017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
5018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
5020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
5021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a0, a0, a1                                 #  a0 <- op, a0-a3 changed
5037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
5039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_XOR_INT: /* 0x97 */
5046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_XOR_INT.S */
5047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
5048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
5050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
5051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
5056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
5057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
5058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
5060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
5061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a0, a0, a1                                 #  a0 <- op, a0-a3 changed
5077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
5079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHL_INT: /* 0x98 */
5086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHL_INT.S */
5087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
5088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
5090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
5091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
5096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
5097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
5098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
5100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
5101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
5116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll a0, a0, a1                                 #  a0 <- op, a0-a3 changed
5117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
5119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHR_INT: /* 0x99 */
5126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHR_INT.S */
5127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
5128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
5130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
5131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
5136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
5137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
5138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
5140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
5141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
5156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra a0, a0, a1                                 #  a0 <- op, a0-a3 changed
5157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
5159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_USHR_INT: /* 0x9a */
5166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_USHR_INT.S */
5167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop.S */
5168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary operation.  Provide an "instr" line that
5170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0 op a1".
5171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.  Note that we
5176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * *don't* check for (INT_MIN / -1) here, because the ARM math lib
5177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * handles it correctly.
5178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int, sub-int, mul-int, div-int, rem-int, and-int, or-int,
5180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-int, shl-int, shr-int, ushr-int
5181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
5196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl a0, a0, a1                                 #  a0 <- op, a0-a3 changed
5197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
5199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_LONG: /* 0x9b */
5206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_LONG.S */
5207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
5208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *  The compiler generates the following sequence for
5209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *  [v1 v0] =  [a1 a0] + [a3 a2];
5210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    addu v0,a2,a0
5211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    addu a1,a3,a1
5212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    sltu v1,v0,a2
5213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    addu v1,v1,a1
5214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
5215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu v0, a2, a0                              #  optional op
5247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a1, a3, a1; sltu v1, v0, a2; addu v1, v1, a1                                 #  result <- op, a0-a3 changed
5248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
5250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_LONG: /* 0x9c */
5258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_LONG.S */
5259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
5260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * For little endian the code sequence looks as follows:
5261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    subu    v0,a0,a2
5262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    subu    v1,a1,a3
5263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    sltu    a0,a0,v0
5264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *    subu    v1,v1,a0
5265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
5266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu v0, a0, a2                              #  optional op
5298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu v1, a1, a3; sltu a0, a0, v0; subu v1, v1, a0                                 #  result <- op, a0-a3 changed
5299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
5301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_LONG: /* 0x9d */
5310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_LONG.S */
5311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Signed 64-bit integer multiply.
5313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *         a1   a0
5314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   x     a3   a2
5315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *   -------------
5316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *       a2a1 a2a0
5317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *       a3a0
5318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a3a1 (<= unused)
5319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  ---------------
5320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *         v1   v0
5321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* mul-long vAA, vBB, vCC */
5323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       t0, a0, 255                  #  a2 <- BB
5325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       t1, a0, 8                    #  a3 <- CC
5326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t0, rFP, t0)                      #  t0 <- &fp[BB]
5327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, t0)                     #  a0/a1 <- vBB/vBB+1
5328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, t1)                      #  t0 <- &fp[CC]
5330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)                     #  a2/a3 <- vCC/vCC+1
5331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul       v1, a3, a0                   #  v1= a3a0
5333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    multu     a2, a0
5334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mfhi      t1
5335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mflo      v0                           #  v0= a2a0
5336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul       t0, a2, a1                   #  t0= a2a1
5337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      v1, v1, t1                   #  v1+= hi(a2a0)
5338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      v1, v1, t0                   #  v1= a3a0 + a2a1;
5339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)                            #  a0 <- AA
5341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a0, rFP, a0)                      #  a0 <- &fp[A]
5342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         .LOP_MUL_LONG_finish
5344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_LONG: /* 0x9e */
5348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_LONG.S */
5349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
5350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
5376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divdi3)                                 #  result <- op, a0-a3 changed
5383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
5385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a1, a0, a2)               #  a0/a1 <- vBB/vBB+1
5414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a3, a2, t1)               #  a2/a3 <- vCC/vCC+1
5415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
5416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a3, a2             #  second arg (a2-a3) is zero?
5417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divdi3)                                 #  result <- op, a0-a3 changed
5423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v1, v0, rOBJ)      #  vAA/vAA+1 <- v1/v0
5425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_LONG: /* 0x9f */
5434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_LONG.S */
5435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ldivmod returns quotient in a0/a1 and remainder in a2/a3 */
5436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
5437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
5463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__moddi3)                                 #  result <- op, a0-a3 changed
5470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
5472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a1, a0, a2)               #  a0/a1 <- vBB/vBB+1
5501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a3, a2, t1)               #  a2/a3 <- vCC/vCC+1
5502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
5503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a3, a2             #  second arg (a2-a3) is zero?
5504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__moddi3)                                 #  result <- op, a0-a3 changed
5510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v1, v0, rOBJ)      #  vAA/vAA+1 <- v1/v0
5512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AND_LONG: /* 0xa0 */
5521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AND_LONG.S */
5522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, a0, a2                              #  optional op
5554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, a3                                 #  result <- op, a0-a3 changed
5555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA/vAA+1 <- a0/a1
5557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_OR_LONG: /* 0xa1 */
5565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_OR_LONG.S */
5566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a0, a0, a2                              #  optional op
5598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a1, a1, a3                                 #  result <- op, a0-a3 changed
5599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA/vAA+1 <- a0/a1
5601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_XOR_LONG: /* 0xa2 */
5609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_XOR_LONG.S */
5610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide.S */
5611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
5613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
5614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
5615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
5616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
5618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
5619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
5621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long
5622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
5624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
5628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[AA]
5631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
5632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
5633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a2)               #  a0/a1 <- vBB/vBB+1
5634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)               #  a2/a3 <- vCC/vCC+1
5635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
5637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
5638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a0, a0, a2                              #  optional op
5642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a1, a1, a3                                 #  result <- op, a0-a3 changed
5643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA/vAA+1 <- a0/a1
5645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
5647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHL_LONG: /* 0xa3 */
5653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHL_LONG.S */
5654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Long integer shift.  This is different from the generic 32/64-bit
5656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * binary operations because vAA/vBB are 64-bit but vCC (the shift
5657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * distance) is 32-bit.  Also, Dalvik requires us to mask off the low
5658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 6 bits of the shift distance.
5659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* shl-long vAA, vBB, vCC */
5661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t2)                            #  t2 <- AA
5663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a3, a0, 255                  #  a3 <- BB
5664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a0, a0, 8                    #  a0 <- CC
5665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[BB]
5666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vCC
5667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- vBB/vBB+1
5668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t2, rFP, t2)                      #  t2 <- &fp[AA]
5670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     v0, a0, a2                     #  rlo<- alo << (shift&31)
5673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not     v1, a2                         #  rhi<- 31-shift  (shift is 5b)
5674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl     a0, 1
5675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl     a0, v1                         #  alo<- alo >> (32-(shift&31))
5676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     v1, a1, a2                     #  rhi<- ahi << (shift&31)
5677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or      v1, a0                         #  rhi<- rhi | alo
5678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    andi    a2, 0x20                       #  shift< shift & 0x20
5679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v1, v0, a2                     #  rhi<- rlo (if shift&0x20)
5680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v0, zero, a2                   #  rlo<- 0  (if shift&0x20)
5681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, t2)                    #  vAA/vAA+1 <- a0/a1
5684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHR_LONG: /* 0xa4 */
5690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHR_LONG.S */
5691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Long integer shift.  This is different from the generic 32/64-bit
5693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * binary operations because vAA/vBB are 64-bit but vCC (the shift
5694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * distance) is 32-bit.  Also, Dalvik requires us to mask off the low
5695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 6 bits of the shift distance.
5696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* shr-long vAA, vBB, vCC */
5698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t3)                            #  t3 <- AA
5700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a3, a0, 255                  #  a3 <- BB
5701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a0, a0, 8                    #  a0 <- CC
5702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[BB]
5703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vCC
5704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- vBB/vBB+1
5705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t3, rFP, t3)                      #  t3 <- &fp[AA]
5706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra     v1, a1, a2                     #  rhi<- ahi >> (shift&31)
5709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl     v0, a0, a2                     #  rlo<- alo >> (shift&31)
5710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra     a3, a1, 31                     #  a3<- sign(ah)
5711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not     a0, a2                         #  alo<- 31-shift (shift is 5b)
5712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     a1, 1
5713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     a1, a0                         #  ahi<- ahi << (32-(shift&31))
5714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or      v0, a1                         #  rlo<- rlo | ahi
5715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    andi    a2, 0x20                       #  shift & 0x20
5716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v0, v1, a2                     #  rlo<- rhi (if shift&0x20)
5717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v1, a3, a2                     #  rhi<- sign(ahi) (if shift&0x20)
5718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, t3)                    #  vAA/VAA+1 <- v0/v0
5720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_USHR_LONG: /* 0xa5 */
5727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_USHR_LONG.S */
5728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Long integer shift.  This is different from the generic 32/64-bit
5730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * binary operations because vAA/vBB are 64-bit but vCC (the shift
5731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * distance) is 32-bit.  Also, Dalvik requires us to mask off the low
5732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 6 bits of the shift distance.
5733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* ushr-long vAA, vBB, vCC */
5735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t0)                            #  t3 <- AA
5737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a3, a0, 255                  #  a3 <- BB
5738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a0, a0, 8                    #  a0 <- CC
5739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a3)                      #  a3 <- &fp[BB]
5740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a0)                       #  a2 <- vCC
5741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- vBB/vBB+1
5742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t0)                    #  rOBJ <- &fp[AA]
5743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       v1, a1, a2                   #  rhi<- ahi >> (shift&31)
5746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       v0, a0, a2                   #  rlo<- alo >> (shift&31)
5747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not       a0, a2                       #  alo<- 31-n  (shift is 5b)
5748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, 1
5749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, a0                       #  ahi<- ahi << (32-(shift&31))
5750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        v0, a1                       #  rlo<- rlo | ahi
5751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    andi      a2, 0x20                     #  shift & 0x20
5752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn      v0, v1, a2                   #  rlo<- rhi (if shift&0x20)
5753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn      v1, zero, a2                 #  rhi<- 0 (if shift&0x20)
5754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)                  #  vAA/vAA+1 <- v0/v1
5756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_FLOAT: /* 0xa6 */
5763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_FLOAT.S */
5764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop.S */
5765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary float operation.
5767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-fp, sub-fp, mul-fp, div-fp
5769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
5774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)                    #  a1 <- vCC
5785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a2)                    #  a0 <- vBB
5786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
5790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1               #  condition bit and comparision with 0
5791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
5792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__addsf3)                                 #  v0 = result
5799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- v0
5800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    add.s fv0, fa0, fa1                               #  f0 = result
5802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- fv0
5803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_FLOAT: /* 0xa7 */
5813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_FLOAT.S */
5814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop.S */
5815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary float operation.
5817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-fp, sub-fp, mul-fp, div-fp
5819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
5824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)                    #  a1 <- vCC
5835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a2)                    #  a0 <- vBB
5836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
5840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1               #  condition bit and comparision with 0
5841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
5842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__subsf3)                                 #  v0 = result
5849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- v0
5850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sub.s fv0, fa0, fa1                               #  f0 = result
5852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- fv0
5853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_FLOAT: /* 0xa8 */
5863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_FLOAT.S */
5864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop.S */
5865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary float operation.
5867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-fp, sub-fp, mul-fp, div-fp
5869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
5874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)                    #  a1 <- vCC
5885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a2)                    #  a0 <- vBB
5886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
5890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1               #  condition bit and comparision with 0
5891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
5892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__mulsf3)                                 #  v0 = result
5899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- v0
5900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul.s fv0, fa0, fa1                               #  f0 = result
5902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- fv0
5903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_FLOAT: /* 0xa9 */
5913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_FLOAT.S */
5914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop.S */
5915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary float operation.
5917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-fp, sub-fp, mul-fp, div-fp
5919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
5924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)                    #  a1 <- vCC
5935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a2)                    #  a0 <- vBB
5936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
5940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1               #  condition bit and comparision with 0
5941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
5942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divsf3)                                 #  v0 = result
5949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- v0
5950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div.s fv0, fa0, fa1                               #  f0 = result
5952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- fv0
5953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
5955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
5956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
5957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
5961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
5962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_FLOAT: /* 0xaa */
5963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_FLOAT.S */
5964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop.S */
5965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
5966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit binary float operation.
5967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
5968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-fp, sub-fp, mul-fp, div-fp
5969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
5970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
5972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
5973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
5974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
5975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
5976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vCC
5978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
5979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
5982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
5984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)                    #  a1 <- vCC
5985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, a2)                    #  a0 <- vBB
5986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
5988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
5989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
5990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1               #  condition bit and comparision with 0
5991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
5992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
5993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
5994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
5995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
5996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
5997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
5998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmodf)                                 #  v0 = result
5999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- v0
6000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmodf)                               #  f0 = result
6002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- fv0
6003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 11-14 instructions */
6007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_DOUBLE: /* 0xab */
6013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_DOUBLE.S */
6014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide.S */
6015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
6017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
6018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
6023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long, add-double, sub-double, mul-double, div-double,
6024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double
6025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
6027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
6029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
6030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
6031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
6032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
6033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s5 <- &fp[AA]
6034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
6035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
6036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a2)               #  a0/a1 <- vBB/vBB+1
6038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, t1)               #  a2/a3 <- vCC/vCC+1
6039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
6041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a2)
6045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, t1)
6046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
6048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
6049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
6050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
6053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
6054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__adddf3)                                 #  result <- op, a0-a3 changed
6057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
6058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    add.d fv0, fa0, fa1
6060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
6061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
6065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_DOUBLE: /* 0xac */
6071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_DOUBLE.S */
6072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide.S */
6073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
6075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
6076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
6081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long, add-double, sub-double, mul-double, div-double,
6082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double
6083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
6085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
6087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
6088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
6089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
6090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
6091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s5 <- &fp[AA]
6092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
6093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
6094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a2)               #  a0/a1 <- vBB/vBB+1
6096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, t1)               #  a2/a3 <- vCC/vCC+1
6097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
6099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a2)
6103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, t1)
6104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
6106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
6107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
6108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
6111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
6112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__subdf3)                                 #  result <- op, a0-a3 changed
6115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
6116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sub.d fv0, fa0, fa1
6118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
6119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
6123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_DOUBLE: /* 0xad */
6129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_DOUBLE.S */
6130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide.S */
6131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
6133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
6134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
6139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long, add-double, sub-double, mul-double, div-double,
6140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double
6141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
6143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
6145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
6146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
6147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
6148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
6149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s5 <- &fp[AA]
6150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
6151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
6152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a2)               #  a0/a1 <- vBB/vBB+1
6154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, t1)               #  a2/a3 <- vCC/vCC+1
6155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
6157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a2)
6161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, t1)
6162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
6164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
6165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
6166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
6169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
6170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__muldf3)                                 #  result <- op, a0-a3 changed
6173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
6174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul.d fv0, fa0, fa1
6176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
6177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
6181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_DOUBLE: /* 0xae */
6187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_DOUBLE.S */
6188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide.S */
6189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
6191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
6192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
6197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long, add-double, sub-double, mul-double, div-double,
6198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double
6199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
6201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
6203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
6204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
6205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
6206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
6207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s5 <- &fp[AA]
6208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
6209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
6210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a2)               #  a0/a1 <- vBB/vBB+1
6212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, t1)               #  a2/a3 <- vCC/vCC+1
6213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
6215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a2)
6219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, t1)
6220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
6222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
6223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
6224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
6227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
6228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divdf3)                                 #  result <- op, a0-a3 changed
6231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
6232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div.d fv0, fa0, fa1
6234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
6235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
6239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_DOUBLE: /* 0xaf */
6245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_DOUBLE.S */
6246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide.S */
6247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit binary operation.  Provide an "instr" line that
6249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * specifies an instruction that performs "result = a0-a1 op a2-a3".
6250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: add-long, sub-long, div-long, rem-long, and-long, or-long,
6255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      xor-long, add-double, sub-double, mul-double, div-double,
6256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double
6257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * IMPORTANT: you may specify "chkzero" or "preinstr" but not both.
6259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop vAA, vBB, vCC */
6261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a0, 1)                           #  a0 <- CCBB
6262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  s5 <- AA
6263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a0, 255                  #  a2 <- BB
6264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       a3, a0, 8                    #  a3 <- CC
6265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  s5 <- &fp[AA]
6266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a2, rFP, a2)                      #  a2 <- &fp[BB]
6267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, a3)                      #  a3 <- &fp[CC]
6268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, a2)               #  a0/a1 <- vBB/vBB+1
6270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, t1)               #  a2/a3 <- vCC/vCC+1
6271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
6273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, a2)
6277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, t1)
6278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
6280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
6281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
6282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
6285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
6286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
6288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmod)                                 #  result <- op, a0-a3 changed
6289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
6290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmod)
6292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
6293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 14-17 instructions */
6297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_INT_2ADDR: /* 0xb0 */
6303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_INT_2ADDR.S */
6304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_INT_2ADDR: /* 0xb1 */
6339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_INT_2ADDR.S */
6340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_INT_2ADDR: /* 0xb2 */
6375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_INT_2ADDR.S */
6376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_INT_2ADDR: /* 0xb3 */
6411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_INT_2ADDR.S */
6412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
6431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mflo a0                                 #  a0 <- op, a0-a3 changed
6438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_INT_2ADDR: /* 0xb4 */
6447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_INT_2ADDR.S */
6448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
6467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mfhi a0                                 #  a0 <- op, a0-a3 changed
6474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AND_INT_2ADDR: /* 0xb5 */
6483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AND_INT_2ADDR.S */
6484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_OR_INT_2ADDR: /* 0xb6 */
6519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_OR_INT_2ADDR.S */
6520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_XOR_INT_2ADDR: /* 0xb7 */
6555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_XOR_INT_2ADDR.S */
6556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHL_INT_2ADDR: /* 0xb8 */
6591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHL_INT_2ADDR.S */
6592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
6617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHR_INT_2ADDR: /* 0xb9 */
6627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHR_INT_2ADDR.S */
6628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
6653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra a0, a0, a1                                 #  a0 <- op, a0-a3 changed
6654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_USHR_INT_2ADDR: /* 0xba */
6663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_USHR_INT_2ADDR.S */
6664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binop2addr.S */
6665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" line
6667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
6668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
6669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr,
6674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr,
6675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/2addr, shr-int/2addr, ushr-int/2addr
6676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
6680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
6681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
6682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
6684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
6685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
6689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl a0, a0, a1                                  #  a0 <- op, a0-a3 changed
6690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
6692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
6693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_LONG_2ADDR: /* 0xbb */
6699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_LONG_2ADDR.S */
6700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
6701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham *See OP_ADD_LONG.S for details
6702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
6703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
6723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
6724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
6726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu v0, a2, a0                              #  optional op
6731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a1, a3, a1; sltu v1, v0, a2; addu v1, v1, a1                                 #  result <- op, a0-a3 changed
6732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
6734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
6736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_LONG_2ADDR: /* 0xbc */
6742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_LONG_2ADDR.S */
6743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
6744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * See comments in OP_SUB_LONG.S
6745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
6746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
6766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
6767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
6769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu v0, a0, a2                              #  optional op
6774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu v1, a1, a3; sltu a0, a0, v0; subu v1, v1, a0                                 #  result <- op, a0-a3 changed
6775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
6777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
6779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_LONG_2ADDR: /* 0xbd */
6785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_LONG_2ADDR.S */
6786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * See comments in OP_MUL_LONG.S
6788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* mul-long/2addr vA, vB */
6790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t0)                           #  t0 <- A+
6791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t0, rFP, t0)                      #  t0 <- &fp[A]
6793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, t0)                     #  vAA.low / high
6794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(t1)                            #  t1 <- B
6796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t1, rFP, t1)                      #  t1 <- &fp[B]
6797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, t1)                     #  vBB.low / high
6798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul       v1, a3, a0                   #  v1= a3a0
6800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    multu     a2, a0
6801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mfhi      t1
6802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mflo      v0                           #  v0= a2a0
6803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul       t2, a2, a1                   #  t2= a2a1
6804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      v1, v1, t1                   #  v1= a3a0 + hi(a2a0)
6805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      v1, v1, t2                   #  v1= v1 + a2a1;
6806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t1)                    #  extract opcode from rINST
6809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # vAA <- v0 (low)
6810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, t0)                    #  vAA+1 <- v1 (high)
6811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t1)                        #  jump to next instruction
6812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_LONG_2ADDR: /* 0xbe */
6817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_LONG_2ADDR.S */
6818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
6819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
6839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
6840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
6841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
6842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divdi3)                                 #  result <- op, a0-a3 changed
6848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
6850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
6852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a3, a2, a1)               #  a2/a3 <- vBB/vBB+1
6875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a1, a0, rOBJ)             #  a0/a1 <- vAA/vAA+1
6876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
6877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a3, a2             #  second arg (a2-a3) is zero?
6878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divdi3)                                 #  result <- op, a0-a3 changed
6884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v1, v0, rOBJ)      #  vAA/vAA+1 <- v1/v0
6886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
6888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_LONG_2ADDR: /* 0xbf */
6895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_LONG_2ADDR.S */
6896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef HAVE_LITTLE_ENDIAN
6897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
6917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
6918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
6919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
6920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__moddi3)                                 #  result <- op, a0-a3 changed
6926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)      #  vAA/vAA+1 <- v0/v1
6928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
6930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
6933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a3, a2, a1)               #  a2/a3 <- vBB/vBB+1
6953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a1, a0, rOBJ)             #  a0/a1 <- vAA/vAA+1
6954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
6955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a3, a2             #  second arg (a2-a3) is zero?
6956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
6959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
6961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__moddi3)                                 #  result <- op, a0-a3 changed
6962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
6963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v1, v0, rOBJ)      #  vAA/vAA+1 <- v1/v0
6964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
6965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
6966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
6969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
6970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
6971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
6972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AND_LONG_2ADDR: /* 0xc0 */
6973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AND_LONG_2ADDR.S */
6974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
6975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
6976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
6977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
6978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
6979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
6980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
6982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
6983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
6984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
6985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
6986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
6987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
6988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
6989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
6990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
6991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
6992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
6993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
6994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
6995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
6996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
6997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
6998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
6999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, a0, a2                              #  optional op
7002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, a3                                 #  result <- op, a0-a3 changed
7003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA/vAA+1 <- a0/a1
7005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_OR_LONG_2ADDR: /* 0xc1 */
7013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_OR_LONG_2ADDR.S */
7014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
7015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
7019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
7025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
7026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
7027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
7034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
7037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a0, a0, a2                              #  optional op
7042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a1, a1, a3                                 #  result <- op, a0-a3 changed
7043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA/vAA+1 <- a0/a1
7045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_XOR_LONG_2ADDR: /* 0xc2 */
7053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_XOR_LONG_2ADDR.S */
7054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopWide2addr.S */
7055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be a MIPS instruction or a function call.  (If the result
7059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-long/2addr, sub-long/2addr, div-long/2addr, rem-long/2addr,
7065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      and-long/2addr, or-long/2addr, xor-long/2addr
7066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-double/2addr
7067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a2, a3, a1)               #  a2/a3 <- vBB/vBB+1
7074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, a2, a3             #  second arg (a2-a3) is zero?
7077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a0, a0, a2                              #  optional op
7082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a1, a1, a3                                 #  result <- op, a0-a3 changed
7083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, rOBJ)      #  vAA/vAA+1 <- a0/a1
7085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHL_LONG_2ADDR: /* 0xc3 */
7093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHL_LONG_2ADDR.S */
7094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Long integer shift, 2addr version.  vA is 64-bit value/result, vB is
7096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 32-bit shift distance.
7097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* shl-long/2addr vA, vB */
7099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t2)                           #  t2 <- A+
7100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a3)                       #  a2 <- vB
7102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t2)                    #  rOBJ <- &fp[A]
7103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)                   #  a0/a1 <- vAA/vAA+1
7104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     v0, a0, a2                     #  rlo<- alo << (shift&31)
7108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not     v1, a2                         #  rhi<- 31-shift  (shift is 5b)
7109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl     a0, 1
7110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl     a0, v1                         #  alo<- alo >> (32-(shift&31))
7111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     v1, a1, a2                     #  rhi<- ahi << (shift&31)
7112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or      v1, a0                         #  rhi<- rhi | alo
7113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    andi    a2, 0x20                       #  shift< shift & 0x20
7114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v1, v0, a2                     #  rhi<- rlo (if shift&0x20)
7115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v0, zero, a2                   #  rlo<- 0  (if shift&0x20)
7116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, rOBJ)                  #  vAA/vAA+1 <- a0/a1
7119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHR_LONG_2ADDR: /* 0xc4 */
7125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHR_LONG_2ADDR.S */
7126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Long integer shift, 2addr version.  vA is 64-bit value/result, vB is
7128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 32-bit shift distance.
7129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* shr-long/2addr vA, vB */
7131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t2)                           #  t2 <- A+
7132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a3)                       #  a2 <- vB
7134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t2, rFP, t2)                      #  t2 <- &fp[A]
7135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, t2)                     #  a0/a1 <- vAA/vAA+1
7136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra     v1, a1, a2                     #  rhi<- ahi >> (shift&31)
7139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl     v0, a0, a2                     #  rlo<- alo >> (shift&31)
7140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra     a3, a1, 31                     #  a3<- sign(ah)
7141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not     a0, a2                         #  alo<- 31-shift (shift is 5b)
7142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     a1, 1
7143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll     a1, a0                         #  ahi<- ahi << (32-(shift&31))
7144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or      v0, a1                         #  rlo<- rlo | ahi
7145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    andi    a2, 0x20                       #  shift & 0x20
7146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v0, v1, a2                     #  rlo<- rhi (if shift&0x20)
7147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn    v1, a3, a2                     #  rhi<- sign(ahi) (if shift&0x20)
7148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, t2)                    #  vAA/vAA+1 <- a0/a1
7151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_USHR_LONG_2ADDR: /* 0xc5 */
7157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_USHR_LONG_2ADDR.S */
7158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Long integer shift, 2addr version.  vA is 64-bit value/result, vB is
7160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 32-bit shift distance.
7161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* ushr-long/2addr vA, vB */
7163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(t3)                           #  t3 <- A+
7164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a3)                       #  a2 <- vB
7166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(t3, rFP, t3)                      #  t3 <- &fp[A]
7167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, t3)                     #  a0/a1 <- vAA/vAA+1
7168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       v1, a1, a2                   #  rhi<- ahi >> (shift&31)
7171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       v0, a0, a2                   #  rlo<- alo >> (shift&31)
7172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    not       a0, a2                       #  alo<- 31-n  (shift is 5b)
7173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, 1
7174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll       a1, a0                       #  ahi<- ahi << (32-(shift&31))
7175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        v0, a1                       #  rlo<- rlo | ahi
7176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    andi      a2, 0x20                     #  shift & 0x20
7177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn      v0, v1, a2                   #  rlo<- rhi (if shift&0x20)
7178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    movn      v1, zero, a2                 #  rhi<- 0 (if shift&0x20)
7179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(v0, v1, t3)                    #  vAA/vAA+1 <- a0/a1
7182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_FLOAT_2ADDR: /* 0xc6 */
7188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_FLOAT_2ADDR.S */
7189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop2addr.S */
7190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" and
7192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "instr_f" line
7193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-float/2addr, sub-float/2addr, mul-float/2addr,
7199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * div-float/2addr, rem-float/2addr
7200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
7203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
7206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
7207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, rOBJ)
7213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)
7214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
7217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1
7218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__addsf3)                                 #  result <- op, a0-a3 changed
7225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result
7226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    add.s fv0, fa0, fa1
7228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- result
7229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_FLOAT_2ADDR: /* 0xc7 */
7239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_FLOAT_2ADDR.S */
7240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop2addr.S */
7241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" and
7243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "instr_f" line
7244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-float/2addr, sub-float/2addr, mul-float/2addr,
7250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * div-float/2addr, rem-float/2addr
7251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
7254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
7257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
7258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, rOBJ)
7264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)
7265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
7268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1
7269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__subsf3)                                 #  result <- op, a0-a3 changed
7276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result
7277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sub.s fv0, fa0, fa1
7279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- result
7280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_FLOAT_2ADDR: /* 0xc8 */
7290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_FLOAT_2ADDR.S */
7291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop2addr.S */
7292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" and
7294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "instr_f" line
7295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-float/2addr, sub-float/2addr, mul-float/2addr,
7301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * div-float/2addr, rem-float/2addr
7302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
7305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
7308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
7309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, rOBJ)
7315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)
7316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
7319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1
7320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__mulsf3)                                 #  result <- op, a0-a3 changed
7327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result
7328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul.s fv0, fa0, fa1
7330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- result
7331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_FLOAT_2ADDR: /* 0xc9 */
7341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_FLOAT_2ADDR.S */
7342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop2addr.S */
7343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" and
7345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "instr_f" line
7346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-float/2addr, sub-float/2addr, mul-float/2addr,
7352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * div-float/2addr, rem-float/2addr
7353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
7356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
7359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
7360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, rOBJ)
7366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)
7367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
7370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1
7371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divsf3)                                 #  result <- op, a0-a3 changed
7378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result
7379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div.s fv0, fa0, fa1
7381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- result
7382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_FLOAT_2ADDR: /* 0xca */
7392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_FLOAT_2ADDR.S */
7393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflop2addr.S */
7394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "/2addr" binary operation.  Provide an "instr" and
7396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * "instr_f" line
7397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-float/2addr, sub-float/2addr, mul-float/2addr,
7403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * div-float/2addr, rem-float/2addr
7404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  t1 <- A+
7407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a3)                            #  a3 <- B
7408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, rOBJ)                     #  a0 <- vA
7410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a1, a3)                       #  a1 <- vB
7411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa0, rOBJ)
7417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG_F(fa1, a3)
7418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
7420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.s      ft0, 0
7421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.s    fcc0, ft0, fa1
7422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmodf)                                 #  result <- op, a0-a3 changed
7429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(v0, rOBJ)                     #  vAA <- result
7430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmodf)
7432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_F(fv0, rOBJ)                  #  vAA <- result
7433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_DOUBLE_2ADDR: /* 0xcb */
7443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_DOUBLE_2ADDR.S */
7444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide2addr.S */
7445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-double/2addr, sub-double/2addr, mul-double/2addr,
7453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  div-double/2addr, rem-double/2addr
7454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, a1)               #  a2/a3 <- vBB/vBB+1
7462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
7465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, rOBJ)
7469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, a1)
7470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
7472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
7473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
7477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__adddf3)                                 #  result <- op, a0-a3 changed
7481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
7482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    add.d fv0, fa0, fa1
7484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
7485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SUB_DOUBLE_2ADDR: /* 0xcc */
7495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SUB_DOUBLE_2ADDR.S */
7496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide2addr.S */
7497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-double/2addr, sub-double/2addr, mul-double/2addr,
7505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  div-double/2addr, rem-double/2addr
7506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, a1)               #  a2/a3 <- vBB/vBB+1
7514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
7517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, rOBJ)
7521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, a1)
7522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
7524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
7525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
7529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__subdf3)                                 #  result <- op, a0-a3 changed
7533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
7534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sub.d fv0, fa0, fa1
7536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
7537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_DOUBLE_2ADDR: /* 0xcd */
7547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_DOUBLE_2ADDR.S */
7548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide2addr.S */
7549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-double/2addr, sub-double/2addr, mul-double/2addr,
7557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  div-double/2addr, rem-double/2addr
7558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, a1)               #  a2/a3 <- vBB/vBB+1
7566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
7569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, rOBJ)
7573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, a1)
7574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
7576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
7577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
7581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__muldf3)                                 #  result <- op, a0-a3 changed
7585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
7586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul.d fv0, fa0, fa1
7588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
7589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_DOUBLE_2ADDR: /* 0xce */
7599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_DOUBLE_2ADDR.S */
7600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide2addr.S */
7601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-double/2addr, sub-double/2addr, mul-double/2addr,
7609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  div-double/2addr, rem-double/2addr
7610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, a1)               #  a2/a3 <- vBB/vBB+1
7618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
7621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, rOBJ)
7625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, a1)
7626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
7628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
7629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
7633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(__divdf3)                                 #  result <- op, a0-a3 changed
7637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
7638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div.d fv0, fa0, fa1
7640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
7641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_DOUBLE_2ADDR: /* 0xcf */
7651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_DOUBLE_2ADDR.S */
7652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binflopWide2addr.S */
7653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 64-bit "/2addr" binary operation.  Provide an "instr" line
7655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0-a1 op a2-a3".
7656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.
7657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-double/2addr, sub-double/2addr, mul-double/2addr,
7661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  div-double/2addr, rem-double/2addr
7662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* binop/2addr vA, vB */
7664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(rOBJ)                         #  rOBJ <- A+
7665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
7666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a1, rFP, a1)                      #  a1 <- &fp[B]
7667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, rOBJ)                  #  rOBJ <- &fp[A]
7668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG2, rARG3, a1)               #  a2/a3 <- vBB/vBB+1
7670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(rARG0, rARG1, rOBJ)             #  a0/a1 <- vAA/vAA+1
7671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or        t0, rARG2, rARG3             #  second arg (a2-a3) is zero?
7673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      t0, common_errDivideByZero
7674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa0, fa0f, rOBJ)
7677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64_F(fa1, fa1f, a1)
7678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li.d      ft0, 0
7680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    c.eq.d    fcc0, fa1, ft0
7681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bc1t      fcc0, common_errDivideByZero
7682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
7685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
7686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
7687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#ifdef SOFT_FLOAT
7688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmod)                                 #  result <- op, a0-a3 changed
7689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(rRESULT0, rRESULT1, rOBJ)
7690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#else
7691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(fmod)
7692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_F(fv0, fv0f, rOBJ)
7693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
7694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
7696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 12-15 instructions */
7697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_INT_LIT16: /* 0xd0 */
7703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_INT_LIT16.S */
7704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a0, a0, a1                                 #  a0 <- op, a0-a3 changed
7730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RSUB_INT: /* 0xd1 */
7739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RSUB_INT.S */
7740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* this op is "rsub-int", but can be thought of as "rsub-int/lit16" */
7741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu a0, a1, a0                                 #  a0 <- op, a0-a3 changed
7767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_INT_LIT16: /* 0xd2 */
7776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_INT_LIT16.S */
7777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul a0, a0, a1                                 #  a0 <- op, a0-a3 changed
7803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_INT_LIT16: /* 0xd3 */
7812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_INT_LIT16.S */
7813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
7833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mflo a0                                 #  a0 <- op, a0-a3 changed
7839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_INT_LIT16: /* 0xd4 */
7848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_INT_LIT16.S */
7849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
7869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mfhi a0                                 #  a0 <- op, a0-a3 changed
7875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AND_INT_LIT16: /* 0xd5 */
7884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AND_INT_LIT16.S */
7885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, a0, a1                                 #  a0 <- op, a0-a3 changed
7911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_OR_INT_LIT16: /* 0xd6 */
7920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_OR_INT_LIT16.S */
7921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a0, a0, a1                                 #  a0 <- op, a0-a3 changed
7947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_XOR_INT_LIT16: /* 0xd7 */
7956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_XOR_INT_LIT16.S */
7957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit16.S */
7958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit16" binary operation.  Provide an "instr" line
7960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
7965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
7966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
7967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit16, rsub-int, mul-int/lit16, div-int/lit16,
7968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit16, and-int/lit16, or-int/lit16, xor-int/lit16
7969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
7970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit16 vA, vB,                  /* +CCCC */
7971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a1, 1)                         #  a1 <- ssssCCCC (sign-extended)
7972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
7973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- A+
7974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vB
7975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       rOBJ, rOBJ, 15
7976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
7977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # cmp a1, 0; is second operand zero?
7978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
7979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
7980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
7981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a0, a0, a1                                 #  a0 <- op, a0-a3 changed
7983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
7984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
7985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-13 instructions */
7986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
7989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
7990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
7991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_ADD_INT_LIT8: /* 0xd8 */
7992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_ADD_INT_LIT8.S */
7993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
7994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
7995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
7996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
7997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
7998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
7999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RSUB_INT_LIT8: /* 0xd9 */
8030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RSUB_INT_LIT8.S */
8031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    subu a0, a1, a0                                 #  a0 <- op, a0-a3 changed
8059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_MUL_INT_LIT8: /* 0xda */
8068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_MUL_INT_LIT8.S */
8069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    mul a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_DIV_INT_LIT8: /* 0xdb */
8106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_DIV_INT_LIT8.S */
8107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
8128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mflo a0                                 #  a0 <- op, a0-a3 changed
8135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_REM_INT_LIT8: /* 0xdc */
8144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_REM_INT_LIT8.S */
8145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
8166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    div zero, a0, a1; mfhi a0                                 #  a0 <- op, a0-a3 changed
8173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_AND_INT_LIT8: /* 0xdd */
8182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_AND_INT_LIT8.S */
8183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8196a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8210a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_OR_INT_LIT8: /* 0xde */
8220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_OR_INT_LIT8.S */
8221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8235a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    or a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_XOR_INT_LIT8: /* 0xdf */
8258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_XOR_INT_LIT8.S */
8259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8285a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham                                  #  optional op
8286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    xor a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHL_INT_LIT8: /* 0xe0 */
8296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHL_INT_LIT8.S */
8297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8321a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
8324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sll a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SHR_INT_LIT8: /* 0xe1 */
8334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SHR_INT_LIT8.S */
8335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
8362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8371a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_USHR_INT_LIT8: /* 0xe2 */
8372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_USHR_INT_LIT8.S */
8373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/binopLit8.S */
8374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Generic 32-bit "lit8" binary operation.  Provide an "instr" line
8376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that specifies an instruction that performs "result = a0 op a1".
8377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * This could be an MIPS instruction or a function call.  (If the result
8378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * comes back in a register other than a0, you can override "result".)
8379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If "chkzero" is set to 1, we perform a divide-by-zero check on
8381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * vCC (a1).  Useful for integer division and modulus.
8382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * For: add-int/lit8, rsub-int/lit8, mul-int/lit8, div-int/lit8,
8384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      rem-int/lit8, and-int/lit8, or-int/lit8, xor-int/lit8,
8385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *      shl-int/lit8, shr-int/lit8, ushr-int/lit8
8386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # binop/lit8 vAA, vBB,                 /* +CC */
8388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_S(a3, 1)                         #  a3 <- ssssCCBB (sign-extended for CC)
8389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(rOBJ)                          #  rOBJ <- AA
8390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, a3, 255                  #  a2 <- BB
8391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- vBB
8392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sra       a1, a3, 8                    #  a1 <- ssssssCC (sign extended)
8393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
8394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is second operand zero?
8395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a1, common_errDivideByZero
8396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and a1, a1, 31                              #  optional op
8400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl a0, a0, a1                                 #  a0 <- op, a0-a3 changed
8401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG_GOTO(a0, rOBJ, t0)       #  vAA <- a0
8403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* 10-12 instructions */
8404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_VOLATILE: /* 0xe3 */
8410a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_VOLATILE.S */
8411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
8412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
8414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
8416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
8418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
8419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
8420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
8421a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
8422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
8423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
8424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_VOLATILE_finish       #  no, already resolved
8426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
8428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
8430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
8431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_VOLATILE_finish
8433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
8434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8435a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_VOLATILE: /* 0xe4 */
8439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_VOLATILE.S */
8440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT.S */
8441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field put.
8443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short
8445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
8447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
8448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
8449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
8450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
8451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
8452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
8453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_VOLATILE_finish       #  no, already resolved
8455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
8457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
8459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
8460a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_VOLATILE_finish       #  yes, finish up
8462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
8463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_VOLATILE: /* 0xe5 */
8468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_VOLATILE.S */
8469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
8470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
8472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
8474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
8476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
8477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
8478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
8479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
8480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
8481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_VOLATILE_finish
8482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
8485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
8486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
8487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
8490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
8491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
8492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
8493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
8495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
8497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
8498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
8499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
8501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
8502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
8504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
8505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_VOLATILE_finish            # resume
8506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8510a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_VOLATILE: /* 0xe6 */
8511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_VOLATILE.S */
8512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT.S */
8513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
8515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput, sput-object, sput-boolean, sput-byte, sput-char, sput-short
8517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
8519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
8520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
8521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
8522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
8523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_VOLATILE_finish       #  is resolved entry null?
8524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
8526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
8527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
8528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
8531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
8532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
8533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
8534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
8536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
8538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
8539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
8541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
8542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
8544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
8545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SPUT_VOLATILE_finish            # resume
8546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_OBJECT_VOLATILE: /* 0xe7 */
8551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_OBJECT_VOLATILE.S */
8552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET.S */
8553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit instance field get.
8555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
8557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
8559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
8560a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
8561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
8562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
8563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
8564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
8565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_OBJECT_VOLATILE_finish       #  no, already resolved
8567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
8569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
8571a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test results
8572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_OBJECT_VOLATILE_finish
8574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
8575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_WIDE_VOLATILE: /* 0xe8 */
8580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_WIDE_VOLATILE.S */
8581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_WIDE.S */
8582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Wide 32-bit instance field get.
8584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # iget-wide vA, vB, field              /* CCCC */
8586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
8587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
8588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
8589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pResFields
8590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
8591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
8592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IGET_WIDE_VOLATILE_finish       #  no, already resolved
8594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
8596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
8598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test return code
8599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IGET_WIDE_VOLATILE_finish
8601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
8602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_WIDE_VOLATILE: /* 0xe9 */
8607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_WIDE_VOLATILE.S */
8608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_WIDE.S */
8609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # iput-wide vA, vB, field              /* CCCC */
8610a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
8611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
8612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
8613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pResFields
8614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
8615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
8616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_WIDE_VOLATILE_finish       #  no, already resolved
8618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
8620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8621a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
8622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
8623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_WIDE_VOLATILE_finish       #  yes, finish up
8625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
8626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_WIDE_VOLATILE: /* 0xea */
8631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_WIDE_VOLATILE.S */
8632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_WIDE.S */
8633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 64-bit SGET handler.
8635a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # sget-wide vAA, field                 /* BBBB */
8637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
8638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
8639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
8640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
8641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_WIDE_VOLATILE_finish
8643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
8646a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
8647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
8648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Returns StaticField pointer in v0.
8650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
8652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
8653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
8654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
8655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
8656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
8657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
8658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
8659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
8660a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
8661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
8662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
8664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
8665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
8667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
8668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_WIDE_VOLATILE_finish            # resume
8670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8671a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_WIDE_VOLATILE: /* 0xeb */
8675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_WIDE_VOLATILE.S */
8676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_WIDE.S */
8677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 64-bit SPUT handler.
8679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # sput-wide vAA, field                 /* BBBB */
8681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
8682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
8683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
8684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(t0)                            #  t0 <- AA
8685a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a2, rBIX, a1)                #  a2 <- resolved StaticField ptr
8686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rOBJ, rFP, t0)                    #  rOBJ<- &fp[AA]
8687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
8688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a2, .LOP_SPUT_WIDE_VOLATILE_resolve      #  yes, do resolve
8689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_SPUT_WIDE_VOLATILE_finish:                        #  field ptr in a2, AA in rOBJ
8690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, rOBJ)                   #  a0/a1 <- vAA/vAA+1
8692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(rBIX)                  #  extract opcode from rINST
8693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 1
8694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu    a2, offStaticField_value       #  a2<- pointer to data
8695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmQuasiAtomicSwap64Sync)          #  stores a0/a1 into addr a2
8696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
8697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64_off(a0, a1, a2, offStaticField_value) #  field <- vAA/vAA+1
8698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(rBIX)                      #  jump to next instruction
8700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_BREAKPOINT: /* 0xec */
8705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* (stub) */
8706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SAVE_PC_TO_SELF()            # only need to export PC and FP
8707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SAVE_FP_TO_SELF()
8708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move        a0, rSELF        # self is first arg to function
8709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmMterp_OP_BREAKPOINT)      # call
8710a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_PC_FROM_SELF()          # retrieve updated values
8711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_FP_FROM_SELF()
8712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_INST()                 # load next instruction from rPC
8713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)          # ...trim down to just the opcode
8714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)              # ...and jump to the handler
8715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_THROW_VERIFICATION_ERROR: /* 0xed */
8718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_THROW_VERIFICATION_ERROR.S */
8719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle a throw-verification-error instruction.  This throws an
8721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * exception for an error discovered during verification.  The
8722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * exception is indicated by AA, with some detail provided by BBBB.
8723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op AA, ref@BBBB */
8725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a0)                  #  a0 <- self->method
8727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a2, 1)                           #  a2 <- BBBB
8728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  export the PC
8729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a1)                            #  a1 <- AA
8730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmThrowVerificationError)         #  always throws
8731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown       #  handle exception
8732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8735a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_EXECUTE_INLINE: /* 0xee */
8737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_EXECUTE_INLINE.S */
8738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Execute a "native inline" instruction.
8740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * We need to call an InlineOp4Func:
8742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  bool (func)(u4 arg0, u4 arg1, u4 arg2, u4 arg3, JValue* pResult)
8743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The first four args are in a0-a3, pointer to return value storage
8745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * is on the stack.  The function's return value is a flag that tells
8746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * us if an exception was thrown.
8747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * TUNING: could maintain two tables, pointer in Thread and
8749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * swap if profiler/debuggger active.
8750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* [opt] execute-inline vAA, {vC, vD, vE, vF}, inline@BBBB */
8752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu       a2, offThread_subMode(rSELF)
8753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(rBIX, 1)                         #  rBIX <- BBBB
8754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  can throw
8755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, kSubModeDebugProfile     #  Any going on?
8756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a2, .LOP_EXECUTE_INLINE_debugmode    #  yes - take slow path
8757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_EXECUTE_INLINE_resume:
8758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, rSELF, offThread_retval  #  a1 <- &self->retval
8759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
8760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # Stack should have 16/20 available
8761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        a1, STACK_OFFSET_ARG04(sp)   #  push &self->retval
8762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(.LOP_EXECUTE_INLINE_continue)              #  make call; will return after
8763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        gp, STACK_OFFSET_GP(sp)      #  restore gp
8764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # test boolean result of inline
8765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  returned false, handle exception
8766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
8767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8771a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_EXECUTE_INLINE_RANGE: /* 0xef */
8773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_EXECUTE_INLINE_RANGE.S */
8774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Execute a "native inline" instruction, using "/range" semantics.
8776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Same idea as execute-inline, but we get the args differently.
8777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * We need to call an InlineOp4Func:
8779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  bool (func)(u4 arg0, u4 arg1, u4 arg2, u4 arg3, JValue* pResult)
8780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * The first four args are in a0-a3, pointer to return value storage
8782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * is on the stack.  The function's return value is a flag that tells
8783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * us if an exception was thrown.
8784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* [opt] execute-inline/range {vCCCC..v(CCCC+AA-1)}, inline@BBBB */
8786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu       a2, offThread_subMode(rSELF)
8787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(rBIX, 1)                       # rBIX<- BBBB
8788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                          # can throw
8789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a2, kSubModeDebugProfile   # Any going on?
8790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a2, .LOP_EXECUTE_INLINE_RANGE_debugmode  # yes - take slow path
8791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_EXECUTE_INLINE_RANGE_resume:
8792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a1, rSELF, offThread_retval # a1<- &self->retval
8793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA(a0)
8794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        a1, STACK_OFFSET_ARG04(sp)  # push &self->retval
8795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    BAL(.LOP_EXECUTE_INLINE_RANGE_continue)             # make call; will return after
8796a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        gp, STACK_OFFSET_GP(sp)     #  restore gp
8797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown  # returned false, handle exception
8798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(3)                 # advance rPC, load rINST
8799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                   # extract opcode from rINST
8800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                       # jump to next instruction
8801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_OBJECT_INIT_RANGE: /* 0xf0 */
8806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_OBJECT_INIT_RANGE.S */
8807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Invoke Object.<init> on an object.  In practice we know that
8809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Object's nullary constructor doesn't do anything, so we just
8810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * skip it unless a debugger is active.
8811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 2)                  # a1<- CCCC
8813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a1)                    # a0<- "this" ptr
8814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check for NULL
8815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz    a0, common_errNullObject    # export PC and throw NPE
8816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a1, a0)   # a1<- obj->clazz
8817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_accessFlags(a2, a1) # a2<- clazz->accessFlags
8818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and     a2, CLASS_ISFINALIZABLE     # is this class finalizable?
8819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz    a2, .LOP_INVOKE_OBJECT_INIT_RANGE_finish      # no, go
8820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8821a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INVOKE_OBJECT_INIT_RANGE_setFinal:
8822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                         # can throw
8823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmSetFinalizable)              # call dvmSetFinalizable(obj)
8824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_offThread_exception(a0, rSELF)	# a0<- self->exception
8825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # exception pending?
8826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez    a0, common_exceptionThrown  # yes, handle it
8827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.LOP_INVOKE_OBJECT_INIT_RANGE_finish:
8829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lhu     a1, offThread_subMode(rSELF)
8830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and     a1, kSubModeDebuggerActive  # debugger active?
8831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez    a1, .LOP_INVOKE_OBJECT_INIT_RANGE_debugger    # Yes - skip optimization
8832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2+1)       # advance to next instr, load rINST
8833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                 # t0<- opcode from rINST
8834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                     # execute it
8835a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_RETURN_VOID_BARRIER: /* 0xf1 */
8840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_RETURN_VOID_BARRIER.S */
8841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SMP_DMB
8842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_returnFromMethod
8843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_QUICK: /* 0xf2 */
8847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_QUICK.S */
8848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* For: iget-quick, iget-object-quick */
8849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, offset                    /* CCCC */
8850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
8851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a2)                       #  a3 <- object we're operating on
8852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field byte offset
8853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A(+)
8854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check object for null
8855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a3, common_errNullObject     #  object was null
8856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t0, a3, a1 #
8857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, 0(t0)                    #  a0 <- obj.field (always 32 bits)
8858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8860a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(a0, a2)                       #  fp[A] <- a0
8861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_WIDE_QUICK: /* 0xf3 */
8867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_WIDE_QUICK.S */
8868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # iget-wide-quick vA, vB, offset       /* CCCC */
8869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
8870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a2)                       #  a3 <- object we're operating on
8871a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field byte offset
8872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A(+)
8873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check object for null
8874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a3, common_errNullObject     #  object was null
8875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t0, a3, a1                   #  t0 <- a3 + a1
8876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, t0)                     #  a0 <- obj.field (64 bits, aligned)
8877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a2)
8879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a3)                    #  fp[A] <- a0/a1
8881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IGET_OBJECT_QUICK: /* 0xf4 */
8887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_OBJECT_QUICK.S */
8888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IGET_QUICK.S */
8889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* For: iget-quick, iget-object-quick */
8890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, offset                    /* CCCC */
8891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
8892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a2)                       #  a3 <- object we're operating on
8893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field byte offset
8894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A(+)
8895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check object for null
8896a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a3, common_errNullObject     #  object was null
8897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t0, a3, a1 #
8898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a0, 0(t0)                    #  a0 <- obj.field (always 32 bits)
8899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    SET_VREG(a0, a2)                       #  fp[A] <- a0
8902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_QUICK: /* 0xf5 */
8909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_QUICK.S */
8910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* For: iput-quick, iput-object-quick */
8911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, offset                    /* CCCC */
8912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
8913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a2)                       #  a3 <- fp[B], the object pointer
8914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field byte offset
8915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A(+)
8916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a3, common_errNullObject     #  object was null
8917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- fp[A]
8918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t0, a3, a1
8920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        a0, 0(t0)                    #  obj.field (always 32 bits) <- a0
8921a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_WIDE_QUICK: /* 0xf6 */
8928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_WIDE_QUICK.S */
8929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # iput-wide-quick vA, vB, offset       /* CCCC */
8930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a0)                           #  a0 <- A(+)
8931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a1)                            #  a1 <- B
8932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a2, a1)                       #  a2 <- fp[B], the object pointer
8933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(a3, rFP, a0)                      #  a3 <- &fp[A]
8934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD64(a0, a1, a3)                     #  a0/a1 <- fp[A]
8935a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # check object for null
8936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a2, common_errNullObject     #  object was null
8937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 1)                           #  a3 <- field byte offset
8938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      a2, a2, a3                   #  obj.field (64 bits, aligned) <- a0/a1
8940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    STORE64(a0, a1, a2)                    #  obj.field (64 bits, aligned) <- a0/a1
8941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8946a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_OBJECT_QUICK: /* 0xf7 */
8948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_OBJECT_QUICK.S */
8949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* For: iput-object-quick */
8950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, offset                    /* CCCC */
8951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a2)                            #  a2 <- B
8952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a3, a2)                       #  a3 <- fp[B], the object pointer
8953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field byte offset
8954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPA4(a2)                           #  a2 <- A(+)
8955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a3, common_errNullObject     #  object was null
8956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(a0, a2)                       #  a0 <- fp[A]
8957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
8958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t0, a3, a1
8959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sw        a0, 0(t0)                    #  obj.field (always 32 bits) <- a0
8960a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      a0, 1f
8961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
8962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    srl       t1, a3, GC_CARD_SHIFT
8963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    addu      t2, a2, t1
8964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    sb        a2, 0(t2)
8965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
8966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
8967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(t0)                        #  jump to next instruction
8968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_VIRTUAL_QUICK: /* 0xf8 */
8972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_VIRTUAL_QUICK.S */
8973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
8974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle an optimized virtual method call.
8975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
8976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: [opt] invoke-virtual-quick, invoke-virtual-quick/range
8977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
8978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
8979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
8980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 2)                           #  a3 <- FEDC or CCCC
8981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
8982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!0)
8983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a3, a3, 15                   #  a3 <- C (or stays CCCC)
8984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
8985a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a3)                     #  rOBJ <- vC ("this" ptr)
8986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is "this" null?
8987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  null "this", throw exception
8988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a2, rOBJ)    #  a2 <- thisPtr->clazz
8989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_vtable(a2, a2) #  a2 <- thisPtr->clazz->vtable
8990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  invoke must export
8991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- vtable[BBBB]
8992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_invokeMethodNoRange #  (a0=method, r9="this")
8993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
8994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
8995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
8996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_VIRTUAL_QUICK_RANGE: /* 0xf9 */
8997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_VIRTUAL_QUICK_RANGE.S */
8998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_VIRTUAL_QUICK.S */
8999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle an optimized virtual method call.
9001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: [opt] invoke-virtual-quick, invoke-virtual-quick/range
9003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
9005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
9006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a3, 2)                           #  a3 <- FEDC or CCCC
9007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
9008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!1)
9009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       a3, a3, 15                   #  a3 <- C (or stays CCCC)
9010a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
9011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a3)                     #  rOBJ <- vC ("this" ptr)
9012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is "this" null?
9013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  null "this", throw exception
9014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a2, rOBJ)    #  a2 <- thisPtr->clazz
9015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_vtable(a2, a2) #  a2 <- thisPtr->clazz->vtable
9016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  invoke must export
9017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- vtable[BBBB]
9018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_invokeMethodRange #  (a0=method, r9="this")
9019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
9022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
9023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_SUPER_QUICK: /* 0xfa */
9024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_SUPER_QUICK.S */
9025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle an optimized "super" method call.
9027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: [opt] invoke-super-quick, invoke-super-quick/range
9029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
9031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
9032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(t0, 2)                           #  t0 <- GFED or CCCC
9033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
9034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!0)
9035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       t0, t0, 15                   #  t0 <- D (or stays CCCC)
9036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
9037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
9038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a2, a2)      #  a2 <- method->clazz
9039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
9040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_super(a2, a2) #  a2 <- method->clazz->super
9041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, t0)                     #  rOBJ <- "this"
9042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_vtable(a2, a2) #  a2 <- ...clazz->super->vtable
9043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is "this" null ?
9044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- super->vtable[BBBB]
9045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  "this" is null, throw exception
9046a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_invokeMethodNoRange #  (a0=method, rOBJ="this")
9047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
9050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
9051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_INVOKE_SUPER_QUICK_RANGE: /* 0xfb */
9052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_SUPER_QUICK_RANGE.S */
9053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_INVOKE_SUPER_QUICK.S */
9054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Handle an optimized "super" method call.
9056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: [opt] invoke-super-quick, invoke-super-quick/range
9058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vB, {vD, vE, vF, vG, vA}, class   /* CCCC */
9060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, {vCCCC..v(CCCC+AA-1)}, meth  /* BBBB */
9061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(t0, 2)                           #  t0 <- GFED or CCCC
9062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
9063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if (!1)
9064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    and       t0, t0, 15                   #  t0 <- D (or stays CCCC)
9065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
9066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- BBBB
9067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a2, a2)      #  a2 <- method->clazz
9068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  must export for invoke
9069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_super(a2, a2) #  a2 <- method->clazz->super
9070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, t0)                     #  rOBJ <- "this"
9071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offClassObject_vtable(a2, a2) #  a2 <- ...clazz->super->vtable
9072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is "this" null ?
9073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- super->vtable[BBBB]
9074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      rOBJ, common_errNullObject   #  "this" is null, throw exception
9075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_invokeMethodRange #  (a0=method, rOBJ="this")
9076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
9080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
9081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_IPUT_OBJECT_VOLATILE: /* 0xfc */
9082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_OBJECT_VOLATILE.S */
9083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_IPUT_OBJECT.S */
9084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * 32-bit instance field put.
9086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: iput-object, iput-object-volatile
9088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vA, vB, field                     /* CCCC */
9090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_OPB(a0)                            #  a0 <- B
9091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a3)          #  a3 <- DvmDex
9092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref CCCC
9093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(a2, a3) #  a2 <- pDvmDex->pResFields
9094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_VREG(rOBJ, a0)                     #  rOBJ <- fp[B], the object pointer
9095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, a2, a1)                  #  a0 <- resolved InstField ptr
9096a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry null?
9097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_IPUT_OBJECT_VOLATILE_finish       #  no, already resolved
9098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
9099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw
9100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
9101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveInstField)               #  v0 <- resolved InstField ptr
9102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
9103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
9104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      v0, .LOP_IPUT_OBJECT_VOLATILE_finish       #  yes, finish up
9105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown
9106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
9109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
9110a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SGET_OBJECT_VOLATILE: /* 0xfd */
9111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET_OBJECT_VOLATILE.S */
9112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SGET.S */
9113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SGET handler.
9115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
9117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # op vAA, field                        /* BBBB */
9119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
9120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
9121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
9122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
9123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # is resolved entry !null?
9124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SGET_OBJECT_VOLATILE_finish
9125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
9128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  a1:  BBBB field ref
9129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
9130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
9132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
9133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
9134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
9135a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() could throw, so export now
9136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
9137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
9138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
9139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # success?
9140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  no, handle exception
9141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
9142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
9144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
9145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9146a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
9147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
9148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b        .LOP_SGET_OBJECT_VOLATILE_finish            # resume
9149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
9152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
9153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham.L_OP_SPUT_OBJECT_VOLATILE: /* 0xfe */
9154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_OBJECT_VOLATILE.S */
9155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/OP_SPUT_OBJECT.S */
9156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * General 32-bit SPUT handler.
9158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * for: sput-object, sput-object-volatile
9160a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* op vAA, field@BBBB */
9162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
9163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    FETCH(a1, 1)                           #  a1 <- field ref BBBB
9164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
9165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
9166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez      a0, .LOP_SPUT_OBJECT_VOLATILE_finish       #  is resolved entry null?
9167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /* Continuation if the field has not yet been resolved.
9169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * a1:  BBBB field ref
9170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * rBIX: dvmDex->pResFields
9171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
9173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
9174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
9175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
9176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()                            #  resolve() may throw, so export now
9177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
9178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
9179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
9180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    beqz      v0, common_exceptionThrown   #  success? no, handle exception
9181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
9182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
9184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
9185a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
9187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
9188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b       .LOP_SPUT_OBJECT_VOLATILE_finish             # resume
9189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
9193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
9194ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_OP_UNUSED_FF: /* 0xff */
9195ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* File: mips/OP_UNUSED_FF.S */
9196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* File: mips/unused.S */
9197ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    BAL(common_abort)
9198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9201ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .balign 128
9202ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .size   dvmAsmInstructionStart, .-dvmAsmInstructionStart
9203ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmAsmInstructionEnd
9204ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmAsmInstructionEnd:
9205ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9206ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
9207ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * ===========================================================================
9208ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *  Sister implementations
9209ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * ===========================================================================
9210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
9211ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmAsmSisterStart
9212ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .type   dvmAsmSisterStart, %function
9213ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .text
9214ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .balign 4
9215ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmAsmSisterStart:
9216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9217ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_CHECK_CAST */
9218ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9219ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_CHECK_CAST_castfailure:
9220ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # A cast has failed. We need to throw a ClassCastException with the
9221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # class of the object that failed to be cast.
9222ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  about to throw
9223ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a0, rOBJ)    #  a0 <- obj->clazz
9224ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1,rBIX                      #  r1<- desired class
9225ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowClassCastException)
9226ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown
9227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9229ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Resolution required.  This is the least-likely path.
9230ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
9231ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a2   holds BBBB
9232ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9234ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_CHECK_CAST_resolve:
9235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  resolve() could throw
9236ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_rSELF_method(a3)                  #  a3 <- self->method
9237ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, a2                       #  a1 <- BBBB
9238ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, 0                        #  a2 <- false
9239ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
9240ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveClass)                   #  v0 <- resolved ClassObject ptr
9241ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # got null?
9242ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  yes, handle exception
9243ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, v0                       #  a1 <- class resolved from BBB
9244ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a0, rOBJ)    #  a0 <- obj->clazz
9245ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_CHECK_CAST_resolved         #  pick up where we left off
9246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9247ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INSTANCE_OF */
9248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Trivial test failed, need to perform full check.  This is common.
9251ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0   holds obj->clazz
9252ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a1   holds class resolved from BBBB
9253ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds A
9254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9255ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INSTANCE_OF_fullcheck:
9256ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmInstanceofNonTrivial)           #  v0 <- boolean result
9257ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0                       #  fall through to OP_INSTANCE_OF_store
9258ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_INSTANCE_OF_store
9259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9261ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Resolution required.  This is the least-likely path.
9262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9263ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a3   holds BBBB
9264ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds A
9265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9266ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INSTANCE_OF_resolve:
9267ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  resolve() could throw
9268ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_rSELF_method(a0)                  #  a0 <- self->method
9269ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, a3                       #  a1 <- BBBB
9270ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, 1                        #  a2 <- true
9271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_clazz(a0, a0)      #  a0 <- method->clazz
9272ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveClass)                   #  v0 <- resolved ClassObject ptr
9273ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # got null?
9274ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, v0                       #  a1 <- class resolved from BBB
9275ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  yes, handle exception
9276ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPB(a3)                            #  a3 <- B
9277ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a3)                       #  a0 <- vB (object)
9278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offObject_clazz(a0, a0)      #  a0 <- obj->clazz
9279ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_INSTANCE_OF_resolved         #  pick up where we left off
9280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9282ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_NEW_INSTANCE */
9283ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9284ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_NEW_INSTANCE_continue:
9285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9286ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9287ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(v0, a3)                       #  vAA <- v0
9288ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
9291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9292ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Check to see if we need to stop the trace building early.
9293ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * v0: new object
9294ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * a3: vAA
9295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_NEW_INSTANCE_jitCheck:
9297ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, 0(rBIX)                  #  reload resolved class
9298ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # okay?
9299ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a1, .LOP_NEW_INSTANCE_continue     #  yes, finish
9300ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rOBJ, v0                     #  preserve new object
9301ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a3                     #  preserve vAA
9302ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
9303ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC
9304ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitEndTraceSelect)              #  (self, pc)
9305ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9306ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9307ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(rOBJ, rBIX)                   #  vAA <- new object
9308ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
9310a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9312ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Class initialization required.
9313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9314ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds class object
9315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9316ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_NEW_INSTANCE_needinit:
9317ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmInitClass)                      #  initialize class
9318ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rOBJ                     #  restore a0
9319ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check boolean result
9320ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      v0, .LOP_NEW_INSTANCE_initialized  #  success, continue
9321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown       #  failed, deal with init exception
9322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9325ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Resolution required.  This is the least-likely path.
9326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9327ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a1 holds BBBB
9328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9329ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_NEW_INSTANCE_resolve:
9330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a3)                  #  a3 <- self->method
9331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    li        a2, 0                        #  a2 <- false
9332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
9333ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveClass)                   #  v0 <- resolved ClassObject ptr
9334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
9335a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
9336ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      v0, .LOP_NEW_INSTANCE_resolved     #  no, continue
9337ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown       #  yes, handle exception
9338ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9339ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_NEW_ARRAY */
9340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9342ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Resolve class.  (This is an uncommon case.)
9343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *
9344ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a1 holds array length
9345ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a2 holds class ref CCCC
9346a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9347ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_NEW_ARRAY_resolve:
9348ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_rSELF_method(a3)                  #  a3 <- self->method
9349ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rOBJ, a1                     #  rOBJ <- length (save)
9350ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, a2                       #  a1 <- CCCC
9351ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, 0                        #  a2 <- false
9352ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
9353ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveClass)                   #  v0 <- call(clazz, ref)
9354ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rOBJ                     #  a1 <- length (restore)
9355ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # got null?
9356ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  yes, handle exception
9357ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
9358ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_NEW_ARRAY_finish           #  continue with OP_NEW_ARRAY_finish
9359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9360a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9362ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_FILLED_NEW_ARRAY */
9363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9365ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * On entry:
9366ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds array class
9367ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds AA or BA
9368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9369ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_FILLED_NEW_ARRAY_continue:
9370ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_descriptor(a3, a0) #  a3 <- arrayClass->descriptor
9371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, ALLOC_DONT_TRACK         #  a2 <- alloc flags
9372ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lbu       rINST, 1(a3)                 #  rINST <- descriptor[1]
9373ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 0
9374ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rOBJ                     #  a1 <- AA (length)
9375ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
9376ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       a1, rOBJ, 4                  #  rOBJ <- B (length)
9377ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
9378ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t0, rINST, 'I'               #  array of ints?
9379ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t1, rINST, 'L'               #  array of objects?
9380ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    or        t0, t1
9381ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t1, rINST, '['               #  array of arrays?
9382ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    or        t0, t1
9383ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a1                     #  save length in rBIX
9384ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      t0, .LOP_FILLED_NEW_ARRAY_notimpl      #  no, not handled yet
9385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmAllocArrayByClass)              #  v0 <- call(arClass, length, flags)
9386ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # null return?
9387ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  alloc failed, handle exception
9388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9389ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH(a1, 2)                           #  a1 <- FEDC or CCCC
9390ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        v0, offThread_retval(rSELF)  #  retval.l <- new array
9391ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rINST, (offThread_retval+4)(rSELF) #  retval.h <- type
9392ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a0, v0, offArrayObject_contents #  a0 <- newArray->contents
9393ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, rBIX, 1                #  length--, check for neg
9394ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(3)                  #  advance to next instr, load rINST
9395ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bltz      rBIX, 2f                     #  was zero, bail
9396a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9397ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # copy values from registers into the array
9398ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=array, a1=CCCC/FEDC, t0=length (from AA or B), rOBJ=AA/BA
9399ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, rBIX
9400ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 0
9401ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a2, rFP, a1)                      #  a2 <- &fp[CCCC]
9402ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
9403ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, 0(a2)                    #  a3 <- *a2++
9404ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a2, 4
9405ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, t0, 1                    #  count--
9406ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, (a0)                     #  *contents++ = vX
9407ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a0, 4
9408ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, 1b
9409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # continue at 2
9411ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
9412ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    slt       t1, t0, 4                    #  length was initially 5?
9413ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       a2, rOBJ, 15                 #  a2 <- A
9414ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t1, 1f                       #  <= 4 args, branch
9415ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a3, a2)                       #  a3 <- vA
9416ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, t0, 1                    #  count--
9417ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 16(a0)                   #  contents[4] = vA
9418ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
9419ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       a2, a1, 15                   #  a2 <- F/E/D/C
9420ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a3, a2)                       #  a3 <- vF/vE/vD/vC
9421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       a1, a1, 4                    #  a1 <- next reg in low 4
9422ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, t0, 1                    #  count--
9423ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(a0)                    #  *contents++ = vX
9424ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a0, a0, 4
9425ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, 1b
9426ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # continue at 2
9427ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
9428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9429ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
9430ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_retval(rSELF)  #  a0 <- object
9431ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, (offThread_retval+4)(rSELF) #  a1 <- type
9432ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t1, a1, 'I'                  #  Is int array?
9433ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t1, 3f
9434ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
9435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t3, a0, GC_CARD_SHIFT
9436ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, a2, t3
9437ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t2)
9438ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
9439ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  ip <- opcode from rINST
9440ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  execute it
9441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9444ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Throw an exception indicating that we have not implemented this
9445ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * mode of filled-new-array.
9446a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9447ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_FILLED_NEW_ARRAY_notimpl:
9448ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrFilledNewArrayNotImpl
9449ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowInternalError)
9450ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown
9451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9453ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Ideally we'd only define this once, but depending on layout we can
9454ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * exceed the range of the load above.
9455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9457ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_FILLED_NEW_ARRAY_RANGE */
9458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * On entry:
9461ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds array class
9462ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds AA or BA
9463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9464ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_FILLED_NEW_ARRAY_RANGE_continue:
9465ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_descriptor(a3, a0) #  a3 <- arrayClass->descriptor
9466ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, ALLOC_DONT_TRACK         #  a2 <- alloc flags
9467ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lbu       rINST, 1(a3)                 #  rINST <- descriptor[1]
9468ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 1
9469ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rOBJ                     #  a1 <- AA (length)
9470ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
9471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       a1, rOBJ, 4                  #  rOBJ <- B (length)
9472ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
9473ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t0, rINST, 'I'               #  array of ints?
9474ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t1, rINST, 'L'               #  array of objects?
9475ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    or        t0, t1
9476ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t1, rINST, '['               #  array of arrays?
9477ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    or        t0, t1
9478ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a1                     #  save length in rBIX
9479ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      t0, .LOP_FILLED_NEW_ARRAY_RANGE_notimpl      #  no, not handled yet
9480ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmAllocArrayByClass)              #  v0 <- call(arClass, length, flags)
9481ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # null return?
9482ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  alloc failed, handle exception
9483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9484ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH(a1, 2)                           #  a1 <- FEDC or CCCC
9485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        v0, offThread_retval(rSELF)  #  retval.l <- new array
9486ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rINST, (offThread_retval+4)(rSELF) #  retval.h <- type
9487ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a0, v0, offArrayObject_contents #  a0 <- newArray->contents
9488ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, rBIX, 1                #  length--, check for neg
9489ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(3)                  #  advance to next instr, load rINST
9490ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bltz      rBIX, 2f                     #  was zero, bail
9491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9492ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # copy values from registers into the array
9493ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=array, a1=CCCC/FEDC, t0=length (from AA or B), rOBJ=AA/BA
9494ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, rBIX
9495ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 1
9496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a2, rFP, a1)                      #  a2 <- &fp[CCCC]
9497ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
9498ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, 0(a2)                    #  a3 <- *a2++
9499ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a2, 4
9500ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, t0, 1                    #  count--
9501ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, (a0)                     #  *contents++ = vX
9502ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a0, 4
9503ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, 1b
9504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9505ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # continue at 2
9506ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
9507ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    slt       t1, t0, 4                    #  length was initially 5?
9508ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       a2, rOBJ, 15                 #  a2 <- A
9509ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t1, 1f                       #  <= 4 args, branch
9510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a3, a2)                       #  a3 <- vA
9511ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, t0, 1                    #  count--
9512ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 16(a0)                   #  contents[4] = vA
9513ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
9514ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       a2, a1, 15                   #  a2 <- F/E/D/C
9515ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a3, a2)                       #  a3 <- vF/vE/vD/vC
9516ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       a1, a1, 4                    #  a1 <- next reg in low 4
9517ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, t0, 1                    #  count--
9518ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(a0)                    #  *contents++ = vX
9519ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a0, a0, 4
9520ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, 1b
9521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # continue at 2
9522ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
9523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9524ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
9525ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_retval(rSELF)  #  a0 <- object
9526ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, (offThread_retval+4)(rSELF) #  a1 <- type
9527ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    seq       t1, a1, 'I'                  #  Is int array?
9528ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t1, 3f
9529ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
9530ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t3, a0, GC_CARD_SHIFT
9531ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, a2, t3
9532ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t2)
9533ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
9534ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  ip <- opcode from rINST
9535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  execute it
9536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9539ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Throw an exception indicating that we have not implemented this
9540ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * mode of filled-new-array.
9541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9542ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
9543ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrFilledNewArrayNotImpl
9544ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowInternalError)
9545ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown
9546a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9548ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Ideally we'd only define this once, but depending on layout we can
9549ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * exceed the range of the load above.
9550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9552ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_CMPL_FLOAT */
9553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9554ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPL_FLOAT_nan:
9555ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li rTEMP, -1
9556ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         OP_CMPL_FLOAT_finish
9557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9558ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
9559ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPL_FLOAT_continue:
9560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gtsf2)                           #  v0 <- (vBB > vCC)
9561ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rTEMP, 1                     #  rTEMP = 1 if v0 != 0
9562ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgtz      v0, OP_CMPL_FLOAT_finish
9563ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         OP_CMPL_FLOAT_nan
9564ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
9565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9566ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPL_FLOAT_finish:
9567ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(t0)
9568ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9569ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(rTEMP, t0)                    #  vAA <- rTEMP
9570ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
9572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9573ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_CMPG_FLOAT */
9574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9575ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPG_FLOAT_nan:
9576ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li rTEMP, 1
9577ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         OP_CMPG_FLOAT_finish
9578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9579ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
9580ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPG_FLOAT_continue:
9581ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gtsf2)                           #  v0 <- (vBB > vCC)
9582ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rTEMP, 1                     #  rTEMP = 1 if v0 != 0
9583ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgtz      v0, OP_CMPG_FLOAT_finish
9584ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         OP_CMPG_FLOAT_nan
9585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
9586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9587ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPG_FLOAT_finish:
9588ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(t0)
9589ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9590ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(rTEMP, t0)                    #  vAA <- rTEMP
9591ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9592ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
9593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9594ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_CMPL_DOUBLE */
9595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPL_DOUBLE_nan:
9597ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li rTEMP, -1
9598ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         OP_CMPL_DOUBLE_finish
9599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9600ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
9601ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPL_DOUBLE_continue:
9602ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rARG2, rARG3, rBIX)             #  a2/a3 <- vCC/vCC+1
9603ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gtdf2)                           #  fallthru
9604ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rTEMP, 1                     #  rTEMP = 1 if v0 != 0
9605ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    blez      v0, OP_CMPL_DOUBLE_nan            #  fall thru for finish
9606ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
9607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9608ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPL_DOUBLE_finish:
9609ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(rOBJ)
9610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9611ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9612ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(rTEMP, rOBJ, t0)         #  vAA <- rTEMP
9613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9614ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_CMPG_DOUBLE */
9615ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9616ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPG_DOUBLE_nan:
9617ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li rTEMP, 1
9618ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         OP_CMPG_DOUBLE_finish
9619ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9620ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
9621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPG_DOUBLE_continue:
9622ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rARG2, rARG3, rBIX)             #  a2/a3 <- vCC/vCC+1
9623ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gtdf2)                           #  fallthru
9624ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rTEMP, 1                     #  rTEMP = 1 if v0 != 0
9625ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    blez      v0, OP_CMPG_DOUBLE_nan            #  fall thru for finish
9626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
9627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9628ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesOP_CMPG_DOUBLE_finish:
9629ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(rOBJ)
9630ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9631ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9632ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(rTEMP, rOBJ, t0)         #  vAA <- rTEMP
9633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9634ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_APUT_OBJECT */
9635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_APUT_OBJECT_checks:
9636ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a0, rBIX)    #  a0 <- obj->clazz
9637ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a1, rINST)   #  a1 <- arrayObj->clazz
9638ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmCanPutArrayElement)             #  test object type vs. array type
9639ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, .LOP_APUT_OBJECT_throw        #  okay ?
9640ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF)
9641ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t1, rINST, GC_CARD_SHIFT
9642ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, a2, t1
9643ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t2)
9644ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_APUT_OBJECT_finish           #  yes, skip type checks
9645ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_APUT_OBJECT_throw:
9646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a0, rBIX)    #  a0 <- obj->clazz
9647ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a1, rINST)   #  a1 <- arrayObj->clazz
9648ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
9649ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowArrayStoreExceptionIncompatibleElement)
9650ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown
9651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9652ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET */
9653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9655ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9656ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
9657ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
9658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9659ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_finish:
9660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9661ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9662ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9663ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9664ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
9665ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
9666ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes         # noop                               #  acquiring load
9667ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9668ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9669ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9670ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
9671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9672ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9673ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9674ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_WIDE */
9675ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9677ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9678ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0   holds resolved field
9679ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9681ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_WIDE_finish:
9682ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9683ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9684ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
9686ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 0
9687ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    vLOAD64(a0, a1, rOBJ)                  #  a0/a1 <- obj.field (64-bit align ok)
9688ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
9689ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(a0, a1, rOBJ)                   #  a0/a1 <- obj.field (64-bit align ok)
9690ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
9691ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9692ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a3, rFP, a2)                      #  a3 <- &fp[A]
9693ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9694ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(a0, a1, a3)                    #  fp[A] <- a0/a1
9695ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9698ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_OBJECT */
9699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9701ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9702ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
9703ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
9704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9705ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_OBJECT_finish:
9706ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9707ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9708ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9709ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
9711ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
9712ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes         # noop                               #  acquiring load
9713ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9714ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9715ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9716ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
9717ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9720ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_BOOLEAN */
9721a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9723ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9724ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
9725ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
9726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9727ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_BOOLEAN_finish:
9728ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9729ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9730ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9731ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9732ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
9733ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
9734ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes         # noop                               #  acquiring load
9735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9736ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9737ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9738ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
9739ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9742ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_BYTE */
9743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9745ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
9747ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
9748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9749ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_BYTE_finish:
9750ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9751ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9752ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9753ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9754ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
9755ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
9756ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes         # noop                               #  acquiring load
9757ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9758ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9759ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
9761ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9764ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_CHAR */
9765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9767ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9768ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
9769ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
9770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_CHAR_finish:
9772ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9773ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9774ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9775ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9776ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
9777ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
9778ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes         # noop                               #  acquiring load
9779ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9780ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9781ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9782ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
9783ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9785a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9786ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_SHORT */
9787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9789ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9790ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
9791ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
9792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9793ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_SHORT_finish:
9794ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9795ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9797ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9798ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
9799ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
9800ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes         # noop                               #  acquiring load
9801ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9802ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9803ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9804ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
9805ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9806ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9807ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9808ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT */
9809ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9810a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9811ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9812ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
9813ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9815ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_finish:
9816ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9817ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
9818ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9819ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
9820ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9822ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9823ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9824ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
9825ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop                            #  releasing store
9826ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
9827ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop
9828ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9829ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9830ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9831ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_WIDE */
9832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9834ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0   holds resolved field
9836ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9838ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_WIDE_finish:
9839ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
9840ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9841ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a2, rFP, a2)                      #  a2 <- &fp[A]
9842ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9843ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9844ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9845ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(a0, a1, a2)                     #  a0/a1 <- fp[A]
9846a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GET_INST_OPCODE(rBIX)                  #  extract opcode from rINST
9847ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a2, rOBJ, a3                 #  form address
9848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .if 0
9849ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmQuasiAtomicSwap64Sync)          # stores r0/r1 into addr r2
9850ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#    STORE64(a0, a1, a2)                    #  obj.field (64 bits, aligned) <- a0 a1
9851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .else
9852ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(a0, a1, a2)                    #  obj.field (64 bits, aligned) <- a0 a1
9853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .endif
9854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    GOTO_OPCODE(rBIX)                      #  jump to next instruction
9855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9856ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9857ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_OBJECT */
9858ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9861ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
9862ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9864ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_OBJECT_finish:
9865ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9866ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
9867ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9868ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
9869ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
9870ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9872ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9873ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9874ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, rOBJ, a3                 #  form address
9875ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop                            #  releasing store
9876ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (t2)                        #  obj.field (32 bits) <- a0
9877ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop
9878ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, 1f                       #  stored a null reference?
9879ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t1, rOBJ, GC_CARD_SHIFT
9880ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, a2, t1
9881ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t2)                     #  mark card if not
9882ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
9883ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9885a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9886ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_BOOLEAN */
9887ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9889ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9890ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
9891ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9893ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_BOOLEAN_finish:
9894ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9895ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
9896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9897ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
9898ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9899ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9900ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9901ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9902ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
9903ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop                            #  releasing store
9904ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
9905ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop
9906ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9909ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_BYTE */
9910a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9912ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9913ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
9914ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9916ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_BYTE_finish:
9917ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9918ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
9919ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9920ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
9921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9922ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9923ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9924ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9925ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
9926ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop                            #  releasing store
9927ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
9928ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop
9929ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9930ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9931ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9932ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_CHAR */
9933ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9936ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
9937ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9939ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_CHAR_finish:
9940ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9941ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
9942ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9943ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
9944ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9945ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9947ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9948ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
9949ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop                            #  releasing store
9950ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
9951ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop
9952ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
9955ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_SHORT */
9956ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
9958ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
9959ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
9960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
9961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
9962ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_SHORT_finish:
9963ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
9964ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
9965ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
9966ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
9967ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
9968ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
9969ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9970ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
9972ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop                            #  releasing store
9973ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
9974ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes        #  noop
9975ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
9976ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9977ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9978ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET */
9979ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9980ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_finish:
9981ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
9982ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                      #  no-op                                #  acquiring load
9983ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
9984ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
9986ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
9987ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9988ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_WIDE */
9989ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
9990ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_WIDE_finish:
9991ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a1)                            #  a1 <- AA
9992ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 0
9993ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    vLOAD64_off(a2, a3, a0, offStaticField_value) #  a2/a3 <- field value (aligned)
9994ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
9995ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64_off(a2, a3, a0, offStaticField_value) #  a2/a3 <- field value (aligned)
9996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
9997ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
9998ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a1, rFP, a1)                      #  a1 <- &fp[AA]
9999ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(a2, a3, a1)                    #  vAA/vAA+1 <- a2/a3
10000ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10001ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10002ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10003ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10004ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10005ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_OBJECT */
10006ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10007ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_OBJECT_finish:
10008ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10009ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                      #  no-op                                #  acquiring load
10010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10011ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10012ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10013ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10014ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10015ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_BOOLEAN */
10016ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10017ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_BOOLEAN_finish:
10018ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10019ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                      #  no-op                                #  acquiring load
10020ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10022ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10023ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10024ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10025ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_BYTE */
10026ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10027ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_BYTE_finish:
10028ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10029ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                      #  no-op                                #  acquiring load
10030ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10031ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10032ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10033ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10034ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_CHAR */
10036ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10037ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_CHAR_finish:
10038ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10039ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                      #  no-op                                #  acquiring load
10040ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10041ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10042ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10043ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10044ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10045ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_SHORT */
10046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10047ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_SHORT_finish:
10048ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10049ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                      #  no-op                                #  acquiring load
10050ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10051ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10052ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10053ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10054ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10055ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT */
10056ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10057ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_finish:
10058ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # field ptr in a0
10059ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10061ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10062ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10063ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op                            #  releasing store
10064ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10065ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op
10066ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10067ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10068ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_WIDE */
10069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10071a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * Continuation if the field has not yet been resolved.
10072ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a1:  BBBB field ref
10073ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ:  &fp[AA]
10074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     *  rBIX: dvmDex->pResFields
10075ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
10076ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Returns StaticField pointer in a2.
10077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10078ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_WIDE_resolve:
10079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a2)                  #  a2 <- current method
10080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
10081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
10082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
10083ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  resolve() could throw, so export now
10084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
10085a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
10086ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # success ?
10087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
10088ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  no, handle exception
10089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
10090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * If the JIT is actively building a trace we need to make sure
10092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     * that the field is fully resolved before including this instruction.
10093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(common_verifyField)
10095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
10096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a2, v0
10097ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_SPUT_WIDE_finish           # resume
10098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10099ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_OBJECT */
10100ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_OBJECT_finish:                        #  field ptr in a0
10101ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10102ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10103ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10104ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
10105ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        t1, offField_clazz(a0)       #  t1 <- field->clazz
10106ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10107ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op                            #  releasing store
10108ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10109ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op
10110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a1, 1f
10111ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t2, t1, GC_CARD_SHIFT
10112ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t3, a2, t2
10113ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t3)
10114ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
10115ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10116ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10117ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_BOOLEAN */
10118ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10119ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_BOOLEAN_finish:
10120ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # field ptr in a0
10121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10122ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10123ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10124ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10125ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op                            #  releasing store
10126ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10127ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op
10128ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10129ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10130ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_BYTE */
10131ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10132ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_BYTE_finish:
10133ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # field ptr in a0
10134ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10136ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10137ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10138ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op                            #  releasing store
10139ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10140ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op
10141ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10142ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10143ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_CHAR */
10144ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10145ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_CHAR_finish:
10146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # field ptr in a0
10147ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10148ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10149ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10150ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10151ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op                            #  releasing store
10152ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10153ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op
10154ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10155ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10156ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_SHORT */
10157ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10158ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_SHORT_finish:
10159ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # field ptr in a0
10160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10161ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10162ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10163ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10164ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op                            #  releasing store
10165ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10166ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #  no-op
10167ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10168ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10169ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_VIRTUAL */
10170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10171a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10172ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * At this point:
10173ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = resolved base method
10174ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX= C or CCCC (index of first arg, which is the "this" ptr)
10175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10176ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_VIRTUAL_continue:
10177ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(rOBJ, rBIX)                   #  rOBJ <- "this" ptr
10178ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOADu2_offMethod_methodIndex(a2, a0)   #  a2 <- baseMethod->methodIndex
10179ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # is "this" null?
10180ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  null "this", throw exception
10181ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a3, rOBJ)    #  a3 <- thisPtr->clazz
10182ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_vtable(a3, a3) #  a3 <- thisPtr->clazz->vtable
10183ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_eas2(a0, a3, a2)                  #  a0 <- vtable[methodIndex]
10184ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_invokeMethodNoRange #  (a0=method, rOBJ="this")
10185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10186ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10187ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_SUPER */
10188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10190ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * At this point:
10191ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = resolved base method
10192ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX = method->clazz
10193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10194ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_SUPER_continue:
10195ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_super(a1, rBIX) #  a1 <- method->clazz->super
10196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOADu2_offMethod_methodIndex(a2, a0)   #  a2 <- baseMethod->methodIndex
10197ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_vtableCount(a3, a1) #  a3 <- super->vtableCount
10198ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  must export for invoke
10199ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # compare (methodIndex, vtableCount)
10200ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgeu      a2, a3, .LOP_INVOKE_SUPER_nsm      #  method not present in superclass
10201ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_vtable(a1, a1) #  a1 <- ...clazz->super->vtable
10202ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_eas2(a0, a1, a2)                  #  a0 <- vtable[methodIndex]
10203ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_invokeMethodNoRange #  continue on
10204ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10205ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10206ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Throw a NoSuchMethodError with the method name as the message.
10207ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = resolved base method
10208ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10209ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_SUPER_nsm:
10210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_name(a1, a0)       #  a1 <- method name
10211ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_errNoSuchMethod
10212ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10213ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10214ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_STATIC */
10215ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10216ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_STATIC_resolve:
10217ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_rSELF_method(a3)                  #  a3 <- self->method
10218ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
10219ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, METHOD_STATIC            #  resolver method type
10220ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
10221a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
10222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#if defined(WITH_JIT)
10223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10224ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Check to see if we're actively building a trace.  If so,
10225ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * we need to keep this instruction out of it.
10226ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * rBIX: &resolved_methodToCall
10227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10228ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       a2, offThread_subMode(rSELF)
10229ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  null, handle exception
10230ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       a2, kSubModeJitTraceBuild    #  trace under construction?
10231ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a2, common_invokeMethodNoRange #  no, (a0=method, rOBJ="this")
10232ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, 0(rBIX)                  #  reload resolved method
10233ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # finished resloving?
10234ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a1, common_invokeMethodNoRange #  yes, (a0=method, rOBJ="this")
10235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a0                     #  preserve method
10236ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
10237ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC
10238ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitEndTraceSelect)              #  (self, pc)
10239ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10240ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_invokeMethodNoRange #  whew, finally!
10241ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
10242ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # got null?
10243ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      v0, common_invokeMethodNoRange #  (a0=method, rOBJ="this")
10244ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown       #  yes, handle exception
10245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
10246a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10247ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_VIRTUAL_RANGE */
10248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10250ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * At this point:
10251ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = resolved base method
10252ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX= C or CCCC (index of first arg, which is the "this" ptr)
10253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10254ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_VIRTUAL_RANGE_continue:
10255ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(rOBJ, rBIX)                   #  rOBJ <- "this" ptr
10256ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOADu2_offMethod_methodIndex(a2, a0)   #  a2 <- baseMethod->methodIndex
10257ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # is "this" null?
10258ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  null "this", throw exception
10259ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offObject_clazz(a3, rOBJ)    #  a3 <- thisPtr->clazz
10260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_vtable(a3, a3) #  a3 <- thisPtr->clazz->vtable
10261ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_eas2(a0, a3, a2)                  #  a0 <- vtable[methodIndex]
10262ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_invokeMethodRange #  (a0=method, rOBJ="this")
10263ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10264ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10265ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_SUPER_RANGE */
10266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10268ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * At this point:
10269ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = resolved base method
10270ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX = method->clazz
10271a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10272ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_SUPER_RANGE_continue:
10273ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_super(a1, rBIX) #  a1 <- method->clazz->super
10274ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOADu2_offMethod_methodIndex(a2, a0)   #  a2 <- baseMethod->methodIndex
10275ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_vtableCount(a3, a1) #  a3 <- super->vtableCount
10276ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  must export for invoke
10277ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # compare (methodIndex, vtableCount)
10278ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgeu      a2, a3, .LOP_INVOKE_SUPER_RANGE_nsm      #  method not present in superclass
10279ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offClassObject_vtable(a1, a1) #  a1 <- ...clazz->super->vtable
10280ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_eas2(a0, a1, a2)                  #  a0 <- vtable[methodIndex]
10281ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_invokeMethodRange #  continue on
10282ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
10283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    /*
10284ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Throw a NoSuchMethodError with the method name as the message.
10285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = resolved base method
10286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham     */
10287ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_SUPER_RANGE_nsm:
10288ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_name(a1, a0)       #  a1 <- method name
10289ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_errNoSuchMethod
10290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10292ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_STATIC_RANGE */
10293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10294ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_STATIC_RANGE_resolve:
10295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_rSELF_method(a3)                  #  a3 <- self->method
10296a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    LOAD_base_offMethod_clazz(a0, a3)      #  a0 <- method->clazz
10297ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, METHOD_STATIC            #  resolver method type
10298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmResolveMethod)                  #  v0 <- call(clazz, ref, flags)
10299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move      a0, v0
10300ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
10301ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10302ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Check to see if we're actively building a trace.  If so,
10303ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * we need to keep this instruction out of it.
10304ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * rBIX: &resolved_methodToCall
10305ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10306ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       a2, offThread_subMode(rSELF)
10307ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  null, handle exception
10308ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       a2, kSubModeJitTraceBuild    #  trace under construction?
10309ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a2, common_invokeMethodRange #  no, (a0=method, rOBJ="this")
10310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, 0(rBIX)                  #  reload resolved method
10311ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # finished resloving?
10312ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a1, common_invokeMethodRange #  yes, (a0=method, rOBJ="this")
10313ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a0                     #  preserve method
10314ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
10315ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC
10316ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitEndTraceSelect)              #  (self, pc)
10317ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10318ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_invokeMethodRange #  whew, finally!
10319ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
10320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    # got null?
10321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      v0, common_invokeMethodRange #  (a0=method, rOBJ="this")
10322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    b         common_exceptionThrown       #  yes, handle exception
10323ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
10324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10325ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_FLOAT_TO_INT */
10326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10327ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
10328ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Not an entry point as it is used only once !!
10329ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
10330ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesf2i_doconv:
10331ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
10332ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, 0x4f000000               #  (float)maxint
10333ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a0
10334ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gesf2)                           #  is arg >= maxint?
10335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10336ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        v0, ~0x80000000              #  return maxint (7fffffff)
10337ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, .LOP_FLOAT_TO_INT_set_vreg
10338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10339ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX                     #  recover arg
10340ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, 0xcf000000               #  (float)minint
10341ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__lesf2)
10342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10343ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10344ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        v0, 0x80000000               #  return minint (80000000)
10345ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    blez      t0, .LOP_FLOAT_TO_INT_set_vreg
10346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10347ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rBIX
10348ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__nesf2)
10349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10350ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10351ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        v0, 0                        #  return zero for NaN
10352ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t0, .LOP_FLOAT_TO_INT_set_vreg
10353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10354ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10355ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__fixsfsi)
10356ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_FLOAT_TO_INT_set_vreg
10357ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
10358ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fa1, .LFLOAT_TO_INT_max
10359ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.s   fcc0, fa1, fa0
10360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fv0, .LFLOAT_TO_INT_ret_max
10361ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_FLOAT_TO_INT_set_vreg_f
10362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10363ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fa1, .LFLOAT_TO_INT_min
10364ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.s   fcc0, fa0, fa1
10365ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fv0, .LFLOAT_TO_INT_ret_min
10366ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_FLOAT_TO_INT_set_vreg_f
10367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10368ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    mov.s     fa1, fa0
10369ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.un.s    fcc0, fa0, fa1
10370ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li.s      fv0, 0
10371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_FLOAT_TO_INT_set_vreg_f
10372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10373ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    trunc.w.s  fv0, fa0
10374ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_FLOAT_TO_INT_set_vreg_f
10375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham#endif
10376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10377ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LFLOAT_TO_INT_max:
10378ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0x4f000000
10379ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LFLOAT_TO_INT_min:
10380ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0xcf000000
10381ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LFLOAT_TO_INT_ret_max:
10382ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0x7fffffff
10383ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LFLOAT_TO_INT_ret_min:
10384ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0x80000000
10385a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10387ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_FLOAT_TO_LONG */
10388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10389ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesf2l_doconv:
10390ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
10391ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, 0x5f000000
10392ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a0
10393ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gesf2)
10394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10395ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, ~0
10397ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, ~0x80000000
10398ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, .LOP_FLOAT_TO_LONG_set_vreg
10399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10400ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10401ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, 0xdf000000
10402ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__lesf2)
10403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10404ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10405ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, 0
10406ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, 0x80000000
10407ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    blez      t0, .LOP_FLOAT_TO_LONG_set_vreg
10408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10409ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rBIX
10411ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__nesf2)
10412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10413ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10414ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, 0
10415ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, 0
10416ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t0, .LOP_FLOAT_TO_LONG_set_vreg
10417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10418ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10419ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__fixsfdi)
10420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
10422ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fa1, .LLONG_TO_max
10423ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.s   fcc0, fa1, fa0
10424ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, ~0
10425ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, ~0x80000000
10426ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_FLOAT_TO_LONG_set_vreg
10427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10428ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fa1, .LLONG_TO_min
10429ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.s   fcc0, fa0, fa1
10430ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, 0
10431ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, 0x80000000
10432ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_FLOAT_TO_LONG_set_vreg
10433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10434ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    mov.s     fa1, fa0
10435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.un.s    fcc0, fa0, fa1
10436ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, 0
10437ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, 0
10438ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_FLOAT_TO_LONG_set_vreg
10439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10440ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__fixsfdi)
10441ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
10442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10443ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_FLOAT_TO_LONG_set_vreg
10444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10445ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LLONG_TO_max:
10446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0x5f000000
10447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10448ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LLONG_TO_min:
10449ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0xdf000000
10450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10451ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_DOUBLE_TO_INT */
10452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10454ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesd2i_doconv:
10455ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
10456ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_INT_max
10457ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rARG2, rARG3, t0)
10458ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, rARG0                  #  save a0
10459ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rTEMP, rARG1                 #  and a1
10460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gedf2)                           #  is arg >= maxint?
10461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10462ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10463ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        v0, ~0x80000000              #  return maxint (7fffffff)
10464ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t0, .LOP_DOUBLE_TO_INT_set_vreg     #  nonzero == yes
10465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10466ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG0, rBIX                  #  recover arg
10467ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG1, rTEMP
10468ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_INT_min
10469ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rARG2, rARG3, t0)
10470ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__ledf2)                           #  is arg <= minint?
10471a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10472ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10473ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        v0, 0x80000000               #  return minint (80000000)
10474ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    blez      t0, .LOP_DOUBLE_TO_INT_set_vreg     #  nonzero == yes
10475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10476ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG0, rBIX                  #  recover arg
10477ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG1, rTEMP
10478ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG2, rBIX                  #  compare against self
10479ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG3, rTEMP
10480ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__nedf2)                           #  is arg == self?
10481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10482ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0                       #  zero == no
10483ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        v0, 0
10484ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t0, .LOP_DOUBLE_TO_INT_set_vreg     #  return zero for NaN
10485a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10486ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG0, rBIX                  #  recover arg
10487ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG1, rTEMP
10488ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__fixdfsi)                         #  convert double to int
10489ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_DOUBLE_TO_INT_set_vreg
10490ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
10491ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_INT_max
10492ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64_F(fa1, fa1f, t0)
10493ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.d   fcc0, fa1, fa0
10494ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fv0, .LDOUBLE_TO_INT_maxret
10495ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_DOUBLE_TO_INT_set_vreg_f
10496a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10497ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_INT_min
10498ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64_F(fa1, fa1f, t0)
10499ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.d   fcc0, fa0, fa1
10500ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    l.s       fv0, .LDOUBLE_TO_INT_minret
10501ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_DOUBLE_TO_INT_set_vreg_f
10502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10503ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    mov.d     fa1, fa0
10504ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.un.d    fcc0, fa0, fa1
10505ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li.s      fv0, 0
10506ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_DOUBLE_TO_INT_set_vreg_f
10507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10508ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    trunc.w.d  fv0, fa0
10509ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_DOUBLE_TO_INT_set_vreg_f
10510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
10511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10513ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_INT_max:
10514ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .dword 0x41dfffffffc00000
10515ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_INT_min:
10516ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .dword 0xc1e0000000000000              #  minint, as a double (high word)
10517ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_INT_maxret:
10518ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0x7fffffff
10519ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_INT_minret:
10520ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .word 0x80000000
10521a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10522ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_DOUBLE_TO_LONG */
10523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10524ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesd2l_doconv:
10525ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef SOFT_FLOAT
10526ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_max
10527ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rARG2, rARG3, t0)
10528ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, rARG0                  #  save a0
10529ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rTEMP, rARG1                 #  and a1
10530ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__gedf2)
10531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10532ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t1, v0
10533ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_ret_max
10534ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rRESULT0, rRESULT1, t0)
10535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bgez      t1, .LOP_DOUBLE_TO_LONG_set_vreg
10536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10537ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG0, rBIX
10538ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG1, rTEMP
10539ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_min
10540ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rARG2, rARG3, t0)
10541ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__ledf2)
10542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10543ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t1, v0
10544ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_ret_min
10545ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rRESULT0, rRESULT1, t0)
10546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    blez      t1, .LOP_DOUBLE_TO_LONG_set_vreg
10547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10548ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG0, rBIX
10549ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG1, rTEMP
10550ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG2, rBIX
10551ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG3, rTEMP
10552ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__nedf2)
10553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10554ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      t0, v0
10555ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, 0
10556ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, 0
10557ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t0, .LOP_DOUBLE_TO_LONG_set_vreg
10558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10559ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG0, rBIX
10560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rARG1, rTEMP
10561ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__fixdfdi)
10562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10563ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
10564ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_max
10565ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64_F(fa1, fa1f, t0)
10566ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.d   fcc0, fa1, fa0
10567ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_ret_max
10568ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rRESULT0, rRESULT1, t0)
10569ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_DOUBLE_TO_LONG_set_vreg
10570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_min
10572ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64_F(fa1, fa1f, t0)
10573ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.ole.d   fcc0, fa0, fa1
10574ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        t0, .LDOUBLE_TO_LONG_ret_min
10575ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(rRESULT0, rRESULT1, t0)
10576ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_DOUBLE_TO_LONG_set_vreg
10577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10578ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    mov.d     fa1, fa0
10579ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    c.un.d    fcc0, fa0, fa1
10580ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT0, 0
10581ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        rRESULT1, 0
10582ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bc1t      .LOP_DOUBLE_TO_LONG_set_vreg
10583ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__fixdfdi)
10584ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
10585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_DOUBLE_TO_LONG_set_vreg
10586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10588ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_LONG_max:
10589ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .dword 0x43e0000000000000              #  maxlong, as a double (high word)
10590ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_LONG_min:
10591ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .dword 0xc3e0000000000000              #  minlong, as a double (high word)
10592ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_LONG_ret_max:
10593ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .dword 0x7fffffffffffffff
10594ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LDOUBLE_TO_LONG_ret_min:
10595ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .dword 0x8000000000000000
10596a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10597ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_MUL_LONG */
10598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10599ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_MUL_LONG_finish:
10600ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10601ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(v0, v1, a0)                    #  vAA::vAA+1 <- v0(low) :: v1(high)
10602ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10605ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_VOLATILE */
10606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10607ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10608ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
10609ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
10610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
10611ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10612ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_VOLATILE_finish:
10613ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
10614ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
10615ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
10616ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
10617ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
10618ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
10619ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB                               #  acquiring load
10620ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
10621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10622ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10623ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
10624ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10627ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_VOLATILE */
10628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10629ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10630ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
10631ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
10632ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
10633ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10634ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_VOLATILE_finish:
10635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
10636ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
10637ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
10638ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
10639ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
10640ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
10641ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10642ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10643ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
10644ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB_ST                            #  releasing store
10645ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
10646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB
10647ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10650ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_VOLATILE */
10651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10652ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_VOLATILE_finish:
10653ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10654ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB                               #  acquiring load
10655ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10656ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10657ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10658ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_VOLATILE */
10661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10662ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_VOLATILE_finish:
10663ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # field ptr in a0
10664ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10665ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10666ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10667ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10668ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB_ST                            #  releasing store
10669ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10670ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB
10671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10673ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_OBJECT_VOLATILE */
10674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10675ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10676ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
10677ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  v0 holds resolved field
10678ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object (caller saved)
10679ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10680ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_OBJECT_VOLATILE_finish:
10681ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
10682ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
10683ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
10684ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
10685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, rOBJ                 #  form address
10686ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw a0, (a3)                         #  a0 <- obj.field (8/16/32 bits)
10687ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB                               #  acquiring load
10688ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
10689ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10690ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10691ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG(a0, a2)                       #  fp[A] <- a0
10692ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10695ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IGET_WIDE_VOLATILE */
10696a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10697ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10698ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
10699ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0   holds resolved field
10700ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
10701ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10702ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IGET_WIDE_VOLATILE_finish:
10703ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
10704ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
10705ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
10706ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rOBJ, rOBJ, a3               #  form address
10707ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 1
10708ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    vLOAD64(a0, a1, rOBJ)                  #  a0/a1 <- obj.field (64-bit align ok)
10709ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
10710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(a0, a1, rOBJ)                   #  a0/a1 <- obj.field (64-bit align ok)
10711ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
10712ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10713ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a3, rFP, a2)                      #  a3 <- &fp[A]
10714ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10715ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(a0, a1, a3)                    #  fp[A] <- a0/a1
10716ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10719ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_WIDE_VOLATILE */
10720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10722ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
10723ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0   holds resolved field
10724ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
10725ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10726ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_WIDE_VOLATILE_finish:
10727ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a2)                           #  a2 <- A+
10728ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
10729ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a2, rFP, a2)                      #  a2 <- &fp[A]
10730ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
10731ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
10732ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10733ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64(a0, a1, a2)                     #  a0/a1 <- fp[A]
10734ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(rBIX)                  #  extract opcode from rINST
10735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a2, rOBJ, a3                 #  form address
10736ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 1
10737ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmQuasiAtomicSwap64Sync)          # stores r0/r1 into addr r2
10738ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#    STORE64(a0, a1, a2)                    #  obj.field (64 bits, aligned) <- a0 a1
10739ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
10740ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(a0, a1, a2)                    #  obj.field (64 bits, aligned) <- a0 a1
10741ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
10742ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(rBIX)                      #  jump to next instruction
10743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10745ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_WIDE_VOLATILE */
10746a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10747ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_WIDE_VOLATILE_finish:
10748ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a1)                            #  a1 <- AA
10749ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 1
10750ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    vLOAD64_off(a2, a3, a0, offStaticField_value) #  a2/a3 <- field value (aligned)
10751ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .else
10752ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD64_off(a2, a3, a0, offStaticField_value) #  a2/a3 <- field value (aligned)
10753ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
10754ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10755ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a1, rFP, a1)                      #  a1 <- &fp[AA]
10756ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STORE64(a2, a3, a1)                    #  vAA/vAA+1 <- a2/a3
10757ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10758ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10760a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10762ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_WIDE_VOLATILE */
10763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10764ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10765ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Continuation if the field has not yet been resolved.
10766ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a1:  BBBB field ref
10767ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ:  &fp[AA]
10768ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX: dvmDex->pResFields
10769ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
10770ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Returns StaticField pointer in a2.
10771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10772ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_WIDE_VOLATILE_resolve:
10773ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_rSELF_method(a2)                  #  a2 <- current method
10774ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
10775ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
10776ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
10777ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()                            #  resolve() could throw, so export now
10778ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
10779ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
10780ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # success ?
10781ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
10782ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, common_exceptionThrown   #  no, handle exception
10783ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
10784ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * If the JIT is actively building a trace we need to make sure
10786ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * that the field is fully resolved before including this instruction.
10787ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10788ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(common_verifyField)
10789ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
10790ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a2, v0
10791ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LOP_SPUT_WIDE_VOLATILE_finish           # resume
10792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10793ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_EXECUTE_INLINE */
10794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10795ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Extract args, call function.
10797ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = #of args (0-4)
10798ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX = call index
10799ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
10800ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Other ideas:
10801ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * - Use a jump table from the main piece to jump directly into the
10802ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *   AND/LW pairs.  Costs a data load, saves a branch.
10803ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * - Have five separate pieces that do the loading, so we can work the
10804ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *   interleave a little better.  Increases code size.
10805ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10806ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_EXECUTE_INLINE_continue:
10807ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH(rINST, 2)                        #  rINST <- FEDC
10808ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 0, 0f
10809ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 1, 1f
10810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 2, 2f
10811ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 3, 3f
10812ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 4, 4f
10813ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(common_abort)                      #  too many arguments
10814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10815ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes4:
10816ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, rINST, 0xf000            #  isolate F
10817ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t1, rFP, t0, 10)
10818ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, 0(t1)                    #  a3 <- vF (shift right 12, left 2)
10819ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
10820ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, rINST, 0x0f00            #  isolate E
10821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t1, rFP, t0, 6)
10822ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, 0(t1)                    #  a2 <- vE
10823ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
10824ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, rINST, 0x00f0            #  isolate D
10825ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t1, rFP, t0, 2)
10826ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, 0(t1)                    #  a1 <- vD
10827ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
10828ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, rINST, 0x000f            #  isolate C
10829ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EASN(t1, rFP, t0, 2)
10830ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, 0(t1)                    #  a0 <- vC
10831ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes0:
10832ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        rINST, gDvmInlineOpsTable    #  table of InlineOperation
10833ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS4(t1, rINST, rBIX)                  #  t1 <- rINST + rBIX<<4
10834ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        t9, 0(t1)
10835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        t9                           #  sizeof=16, "func" is first entry
10836ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # (not reached)
10837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10838ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10839ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * We're debugging or profiling.
10840ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * rBIX: opIndex
10841ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10842ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_EXECUTE_INLINE_debugmode:
10843ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10844ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveInlineNative)
10845ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, .LOP_EXECUTE_INLINE_resume       #  did it resolve? no, just move on
10846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rOBJ, v0                     #  remember method
10847ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
10848ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
10849ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmFastMethodTraceEnter)           #  (method, self)
10850ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a1, rSELF, offThread_retval  #  a1<- &self->retval
10851ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPB(a0)                            #  a0 <- B
10852ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Stack should have 16/20 available
1085346abe70f710c3e1b1c2ec1bd7fab35ed833ffba1Douglas Leung    sw        a1, STACK_OFFSET_ARG04(sp)   #  push &self->retval
10854ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    BAL(.LOP_EXECUTE_INLINE_continue)              #  make call; will return after
10855ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)      #  restore gp
10856ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rINST, v0                    #  save result of inline
10857ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rOBJ                     #  a0<- method
10858ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF                    #  a1<- self
1085946abe70f710c3e1b1c2ec1bd7fab35ed833ffba1Douglas Leung    JAL(dvmFastNativeMethodTraceExit)      #  (method, self)
1086046abe70f710c3e1b1c2ec1bd7fab35ed833ffba1Douglas Leung    beqz      rINST, common_exceptionThrown   #  returned false, handle exception
10861ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
10862ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10863ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10865ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_EXECUTE_INLINE_RANGE */
10866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10867ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10868ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Extract args, call function.
10869ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 = #of args (0-4)
10870ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rBIX = call index
10871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  ra = return addr, above  [DO NOT JAL out of here w/o preserving ra]
10872ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10873ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_EXECUTE_INLINE_RANGE_continue:
10874ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH(rOBJ, 2)                       # rOBJ <- CCCC
10875ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 0, 0f
10876ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 1, 1f
10877ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 2, 2f
10878ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 3, 3f
10879ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a0, 4, 4f
10880ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(common_abort)                      #  too many arguments
10881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10882ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes4:
10883ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    add       t0, rOBJ, 3
10884ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a3, t0)
10885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
10886ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    add       t0, rOBJ, 2
10887ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a2, t0)
10888ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
10889ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    add       t0, rOBJ, 1
10890ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, t0)
10891ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
10892ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, rOBJ)
10893ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes0:
10894ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        rOBJ, gDvmInlineOpsTable      # table of InlineOperation
10895ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS4(t1, rOBJ, rBIX)                    # t1 <- rINST + rBIX<<4
10896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        t9, 0(t1)
10897ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        t9                            # sizeof=16, "func" is first entry
10898ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # not reached
10899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10900ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10901ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * We're debugging or profiling.
10902ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * rBIX: opIndex
10903ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10904ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_EXECUTE_INLINE_RANGE_debugmode:
10905ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
10906ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmResolveInlineNative)
10907ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, .LOP_EXECUTE_INLINE_RANGE_resume       #  did it resolve? no, just move on
10908ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rOBJ, v0                     #  remember method
10909ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
10910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
10911ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmFastMethodTraceEnter)           #  (method, self)
10912ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a1, rSELF, offThread_retval  #  a1<- &self->retval
10913ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a0)                            #  a0 <- A
10914ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Stack should have 16/20 available
1091546abe70f710c3e1b1c2ec1bd7fab35ed833ffba1Douglas Leung    sw        a1, STACK_OFFSET_ARG04(sp)   #  push &self->retval
10916ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rINST, rOBJ                  #  rINST<- method
10917ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    BAL(.LOP_EXECUTE_INLINE_RANGE_continue)              #  make call; will return after
10918ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)      #  restore gp
10919ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rOBJ, v0                     #  save result of inline
10920ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rINST                    #  a0<- method
10921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF                    #  a1<- self
10922ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmFastNativeMethodTraceExit)      #  (method, self)
10923ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_exceptionThrown #  returned false, handle exception
10924ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(3)                  #  advance rPC, load rINST
10925ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10926ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10928ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_INVOKE_OBJECT_INIT_RANGE */
10929ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10930ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * A debugger is attached, so we need to go ahead and do
10931ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * this.  For simplicity, we'll just jump directly to the
10932ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * corresponding handler.  Note that we can't use
10933ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * rIBASE here because it may be in single-step mode.
10934ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Load the primary table base directly.
10935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10936ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_INVOKE_OBJECT_INIT_RANGE_debugger:
10937ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      a1, offThread_mainHandlerTable(rSELF)
10938ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li      t0, OP_INVOKE_DIRECT_RANGE
10939ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE_BASE(a1, t0)            # execute it
10940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10941ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_IPUT_OBJECT_VOLATILE */
10942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10943ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
10944ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Currently:
10945ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  a0 holds resolved field
10946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  rOBJ holds object
10947ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
10948ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_IPUT_OBJECT_VOLATILE_finish:
10949ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #BAL(common_squeak0)
10950ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA4(a1)                           #  a1 <- A+
10951ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
10952ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a0, a1)                       #  a0 <- fp[A]
10953ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
10954ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # check object for null
10955ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      rOBJ, common_errNullObject   #  object was null
10956ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10957ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10958ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, rOBJ, a3                 #  form address
10959ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB_ST                            #  releasing store
10960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw a0, (t2)                        #  obj.field (32 bits) <- a0
10961ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB
10962ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, 1f                       #  stored a null reference?
10963ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t1, rOBJ, GC_CARD_SHIFT
10964ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t2, a2, t1
10965ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t2)                     #  mark card if not
10966ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
10967ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10970ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SGET_OBJECT_VOLATILE */
10971a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10972ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SGET_OBJECT_VOLATILE_finish:
10973ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
10974ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB                               #  acquiring load
10975ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10976ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10977ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10978ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1
10979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10980ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* continuation for OP_SPUT_OBJECT_VOLATILE */
10981ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LOP_SPUT_OBJECT_VOLATILE_finish:                        #  field ptr in a0
10982ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)                            #  a2 <- AA
10983ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
10984ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_VREG(a1, a2)                       #  a1 <- fp[AA]
10985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offThread_cardTable(rSELF) #  a2 <- card table base
10986ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        t1, offField_clazz(a0)       #  t1 <- field->clazz
10987ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
10988ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB_ST                            #  releasing store
10989ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offStaticField_value(a0) #  field <- vAA
10990ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SMP_DMB
10991ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a1, 1f
10992ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       t2, t1, GC_CARD_SHIFT
10993ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t3, a2, t2
10994ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a2, (t3)
10995ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
10996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
10997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
10998ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .size   dvmAsmSisterStart, .-dvmAsmSisterStart
10999ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmAsmSisterEnd
11000ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmAsmSisterEnd:
11001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11002ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* File: mips/footer.S */
11003ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11004ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * ===========================================================================
11005ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *  Common subroutines and data
11006ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * ===========================================================================
11007ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11009ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .text
11010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .align 2
11011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11012ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11013ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_SELF_VERIFICATION)
11014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11015ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11016ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * "longjmp" to a translation after single-stepping.  Before returning
11017ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * to translation, must save state for self-verification.
11018ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11019ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitResumeTranslation             # (Thread* self, u4* dFP)
11020ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitResumeTranslation:
11021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    rSELF, a0                           # restore self
11022ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    rPC, a1                             # restore Dalvik pc
11023ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    rFP, a2                             # restore Dalvik fp
11024ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      rBIX, offThread_jitResumeNPC(rSELF)
11025ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw      zero, offThread_jitResumeNPC(rSELF) # reset resume address
11026ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      sp, offThread_jitResumeNSP(rSELF)   # cut back native stack
11027ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b       jitSVShadowRunStart                 # resume as if cache hit
11028ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                                                # expects resume addr in rBIX
11029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11030ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpPunt
11031ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpPunt:
11032ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSPunt                 #  a2 <- interpreter entry point
11033ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11034ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11036ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpSingleStep
11037ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpSingleStep:
11038ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rPC, a0                      # set up dalvik pc
11039ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11040ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        ra, offThread_jitResumeNPC(rSELF)
11041ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_jitResumeDPC(rSELF)
11042ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSSingleStep           #  a2 <- interpreter entry point
11043ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11045ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpNoChainNoProfile
11046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpNoChainNoProfile:
11047ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC                      #  pass our target PC
11048ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSNoProfile            #  a2 <- interpreter entry point
11049ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11050ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11052ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpTraceSelectNoChain
11053ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpTraceSelectNoChain:
11054ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC                      #  pass our target PC
11055ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSTraceSelect          #  a2 <- interpreter entry point
11056ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11057ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11059ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpTraceSelect
11060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpTraceSelect:
11061ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, 0(ra)                   #  pass our target PC
11062ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSTraceSelect          #  a2 <- interpreter entry point
11063ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11064ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11066ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpBackwardBranch
11067ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpBackwardBranch:
11068ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, 0(ra)                   #  pass our target PC
11069ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSBackwardBranch       #  a2 <- interpreter entry point
11070ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11073ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpNormal
11074ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpNormal:
11075ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, 0(ra)                   #  pass our target PC
11076ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSNormal               #  a2 <- interpreter entry point
11077ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11078ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11080ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpNoChain
11081ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpNoChain:
11082ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC                      #  pass our target PC
11083ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kSVSNoChain              #  a2 <- interpreter entry point
11084ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  Back to the interp land
11085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         jitSVShadowRunEnd            #  doesn't return
11086ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else                                   /*  WITH_SELF_VERIFICATION */
11087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11089ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11090ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * "longjmp" to a translation after single-stepping.
11091ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11092ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitResumeTranslation             # (Thread* self, u4* dFP)
11093ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitResumeTranslation:
11094ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    rSELF, a0                           # restore self
11095ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    rPC, a1                             # restore Dalvik pc
11096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    rFP, a2                             # restore Dalvik fp
11097ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      a0, offThread_jitResumeNPC(rSELF)
11098ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw      zero, offThread_jitResumeNPC(rSELF) # reset resume address
11099ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      sp, offThread_jitResumeNSP(rSELF)   # cut back native stack
11100ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr      a0                                  # resume translation
11101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11103ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11104ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return from the translation cache to the interpreter when the compiler is
11105ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * having issues translating/executing a Dalvik instruction. We have to skip
11106ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * the code cache lookup otherwise it is possible to indefinitely bouce
11107ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * between the interpreter and the code cache if the instruction that fails
11108ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * to be compiled happens to be at a trace start.
11109ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpPunt
11111ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpPunt:
11112ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11113ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rPC, a0
11114ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT_TUNING)
11115ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, ra
11116ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmBumpPunt)
11117ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11118ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11119ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) # Back to the interp land
11120ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11122ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11123ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11125ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11126ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return to the interpreter to handle a single instruction.
11127ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry:
11128ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    rPC <= Dalvik PC of instrucion to interpret
11129ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    a1 <= Dalvik PC of resume instruction
11130ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    ra <= resume point in translation
11131ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11133ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpSingleStep
11134ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpSingleStep:
11135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11136ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rPC, a0                       # set up dalvik pc
11137ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11138ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        ra, offThread_jitResumeNPC(rSELF)
11139ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        sp, offThread_jitResumeNSP(rSELF)
11140ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_jitResumeDPC(rSELF)
11141ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, 1
11142ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_singleStepCount(rSELF) # just step once
11143ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
11144ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, kSubModeCountedStep
11145ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmEnableSubMode)                   # (self, subMode)
11146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11147ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11148ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11149ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11150ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11151ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return from the translation cache and immediately request
11152ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * a translation for the exit target.  Commonly used for callees.
11153ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11154ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpTraceSelectNoChain
11155ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpTraceSelectNoChain:
11156ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11157ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT_TUNING)
11158ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmBumpNoChain)
11159ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC
11161ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11162ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitGetTraceAddrThread)          # (pc, self)
11163ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11164ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, offThread_inJitCodeCache(rSELF) # set the inJitCodeCache flag
11165ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC                      # arg1 of translation may need this
11166ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      ra, zero                     #  in case target is HANDLER_INTERPRET
11167ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, 2f                       # 0 means translation does not exist
11168ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        a0
11169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11170ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return from the translation cache and immediately request
11172ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * a translation for the exit target.  Commonly used following
11173ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * invokes.
11174ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11175ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpTraceSelect
11176ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpTraceSelect:
11177ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11178ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rPC, (ra)                    #  get our target PC
11179ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rINST, ra, 8                 #  save start of chain branch
11180ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC
11181ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11182ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitGetTraceAddrThread)          # @ (pc, self)
11183ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        v0, offThread_inJitCodeCache(rSELF) # set the inJitCodeCache flag
11184ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      v0, 2f
11185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11186ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rINST
11187ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitChain)                       #  v0 <- dvmJitChain(codeAddr, chainAddr)
11188ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC                      #  arg1 of translation may need this
11189ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      ra, zero                     #  in case target is HANDLER_INTERPRET
11190ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11191ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, toInterpreter            #  didn't chain - resume with interpreter
11192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11193ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        a0                           #  continue native execution
11194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11195ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* No translation, so request one if profiling isn't disabled */
11196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
11197ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11198ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_pJitProfTable(rSELF)
11199ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11200ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        t0, kJitTSelectRequestHot
11201ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    movn      a2, t0, a0                   #  ask for trace selection
11202ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a0, common_selectTrace
11203ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11204ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11206ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11207ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return from the translation cache to the interpreter.
11208ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * The return was done with a BLX from thumb mode, and
11209ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * the following 32-bit word contains the target rPC value.
11210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Note that lr (r14) will have its low-order bit set to denote
11211ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * its thumb-mode origin.
11212ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11213ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * We'll need to stash our lr origin away, recover the new
11214ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * target and then check to see if there is a translation available
11215ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * for our new target.  If so, we do a translation chain and
11216ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * go back to native execution.  Otherwise, it's back to the
11217ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * interpreter (after treating this entry as a potential
11218ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * trace start).
11219ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11220ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpNormal
11221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpNormal:
11222ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11223ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rPC, (ra)                    #  get our target PC
11224ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rINST, ra, 8                 #  save start of chain branch
11225ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT_TUNING)
11226ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmBumpNormal)
11227ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11228ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC
11229ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11230ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitGetTraceAddrThread)           # @ (pc, self)
11231ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11232ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, offThread_inJitCodeCache(rSELF) #  set the inJitCodeCache flag
11233ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, toInterpreter            #  go if not, otherwise do chain
11234ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rINST
11235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitChain)                       #  v0 <- dvmJitChain(codeAddr, chainAddr)
11236ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC                      #  arg1 of translation may need this
11237ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      ra, zero                     #  in case target is HANDLER_INTERPRET
11238ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11239ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, toInterpreter            #  didn't chain - resume with interpreter
11240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11241ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        a0                           #  continue native execution
11242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11243ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11244ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return from the translation cache to the interpreter to do method invocation.
11245ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Check if translation exists for the callee, but don't chain to it.
11246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11247ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpNoChainNoProfile
11248ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpNoChainNoProfile:
11249ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT_TUNING)
11250ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmBumpNoChain)
11251ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11252ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC
11253ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11254ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitGetTraceAddrThread)          # (pc, self)
11255ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11256ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, offThread_inJitCodeCache(rSELF) #  set the inJitCodeCache flag
11257ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC                      #  arg1 of translation may need this
11258ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      ra, zero                     #  in case target is HANDLER_INTERPRET
11259ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, footer235
11260a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11261ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        a0                           #  continue native execution if so
11262ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesfooter235:
11263ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11264ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11265ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11266ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
11267ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  jump to next instruction
11268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11269ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11270ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Return from the translation cache to the interpreter to do method invocation.
11271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Check if translation exists for the callee, but don't chain to it.
11272ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11274ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmJitToInterpNoChain
11275ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmJitToInterpNoChain:
11276ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11277ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT_TUNING)
11278ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmBumpNoChain)
11279ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11280ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC
11281ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11282ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitGetTraceAddrThread)          # (pc, self)
11283ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11284ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, offThread_inJitCodeCache(rSELF) #  set the inJitCodeCache flag
11285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC                      #  arg1 of translation may need this
11286ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      ra, zero                     #  in case target is HANDLER_INTERPRET
11287ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, 1f
11288ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        a0                           #  continue native execution if so
11289ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11290ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif                                  /*  WITH_SELF_VERIFICATION */
11291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11292ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11293ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * No translation, restore interpreter regs and start interpreting.
11294ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * rSELF & rFP were preserved in the translated code, and rPC has
11295ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * already been restored by the time we get here.  We'll need to set
11296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * up rIBASE & rINST, and load the address of the JitTable into r0.
11297ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11299ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughestoInterpreter:
11300ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11301ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11302ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11303ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_pJitProfTable(rSELF)
11304ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11305ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # NOTE: intended fallthrough
11306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11307ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11308ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Similar to common_updateProfile, but tests for null pJitProfTable
11309ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * r0 holds pJifProfTAble, rINST is loaded, rPC is current and
11310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * rIBASE has been recently refreshed.
11311ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11313ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_testUpdateProfile:
11314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11315ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, 4f
11316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11317ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11318ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Common code to update potential trace start counter, and initiate
11319ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * a trace-build if appropriate.
11320ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry here:
11321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    r0    <= pJitProfTable (verified non-NULL)
11322ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    rPC   <= Dalvik PC
11323ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    rINST <= next instruction
11324ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11325ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_updateProfile:
11326ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    srl       a3, rPC, 12                  #  cheap, but fast hash function
11327ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    xor       a3, a3, rPC
11328ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    andi      a3, a3, JIT_PROF_SIZE-1      #  eliminate excess bits
11329ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      t1, a0, a3
11330ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lbu       a1, (t1)                     #  get counter
11331ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11332ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      a1, a1, 1                    #  decrement counter
11333ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a1, (t1)                     #  and store it
11334ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a1, 1f
11335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                        #  if not threshold, fallthrough otherwise
11336ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11337ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* Looks good, reset the counter */
11338ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, offThread_jitThreshold(rSELF)
11339ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sb        a1, (t1)
11340ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11341ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC
11342ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11343ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitGetTraceAddrThread)          # (pc, self)
11344ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11345ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        v0, offThread_inJitCodeCache(rSELF) #  set the inJitCodeCache flag
11346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rPC                      #  arg1 of translation may need this
11347ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      ra, zero                     #  in case target is HANDLER_INTERPRET
11348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11349ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if !defined(WITH_SELF_VERIFICATION)
11350ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        t0, kJitTSelectRequest       #  ask for trace selection
11351ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    movz      a2, t0, a0
11352ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a0, common_selectTrace
11353ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        a0                           #  jump to the translation
11354ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
11355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11356ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bne       a0, zero, skip_ask_for_trace_selection
11357ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kJitTSelectRequest       #  ask for trace selection
11358ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    j         common_selectTrace
11359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesskip_ask_for_trace_selection:
11361ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
11362ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * At this point, we have a target translation.  However, if
11363ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * that translation is actually the interpret-only pseudo-translation
11364ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * we want to treat it the same as no translation.
11365ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
11366ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a0                     #  save target
11367ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jal       dvmCompilerGetInterpretTemplate
11368ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # special case?
11369ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bne       v0, rBIX, jitSVShadowRunStart  #  set up self verification shadow space
11370ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Need to clear the inJitCodeCache flag
11371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, offThread_inJitCodeCache(rSELF) #  back to the interp land
11372ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11373ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11374ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* no return */
11375ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11377ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11378ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry:
11379ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *  r2 is jit state.
11380ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11382ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_selectTrace:
11383ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu        a0, offThread_subMode(rSELF)
11384ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    andi       a0, (kSubModeJitTraceBuild | kSubModeJitSV)
11385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez       a0, 3f                      # already doing JIT work, continue
11386ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw         a2, offThread_jitState(rSELF)
11387ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move       a0, rSELF
11388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11389ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11390ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Call out to validate trace-building request.  If successful,
11391ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * rIBASE will be swapped to to send us into single-stepping trace
11392ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * building mode, so we need to refresh before we continue.
11393ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11395ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVE_PC_TO_SELF()
11397ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVE_FP_TO_SELF()
11398ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitCheckTraceRequest)
11399ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
11400ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11401ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11402ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes4:
11403ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                    # extract opcode from rINST
11404ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11405ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* no return */
11406ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11408ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_SELF_VERIFICATION)
11409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11411ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Save PC and registers to shadow memory for self verification mode
11412ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * before jumping to native translation.
11413ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry:
11414ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    rPC, rFP, rSELF: the values that they should contain
11415ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *    r10: the address of the target translation.
11416ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11417ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesjitSVShadowRunStart:
11418ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rPC                      #  r0 <- program counter
11419ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rFP                      #  r1 <- frame pointer
11420ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a2, rSELF                    #  r2 <- InterpState pointer
11421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a3, rBIX                     #  r3 <- target translation
11422ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jal       dvmSelfVerificationSaveState #  save registers to shadow space
11423ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rFP, offShadowSpace_shadowFP(v0) #  rFP <- fp in shadow space
11424ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr        rBIX                         #  jump to the translation
11425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11426ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11427ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Restore PC, registers, and interpState to original values
11428ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * before jumping back to the interpreter.
11429ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11430ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesjitSVShadowRunEnd:
11431ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rFP                      #  pass ending fp
11432ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a3, rSELF                    #  pass self ptr for convenience
11433ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jal       dvmSelfVerificationRestoreState #  restore pc and fp values
11434ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_PC_FP_FROM_SELF()                 #  restore pc, fp
11435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, offShadowSpace_svState(a0) #  get self verification state
11436ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a1, zero, 1f                 #  check for punt condition
11437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11438ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Setup SV single-stepping
11439ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
11440ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a1, kSubModeJitSV
11441ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmEnableSubMode)                  # (self, subMode)
11442ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, kJitSelfVerification     #  ask for self verification
11443ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a2, offThread_jitState(rSELF)
11444ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Intentional fallthrough
11445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11447ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # exit to interpreter without check
11448ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11449ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11450ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11451ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11452ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11453ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11455ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11456ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * The equivalent of "goto bail", this calls through the "bail handler".
11457ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * It will end this interpreter activation, and return to the caller
11458ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * of dvmMterpStdRun.
11459ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * State registers will be saved to the "thread" area before bailing
11461ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * debugging purposes
11462ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11463ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .ent common_gotoBail
11464ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_gotoBail:
11465ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVE_PC_FP_TO_SELF()                   # export state to "thread"
11466ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF                    # a0 <- self ptr
11467ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         dvmMterpStdBail              # call(self, changeInterp)
11468ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .end common_gotoBail
11469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11470ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * The JIT's invoke method needs to remember the callsite class and
11472ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * target pair.  Save them here so that they are available to
11473ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * dvmCheckJit following the interpretation of this invoke.
11474ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11475ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11476ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughessave_callsiteinfo:
11477ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz    rOBJ, 1f
11478ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      rOBJ, offObject_clazz(rOBJ)
11479ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11480ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw      a0, offThread_methodToCall(rSELF)
11481ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw      rOBJ, offThread_callsiteClass(rSELF)
11482ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr      ra
11483ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11486ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Common code for method invocation with range.
11487ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11488ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry:
11489ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *  a0 is "Method* methodToCall", the method we're trying to call
11490ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11491ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_invokeMethodRange:
11492ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LinvokeNewRange:
11493ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11494ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu      a1, offThread_subMode(rSELF)
11495ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    andi     a1, kSubModeJitTraceBuild
11496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz     a1, 1f
11497ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(save_callsiteinfo)
11498ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11499ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # prepare to copy args to "outs" area of current frame
11500ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11501ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPA(a2)
11502ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(rBIX, rFP)              #  rBIX <- stack save area
11503ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a2, .LinvokeArgsDone
11504ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH(a1, 2)                           #  a1 <- CCCC
11505ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LinvokeRangeArgs:
11506ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=methodToCall, a1=CCCC, a2=count, rBIX=outs
11507ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # (very few methods have > 10 args; could unroll for common cases)
11508ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS2(a3, rFP, a1)
11509ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sll       t0, a2, 2
11510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, rBIX, t0
11511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11512ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11513ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, 0(a3)
11514ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a3, a3, 4
11515ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      a2, a2, 1
11516ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, 0(rBIX)
11517ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      rBIX, 4
11518ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a2, 1b
11519ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .LinvokeArgsDone
11520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11522ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Common code for method invocation without range.
11523ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11524ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry:
11525ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *  a0 is "Method* methodToCall", "rOBJ is this"
11526ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11527ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_invokeMethodNoRange:
11528ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LinvokeNewNoRange:
11529ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11530ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu      a1, offThread_subMode(rSELF)
11531ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    andi     a1, kSubModeJitTraceBuild
11532ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz     a1, 1f
11533ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(save_callsiteinfo)
11534ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11535a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11536ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # prepare to copy args to "outs" area of current frame
11537ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11538ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_OPB(a2)
11539ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(rBIX, rFP)
11540ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a2, .LinvokeArgsDone
11541ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH(a1, 2)
11542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11543ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=methodToCall, a1=GFED, a2=count,
11544ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LinvokeNonRange:
11545ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a2, 0, 0f
11546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a2, 1, 1f
11547ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a2, 2, 2f
11548ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a2, 3, 3f
11549ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a2, 4, 4f
11550ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beq       a2, 5, 5f
11551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11552ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes5:
11553ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, rINST, 0x0f00
11554ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t2, rFP, t0, 6)
11555ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, (t2)
11556ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, 4
11557ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(rBIX)
11558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11559ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes4:
11560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, a1, 0xf000
11561ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t2, rFP, t0, 10)
11562ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, (t2)
11563ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, 4
11564ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(rBIX)
11565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11566ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
11567ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, a1, 0x0f00
11568ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t2, rFP, t0, 6)
11569ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, (t2)
11570ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, 4
11571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(rBIX)
11572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11573ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
11574ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, a1, 0x00f0
11575ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    ESRN(t2, rFP, t0, 2)
11576ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, (t2)
11577ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, 4
11578ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(rBIX)
11579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11580ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11581ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t0, a1, 0x000f
11582ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EASN(t2, rFP, t0, 2)
11583ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, (t2)
11584ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      rBIX, 4
11585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, 0(rBIX)
11586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11587ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes0:
11588ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    #fall through .LinvokeArgsDone
11589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11591ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LinvokeArgsDone:                          #  a0=methodToCall
11592ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       rOBJ, offMethod_registersSize(a0)
11593ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       a3, offMethod_outsSize(a0)
11594ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offMethod_insns(a0)
11595ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rINST, offMethod_clazz(a0)
11596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # find space for the new stack frame, check for overflow
11597ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(a1, rFP)              # a1 <- stack save area
11598ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sll       t0, rOBJ, 2                    #  a1 <- newFp (old savearea - regsSize)
11599ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      a1, a1, t0
11600ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(rBIX, a1)
11601ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rOBJ, offThread_interpStackEnd(rSELF) #  t3 <- interpStackEnd
11602ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sll       t2, a3, 2
11603ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      t0, rBIX, t2
11604ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       ra, offThread_subMode(rSELF)
11605ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, offMethod_accessFlags(a0) #  a3 <- methodToCall->accessFlags
11606ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bltu      t0, rOBJ, .LstackOverflow      #  yes, this frame will overflow stack
11607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11609ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # set up newSaveArea
11610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef EASY_GDB
11611ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(t0, rFP)
11612ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        t0, offStackSaveArea_prevSave(rBIX)
11613ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11614ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rFP, (offStackSaveArea_prevFrame)(rBIX)
11615ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rPC, (offStackSaveArea_savedPc)(rBIX)
11616ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11617ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        zero, (offStackSaveArea_returnAddr)(rBIX)
11618ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11619ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, (offStackSaveArea_method)(rBIX)
11620ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Profiling?
11621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez       ra, 2f
11622ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11623ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    and       t2, a3, ACC_NATIVE
11624ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t2, .LinvokeNative
11625ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       rOBJ, (a2)           # rOBJ -< load Inst from New PC
11626ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, offClassObject_pDvmDex(rINST)
11627ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rPC, a2              # Publish new rPC
11628ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Update state values for the new method
11629ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=methodToCall, a1=newFp, a3=newMethodClass, rOBJ=newINST
11630ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, offThread_method(rSELF)
11631ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a3, offThread_methodClassDex(rSELF)
11632ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a2, 1
11633ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a2, offThread_debugIsMethodEntry(rSELF)
11634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11636ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_pJitProfTable(rSELF)
11637ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rFP, a1                    # fp = newFp
11638ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_PREFETCHED_OPCODE(t0, rOBJ)      # extract prefetched opcode from rOBJ
11639ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rINST, rOBJ                # publish new rINST
11640ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_curFrame(rSELF)
11641ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a0, common_updateProfile
11642ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11643ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
11644ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rFP, a1
11645ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_PREFETCHED_OPCODE(t0, rOBJ)
11646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rINST, rOBJ
11647ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_curFrame(rSELF)
11648ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11649ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11651ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
11652ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Profiling - record method entry.  a0: methodToCall
11653ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE(a0, 0)
11654ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE(a1, 4)
11655ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE(a2, 8)
11656ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE(a3, 12)
11657ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw       rPC, offThread_pc(rSELF)          # update interpSave.pc
11658ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a1, a0
11659ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a0, rSELF
11660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReportInvoke)
11661ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD(a3, 12)                         # restore a0-a3
11662ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD(a2, 8)
11663ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD(a1, 4)
11664ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD(a0, 0)
11665ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b        1b
11666ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LinvokeNative:
11667ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Prep for the native call
11668ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=methodToCall, a1=newFp, rBIX=newSaveArea
11669ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       ra, offThread_subMode(rSELF)
11670ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        t3, offThread_jniLocal_topCookie(rSELF)
11671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_curFrame(rSELF)
11672ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        t3, offStackSaveArea_localRefCookie(rBIX) # newFp->localRefCookie=top
11673ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a2, a0
11674ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, a1
11675ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu      a1, rSELF, offThread_retval
11676ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a3, rSELF
11677ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef ASSIST_DEBUGGER
11678ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* insert fake function header to help gdb find the stack frame */
11679ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         .Lskip
11680ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .ent dalvik_mterp
11681ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughesdalvik_mterp:
11682ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_FULL()
11683ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.Lskip:
11684ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      ra, 11f                          # Any special SubModes active?
11686ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        t9, offMethod_nativeFunc(a2)
11687ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jalr      t9
11688ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        gp, STACK_OFFSET_GP(sp)
11689ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes7:
11690ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # native return; rBIX=newSaveArea
11691ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # equivalent to dvmPopJniLocals
11692ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offStackSaveArea_localRefCookie(rBIX)
11693ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, offThread_exception(rSELF)
11694ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rFP, offThread_curFrame(rSELF)
11695ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a0, offThread_jniLocal_topCookie(rSELF)    # new top <- old top
11696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      a1, common_exceptionThrown
11697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11698ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_ADVANCE_INST(3)
11699ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11700ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11701ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes11:
11702ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # a0=newFp, a1=&retval, a2=methodToCall, a3=self, ra=subModes
11703ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a0, 0)
11704ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a1, 4)
11705ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a2, 8)
11706ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a3, 12)
11707ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, a2                    # a0 <- methodToCall
11708ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11709ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a2, rFP
11710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReportPreNativeInvoke)       # (methodToCall, self, fp)
11711ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a3, 12)                         # restore a0-a3
11712ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a2, 8)
11713ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a1, 4)
11714ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a0, 0)
11715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11716ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Call the native method
11717ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw       t9, offMethod_nativeFunc(a2)      # t9<-methodToCall->nativeFunc
11718ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jalr     t9
11719ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw       gp, STACK_OFFSET_GP(sp)
11720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Restore the pre-call arguments
11722ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a3, 12)                         # restore a0-a3
11723ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a2, 8)
11724ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a1, 4)
11725ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a0, 0)
11726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11727ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Finish up any post-invoke subMode requirements
11728ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, a2
11729ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11730ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a2, rFP
11731ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReportPostNativeInvoke)      # (methodToCall, self, fp)
11732ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         7b
11733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstackOverflow:       # a0=methodToCall
11736ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, a0                    #  a1 <- methodToCall
11737ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF                 # a0 <- self
11738ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmHandleStackOverflow)         #  dvmHandleStackOverflow(self, methodToCall)
11739ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown
11740ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#ifdef ASSIST_DEBUGGER
11741ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .end dalvik_mterp
11742ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11744ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
11745ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Common code for method invocation, calling through "glue code".
11746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
11747ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * TODO: now that we have range and non-range invoke handlers, this
11748ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *       needs to be split into two.  Maybe just create entry points
11749ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *       that set r9 and jump here?
11750ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
11751ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * On entry:
11752ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  r0 is "Method* methodToCall", the method we're trying to call
11753ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *  r9 is "bool methodCallRange", indicating if this is a /range variant
11754ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
11755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11756ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11757ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Common code for handling a return instruction.
11758ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11759ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * This does not return.
11760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11761ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_returnFromMethod:
11762ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LreturnNew:
11763ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu       t0, offThread_subMode(rSELF)
11764ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(a0, rFP)
11765ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rOBJ, offStackSaveArea_savedPc(a0) # rOBJ = saveArea->savedPc
11766ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez      t0, 19f
11767ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes14:
11768ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rFP, offStackSaveArea_prevFrame(a0) # fp = saveArea->prevFrame
11769ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, (offStackSaveArea_method - sizeofStackSaveArea)(rFP)
11770ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes                                               # a2<- method we're returning to
11771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # is this a break frame?
11772ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a2, common_gotoBail              # break frame, bail out completely
11773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11774ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rBIX, offMethod_clazz(a2)        # rBIX<- method->clazz
11775ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF) # refresh rIBASE
11776ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    PREFETCH_ADVANCE_INST(rINST, rOBJ, 3)      # advance rOBJ, update new rINST
11777ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a2, offThread_method(rSELF)      # self->method = newSave->method
11778ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, offClassObject_pDvmDex(rBIX) # r1<- method->clazz->pDvmDex
11779ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rFP, offThread_curFrame(rSELF)   # curFrame = fp
11780ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11781ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw         rBIX, offStackSaveArea_returnAddr(a0)
11782ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move       rPC, rOBJ                       # publish new rPC
11783ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw         a1, offThread_methodClassDex(rSELF)
11784ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw         rBIX, offThread_inJitCodeCache(rSELF) # may return to JIT'ed land
11785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz       rBIX, 15f                       # caller is compiled code
11786ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move       t9, rBIX
11787ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jalr       t9
11788ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw         gp, STACK_OFFSET_GP(sp)
11789ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes15:
11790ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                        # extract opcode from rINST
11791ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                            # jump to next instruction
11792ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#else
11793ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)                        # extract opcode from rINST
11794ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move       rPC, rOBJ                       # publish new rPC
11795ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw         a1, offThread_methodClassDex(rSELF)
11796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11797ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11799ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes19:
11800ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Handle special actions
11801ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # On entry, a0: StackSaveArea
11802ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw         a1, offStackSaveArea_prevFrame(a0) # a1<- prevFP
11803ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw         rPC, offThread_pc(rSELF)        # update interpSave.pc
11804ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw         a1, offThread_curFrame(rSELF)   # update interpSave.curFrame
11805ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move       a0, rSELF
11806ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReportReturn)
11807ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(a0, rFP)                  # restore StackSaveArea
11808ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b          14b
11809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 0
11811ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
11812ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Return handling, calls through "glue code".
11813ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
11814ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LreturnOld:
11815ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVE_PC_FP_TO_SELF()                       # export state
11816ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move       a0, rSELF                       # arg to function
11817ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmMterp_returnFromMethod)
11818ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b          common_resumeAfterGlueCall
11819ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
11820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
11822ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Somebody has thrown an exception.  Handle it.
11823ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11824ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * If the exception processing code returns to us (instead of falling
11825ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * out of the interpreter), continue with whatever the next instruction
11826ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * now happens to be.
11827ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes *
11828ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * This does not return.
11829ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
11830ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmMterpCommonExceptionThrown
11831ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmMterpCommonExceptionThrown:
11832ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_exceptionThrown:
11833ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LexceptionNew:
11834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EXPORT_PC()
11836ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a0, rSELF
11837ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmCheckSuspendPending)
11838ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw       rOBJ, offThread_exception(rSELF)
11839ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a1, rSELF
11840ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a0, rOBJ
11841ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmAddTrackedAlloc)
11842ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lhu      a2, offThread_subMode(rSELF)
11843ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw       zero, offThread_exception(rSELF)
11844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11845ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Special subMode?
11846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bnez     a2, 7f                     # any special subMode handling needed?
11847ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes8:
11848ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* set up args and a local for "&fp" */
11849ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw       rFP, 20(sp)                 #  store rFP => tmp
11850ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    addu     t0, sp, 20                  #  compute &tmp
11851ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw       t0, STACK_OFFSET_ARG04(sp)  #  save it in arg4 as per ABI
11852ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li       a3, 0                       #  a3 <- false
11853ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw       a1, offThread_method(rSELF)
11854ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a0, rSELF
11855ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw       a1, offMethod_insns(a1)
11856ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a2, rOBJ
11857ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu     a1, rPC, a1
11858ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sra      a1, a1, 1
11859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* call, r0 gets catchRelPc (a code-unit offset) */
11861ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmFindCatchBlock)           # call(self, relPc, exc, scan?, &fp)
11862ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rFP, 20(sp)            # retrieve the updated rFP
11863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11864ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* update frame pointer and check result from dvmFindCatchBlock */
11865ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, v0
11866ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bltz      v0, .LnotCaughtLocally
11867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11868ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* fix earlier stack overflow if necessary; Preserve a0 */
11869ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lbu       a1, offThread_stackOverflowed(rSELF)
11870ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a1, 1f
11871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      rBIX, a0
11872ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
11873ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rOBJ
11874ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmCleanupStackOverflow)
11875ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rBIX
11876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11877ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes1:
11878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11879ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/* adjust locals to match self->interpSave.curFrame and updated PC */
11880ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVEAREA_FROM_FP(a1, rFP)           # a1<- new save area
11881ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, offStackSaveArea_method(a1)
11882ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a1, offThread_method(rSELF)
11883ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offMethod_clazz(a1)
11884ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, offMethod_insns(a1)
11885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a2, offClassObject_pDvmDex(a2)
11886ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    EAS1(rPC, a3, a0)
11887ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        a2, offThread_methodClassDex(rSELF)
11888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11889ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* release the tracked alloc on the exception */
11890ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rOBJ
11891ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11892ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReleaseTrackedAlloc)
11893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11894ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* restore the exception if the handler wants it */
11895ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        rIBASE, offThread_curHandlerTable(rSELF)
11896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()
11897ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)
11898ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    bne       t0, OP_MOVE_EXCEPTION, 2f
11899ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rOBJ, offThread_exception(rSELF)
11900ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
11901ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)
11902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11903ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # Manage debugger bookkeeping
11904ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes7:
11905ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rPC, offThread_pc(rSELF)
11906ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rFP, offThread_curFrame(rSELF)
11907ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
11908ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rOBJ
11909ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReportExceptionThrow)
11910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         8b
11911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11912ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LnotCaughtLocally:                     #  rOBJ = exception
11913ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* fix stack overflow if necessary */
11914ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lbu       a1, offThread_stackOverflowed(rSELF)
11915ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    beqz      a1, 3f
11916ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rSELF
11917ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rOBJ
11918ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmCleanupStackOverflow)           #  dvmCleanupStackOverflow(self, exception)
11919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11920ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes3:
11921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # may want to show "not caught locally" debug messages here
11922ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if DVM_SHOW_EXCEPTION >= 2
11923ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* call __android_log_print(prio, tag, format, ...) */
11924ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /* "Exception %s from %s:%d not caught locally" */
11925ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_method(rSELF)
11926ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a1, offMethod_insns(a0)
11927ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    subu      a1, rPC, a1
11928ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sra       a1, a1, 1
11929ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmLineNumFromPC)
11930ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        v0, 20(sp)
11931ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # dvmGetMethodSourceFile(method)
11932ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a0, offThread_method(rSELF)
11933ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmGetMethodSourceFile)
11934ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        v0, 16(sp)
11935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    # exception->clazz->descriptor
11936ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, offObject_clazz(rOBJ)
11937ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw        a3, offClassObject_descriptor(a3)
11938ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a2, .LstrExceptionNotCaughtLocally
11939ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a1, .LstrLogTag
11940ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li        a0, 3
11941ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(__android_log_print)
11942ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11943ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    sw        rOBJ, offThread_exception(rSELF)
11944ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, rOBJ
11945ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a1, rSELF
11946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmReleaseTrackedAlloc)
11947ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_gotoBail
11948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11949ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
11950ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Exception handling, calls through "glue code".
11951ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
11952ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if     0
11953ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LexceptionOld:
11954ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVE_PC_TO_SELF()                # export state
11955ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SAVE_FP_TO_SELF()
11956ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a0, rSELF               # arg to function
11957ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmMterp_exceptionThrown)
11958ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b       common_resumeAfterGlueCall
11959ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
11960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
11961ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#if defined(WITH_JIT)
11962ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
11963ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * If the JIT is actively building a trace we need to make sure
11964ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * that the field is fully resolved before including the current
11965ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * instruction.
11966ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *
11967ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * On entry:
11968ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *     rBIX: &dvmDex->pResFields[field]
11969ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     *     a0:  field pointer (must preserve)
11970ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
11971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_verifyField:
11972ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     lhu     a3, offThread_subMode(rSELF)
11973ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     andi    a3, kSubModeJitTraceBuild
11974ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     bnez    a3, 1f                 # Not building trace, continue
11975ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     jr      ra
11976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
11977ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     lw      a1, (rBIX)
11978ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     beqz    a1, 2f                 # resolution complete ?
11979ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     jr      ra
11980ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes2:
11981ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a0, 0)
11982ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a1, 4)
11983ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a2, 8)
11984ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(a3, 12)
11985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_STORE(ra, 16)
11986ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    a0, rSELF
11987ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    a1, rPC
11988ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmJitEndTraceSelect)        #(self,pc) end trace before this inst)
11989ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a0, 0)
11990ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a1, 4)
11991ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a2, 8)
11992ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(a3, 12)
11993ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SCRATCH_LOAD(ra, 16)
11994ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    jr      ra                       # return
11995ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes#endif
11996a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
11997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
11998ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * After returning from a "glued" function, pull out the updated
11999ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * values and start executing at the next instruction.
12000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12001ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_resumeAfterGlueCall:
12002ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_PC_FP_FROM_SELF()           #  pull rPC and rFP out of thread
12003ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      rIBASE, offThread_curHandlerTable(rSELF) # refresh
12004ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    FETCH_INST()                     #  load rINST from rPC
12005ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GET_INST_OPCODE(t0)              #  extract opcode from rINST
12006ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    GOTO_OPCODE(t0)                  #  jump to next instruction
12007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12009ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Invalid array index. Note that our calling convention is strange; we use a1
12010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * and a3 because those just happen to be the registers all our callers are
12011ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * using. We move a3 before calling the C function, but a1 happens to match.
12012ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * a1: index
12013ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * a3: size
12014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12015ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_errArrayIndex:
12016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12017ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move      a0, a3
12018ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowArrayIndexOutOfBoundsException)
12019ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b         common_exceptionThrown
12020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12021a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12022ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Integer divide or mod by zero.
12023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12024ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_errDivideByZero:
12025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12026ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     a0, .LstrDivideByZero
12027ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowArithmeticException)
12028ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b       common_exceptionThrown
12029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12031ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Attempt to allocate an array with a negative size.
12032ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry: length in a1
12033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12034ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_errNegativeArraySize:
12035a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12036ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move    a0, a1                                # arg0 <- len
12037ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowNegativeArraySizeException)    # (len)
12038ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b       common_exceptionThrown
12039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12041ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Invocation of a non-existent method.
12042ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * On entry: method name in a1
12043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12044ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_errNoSuchMethod:
12045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    move     a0, a1
12047ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowNoSuchMethodError)
12048ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b       common_exceptionThrown
12049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12051ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * We encountered a null object when we weren't expecting one.  We
12052ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * export the PC, throw a NullPointerException, and goto the exception
12053ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * processing code.
12054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12055ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_errNullObject:
12056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12057ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    li      a0, 0
12058ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmThrowNullPointerException)
12059ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    b       common_exceptionThrown
12060a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12062ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * For debugging, cause an immediate fault. The source address will be in ra. Use a jal to jump here.
12063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12064ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_abort:
12065ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    lw      zero,-4(zero)            #  generate SIGSEGV
12066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12068ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Spit out a "we were here", preserving all registers.
12069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12070ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .macro SQUEAK num
12071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_squeak\num:
12072ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA();
12073ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrSqueak
12074ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    LOAD_IMM(a1, \num);
12075ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(printf);
12076ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA();
12077ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    RETURN;
12078ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endm
12079ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12080ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SQUEAK 0
12081ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SQUEAK 1
12082ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SQUEAK 2
12083ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SQUEAK 3
12084ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SQUEAK 4
12085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    SQUEAK 5
12086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12088ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Spit out the number in a0, preserving registers.
12089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12090ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_printNum:
12091ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA()
12092ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    MOVE_REG(a1, a0)
12093ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrSqueak
12094ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(printf)
12095ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA()
12096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    RETURN
12097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12099ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Print a newline, preserving registers.
12100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12101ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_printNewline:
12102ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA()
12103ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrNewline
12104ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(printf)
12105ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA()
12106ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    RETURN
12107ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12108ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    /*
12109ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     * Print the 32-bit quantity in a0 as a hex value, preserving registers.
12110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes     */
12111ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_printHex:
12112ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA()
12113ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    MOVE_REG(a1, a0)
12114ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrPrintHex
12115ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(printf)
12116ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA()
12117ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesRETURN;
12118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12120ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Print the 64-bit quantity in a0-a1, preserving registers.
12121a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12122ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_printLong:
12123ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA()
12124ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    MOVE_REG(a3, a1)
12125ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    MOVE_REG(a2, a0)
12126ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la        a0, .LstrPrintLong
12127ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(printf)
12128ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA()
12129ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    RETURN;
12130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12132ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Print full method info.  Pass the Method* in a0.  Preserves regs.
12133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12134ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_printMethod:
12135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA()
12136ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmMterpPrintMethod)
12137ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA()
12138ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    RETURN
12139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12141ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Call a C helper function that dumps regs and possibly some
12142ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * additional info.  Requires the C function to be compiled in.
12143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12144ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .if 0
12145ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughescommon_dumpRegs:
12146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_STORE_RA()
12147ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    JAL(dvmMterpDumpMipsRegs)
12148ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    STACK_LOAD_RA()
12149ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    RETURN
12150ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .endif
12151ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12152ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes/*
12153ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes * Zero-terminated ASCII string data.
12154ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes */
12155ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .data
12156ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12157ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrBadEntryPoint:
12158ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "Bad entry point %d\n"
12159ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrDivideByZero:
12160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "divide by zero"
12161ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrFilledNewArrayNotImpl:
12162ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "filled-new-array only implemented for 'int'"
12163ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrLogTag:
12164ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz  "mterp"
12165ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrExceptionNotCaughtLocally:
12166ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz  "Exception %s from %s:%d not caught locally\n"
12167ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12168ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrNewline:
12169ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "\n"
12170ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrSqueak:
12171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "<%d>"
12172ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrPrintHex:
12173ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "<0x%x>"
12174ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.LstrPrintLong:
12175ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .asciiz "<%lld>"
12176ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12177ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes
12178ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .global dvmAsmAltInstructionStart
12179ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .type   dvmAsmAltInstructionStart, %function
12180ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    .text
12181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12182ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott HughesdvmAsmAltInstructionStart = .L_ALT_OP_NOP
12183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NOP: /* 0x00 */
12186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (0 * 128)
12197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE: /* 0x01 */
12211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (1 * 128)
12222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_FROM16: /* 0x02 */
12236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (2 * 128)
12247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_16: /* 0x03 */
12261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (3 * 128)
12272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_WIDE: /* 0x04 */
12286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (4 * 128)
12297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_WIDE_FROM16: /* 0x05 */
12311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (5 * 128)
12322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_WIDE_16: /* 0x06 */
12336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (6 * 128)
12347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_OBJECT: /* 0x07 */
12361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (7 * 128)
12372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_OBJECT_FROM16: /* 0x08 */
12386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (8 * 128)
12397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_OBJECT_16: /* 0x09 */
12411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (9 * 128)
12422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_RESULT: /* 0x0a */
12436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (10 * 128)
12447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_RESULT_WIDE: /* 0x0b */
12461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (11 * 128)
12472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_RESULT_OBJECT: /* 0x0c */
12486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (12 * 128)
12497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MOVE_EXCEPTION: /* 0x0d */
12511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (13 * 128)
12522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RETURN_VOID: /* 0x0e */
12536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (14 * 128)
12547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RETURN: /* 0x0f */
12561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (15 * 128)
12572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RETURN_WIDE: /* 0x10 */
12586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (16 * 128)
12597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RETURN_OBJECT: /* 0x11 */
12611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (17 * 128)
12622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_4: /* 0x12 */
12636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (18 * 128)
12647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_16: /* 0x13 */
12661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (19 * 128)
12672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST: /* 0x14 */
12686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (20 * 128)
12697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_HIGH16: /* 0x15 */
12711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (21 * 128)
12722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_WIDE_16: /* 0x16 */
12736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (22 * 128)
12747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_WIDE_32: /* 0x17 */
12761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (23 * 128)
12772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_WIDE: /* 0x18 */
12786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (24 * 128)
12797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_WIDE_HIGH16: /* 0x19 */
12811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (25 * 128)
12822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_STRING: /* 0x1a */
12836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (26 * 128)
12847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_STRING_JUMBO: /* 0x1b */
12861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (27 * 128)
12872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CONST_CLASS: /* 0x1c */
12886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (28 * 128)
12897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MONITOR_ENTER: /* 0x1d */
12911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (29 * 128)
12922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MONITOR_EXIT: /* 0x1e */
12936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (30 * 128)
12947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CHECK_CAST: /* 0x1f */
12961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (31 * 128)
12972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
12975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
12976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
12977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
12978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
12979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
12980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
12981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
12982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
12983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
12984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
12985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INSTANCE_OF: /* 0x20 */
12986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
12987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
12988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
12989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
12990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
12991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
12992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
12993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
12994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
12995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
12996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (32 * 128)
12997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
12998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
12999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ARRAY_LENGTH: /* 0x21 */
13011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (33 * 128)
13022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NEW_INSTANCE: /* 0x22 */
13036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (34 * 128)
13047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NEW_ARRAY: /* 0x23 */
13061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (35 * 128)
13072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_FILLED_NEW_ARRAY: /* 0x24 */
13086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (36 * 128)
13097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_FILLED_NEW_ARRAY_RANGE: /* 0x25 */
13111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (37 * 128)
13122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_FILL_ARRAY_DATA: /* 0x26 */
13136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (38 * 128)
13147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_THROW: /* 0x27 */
13161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (39 * 128)
13172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_GOTO: /* 0x28 */
13186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (40 * 128)
13197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_GOTO_16: /* 0x29 */
13211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (41 * 128)
13222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_GOTO_32: /* 0x2a */
13236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (42 * 128)
13247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_PACKED_SWITCH: /* 0x2b */
13261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (43 * 128)
13272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPARSE_SWITCH: /* 0x2c */
13286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (44 * 128)
13297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CMPL_FLOAT: /* 0x2d */
13311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (45 * 128)
13322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CMPG_FLOAT: /* 0x2e */
13336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (46 * 128)
13347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CMPL_DOUBLE: /* 0x2f */
13361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (47 * 128)
13372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CMPG_DOUBLE: /* 0x30 */
13386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (48 * 128)
13397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_CMP_LONG: /* 0x31 */
13411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (49 * 128)
13422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_EQ: /* 0x32 */
13436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (50 * 128)
13447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_NE: /* 0x33 */
13461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (51 * 128)
13472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_LT: /* 0x34 */
13486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (52 * 128)
13497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_GE: /* 0x35 */
13511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (53 * 128)
13522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_GT: /* 0x36 */
13536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (54 * 128)
13547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_LE: /* 0x37 */
13561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (55 * 128)
13572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_EQZ: /* 0x38 */
13586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (56 * 128)
13597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_NEZ: /* 0x39 */
13611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (57 * 128)
13622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_LTZ: /* 0x3a */
13636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (58 * 128)
13647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_GEZ: /* 0x3b */
13661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (59 * 128)
13672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_GTZ: /* 0x3c */
13686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (60 * 128)
13697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IF_LEZ: /* 0x3d */
13711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (61 * 128)
13722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_3E: /* 0x3e */
13736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (62 * 128)
13747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_3F: /* 0x3f */
13761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (63 * 128)
13772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_40: /* 0x40 */
13786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (64 * 128)
13797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_41: /* 0x41 */
13811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (65 * 128)
13822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_42: /* 0x42 */
13836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (66 * 128)
13847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_43: /* 0x43 */
13861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (67 * 128)
13872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET: /* 0x44 */
13886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (68 * 128)
13897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET_WIDE: /* 0x45 */
13911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (69 * 128)
13922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET_OBJECT: /* 0x46 */
13936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (70 * 128)
13947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET_BOOLEAN: /* 0x47 */
13961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (71 * 128)
13972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
13975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
13976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
13977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
13978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
13979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
13980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
13981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
13982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
13983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
13984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
13985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET_BYTE: /* 0x48 */
13986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
13987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
13988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
13989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
13990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
13991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
13992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
13993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
13994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
13995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
13996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (72 * 128)
13997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
13998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
13999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET_CHAR: /* 0x49 */
14011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (73 * 128)
14022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AGET_SHORT: /* 0x4a */
14036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (74 * 128)
14047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT: /* 0x4b */
14061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (75 * 128)
14072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT_WIDE: /* 0x4c */
14086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (76 * 128)
14097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT_OBJECT: /* 0x4d */
14111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (77 * 128)
14122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT_BOOLEAN: /* 0x4e */
14136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (78 * 128)
14147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT_BYTE: /* 0x4f */
14161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (79 * 128)
14172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT_CHAR: /* 0x50 */
14186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (80 * 128)
14197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_APUT_SHORT: /* 0x51 */
14211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (81 * 128)
14222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET: /* 0x52 */
14236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (82 * 128)
14247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_WIDE: /* 0x53 */
14261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (83 * 128)
14272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_OBJECT: /* 0x54 */
14286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (84 * 128)
14297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_BOOLEAN: /* 0x55 */
14311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (85 * 128)
14322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_BYTE: /* 0x56 */
14336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (86 * 128)
14347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_CHAR: /* 0x57 */
14361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (87 * 128)
14372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_SHORT: /* 0x58 */
14386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (88 * 128)
14397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT: /* 0x59 */
14411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (89 * 128)
14422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_WIDE: /* 0x5a */
14436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (90 * 128)
14447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_OBJECT: /* 0x5b */
14461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (91 * 128)
14472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_BOOLEAN: /* 0x5c */
14486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (92 * 128)
14497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_BYTE: /* 0x5d */
14511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (93 * 128)
14522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_CHAR: /* 0x5e */
14536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (94 * 128)
14547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_SHORT: /* 0x5f */
14561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (95 * 128)
14572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET: /* 0x60 */
14586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (96 * 128)
14597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_WIDE: /* 0x61 */
14611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (97 * 128)
14622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_OBJECT: /* 0x62 */
14636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (98 * 128)
14647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_BOOLEAN: /* 0x63 */
14661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (99 * 128)
14672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_BYTE: /* 0x64 */
14686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (100 * 128)
14697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_CHAR: /* 0x65 */
14711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (101 * 128)
14722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_SHORT: /* 0x66 */
14736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (102 * 128)
14747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT: /* 0x67 */
14761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (103 * 128)
14772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_WIDE: /* 0x68 */
14786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (104 * 128)
14797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_OBJECT: /* 0x69 */
14811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (105 * 128)
14822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_BOOLEAN: /* 0x6a */
14836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (106 * 128)
14847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_BYTE: /* 0x6b */
14861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (107 * 128)
14872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_CHAR: /* 0x6c */
14886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (108 * 128)
14897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_SHORT: /* 0x6d */
14911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (109 * 128)
14922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_VIRTUAL: /* 0x6e */
14936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (110 * 128)
14947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_SUPER: /* 0x6f */
14961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (111 * 128)
14972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
14975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
14976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
14977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
14978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
14979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
14980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
14981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
14982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
14983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
14984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
14985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_DIRECT: /* 0x70 */
14986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
14987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
14988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
14989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
14990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
14991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
14992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
14993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
14994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
14995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
14996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (112 * 128)
14997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
14998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
14999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_STATIC: /* 0x71 */
15011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (113 * 128)
15022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_INTERFACE: /* 0x72 */
15036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (114 * 128)
15047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_73: /* 0x73 */
15061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (115 * 128)
15072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_VIRTUAL_RANGE: /* 0x74 */
15086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (116 * 128)
15097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_SUPER_RANGE: /* 0x75 */
15111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (117 * 128)
15122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_DIRECT_RANGE: /* 0x76 */
15136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (118 * 128)
15147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_STATIC_RANGE: /* 0x77 */
15161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (119 * 128)
15172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_INTERFACE_RANGE: /* 0x78 */
15186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (120 * 128)
15197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_79: /* 0x79 */
15211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (121 * 128)
15222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_7A: /* 0x7a */
15236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (122 * 128)
15247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NEG_INT: /* 0x7b */
15261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (123 * 128)
15272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NOT_INT: /* 0x7c */
15286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (124 * 128)
15297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NEG_LONG: /* 0x7d */
15311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (125 * 128)
15322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NOT_LONG: /* 0x7e */
15336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (126 * 128)
15347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NEG_FLOAT: /* 0x7f */
15361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (127 * 128)
15372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_NEG_DOUBLE: /* 0x80 */
15386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (128 * 128)
15397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INT_TO_LONG: /* 0x81 */
15411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (129 * 128)
15422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INT_TO_FLOAT: /* 0x82 */
15436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (130 * 128)
15447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INT_TO_DOUBLE: /* 0x83 */
15461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (131 * 128)
15472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_LONG_TO_INT: /* 0x84 */
15486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (132 * 128)
15497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_LONG_TO_FLOAT: /* 0x85 */
15511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (133 * 128)
15522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_LONG_TO_DOUBLE: /* 0x86 */
15536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (134 * 128)
15547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_FLOAT_TO_INT: /* 0x87 */
15561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (135 * 128)
15572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_FLOAT_TO_LONG: /* 0x88 */
15586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (136 * 128)
15597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_FLOAT_TO_DOUBLE: /* 0x89 */
15611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (137 * 128)
15622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DOUBLE_TO_INT: /* 0x8a */
15636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (138 * 128)
15647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DOUBLE_TO_LONG: /* 0x8b */
15661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (139 * 128)
15672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DOUBLE_TO_FLOAT: /* 0x8c */
15686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (140 * 128)
15697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INT_TO_BYTE: /* 0x8d */
15711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (141 * 128)
15722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INT_TO_CHAR: /* 0x8e */
15736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (142 * 128)
15747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INT_TO_SHORT: /* 0x8f */
15761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (143 * 128)
15772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_INT: /* 0x90 */
15786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (144 * 128)
15797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_INT: /* 0x91 */
15811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (145 * 128)
15822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_INT: /* 0x92 */
15836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (146 * 128)
15847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_INT: /* 0x93 */
15861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (147 * 128)
15872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_INT: /* 0x94 */
15886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (148 * 128)
15897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AND_INT: /* 0x95 */
15911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (149 * 128)
15922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_OR_INT: /* 0x96 */
15936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (150 * 128)
15947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_XOR_INT: /* 0x97 */
15961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (151 * 128)
15972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
15975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
15976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
15977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
15978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
15979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
15980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
15981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
15982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
15983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
15984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
15985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHL_INT: /* 0x98 */
15986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
15987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
15988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
15989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
15990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
15991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
15992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
15993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
15994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
15995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
15996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (152 * 128)
15997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
15998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
15999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHR_INT: /* 0x99 */
16011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (153 * 128)
16022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_USHR_INT: /* 0x9a */
16036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (154 * 128)
16047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_LONG: /* 0x9b */
16061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (155 * 128)
16072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_LONG: /* 0x9c */
16086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (156 * 128)
16097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_LONG: /* 0x9d */
16111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (157 * 128)
16122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_LONG: /* 0x9e */
16136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (158 * 128)
16147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_LONG: /* 0x9f */
16161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (159 * 128)
16172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AND_LONG: /* 0xa0 */
16186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (160 * 128)
16197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_OR_LONG: /* 0xa1 */
16211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (161 * 128)
16222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_XOR_LONG: /* 0xa2 */
16236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (162 * 128)
16247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHL_LONG: /* 0xa3 */
16261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (163 * 128)
16272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHR_LONG: /* 0xa4 */
16286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (164 * 128)
16297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_USHR_LONG: /* 0xa5 */
16311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (165 * 128)
16322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_FLOAT: /* 0xa6 */
16336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (166 * 128)
16347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_FLOAT: /* 0xa7 */
16361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (167 * 128)
16372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_FLOAT: /* 0xa8 */
16386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (168 * 128)
16397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_FLOAT: /* 0xa9 */
16411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (169 * 128)
16422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_FLOAT: /* 0xaa */
16436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (170 * 128)
16447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_DOUBLE: /* 0xab */
16461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (171 * 128)
16472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_DOUBLE: /* 0xac */
16486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (172 * 128)
16497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_DOUBLE: /* 0xad */
16511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (173 * 128)
16522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_DOUBLE: /* 0xae */
16536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (174 * 128)
16547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_DOUBLE: /* 0xaf */
16561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (175 * 128)
16572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_INT_2ADDR: /* 0xb0 */
16586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (176 * 128)
16597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_INT_2ADDR: /* 0xb1 */
16611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (177 * 128)
16622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_INT_2ADDR: /* 0xb2 */
16636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (178 * 128)
16647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_INT_2ADDR: /* 0xb3 */
16661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (179 * 128)
16672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_INT_2ADDR: /* 0xb4 */
16686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (180 * 128)
16697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AND_INT_2ADDR: /* 0xb5 */
16711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (181 * 128)
16722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_OR_INT_2ADDR: /* 0xb6 */
16736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (182 * 128)
16747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_XOR_INT_2ADDR: /* 0xb7 */
16761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (183 * 128)
16772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHL_INT_2ADDR: /* 0xb8 */
16786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (184 * 128)
16797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHR_INT_2ADDR: /* 0xb9 */
16811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (185 * 128)
16822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_USHR_INT_2ADDR: /* 0xba */
16836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (186 * 128)
16847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_LONG_2ADDR: /* 0xbb */
16861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (187 * 128)
16872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_LONG_2ADDR: /* 0xbc */
16886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (188 * 128)
16897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_LONG_2ADDR: /* 0xbd */
16911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (189 * 128)
16922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_LONG_2ADDR: /* 0xbe */
16936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (190 * 128)
16947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_LONG_2ADDR: /* 0xbf */
16961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (191 * 128)
16972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
16975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
16976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
16977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
16978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
16979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
16980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
16981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
16982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
16983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
16984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
16985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AND_LONG_2ADDR: /* 0xc0 */
16986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
16987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
16988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
16989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
16990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
16991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
16992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
16993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
16994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
16995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
16996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (192 * 128)
16997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
16998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
16999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_OR_LONG_2ADDR: /* 0xc1 */
17011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (193 * 128)
17022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_XOR_LONG_2ADDR: /* 0xc2 */
17036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (194 * 128)
17047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHL_LONG_2ADDR: /* 0xc3 */
17061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (195 * 128)
17072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHR_LONG_2ADDR: /* 0xc4 */
17086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (196 * 128)
17097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_USHR_LONG_2ADDR: /* 0xc5 */
17111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (197 * 128)
17122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_FLOAT_2ADDR: /* 0xc6 */
17136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (198 * 128)
17147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_FLOAT_2ADDR: /* 0xc7 */
17161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (199 * 128)
17172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_FLOAT_2ADDR: /* 0xc8 */
17186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (200 * 128)
17197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_FLOAT_2ADDR: /* 0xc9 */
17211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (201 * 128)
17222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_FLOAT_2ADDR: /* 0xca */
17236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (202 * 128)
17247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_DOUBLE_2ADDR: /* 0xcb */
17261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (203 * 128)
17272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SUB_DOUBLE_2ADDR: /* 0xcc */
17286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (204 * 128)
17297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_DOUBLE_2ADDR: /* 0xcd */
17311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (205 * 128)
17322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_DOUBLE_2ADDR: /* 0xce */
17336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (206 * 128)
17347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_DOUBLE_2ADDR: /* 0xcf */
17361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (207 * 128)
17372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_INT_LIT16: /* 0xd0 */
17386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (208 * 128)
17397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RSUB_INT: /* 0xd1 */
17411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (209 * 128)
17422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_INT_LIT16: /* 0xd2 */
17436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (210 * 128)
17447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_INT_LIT16: /* 0xd3 */
17461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (211 * 128)
17472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_INT_LIT16: /* 0xd4 */
17486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (212 * 128)
17497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AND_INT_LIT16: /* 0xd5 */
17511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (213 * 128)
17522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_OR_INT_LIT16: /* 0xd6 */
17536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (214 * 128)
17547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_XOR_INT_LIT16: /* 0xd7 */
17561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (215 * 128)
17572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17585ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_ADD_INT_LIT8: /* 0xd8 */
17586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17587a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17588a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17589a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17590a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17591a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17592a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17593a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17594a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17595a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17596ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (216 * 128)
17597a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17598a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17599a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17600a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17601a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17602a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17603a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17604a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17605a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17606a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17607a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17608a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17609a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17610ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RSUB_INT_LIT8: /* 0xd9 */
17611a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17612a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17613a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17614a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17615a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17616a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17617a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17618a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17619a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17620a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17621ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (217 * 128)
17622a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17623a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17624a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17625a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17626a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17627a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17628a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17629a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17630a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17631a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17632a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17633a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17634a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17635ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_MUL_INT_LIT8: /* 0xda */
17636a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17637a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17638a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17639a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17640a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17641a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17642a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17643a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17644a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17645a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17646ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (218 * 128)
17647a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17648a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17649a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17650a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17651a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17652a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17653a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17654a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17655a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17656a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17657a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17658a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17659a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17660ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_DIV_INT_LIT8: /* 0xdb */
17661a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17662a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17663a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17664a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17665a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17666a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17667a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17668a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17669a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17670a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17671ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (219 * 128)
17672a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17673a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17674a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17675a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17676a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17677a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17678a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17679a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17680a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17681a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17682a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17683a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17684a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17685ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_REM_INT_LIT8: /* 0xdc */
17686a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17687a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17688a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17689a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17690a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17691a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17692a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17693a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17694a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17695a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17696ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (220 * 128)
17697a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17698a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17699a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17700a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17701a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17702a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17703a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17704a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17705a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17706a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17707a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17708a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17709a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17710ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_AND_INT_LIT8: /* 0xdd */
17711a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17712a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17713a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17714a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17715a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17716a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17717a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17718a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17719a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17720a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17721ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (221 * 128)
17722a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17723a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17724a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17725a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17726a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17727a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17728a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17729a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17730a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17731a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17732a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17733a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17734a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17735ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_OR_INT_LIT8: /* 0xde */
17736a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17737a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17738a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17739a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17740a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17741a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17742a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17743a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17744a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17745a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17746ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (222 * 128)
17747a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17748a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17749a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17750a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17751a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17752a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17753a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17754a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17755a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17756a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17757a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17758a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17759a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17760ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_XOR_INT_LIT8: /* 0xdf */
17761a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17762a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17763a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17764a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17765a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17766a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17767a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17768a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17769a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17770a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17771ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (223 * 128)
17772a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17773a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17774a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17775a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17776a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17777a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17778a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17779a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17780a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17781a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17782a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17783a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17784a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17785ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHL_INT_LIT8: /* 0xe0 */
17786a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17787a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17788a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17789a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17790a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17791a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17792a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17793a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17794a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17795a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17796ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (224 * 128)
17797a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17798a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17799a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17800a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17801a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17802a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17803a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17804a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17805a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17806a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17807a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17808a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17809a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17810ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SHR_INT_LIT8: /* 0xe1 */
17811a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17812a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17813a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17814a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17815a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17816a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17817a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17818a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17819a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17820a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17821ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (225 * 128)
17822a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17823a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17824a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17825a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17826a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17827a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17828a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17829a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17830a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17831a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17832a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17833a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17834a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17835ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_USHR_INT_LIT8: /* 0xe2 */
17836a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17837a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17838a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17839a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17840a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17841a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17842a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17843a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17844a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17845a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17846ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (226 * 128)
17847a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17848a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17849a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17850a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17851a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17852a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17853a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17854a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17855a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17856a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17857a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17858a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17859a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17860ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_VOLATILE: /* 0xe3 */
17861a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17862a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17863a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17864a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17865a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17866a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17867a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17868a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17869a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17870a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17871ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (227 * 128)
17872a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17873a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17874a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17875a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17876a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17877a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17878a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17879a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17880a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17881a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17882a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17883a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17884a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17885ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_VOLATILE: /* 0xe4 */
17886a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17887a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17888a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17889a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17890a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17891a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17892a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17893a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17894a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17895a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17896ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (228 * 128)
17897a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17898a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17899a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17900a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17901a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17902a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17903a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17904a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17905a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17906a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17907a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17908a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17909a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17910ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_VOLATILE: /* 0xe5 */
17911a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17912a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17913a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17914a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17915a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17916a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17917a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17918a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17919a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17920a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17921ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (229 * 128)
17922a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17923a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17924a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17925a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17926a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17927a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17928a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17929a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17930a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17931a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17932a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17933a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17934a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17935ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_VOLATILE: /* 0xe6 */
17936a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17937a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17938a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17939a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17940a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17941a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17942a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17943a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17944a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17945a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17946ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (230 * 128)
17947a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17948a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17949a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17950a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17951a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17952a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17953a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17954a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17955a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17956a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17957a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17958a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17959a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17960ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_OBJECT_VOLATILE: /* 0xe7 */
17961a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17962a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17963a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17964a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17965a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17966a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17967a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17968a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17969a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17970a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17971ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (231 * 128)
17972a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17973a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17974a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
17975a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
17976a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
17977a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
17978a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
17979a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
17980a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
17981a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
17982a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
17983a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
17984a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
17985ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_WIDE_VOLATILE: /* 0xe8 */
17986a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
17987a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
17988a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
17989a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
17990a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
17991a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
17992a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
17993a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
17994a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
17995a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
17996ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (232 * 128)
17997a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
17998a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
17999a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18000a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18001a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18002a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18003a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18004a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18005a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18006a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18007a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18008a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18009a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18010ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_WIDE_VOLATILE: /* 0xe9 */
18011a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18012a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18013a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18014a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18015a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18016a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18017a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18018a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18019a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18020a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18021ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (233 * 128)
18022a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18023a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18024a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18025a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18026a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18027a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18028a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18029a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18030a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18031a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18032a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18033a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18034a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18035ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_WIDE_VOLATILE: /* 0xea */
18036a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18037a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18038a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18039a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18040a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18041a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18042a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18043a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18044a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18045a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18046ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (234 * 128)
18047a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18048a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18049a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18050a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18051a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18052a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18053a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18054a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18055a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18056a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18057a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18058a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18059a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18060ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_WIDE_VOLATILE: /* 0xeb */
18061a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18062a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18063a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18064a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18065a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18066a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18067a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18068a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18069a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18070a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18071ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (235 * 128)
18072a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18073a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18074a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18075a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18076a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18077a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18078a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18079a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18080a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18081a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18082a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18083a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18084a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18085ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_BREAKPOINT: /* 0xec */
18086a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18087a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18088a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18089a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18090a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18091a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18092a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18093a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18094a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18095a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18096ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (236 * 128)
18097a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18098a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18099a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18100a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18101a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18102a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18103a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18104a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18105a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18106a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18107a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18108a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18109a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18110ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_THROW_VERIFICATION_ERROR: /* 0xed */
18111a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18112a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18113a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18114a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18115a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18116a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18117a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18118a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18119a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18120a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18121ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (237 * 128)
18122a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18123a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18124a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18125a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18126a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18127a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18128a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18129a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18130a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18131a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18132a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18133a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18134a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18135ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_EXECUTE_INLINE: /* 0xee */
18136a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18137a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18138a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18139a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18140a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18141a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18142a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18143a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18144a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18145a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18146ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (238 * 128)
18147a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18148a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18149a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18150a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18151a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18152a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18153a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18154a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18155a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18156a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18157a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18158a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18159a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18160ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_EXECUTE_INLINE_RANGE: /* 0xef */
18161a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18162a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18163a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18164a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18165a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18166a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18167a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18168a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18169a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18170a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18171ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (239 * 128)
18172a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18173a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18174a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18175a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18176a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18177a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18178a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18179a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18180a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18181a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18182a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18183a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18184a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18185ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_OBJECT_INIT_RANGE: /* 0xf0 */
18186a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18187a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18188a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18189a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18190a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18191a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18192a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18193a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18194a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18195a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18196ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (240 * 128)
18197a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18198a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18199a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18200a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18201a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18202a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18203a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18204a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18205a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18206a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18207a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18208a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18209a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18210ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_RETURN_VOID_BARRIER: /* 0xf1 */
18211a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18212a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18213a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18214a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18215a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18216a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18217a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18218a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18219a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18220a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18221ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (241 * 128)
18222a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18223a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18224a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18225a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18226a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18227a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18228a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18229a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18230a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18231a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18232a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18233a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18234a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18235ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_QUICK: /* 0xf2 */
18236a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18237a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18238a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18239a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18240a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18241a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18242a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18243a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18244a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18245a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18246ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (242 * 128)
18247a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18248a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18249a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18250a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18251a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18252a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18253a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18254a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18255a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18256a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18257a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18258a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18259a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18260ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_WIDE_QUICK: /* 0xf3 */
18261a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18262a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18263a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18264a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18265a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18266a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18267a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18268a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18269a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18270a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18271ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (243 * 128)
18272a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18273a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18274a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18275a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18276a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18277a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18278a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18279a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18280a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18281a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18282a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18283a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18284a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18285ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IGET_OBJECT_QUICK: /* 0xf4 */
18286a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18287a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18288a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18289a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18290a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18291a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18292a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18293a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18294a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18295a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18296ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (244 * 128)
18297a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18298a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18299a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18300a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18301a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18302a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18303a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18304a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18305a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18306a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18307a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18308a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18309a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18310ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_QUICK: /* 0xf5 */
18311a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18312a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18313a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18314a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18315a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18316a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18317a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18318a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18319a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18320a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18321ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (245 * 128)
18322a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18323a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18324a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18325a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18326a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18327a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18328a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18329a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18330a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18331a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18332a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18333a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18334a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18335ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_WIDE_QUICK: /* 0xf6 */
18336a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18337a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18338a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18339a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18340a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18341a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18342a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18343a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18344a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18345a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18346ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (246 * 128)
18347a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18348a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18349a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18350a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18351a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18352a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18353a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18354a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18355a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18356a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18357a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18358a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18359a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18360ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_OBJECT_QUICK: /* 0xf7 */
18361a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18362a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18363a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18364a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18365a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18366a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18367a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18368a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18369a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18370a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18371ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (247 * 128)
18372a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18373a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18374a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18375a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18376a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18377a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18378a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18379a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18380a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18381a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18382a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18383a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18384a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18385ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_VIRTUAL_QUICK: /* 0xf8 */
18386a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18387a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18388a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18389a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18390a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18391a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18392a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18393a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18394a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18395a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18396ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (248 * 128)
18397a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18398a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18399a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18400a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18401a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18402a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18403a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18404a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18405a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18406a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18407a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18408a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18409a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18410ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_VIRTUAL_QUICK_RANGE: /* 0xf9 */
18411a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18412a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18413a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18414a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18415a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18416a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18417a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18418a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18419a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18420a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18421ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (249 * 128)
18422a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18423a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18424a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18425a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18426a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18427a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18428a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18429a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18430a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18431a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18432a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18433a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18434a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18435ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_SUPER_QUICK: /* 0xfa */
18436a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18437a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18438a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18439a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18440a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18441a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18442a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18443a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18444a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18445a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18446ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (250 * 128)
18447a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18448a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18449a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18450a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18451a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18452a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18453a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18454a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18455a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18456a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18457a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18458a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18459a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18460ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_INVOKE_SUPER_QUICK_RANGE: /* 0xfb */
18461a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18462a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18463a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18464a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18465a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18466a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18467a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18468a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18469a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18470a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18471ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (251 * 128)
18472a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18473a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18474a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18475a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18476a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18477a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18478a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18479a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18480a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18481a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18482a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18483a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18484a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18485ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_IPUT_OBJECT_VOLATILE: /* 0xfc */
18486a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18487a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18488a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18489a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18490a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18491a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18492a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18493a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18494a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18495a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18496ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (252 * 128)
18497a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18498a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18499a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18500a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18501a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18502a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18503a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18504a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18505a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18506a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18507a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18508a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18509a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18510ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SGET_OBJECT_VOLATILE: /* 0xfd */
18511a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18512a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18513a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18514a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18515a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18516a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18517a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18518a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18519a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18520a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18521ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (253 * 128)
18522a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18523a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18524a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18525a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18526a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18527a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18528a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18529a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18530a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18531a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18532a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18533a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18534a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18535ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_SPUT_OBJECT_VOLATILE: /* 0xfe */
18536a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18537a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18538a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18539a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18540a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18541a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18542a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18543a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18544a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18545a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18546ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (254 * 128)
18547a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18548a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18549a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18550a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18551a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18552a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18553a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18554a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18555a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18556a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18557a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18558a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* ------------------------------ */
18559a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18560ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes.L_ALT_OP_UNUSED_FF: /* 0xff */
18561a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/* File: mips/alt_stub.S */
18562a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham/*
18563a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * Inter-instruction transfer stub.  Call out to dvmCheckBefore to handle
18564a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * any interesting requests and then jump to the real instruction
18565a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * handler.    Note that the call to dvmCheckBefore is done as a tail call.
18566a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * rIBASE updates won't be seen until a refresh, and we can tell we have a
18567a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * stale rIBASE if breakFlags==0.  Always refresh rIBASE here, and then
18568a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham * bail to the real handler if breakFlags==0.
18569a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham */
18570a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lbu    a3, offThread_breakFlags(rSELF)
18571ba1195e1f17456a9a0acab6e122b49f65134fc1fElliott Hughes    la     rBIX, dvmAsmInstructionStart + (255 * 128)
18572a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    lw     rIBASE, offThread_curHandlerTable(rSELF)
18573a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    bnez   a3, 1f
18574a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX            # nothing to do - jump to real handler
18575a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham1:
18576a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    EXPORT_PC()
18577a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a0, rPC         # arg0
18578a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a1, rFP         # arg1
18579a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    move   a2, rSELF       # arg2
18580a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    JAL(dvmCheckBefore)
18581a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    jr     rBIX
18582a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham
18583a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .balign 128
18584a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .size   dvmAsmAltInstructionStart, .-dvmAsmAltInstructionStart
18585a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu Gandham    .global dvmAsmAltInstructionEnd
18586a8b91c52fd8a90b784835dfe1f8898035266c4ddRaghu GandhamdvmAsmAltInstructionEnd:
18587