summaryrefslogtreecommitdiff
path: root/src/buildvm_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildvm_arm.h')
-rw-r--r--src/buildvm_arm.h128
1 files changed, 66 insertions, 62 deletions
diff --git a/src/buildvm_arm.h b/src/buildvm_arm.h
index 505048bd..b450f5df 100644
--- a/src/buildvm_arm.h
+++ b/src/buildvm_arm.h
@@ -12,7 +12,7 @@
12#define DASM_SECTION_CODE_OP 0 12#define DASM_SECTION_CODE_OP 0
13#define DASM_SECTION_CODE_SUB 1 13#define DASM_SECTION_CODE_SUB 1
14#define DASM_MAXSECTION 2 14#define DASM_MAXSECTION 2
15static const unsigned int build_actionlist[5702] = { 15static const unsigned int build_actionlist[5706] = {
160x00010001, 160x00010001,
170x00060014, 170x00060014,
180xe3160000, 180xe3160000,
@@ -5381,9 +5381,10 @@ static const unsigned int build_actionlist[5702] = {
53810xe2400000, 53810xe2400000,
53820x000a0000, 53820x000a0000,
53830xe19710b0, 53830xe19710b0,
53840xe2511001, 53840xe2511000,
53850x000a0000,
53850xe18710b0, 53860xe18710b0,
53860x0a000000, 53870x3a000000,
53870x00050091, 53880x00050091,
53880x00000000, 53890x00000000,
53890xe1aa00d9, 53900xe1aa00d9,
@@ -5519,9 +5520,10 @@ static const unsigned int build_actionlist[5702] = {
55190xe2400000, 55200xe2400000,
55200x000a0000, 55210x000a0000,
55210xe19710b0, 55220xe19710b0,
55220xe2511001, 55230xe2511000,
55240x000a0000,
55230xe18710b0, 55250xe18710b0,
55240x0a000000, 55260x3a000000,
55250x00050091, 55270x00050091,
55260x00000000, 55280x00000000,
55270xe1aa00d9, 55290xe1aa00d9,
@@ -5550,9 +5552,10 @@ static const unsigned int build_actionlist[5702] = {
55500xe2400000, 55520xe2400000,
55510x000a0000, 55530x000a0000,
55520xe19710b0, 55540xe19710b0,
55530xe2511001, 55550xe2511000,
55560x000a0000,
55540xe18710b0, 55570xe18710b0,
55550x0a000000, 55580x3a000000,
55560x00050091, 55590x00050091,
55570x00000000, 55600x00000000,
55580xe5d6c000, 55610xe5d6c000,
@@ -5590,9 +5593,10 @@ static const unsigned int build_actionlist[5702] = {
55900xe2400000, 55930xe2400000,
55910x000a0000, 55940x000a0000,
55920xe19710b0, 55950xe19710b0,
55930xe2511001, 55960xe2511000,
55970x000a0000,
55940xe18710b0, 55980xe18710b0,
55950x0a000000, 55990x3a000000,
55960x00050093, 56000x00050093,
55970x00000000, 56010x00000000,
55980xe5180000, 56020xe5180000,
@@ -7138,7 +7142,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7138 7142
7139 case BC_FORL: 7143 case BC_FORL:
7140#if LJ_HASJIT 7144#if LJ_HASJIT
7141 dasm_put(Dst, 5363, -GG_DISP2HOT); 7145 dasm_put(Dst, 5363, -GG_DISP2HOT, HOTCOUNT_LOOP);
7142#endif 7146#endif
7143 break; 7147 break;
7144 7148
@@ -7150,68 +7154,68 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7150 case BC_FORI: 7154 case BC_FORI:
7151 case BC_IFORL: 7155 case BC_IFORL:
7152 vk = (op == BC_IFORL || op == BC_JFORL); 7156 vk = (op == BC_IFORL || op == BC_JFORL);
7153 dasm_put(Dst, 5373); 7157 dasm_put(Dst, 5374);
7154 if (op != BC_JFORL) { 7158 if (op != BC_JFORL) {
7155 dasm_put(Dst, 5375); 7159 dasm_put(Dst, 5376);
7156 } 7160 }
7157 if (!vk) { 7161 if (!vk) {
7158 dasm_put(Dst, 5377, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM); 7162 dasm_put(Dst, 5378, -LJ_TISNUM, -LJ_TISNUM, -LJ_TISNUM);
7159 } else { 7163 } else {
7160 dasm_put(Dst, 5395, -LJ_TISNUM); 7164 dasm_put(Dst, 5396, -LJ_TISNUM);
7161 if (op == BC_IFORL) { 7165 if (op == BC_IFORL) {
7162 dasm_put(Dst, 5403); 7166 dasm_put(Dst, 5404);
7163 } else { 7167 } else {
7164 dasm_put(Dst, 5405); 7168 dasm_put(Dst, 5406);
7165 } 7169 }
7166 dasm_put(Dst, 5408); 7170 dasm_put(Dst, 5409);
7167 } 7171 }
7168 dasm_put(Dst, 5413); 7172 dasm_put(Dst, 5414);
7169 if (op == BC_FORI) { 7173 if (op == BC_FORI) {
7170 dasm_put(Dst, 5415); 7174 dasm_put(Dst, 5416);
7171 } else if (op == BC_JFORI) { 7175 } else if (op == BC_JFORI) {
7172 dasm_put(Dst, 5417); 7176 dasm_put(Dst, 5418);
7173 } else if (op == BC_IFORL) { 7177 } else if (op == BC_IFORL) {
7174 dasm_put(Dst, 5420); 7178 dasm_put(Dst, 5421);
7175 } 7179 }
7176 if (vk) { 7180 if (vk) {
7177 dasm_put(Dst, 5422); 7181 dasm_put(Dst, 5423);
7178 } 7182 }
7179 dasm_put(Dst, 5424); 7183 dasm_put(Dst, 5425);
7180 if (op == BC_JFORI || op == BC_JFORL) { 7184 if (op == BC_JFORI || op == BC_JFORL) {
7181 dasm_put(Dst, 5429, BC_JLOOP); 7185 dasm_put(Dst, 5430, BC_JLOOP);
7182 } 7186 }
7183 dasm_put(Dst, 5432); 7187 dasm_put(Dst, 5433);
7184 if (!vk) { 7188 if (!vk) {
7185 dasm_put(Dst, 5439); 7189 dasm_put(Dst, 5440);
7186 } else { 7190 } else {
7187 dasm_put(Dst, 5441); 7191 dasm_put(Dst, 5442);
7188 } 7192 }
7189 dasm_put(Dst, 5443); 7193 dasm_put(Dst, 5444);
7190 if (!vk) { 7194 if (!vk) {
7191 dasm_put(Dst, 5447, -LJ_TISNUM, -LJ_TISNUM); 7195 dasm_put(Dst, 5448, -LJ_TISNUM, -LJ_TISNUM);
7192 } else { 7196 } else {
7193 dasm_put(Dst, 5459); 7197 dasm_put(Dst, 5460);
7194 } 7198 }
7195 dasm_put(Dst, 5468); 7199 dasm_put(Dst, 5469);
7196 if (op == BC_FORI) { 7200 if (op == BC_FORI) {
7197 dasm_put(Dst, 5472); 7201 dasm_put(Dst, 5473);
7198 } else if (op == BC_JFORI) { 7202 } else if (op == BC_JFORI) {
7199 dasm_put(Dst, 5474, BC_JLOOP); 7203 dasm_put(Dst, 5475, BC_JLOOP);
7200 } else if (op == BC_IFORL) { 7204 } else if (op == BC_IFORL) {
7201 dasm_put(Dst, 5479); 7205 dasm_put(Dst, 5480);
7202 } else { 7206 } else {
7203 dasm_put(Dst, 5481, BC_JLOOP); 7207 dasm_put(Dst, 5482, BC_JLOOP);
7204 } 7208 }
7205 dasm_put(Dst, 5484); 7209 dasm_put(Dst, 5485);
7206 if (vk) { 7210 if (vk) {
7207 dasm_put(Dst, 5490); 7211 dasm_put(Dst, 5491);
7208 } 7212 }
7209 dasm_put(Dst, 5495); 7213 dasm_put(Dst, 5496);
7210 break; 7214 break;
7211 7215
7212 case BC_ITERL: 7216 case BC_ITERL:
7213#if LJ_HASJIT 7217#if LJ_HASJIT
7214 dasm_put(Dst, 5501, -GG_DISP2HOT); 7218 dasm_put(Dst, 5502, -GG_DISP2HOT, HOTCOUNT_LOOP);
7215#endif 7219#endif
7216 break; 7220 break;
7217 7221
@@ -7220,40 +7224,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7220 break; 7224 break;
7221#endif 7225#endif
7222 case BC_IITERL: 7226 case BC_IITERL:
7223 dasm_put(Dst, 5511); 7227 dasm_put(Dst, 5513);
7224 if (op == BC_JITERL) { 7228 if (op == BC_JITERL) {
7225 dasm_put(Dst, 5513, -LJ_TNIL, BC_JLOOP); 7229 dasm_put(Dst, 5515, -LJ_TNIL, BC_JLOOP);
7226 } else { 7230 } else {
7227 dasm_put(Dst, 5519, -LJ_TNIL); 7231 dasm_put(Dst, 5521, -LJ_TNIL);
7228 } 7232 }
7229 dasm_put(Dst, 5525); 7233 dasm_put(Dst, 5527);
7230 break; 7234 break;
7231 7235
7232 case BC_LOOP: 7236 case BC_LOOP:
7233#if LJ_HASJIT 7237#if LJ_HASJIT
7234 dasm_put(Dst, 5532, -GG_DISP2HOT); 7238 dasm_put(Dst, 5534, -GG_DISP2HOT, HOTCOUNT_LOOP);
7235#endif 7239#endif
7236 break; 7240 break;
7237 7241
7238 case BC_ILOOP: 7242 case BC_ILOOP:
7239 dasm_put(Dst, 5542); 7243 dasm_put(Dst, 5545);
7240 break; 7244 break;
7241 7245
7242 case BC_JLOOP: 7246 case BC_JLOOP:
7243#if LJ_HASJIT 7247#if LJ_HASJIT
7244 dasm_put(Dst, 5549, DISPATCH_J(trace), DISPATCH_GL(vmstate), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); 7248 dasm_put(Dst, 5552, DISPATCH_J(trace), DISPATCH_GL(vmstate), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
7245#endif 7249#endif
7246 break; 7250 break;
7247 7251
7248 case BC_JMP: 7252 case BC_JMP:
7249 dasm_put(Dst, 5563); 7253 dasm_put(Dst, 5566);
7250 break; 7254 break;
7251 7255
7252 /* -- Function headers -------------------------------------------------- */ 7256 /* -- Function headers -------------------------------------------------- */
7253 7257
7254 case BC_FUNCF: 7258 case BC_FUNCF:
7255#if LJ_HASJIT 7259#if LJ_HASJIT
7256 dasm_put(Dst, 5572, -GG_DISP2HOT); 7260 dasm_put(Dst, 5575, -GG_DISP2HOT, HOTCOUNT_CALL);
7257#endif 7261#endif
7258 case BC_FUNCV: /* NYI: compiled vararg functions. */ 7262 case BC_FUNCV: /* NYI: compiled vararg functions. */
7259 break; 7263 break;
@@ -7263,42 +7267,42 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7263 break; 7267 break;
7264#endif 7268#endif
7265 case BC_IFUNCF: 7269 case BC_IFUNCF:
7266 dasm_put(Dst, 5582, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k)); 7270 dasm_put(Dst, 5586, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k));
7267 if (op != BC_JFUNCF) { 7271 if (op != BC_JFUNCF) {
7268 dasm_put(Dst, 5592); 7272 dasm_put(Dst, 5596);
7269 } 7273 }
7270 dasm_put(Dst, 5595, ~LJ_TNIL); 7274 dasm_put(Dst, 5599, ~LJ_TNIL);
7271 if (op == BC_JFUNCF) { 7275 if (op == BC_JFUNCF) {
7272 dasm_put(Dst, 5602, BC_JLOOP); 7276 dasm_put(Dst, 5606, BC_JLOOP);
7273 } else { 7277 } else {
7274 dasm_put(Dst, 5606); 7278 dasm_put(Dst, 5610);
7275 } 7279 }
7276 dasm_put(Dst, 5611); 7280 dasm_put(Dst, 5615);
7277 break; 7281 break;
7278 7282
7279 case BC_JFUNCV: 7283 case BC_JFUNCV:
7280#if !LJ_HASJIT 7284#if !LJ_HASJIT
7281 break; 7285 break;
7282#endif 7286#endif
7283 dasm_put(Dst, 5617); 7287 dasm_put(Dst, 5621);
7284 break; /* NYI: compiled vararg functions. */ 7288 break; /* NYI: compiled vararg functions. */
7285 7289
7286 case BC_IFUNCV: 7290 case BC_IFUNCV:
7287 dasm_put(Dst, 5619, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams), ~LJ_TNIL); 7291 dasm_put(Dst, 5623, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams), ~LJ_TNIL);
7288 break; 7292 break;
7289 7293
7290 case BC_FUNCC: 7294 case BC_FUNCC:
7291 case BC_FUNCCW: 7295 case BC_FUNCCW:
7292 if (op == BC_FUNCC) { 7296 if (op == BC_FUNCC) {
7293 dasm_put(Dst, 5660, Dt8(->f)); 7297 dasm_put(Dst, 5664, Dt8(->f));
7294 } else { 7298 } else {
7295 dasm_put(Dst, 5663, DISPATCH_GL(wrapf)); 7299 dasm_put(Dst, 5667, DISPATCH_GL(wrapf));
7296 } 7300 }
7297 dasm_put(Dst, 5666, Dt1(->maxstack), Dt1(->base), Dt1(->top)); 7301 dasm_put(Dst, 5670, Dt1(->maxstack), Dt1(->base), Dt1(->top));
7298 if (op == BC_FUNCCW) { 7302 if (op == BC_FUNCCW) {
7299 dasm_put(Dst, 5676, Dt8(->f)); 7303 dasm_put(Dst, 5680, Dt8(->f));
7300 } 7304 }
7301 dasm_put(Dst, 5679, LJ_VMST_C, DISPATCH_GL(vmstate), Dt1(->base), LJ_VMST_INTERP, Dt1(->top), DISPATCH_GL(vmstate)); 7305 dasm_put(Dst, 5683, LJ_VMST_C, DISPATCH_GL(vmstate), Dt1(->base), LJ_VMST_INTERP, Dt1(->top), DISPATCH_GL(vmstate));
7302 break; 7306 break;
7303 7307
7304 /* ---------------------------------------------------------------------- */ 7308 /* ---------------------------------------------------------------------- */
@@ -7318,7 +7322,7 @@ static int build_backend(BuildCtx *ctx)
7318 7322
7319 build_subroutines(ctx); 7323 build_subroutines(ctx);
7320 7324
7321 dasm_put(Dst, 5701); 7325 dasm_put(Dst, 5705);
7322 for (op = 0; op < BC__MAX; op++) 7326 for (op = 0; op < BC__MAX; op++)
7323 build_ins(ctx, (BCOp)op, op); 7327 build_ins(ctx, (BCOp)op, op);
7324 7328