GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

  • int line_numbers

実装[]

5199 /* Create some permanent unique rtl objects shared between all functions.
5200    LINE_NUMBERS is nonzero if line numbers are to be generated.  */
5201 
5202 void
5203 init_emit_once (int line_numbers)
5204 {
5205   int i;
5206   enum machine_mode mode;
5207   enum machine_mode double_mode;
5208 
5209   /* We need reg_raw_mode, so initialize the modes now.  */
5210   init_reg_modes_once ();
5211 
5212   /* Initialize the CONST_INT, CONST_DOUBLE, and memory attribute hash
5213      tables.  */
5214   const_int_htab = htab_create_ggc (37, const_int_htab_hash,
5215                                     const_int_htab_eq, NULL);
5216 
5217   const_double_htab = htab_create_ggc (37, const_double_htab_hash,
5218                                        const_double_htab_eq, NULL);
5219 
5220   mem_attrs_htab = htab_create_ggc (37, mem_attrs_htab_hash,
5221                                     mem_attrs_htab_eq, NULL);
5222   reg_attrs_htab = htab_create_ggc (37, reg_attrs_htab_hash,
5223                                     reg_attrs_htab_eq, NULL);
5224 
5225   no_line_numbers = ! line_numbers;
5226 
5227   /* Compute the word and byte modes.  */
5228 
5229   byte_mode = VOIDmode;
5230   word_mode = VOIDmode;
5231   double_mode = VOIDmode;
5232 
5233   for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
5234        mode = [[GET_MODE_WIDER_MODE (mode))
5235     {
5236       if (GET_MODE_BITSIZE (mode) == BITS_PER_UNIT
5237           && byte_mode == VOIDmode)
5238         byte_mode = mode;
5239 
5240       if (GET_MODE_BITSIZE (mode) == BITS_PER_WORD
5241           && word_mode == VOIDmode)
5242         word_mode = mode;
5243     }
5244 
5245   for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
5246        mode = GET_MODE_WIDER_MODE (mode))
5247     {
5248       if (GET_MODE_BITSIZE (mode) == DOUBLE_TYPE_SIZE
5249           && double_mode == VOIDmode)
5250         double_mode = mode;
5251     }
5252 
5253   ptr_mode = mode_for_size (POINTER_SIZE, GET_MODE_CLASS (Pmode), 0);
5254 
5255   /* Assign register numbers to the globally defined register rtx.
5256      This must be done at runtime because the register number field
5257      is in a union and some compilers can't initialize unions.  */
5258 
5259   pc_rtx = gen_rtx_PC (VOIDmode);
5260   cc0_rtx = gen_rtx_CC0 (VOIDmode);
5261   stack_pointer_rtx = gen_raw_REG (Pmode, STACK_POINTER_REGNUM);
5262   frame_pointer_rtx = gen_raw_REG (Pmode, FRAME_POINTER_REGNUM);
5263   if (hard_frame_pointer_rtx == 0)
5264     hard_frame_pointer_rtx = gen_raw_REG (Pmode,
5265                                           HARD_FRAME_POINTER_REGNUM);
5266   if (arg_pointer_rtx == 0)
5267     arg_pointer_rtx = gen_raw_REG (Pmode, ARG_POINTER_REGNUM);
5268   virtual_incoming_args_rtx =
5269     gen_raw_REG (Pmode, VIRTUAL_INCOMING_ARGS_REGNUM);
5270   virtual_stack_vars_rtx =
5271     gen_raw_REG (Pmode, VIRTUAL_STACK_VARS_REGNUM);
5272   virtual_stack_dynamic_rtx =
5273     gen_raw_REG (Pmode, VIRTUAL_STACK_DYNAMIC_REGNUM);
5274   virtual_outgoing_args_rtx =
5275     gen_raw_REG (Pmode, VIRTUAL_OUTGOING_ARGS_REGNUM);
5276   virtual_cfa_rtx = gen_raw_REG (Pmode, VIRTUAL_CFA_REGNUM);
5277 
5278   /* Initialize RTL for commonly used hard registers.  These are
5279      copied into regno_reg_rtx as we begin to compile each function.  */
5280   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
5281     static_regno_reg_rtx[i] = gen_raw_REG (reg_raw_mode[i], i);
5282 
5283 #ifdef INIT_EXPANDERS
5284   /* This is to initialize {init|mark|free}_machine_status before the first
5285      call to push_function_context_to.  This is needed by the Chill front
5286      end which calls push_function_context_to before the first call to
5287      init_function_start.  */
5288   INIT_EXPANDERS;
5289 #endif
5290 
5291   /* Create the unique rtx's for certain rtx codes and operand values.  */
5292 
5293   /* Don't use gen_rtx_CONST_INT here since gen_rtx_CONST_INT in this case
5294      tries to use these variables.  */
5295   for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++)
5296     const_int_rtx[i + MAX_SAVED_CONST_INT] =
5297       gen_rtx_raw_CONST_INT (VOIDmode, (HOST_WIDE_INT) i);
5298 
5299   if (STORE_FLAG_VALUE >= - MAX_SAVED_CONST_INT
5300       && STORE_FLAG_VALUE <= MAX_SAVED_CONST_INT)
5301     const_true_rtx = const_int_rtx[[[STORE_FLAG_VALUE]] + MAX_SAVED_CONST_INT];
5302   else
5303     const_true_rtx = gen_rtx_CONST_INT (VOIDmode, STORE_FLAG_VALUE);
5304 
5305   REAL_VALUE_FROM_INT (dconst0,   0,  0, double_mode);
5306   REAL_VALUE_FROM_INT (dconst1,   1,  0, double_mode);
5307   REAL_VALUE_FROM_INT (dconst2,   2,  0, double_mode);
5308   REAL_VALUE_FROM_INT (dconst3,   3,  0, double_mode);
5309   REAL_VALUE_FROM_INT (dconst10, 10,  0, double_mode);
5310   REAL_VALUE_FROM_INT (dconstm1, -1, -1, double_mode);
5311   REAL_VALUE_FROM_INT (dconstm2, -2, -1, double_mode);
5312 
5313   dconsthalf = dconst1;
5314   SET_REAL_EXP (&dconsthalf, REAL_EXP (&dconsthalf) - 1);
5315 
5316   real_arithmetic (&dconstthird, RDIV_EXPR, &dconst1, &dconst3);
5317 
5318   /* Initialize mathematical constants for constant folding builtins.
5319      These constants need to be given to at least 160 bits precision.  */
5320   real_from_string (&dconstpi,
5321     "3.1415926535897932384626433832795028841971693993751058209749445923078");
5322   real_from_string (&dconste,
5323     "2.7182818284590452353602874713526624977572470936999595749669676277241");
5324 
5325   for (i = 0; i < (int) ARRAY_SIZE (const_tiny_rtx); i++)
5326     {
5327       REAL_VALUE_TYPE *r =
5328         (i == 0 ? &dconst0 : i == 1 ? &dconst1 : &dconst2);
5329 
5330       for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
5331            mode = GET_MODE_WIDER_MODE (mode))
5332         const_tiny_rtx[i][(int) mode] =
5333           CONST_DOUBLE_FROM_REAL_VALUE (*r, mode);
5334 
5335       const_tiny_rtx[i][(int) VOIDmode] = GEN_INT (i);
5336 
5337       for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
5338            mode = GET_MODE_WIDER_MODE (mode))
5339         const_tiny_rtx[i][(int) mode] = GEN_INT (i);
5340 
5341       for (mode = GET_CLASS_NARROWEST_MODE (MODE_PARTIAL_INT);
5342            mode != VOIDmode;
5343            mode = GET_MODE_WIDER_MODE (mode))
5344         const_tiny_rtx[i][(int) mode] = GEN_INT (i);
5345     }
5346 
5347   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
5348        mode != VOIDmode;
5349        mode = GET_MODE_WIDER_MODE (mode))
5350     {
5351       const_tiny_rtx[0][(int) mode] = gen_const_vector (mode, 0);
5352       const_tiny_rtx[1][(int) mode] = gen_const_vector (mode, 1);
5353     }
5354 
5355   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
5356        mode != VOIDmode;
5357        mode = GET_MODE_WIDER_MODE (mode))
5358     {
5359       const_tiny_rtx[0][(int) mode] = gen_const_vector (mode, 0);
5360       const_tiny_rtx[1][(int) mode] = gen_const_vector (mode, 1);
5361     }
5362 
5363   for (i = (int) CCmode; i < (int) MAX_MACHINE_MODE; ++i)
5364     if (GET_MODE_CLASS ((enum machine_mode) i) == MODE_CC)
5365       const_tiny_rtx[0][i] = const0_rtx;
5366 
5367   const_tiny_rtx[0][(int) BImode] = const0_rtx;
5368   if (STORE_FLAG_VALUE == 1)
5369     const_tiny_rtx[1][(int) BImode] = const1_rtx;
5370 
5371 #ifdef RETURN_ADDRESS_POINTER_REGNUM
5372   return_address_pointer_rtx
5373     = gen_raw_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM);
5374 #endif
5375 
5376 #ifdef STATIC_CHAIN_REGNUM
5377   static_chain_rtx = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
5378 
5379 #ifdef STATIC_CHAIN_INCOMING_REGNUM
5380   if (STATIC_CHAIN_INCOMING_REGNUM != STATIC_CHAIN_REGNUM)
5381     static_chain_incoming_rtx
5382       = gen_rtx_REG (Pmode, STATIC_CHAIN_INCOMING_REGNUM);
5383   else
5384 #endif
5385     static_chain_incoming_rtx = static_chain_rtx;
5386 #endif
5387 
5388 #ifdef STATIC_CHAIN
5389   static_chain_rtx = STATIC_CHAIN;
5390 
5391 #ifdef STATIC_CHAIN_INCOMING
5392   static_chain_incoming_rtx = STATIC_CHAIN_INCOMING;
5393 #else
5394   static_chain_incoming_rtx = static_chain_rtx;
5395 #endif
5396 #endif
5397 
5398   if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
5399     pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
5400 }



リンク元

Advertisement