822526bdbbe11f68cf42d79e649aa66c39771190
[cacao.git] / src / vm / jit / m68k / emit.c
1 /* src/vm/jit/m68k/emit.c
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    $Id: arch.h 5330 2006-09-05 18:43:12Z edwin $
26
27 */
28
29
30 #include "config.h"
31
32 #include <assert.h>
33
34 #include "emit.h"
35 #include "vm/jit/emit-common.h"
36 #include "vm/exceptions.h"
37 #include "vm/jit/asmpart.h"
38
39 #include "vm/builtin.h"
40 #include "mm/memory.h"
41
42 #include "codegen.h"
43 #include "md-os.h"
44
45 /*
46  *      Loads an immededat operand into data register
47  */
48 void emit_mov_imm_reg (codegendata *cd, s4 imm, s4 dreg)
49 {
50         if ((imm & 0x000000FF) == imm)  {
51                 /* use byte form */
52                 *((s2*)cd->mcodeptr) = 0x7000 | (dreg << 9) | imm;      /* MOVEQ.L */
53                 cd->mcodeptr += 2;
54         } else if ((imm  & 0xFFFF0000) != 0)    {
55                 /* use long form */
56                 OPWORD( ((2<<6) | (dreg << 3) | 0), 7, 4);
57                 *((s4*)cd->mcodeptr) = (s4)imm;
58                 cd->mcodeptr += 4;
59         } else {
60                 /* use word form */
61                 OPWORD( ((3<<6) | (dreg << 3) | 0), 7, 4);
62                 *((s2*)cd->mcodeptr) = (s2)imm;
63                 cd->mcodeptr += 2;
64         }
65 }
66
67
68 /* emit_copy *******************************************************************
69
70    Generates a register/memory to register/memory copy.
71
72 *******************************************************************************/
73
74 void emit_copy(jitdata *jd, instruction *iptr)
75 {
76         codegendata *cd;
77         varinfo     *src;
78         varinfo     *dst;
79         s4           s1, d;
80
81         /* get required compiler data */
82
83         cd = jd->cd;
84
85         /* get source and destination variables */
86
87         src = VAROP(iptr->s1);
88         dst = VAROP(iptr->dst);
89
90         if ((src->vv.regoff != dst->vv.regoff) ||
91                 (IS_INMEMORY(src->flags ^ dst->flags))) {
92
93                 if ((src->type == TYPE_RET) || (dst->type == TYPE_RET)) {
94                         /* emit nothing, as the value won't be used anyway */
95                         return;
96                 }
97
98                 /* If one of the variables resides in memory, we can eliminate
99                    the register move from/to the temporary register with the
100                    order of getting the destination register and the load. */
101
102                 if (IS_INMEMORY(src->flags)) {
103                         if (IS_LNG_TYPE(src->type))
104                                 d = codegen_reg_of_var(iptr->opc, dst, REG_ITMP12_PACKED);
105                         else
106                                 d = codegen_reg_of_var(iptr->opc, dst, REG_IFTMP);
107
108                         s1 = emit_load(jd, iptr, src, d);
109                 }
110                 else {
111                         if (IS_LNG_TYPE(src->type))
112                                 s1 = emit_load(jd, iptr, src, REG_ITMP12_PACKED);
113                         else
114                                 s1 = emit_load(jd, iptr, src, REG_IFTMP);
115
116                         d = codegen_reg_of_var(iptr->opc, dst, s1);
117                 }
118
119                 if (s1 != d) {
120                         switch(src->type)       {
121                         case TYPE_INT: M_INTMOVE(s1, d); break;
122                         case TYPE_ADR: M_ADRMOVE(s1, d); break;
123                         case TYPE_LNG: M_LNGMOVE(s1, d); break;
124 #if !defined(ENABLE_SOFTFLOAT)
125                         case TYPE_FLT: M_FLTMOVE(s1, d); break;
126                         case TYPE_DBL: M_DBLMOVE(s1, d); break;
127 #else
128                         case TYPE_FLT: M_INTMOVE(s1, d); break;
129                         case TYPE_DBL: M_LNGMOVE(s1, d); break;
130 #endif
131                         default:
132                                 vm_abort("emit_copy: unknown type %d", src->type);
133                         }
134                 }
135
136                 emit_store(jd, iptr, dst, d);
137         }
138 }
139
140
141 /* emit_store ******************************************************************
142
143    Emits a possible store of the destination operand.
144
145 *******************************************************************************/
146
147 inline void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d)
148 {
149         codegendata  *cd;
150
151         /* get required compiler data */
152
153         cd = jd->cd;
154
155         if (IS_INMEMORY(dst->flags)) {
156                 COUNT_SPILLS;
157         
158                 switch(dst->type)       {
159 #if defined(ENABLE_SOFTFLOAT)
160                         case TYPE_DBL:
161 #endif
162                         case TYPE_LNG:
163                                 M_LST(d, REG_SP, dst->vv.regoff * 4);
164                                 break;
165 #if defined(ENABLE_SOFTFLOAT)
166                         case TYPE_FLT:
167 #endif
168                         case TYPE_INT:
169                                 M_IST(d, REG_SP, dst->vv.regoff * 4);
170                                 break;
171                         case TYPE_ADR:
172                                 M_AST(d, REG_SP, dst->vv.regoff * 4);
173                                 break;
174 #if !defined(ENABLE_SOFTFLOAT)
175                         case TYPE_DBL:
176                                 M_DST(d, REG_SP, dst->vv.regoff * 4);
177                                 break;
178                         case TYPE_FLT:
179                                 M_FST(d, REG_SP, dst->vv.regoff * 4);
180                                 break;
181 #endif
182                         default:
183                                 vm_abort("emit_store: unknown type %d", dst->type);
184                 }
185         }
186 }
187
188
189 /* emit_load *******************************************************************
190
191    Emits a possible load of an operand.
192
193 *******************************************************************************/
194
195 s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
196 {
197         codegendata *cd;
198         s4           disp;
199         s4           reg;
200
201         /* get required compiler data */
202
203         cd = jd->cd;
204
205         if (IS_INMEMORY(src->flags)) {
206                 COUNT_SPILLS;
207
208                 disp = src->vv.regoff * 4;
209         
210                 switch (src->type)      {
211 #if defined(ENABLE_SOFTFLOAT)
212                         case TYPE_FLT:
213 #endif
214                         case TYPE_INT: 
215                                 M_ILD(tempreg, REG_SP, disp);
216                                 break;
217 #if defined(ENABLE_SOFTFLOAT)
218                         case TYPE_DBL:
219 #endif
220                         case TYPE_LNG:
221                                 M_LLD(tempreg, REG_SP, disp);
222                                 break;
223                         case TYPE_ADR:
224                                 M_ALD(tempreg, REG_SP, disp);
225                                 break;
226 #if !defined(ENABLE_SOFTFLOAT)
227                         case TYPE_FLT:
228                                 M_FLD(tempreg, REG_SP, disp);
229                                 break;
230                         case TYPE_DBL:
231                                 M_DLD(tempreg, REG_SP, disp);
232                                 break;
233 #endif
234                         default:
235                                 vm_abort("emit_load: unknown type %d", src->type);
236                 }
237                 #if 0
238                 if (IS_FLT_DBL_TYPE(src->type)) {
239                         if (IS_2_WORD_TYPE(src->type)) {
240                                 M_DLD(tempreg, REG_SP, disp);
241                          } else {
242                                 M_FLD(tempreg, REG_SP, disp);
243                         }
244                 } else {
245                         if (IS_2_WORD_TYPE(src->type)) {
246                                 M_LLD(tempreg, REG_SP, disp);
247                         } else {
248                                 M_ILD(tempreg, REG_SP, disp);
249                         }
250                 }
251                 #endif
252
253                 reg = tempreg;
254         }
255         else
256                 reg = src->vv.regoff;
257
258         return reg;
259 }
260
261
262 /* emit_patcher_stubs **********************************************************
263
264    Generates the code for the patcher stubs.
265
266 *******************************************************************************/
267 void emit_patcher_stubs(jitdata *jd)
268 {
269         codegendata *cd;
270         patchref    *pref;
271         u8           mcode;
272         u1          *savedmcodeptr;
273         u1          *tmpmcodeptr;
274         s4           targetdisp;
275         s4           disp;
276
277         /* get required compiler data */
278
279         cd = jd->cd;
280
281         /* generate code patching stub call code */
282
283         targetdisp = 0;
284
285         for (pref = cd->patchrefs; pref != NULL; pref = pref->next) {
286                 /* check code segment size */
287
288                 MCODECHECK(512);
289
290                 /* Get machine code which is patched back in later. A
291                    `bsr.l' is 6 bytes long. */
292
293                 savedmcodeptr = cd->mcodebase + pref->branchpos;
294                 mcode = *((u8 *) savedmcodeptr);
295
296                 /* patch in `bsr.l' to call the following code */
297
298                 tmpmcodeptr  = cd->mcodeptr;    /* save current mcodeptr              */
299                 cd->mcodeptr = savedmcodeptr;   /* set mcodeptr to patch position     */
300
301                 M_BSR_IMM(tmpmcodeptr - (savedmcodeptr + PATCHER_CALL_SIZE) + 4);
302
303                 cd->mcodeptr = tmpmcodeptr;     /* restore the current mcodeptr       */
304
305                 /* save REG_ITMP3 */
306                 M_IPUSH(REG_ITMP3);     /* FIXME why, and restore where ? */
307
308                 /* move pointer to java_objectheader onto stack */
309
310 #if defined(ENABLE_THREADS)
311                 (void) dseg_add_unique_address(cd, NULL);                  /* flcword */
312                 (void) dseg_add_unique_address(cd, lock_get_initial_lock_word());
313                 disp = dseg_add_unique_address(cd, NULL);                  /* vftbl   */
314
315                 assert(0); /* The next lines are wrong */
316                 M_MOV_IMM(0, REG_ITMP3);
317                 dseg_adddata(cd);
318                 M_AADD_IMM(REG_ITMP3, disp);
319                 M_IPUSH(REG_ITMP3);
320 #else
321                 M_IPUSH_IMM(0);
322 #endif
323
324                 /* push move machine code bytes and classinfo pointer */
325
326                 M_IPUSH_IMM(mcode >> 32);
327                 M_IPUSH_IMM(mcode);
328                 M_IPUSH_IMM(pref->ref);
329                 M_IPUSH_IMM(pref->patcher);
330
331                 M_JMP_IMM(asm_patcher_wrapper);
332         }
333 }
334 s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg) 
335 {
336         codegendata  *cd;
337         s4            disp;
338         s4            reg;
339
340 #if !defined(ENABLE_SOFTFLOAT)
341         assert(src->type == TYPE_LNG);
342 #else
343         assert(src->type == TYPE_LNG || src->type == TYPE_DBL);
344 #endif
345
346         /* get required compiler data */
347         cd = jd->cd;
348
349         if (IS_INMEMORY(src->flags)) {
350                 COUNT_SPILLS;
351
352                 disp = src->vv.regoff * 4;
353                 M_ILD(tempreg, REG_SP, disp + 4);
354                 reg = tempreg;
355         } else {
356                 reg = GET_LOW_REG(src->vv.regoff);
357         }
358         return reg;
359 }
360 s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
361 {
362         codegendata  *cd;
363         s4            disp;
364         s4            reg;
365
366 #if !defined(ENABLE_SOFTFLOAT)
367         assert(src->type == TYPE_LNG);
368 #else
369         assert(src->type == TYPE_LNG || src->type == TYPE_DBL);
370 #endif
371         /* get required compiler data */
372         cd = jd->cd;
373
374         if (IS_INMEMORY(src->flags)) {
375                 COUNT_SPILLS;
376                 disp = src->vv.regoff * 4;
377                 M_ILD(tempreg, REG_SP, disp);
378                 reg = tempreg;
379         } else {
380                 reg = GET_HIGH_REG(src->vv.regoff);
381         }
382         return reg;
383 }
384 /* emit_branch *****************************************************************
385
386    Emits the code for conditional and unconditional branchs.
387
388 *******************************************************************************/
389 void emit_branch(codegendata *cd, s4 disp, s4 condition, s4 reg, u4 opt) 
390
391         /* calculate the different displacements */
392         /* PC is a at branch instruction + 2 */
393         /* coditional and uncondition branching work the same way */
394         /* short branches have signed 16 bit offset */
395         /* long branches are signed 32 bit */
396         /* the 8 bit offset branching instructions are not used */
397
398         disp  =  disp - 2;
399
400         /* check displacement for overflow */
401         if ((disp & 0x0000FFFF) != disp)        {
402                 if (!CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)) {
403                         cd->flags |= (CODEGENDATA_FLAG_ERROR | CODEGENDATA_FLAG_LONGBRANCHES);
404                 }
405         }
406
407         /* check which branch to generate */
408
409         if (condition == BRANCH_UNCONDITIONAL) {
410                 if (CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd))      {
411                         M_BR_32(disp);
412                 } else  {
413                         M_BR_16(disp);
414                 }
415         } else {
416                 if (CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)) {
417                         switch (condition) {
418                         case BRANCH_EQ:
419                                 M_BEQ_32(disp);
420                                 break;
421                         case BRANCH_NE:
422                                 M_BNE_32(disp);
423                                 break;
424                         case BRANCH_LT:
425                                 M_BLT_32(disp);
426                                 break;
427                         case BRANCH_GE:
428                                 M_BGE_32(disp);
429                                 break;
430                         case BRANCH_GT:
431                                 M_BGT_32(disp);
432                                 break;
433                         case BRANCH_LE:
434                                 M_BLE_32(disp);
435                                 break;
436                         case BRANCH_NAN:
437                                 M_BNAN_32(disp);
438                                 break;
439                         case BRANCH_UGT:
440                                 M_BHI_32(disp);
441                                 break;
442
443                         default:
444                                 vm_abort("emit_branch: unknown condition %d", condition);
445                         }
446                 } else {
447                         switch (condition) {
448                         case BRANCH_EQ:
449                                 M_BEQ_16(disp);
450                                 break;
451                         case BRANCH_NE:
452                                 M_BNE_16(disp);
453                                 break;
454                         case BRANCH_LT:
455                                 M_BLT_16(disp);
456                                 break;
457                         case BRANCH_GE:
458                                 M_BGE_16(disp);
459                                 break;
460                         case BRANCH_GT:
461                                 M_BGT_16(disp);
462                                 break;
463                         case BRANCH_LE:
464                                 M_BLE_16(disp);
465                                 break;
466                         case BRANCH_NAN:
467                                 M_BNAN_16(disp);
468                                 break;
469                         case BRANCH_UGT:
470                                 M_BHI_16(disp);
471                                 break;
472                         default:
473                                 vm_abort("emit_branch: unknown condition %d", condition);
474                         }
475                 }
476         }
477 }
478
479
480 #if !defined(NDEBUG)
481 /*
482  *      Trace functions. Implement -verbose:call flag
483  *      code marked by real NOP, but performance is no matter when using -verbose:call :)
484  */
485 void emit_verbosecall_enter(jitdata* jd) 
486
487         methodinfo   *m;
488         codegendata  *cd;
489         registerdata *rd;
490         methoddesc   *md;
491         s4      disp,i,t;
492
493
494         if (!JITDATA_HAS_FLAG_VERBOSECALL(jd))
495                 return;
496         
497         /* get required compiler data */
498         m  = jd->m;
499         cd = jd->cd;
500         rd = jd->rd;
501         md = m->parseddesc;
502
503         /* mark trace code */
504         M_NOP;
505
506         M_LINK(REG_FP, -16*4);  
507         M_PUSHALL;
508
509         /* builtin_verbosecall_enter takes all args as s8 type */
510         /* TRACE_ARGS_NUM is the number of args the builtin_verbosecall_enter expects */
511         M_IPUSH_IMM(m);
512         
513         disp = 16*4 + 4 + 4;    /* points to old argument stack initially */
514
515         /* travel up stack to the first argument of the function which needs to be copied */
516         for (i=0; (i < md->paramcount) && (i < TRACE_ARGS_NUM); i++)    {
517                 disp += 4;
518                 if (IS_2_WORD_TYPE(md->paramtypes[i].type)) {   
519                         disp += 4;
520                 }
521         }
522
523         /* disp now points to the first arg which gets copied to the trace stack, relative to REG_SP! */
524         for (i=TRACE_ARGS_NUM-1; i>=0; --i) {
525                 if (i < md->paramcount) {
526                         /* traced function has such an argument */
527                         t = md->paramtypes[i].type;
528                         
529                         if (IS_2_WORD_TYPE(t))  {
530                                 /* copy from original argument stack */
531                                 M_ILD(REG_ITMP1, REG_SP, disp);
532                                 M_IPUSH(REG_ITMP1);
533                                 M_ILD(REG_ITMP1, REG_SP, disp);
534                                 M_IPUSH(REG_ITMP1);
535                         } else  {
536                                 /* displacment is increased as 4 byte on original stack but 8 byte on trace stack */
537                                 M_ILD(REG_ITMP1, REG_SP, disp);
538                                 M_IPUSH(REG_ITMP1);
539                                 M_IPUSH_IMM(0);
540                                 disp += 4;
541                         }
542                 } else  {
543                         /* function has no arg here, push nothing and adapt displacement */
544                         M_IPUSH_IMM(0);
545                         M_IPUSH_IMM(0);
546                         disp += 8;
547                 }
548         }
549         M_JSR_IMM(builtin_verbosecall_enter);
550         /* pop arguments off stack */
551         M_AADD_IMM(TRACE_ARGS_NUM*8+4, REG_SP);
552
553         M_POPALL;
554         M_UNLK(REG_FP);
555         M_NOP;
556 }
557 void emit_verbosecall_exit(jitdata* jd) 
558
559         methodinfo   *m;
560         codegendata  *cd;
561         registerdata *rd;
562         methoddesc   *md;
563
564         if (!JITDATA_HAS_FLAG_VERBOSECALL(jd))
565                 return;
566
567         /* get required compiler data */
568         m  = jd->m;
569         cd = jd->cd;
570         rd = jd->rd;
571         md = m->parseddesc;
572
573         /* void builtin_verbosecall_exit(s8 l, double d, float f, methodinfo *m); */
574
575
576         /* mark trace code */
577         M_NOP;
578         M_LINK(REG_FP, 0);
579
580         M_IPUSH_IMM(m);                                 /* push methodinfo */
581
582         M_IPUSH_IMM(0);                                 /* TODO push float result */
583
584         M_IPUSH_IMM(0);                                 /* TODO push double result */
585         M_IPUSH_IMM(0);                                 /* TODO push double result */
586
587         M_IPUSH(GET_HIGH_REG(REG_RESULT_PACKED))
588         M_IPUSH(GET_LOW_REG(REG_RESULT_PACKED))         /* push long result */
589
590
591         M_JSR_IMM(builtin_verbosecall_exit);
592
593         /* poping result registers from stack */
594         M_IPOP(GET_LOW_REG(REG_RESULT_PACKED))
595         M_IPOP(GET_HIGH_REG(REG_RESULT_PACKED))
596
597 #if 0
598         /* that is wrong of course, overwrites registers and stuff */
599         M_IPOP(0);      /* TODO: pop double result */
600         M_IPOP(0);      /* TODO: pop double result */
601
602         M_IPOP(0);      /* TODO: pop float result */
603 #else
604         M_AADD_IMM(3*4, REG_SP);
605 #endif
606         M_AADD_IMM(4, REG_SP);                          /* remove rest of stack */
607         M_UNLK(REG_FP);
608         M_NOP;
609 }
610 #endif
611
612 /* emit_classcast_check ********************************************************
613
614    Emit a ClassCastException check.
615
616 *******************************************************************************/
617
618 void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 reg, s4 s1)
619 {
620         if (INSTRUCTION_MUST_CHECK(iptr)) {
621                 switch (condition) {
622                 case BRANCH_LE:
623                         M_BGT(4);
624                         break;
625                 case BRANCH_EQ:
626                         M_BNE(4);
627                         break;
628                 case BRANCH_GT:
629                         M_BLE(4);
630                         break;
631                 case BRANCH_UGT:
632                         M_BLS(4);
633                         break;
634                 default:
635                         vm_abort("emit_classcast_check: unknown condition %d", condition);
636                 }
637                 M_TRAP_SETREGISTER(s1);
638                 M_TRAP(EXCEPTION_HARDWARE_CLASSCAST);
639         }
640 }
641
642 /* emit_arrayindexoutofbounds_check ********************************************
643
644    Emit a ArrayIndexOutOfBoundsException check.
645
646 *******************************************************************************/
647 void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1, s4 s2)
648 {
649         if (INSTRUCTION_MUST_CHECK(iptr)) {
650                 M_ILD(REG_ITMP3, s1, OFFSET(java_arrayheader, size));
651                 M_ICMP(s2, REG_ITMP3);
652                 M_BHI(2);
653                 /*M_ALD_INTERN(s2, REG_ZERO, EXCEPTION_LOAD_DISP_ARRAYINDEXOUTOFBOUNDS);*/
654                 M_TRAP(EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS);
655         }
656 }
657
658 /* emit_nullpointer_check ******************************************************
659
660    Emit a NullPointerException check.
661
662 *******************************************************************************/
663 void emit_nullpointer_check(codegendata *cd, instruction *iptr, s4 reg)
664 {
665         if (INSTRUCTION_MUST_CHECK(iptr)) {
666                 /* did like to assert on TYPE_ADR, but not possible in here */
667                 M_ATST(reg);
668                 M_BNE(2);
669                 M_TRAP(M68K_EXCEPTION_HARDWARE_NULLPOINTER);
670         }
671 }
672
673 /* emit_arithmetic_check *******************************************************
674
675    Emit an ArithmeticException check.
676
677 *******************************************************************************/
678
679 void emit_arithmetic_check(codegendata *cd, instruction *iptr, s4 reg)
680 {
681         if (INSTRUCTION_MUST_CHECK(iptr)) {
682                 M_ITST(reg);
683                 M_BNE(2);
684                 /*M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_ARITHMETIC);*/
685                 M_ILLEGAL; /* FIXME */
686         }
687 }
688
689 #if 0
690 /* emit_exception_check_areg **************************************************
691  *
692    Emit an Exception check, tested register is address REG_RESULT
693
694 *******************************************************************************/
695 void emit_exception_check_areg(codegendata *cd, instruction *iptr)
696 {
697         if (INSTRUCTION_MUST_CHECK(iptr)) {
698                 M_ATST(REG_RESULT);
699                 M_BNE(2);
700                 /*M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_EXCEPTION);*/
701                 M_ILLEGAL; /*FIXME*/
702         }
703 }
704 #endif
705
706 /* emit_exception_check_ireg **************************************************
707
708    Emit an Exception check. Teste register is integer REG_RESULT
709
710 *******************************************************************************/
711 void emit_exception_check(codegendata *cd, instruction *iptr)
712 {
713         if (INSTRUCTION_MUST_CHECK(iptr)) {
714                 M_ITST(REG_RESULT);
715                 M_BNE(2);
716                 /*M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_EXCEPTION);*/
717                 M_TRAP(EXCEPTION_HARDWARE_EXCEPTION);
718         }
719 }
720
721
722 /*
723  * These are local overrides for various environment variables in Emacs.
724  * Please do not remove this and leave it at the end of the file, where
725  * Emacs will automagically detect them.
726  * ---------------------------------------------------------------------
727  * Local variables:
728  * mode: c
729  * indent-tabs-mode: t
730  * c-basic-offset: 4
731  * tab-width: 4
732  * End:
733  * vim:noexpandtab:sw=4:ts=4:
734  */