Changeset 14871


Ignore:
Timestamp:
Jul 8, 2011, 11:33:29 PM (8 years ago)
Author:
rme
Message:

Remove the LISP_ASSEMBLER_EXTRA_SIB_BYTE code from pc_luser_xp() and
friends. Finally closes ticket:860.

Also, the consing sequence used to branch around the alloc trap with
a "jg" instruction. We haven't done that for a long time, so don't
check for that any more, either.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-exceptions.c

    r14868 r14871  
    24742474#endif
    24752475#ifdef X8632
    2476 /* The lisp assembler might use both a modrm byte and a sib byte to
    2477    encode a memory operand that contains a displacement but no
    2478    base or index.  Using the sib byte is necessary for 64-bit code,
    2479    since the sib-less form is used to indicate %rip-relative addressing
    2480    on x8664.  On x8632, it's not necessary, slightly suboptimal, and
    2481    doesn't match what we expect; until that's fixed, we may need to
    2482    account for this extra byte when adjusting the PC */
    2483 #undef LISP_ASSEMBLER_EXTRA_SIB_BYTE
    24842476#define TCR_SEG_PREFIX 0x64
    24852477
     
    24932485
    24942486opcode load_allocptr_reg_from_tcr_save_allocptr_instruction[] =
    2495   {TCR_SEG_PREFIX,0x8b,0x0d,SAVE_ALLOCPTR};  /* may have extra SIB byte */
     2487  {TCR_SEG_PREFIX,0x8b,0x0d,SAVE_ALLOCPTR};
    24962488opcode compare_allocptr_reg_to_tcr_save_allocbase_instruction[] =
    2497   {TCR_SEG_PREFIX,0x3b,0x0d,SAVE_ALLOCBASE};  /* may have extra SIB byte */
     2489  {TCR_SEG_PREFIX,0x3b,0x0d,SAVE_ALLOCBASE};
    24982490opcode branch_around_alloc_trap_instruction[] =
    2499   {0x77,0x02};                  /* no SIB byte issue */
     2491  {0x77,0x02};
    25002492opcode alloc_trap_instruction[] =
    2501   {0xcd,0xc5};                  /* no SIB byte issue */
     2493  {0xcd,0xc5};
    25022494opcode clear_tcr_save_allocptr_tag_instruction[] =
    2503   {TCR_SEG_PREFIX,0x80,0x25,SAVE_ALLOCPTR,0xf8}; /* maybe SIB byte */
     2495  {TCR_SEG_PREFIX,0x80,0x25,SAVE_ALLOCPTR,0xf8};
    25042496opcode set_allocptr_header_instruction[] =
    2505   {0x0f,0x7e,0x41,0xfa};        /* no SIB byte issue */
     2497  {0x0f,0x7e,0x41,0xfa};
    25062498
    25072499alloc_instruction_id
     
    25102502  switch(program_counter[0]) {
    25112503  case 0xcd: return ID_alloc_trap_instruction;
    2512   /* 0x7f is jg, which we used to use here instead of ja */
    2513   case 0x7f:
    25142504  case 0x77: return ID_branch_around_alloc_trap_instruction;
    25152505  case 0x0f: return ID_set_allocptr_header_instruction;
     
    25692559    case ID_clear_tcr_save_allocptr_tag_instruction:
    25702560      tcr->save_allocptr = (void *)(((LispObj)tcr->save_allocptr) & ~fulltagmask);
    2571 #ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
    2572       if (((pc)(xpPC(xp)))[2] == 0x24) {
    2573         xpPC(xp) += 1;
    2574       }
    2575 #endif
    25762561      xpPC(xp) += sizeof(clear_tcr_save_allocptr_tag_instruction);
    25772562
     
    25912576        xpGPR(xp,Iallocptr) = VOID_ALLOCPTR;
    25922577        tcr->save_allocptr += disp;
    2593 #ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
    2594         /* This assumes that TCR_SEG_PREFIX can't appear
    2595            anywhere but at the beginning of one of these
    2596            magic allocation-sequence instructions. */
    2597         xpPC(xp) -= (sizeof(branch_around_alloc_trap_instruction)+
    2598                      sizeof(compare_allocptr_reg_to_tcr_save_allocbase_instruction));
    2599         if (*((pc)(xpPC(xp))) == TCR_SEG_PREFIX) {
    2600           xpPC(xp) -= sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction);
    2601         } else {
    2602           xpPC(xp) -= (sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction) + 2);
    2603         }
    2604        
    2605 #else
    26062578        xpPC(xp) -= (sizeof(branch_around_alloc_trap_instruction)+
    26072579                     sizeof(compare_allocptr_reg_to_tcr_save_allocbase_instruction) +
    26082580                     sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction));
    2609 #endif
    26102581      }
    26112582      break;
     
    26332604          }
    26342605          tcr->save_allocptr = (void *)(((LispObj)tcr->save_allocptr) & ~fulltagmask);
    2635 #ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
    2636           if (((pc)xpPC(xp))[2] == 0x24) {
    2637             xpPC(xp) += 1;
    2638           }
    2639 #endif
    26402606          xpPC(xp) += sizeof(clear_tcr_save_allocptr_tag_instruction);
    26412607        } else {
     
    26432609          xpPC(xp) -= (sizeof(compare_allocptr_reg_to_tcr_save_allocbase_instruction) +
    26442610                       sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction));
    2645 #ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
    2646           if (*((pc)(xpPC(xp))) != TCR_SEG_PREFIX) {
    2647             /* skipped two instructions with extra SIB byte */
    2648             xpPC(xp) -= 2;
    2649           }
    2650 #endif
    26512611          xpGPR(xp,Iallocptr) = VOID_ALLOCPTR;
    26522612          if (interrupt_displacement) {
     
    26622622      xpGPR(xp,Iallocptr) = VOID_ALLOCPTR;
    26632623      xpPC(xp) -= sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction);
    2664 #ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
    2665       if (*((pc)xpPC(xp)) != TCR_SEG_PREFIX) {
    2666         xpPC(xp) -= 1;
    2667       }
    2668 #endif
    26692624      /* Fall through */
    26702625    case ID_load_allocptr_reg_from_tcr_save_allocptr_instruction:
Note: See TracChangeset for help on using the changeset viewer.