Changeset 380


Ignore:
Timestamp:
Jul 15, 2003, 4:51:29 PM (22 years ago)
Author:
bird
Message:

#563: mask fpu exceptions and clear exceptions after doing the trunction. OS/2 feature so to speak.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gcc/gcc/config/i386/i386.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r379 r380  
    4949
    5050/* Processor costs (relative to an add) */
    51 static const 
     51static const
    5252struct processor_costs size_cost = {    /* costs for tunning for size */
    5353  2,                                    /* cost of an add instruction */
     
    8686};
    8787/* Processor costs (relative to an add) */
    88 static const 
     88static const
    8989struct processor_costs i386_cost = {    /* 386 specific costs */
    9090  1,                                    /* cost of an add instruction */
     
    123123};
    124124
    125 static const 
     125static const
    126126struct processor_costs i486_cost = {    /* 486 specific costs */
    127127  1,                                    /* cost of an add instruction */
     
    160160};
    161161
    162 static const 
     162static const
    163163struct processor_costs pentium_cost = {
    164164  1,                                    /* cost of an add instruction */
     
    197197};
    198198
    199 static const 
     199static const
    200200struct processor_costs pentiumpro_cost = {
    201201  1,                                    /* cost of an add instruction */
     
    234234};
    235235
    236 static const 
     236static const
    237237struct processor_costs k6_cost = {
    238238  1,                                    /* cost of an add instruction */
     
    271271};
    272272
    273 static const 
     273static const
    274274struct processor_costs athlon_cost = {
    275275  1,                                    /* cost of an add instruction */
     
    308308};
    309309
    310 static const 
     310static const
    311311struct processor_costs pentium4_cost = {
    312312  1,                                    /* cost of an add instruction */
     
    12091209            ix86_fpmath = FPMATH_SSE | FPMATH_387;
    12101210        }
    1211       else 
     1211      else
    12121212        error ("bad value (%s) for -mfpmath= switch", ix86_fpmath_string);
    12131213    }
     
    24512451  type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
    24522452
    2453   f_gpr = build_decl (FIELD_DECL, get_identifier ("gp_offset"), 
     2453  f_gpr = build_decl (FIELD_DECL, get_identifier ("gp_offset"),
    24542454                      unsigned_type_node);
    2455   f_fpr = build_decl (FIELD_DECL, get_identifier ("fp_offset"), 
     2455  f_fpr = build_decl (FIELD_DECL, get_identifier ("fp_offset"),
    24562456                      unsigned_type_node);
    24572457  f_ovf = build_decl (FIELD_DECL, get_identifier ("overflow_arg_area"),
     
    24792479
    24802480/* Perform any needed actions needed for a function that is receiving a
    2481    variable number of arguments. 
     2481   variable number of arguments.
    24822482
    24832483   CUM is as above.
     
    30613061        return 1;
    30623062    }
    3063   else 
     3063  else
    30643064    {
    30653065      if (GET_CODE (op) == UNSPEC)
     
    30993099
    31003100  /* There is, however, a not insubstantial body of code in the rest of
    3101      the compiler that assumes it can just stick the results of 
     3101     the compiler that assumes it can just stick the results of
    31023102     ASM_GENERATE_INTERNAL_LABEL in a symbol_ref and have done.  */
    31033103  /* ??? This is a hack.  Should update the body of the compiler to
     
    48654865      return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode);
    48664866    }
    4867    
     4867
    48684868  return 0;
    48694869}
     
    60566056          /* Like above, but reverse condition */
    60576057        case 'c':
    6058           /* Check to see if argument to %c is really a constant 
     6058          /* Check to see if argument to %c is really a constant
    60596059             and not a condition code which needs to be reversed.  */
    60606060          if (GET_RTX_CLASS (GET_CODE (x)) != '<')
     
    66456645  emit_insn (gen_x86_fnstcw_1 (normal));
    66466646  emit_move_insn (reg, normal);
     6647#ifdef EMX /* #563: On OS/2 we need to mask exceptions. */
     6648  emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0xc3f)));
     6649#else
    66476650  if (!TARGET_PARTIAL_REG_STALL && !optimize_size
    66486651      && !TARGET_64BIT)
     
    66506653  else
    66516654    emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0xc00)));
     6655#endif
    66526656  emit_move_insn (round_down, reg);
    66536657}
     
    66826686  else
    66836687    output_asm_insn ("fist%z0\t%0", operands);
     6688#ifdef EMX /* #563: On OS/2 we need to clear exception flags. */
     6689  output_asm_insn ("fnclex", operands);
     6690#endif
    66846691  output_asm_insn ("fldcw\t%2", operands);
    66856692
     
    69766983
    69776984  emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
    6978 } 
     6985}
    69796986
    69806987/* Attempt to expand a binary operator.  Make the expansion closer to the
     
    1163311640}
    1163411641
    11635 /* In type_for_mode we restrict the ability to create TImode types 
     11642/* In type_for_mode we restrict the ability to create TImode types
    1163611643   to hosts with 64-bit H_W_I.  So we've defined the SSE logicals
    1163711644   to have a V4SFmode signature.  Convert them in-place to TImode.  */
     
    1176311770  if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
    1176411771    op0 = copy_to_mode_reg (mode0, op0);
    11765  
     11772
    1176611773  op1 = op0;
    1176711774  if (! (*insn_data[icode].operand[2].predicate) (op1, mode0))
    1176811775    op1 = copy_to_mode_reg (mode0, op1);
    11769  
     11776
    1177011777  pat = GEN_FCN (icode) (target, op0, op1);
    1177111778  if (! pat)
     
    1247012477{
    1247112478  /* In case we require secondary memory, compute cost of the store followed
    12472      by load.  In order to avoid bad register allocation choices, we need 
     12479     by load.  In order to avoid bad register allocation choices, we need
    1247312480     for this to be *at least* as high as the symmetric MEMORY_MOVE_COST.  */
    1247412481
     
    1248112488      cost += MAX (MEMORY_MOVE_COST (mode, class2, 0),
    1248212489                   MEMORY_MOVE_COST (mode, class2, 1));
    12483      
     12490
    1248412491      /* In case of copying from general_purpose_register we may emit multiple
    1248512492         stores followed by single load causing memory size mismatch stall.
     
    1266912676     for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
    1267012677       reg_alloc_order [pos++] = i;
    12671    
     12678
    1267212679   /* SSE registers.  */
    1267312680   for (i = FIRST_SSE_REG; i <= LAST_SSE_REG; i++)
Note: See TracChangeset for help on using the changeset viewer.