LCOV - code coverage report
Current view: top level - gcc/config/i386 - i386-jit.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 24 24
Test Date: 2026-02-28 14:20:25 Functions: 100.0 % 1 1
Legend: Lines:     hit not hit

            Line data    Source code
       1              : /* Subroutines for the JIT front end on the x86 architecture.
       2              :    Copyright (C) 2023-2026 Free Software Foundation, Inc.
       3              : 
       4              : GCC is free software; you can redistribute it and/or modify
       5              : it under the terms of the GNU General Public License as published by
       6              : the Free Software Foundation; either version 3, or (at your option)
       7              : any later version.
       8              : 
       9              : GCC is distributed in the hope that it will be useful,
      10              : but WITHOUT ANY WARRANTY; without even the implied warranty of
      11              : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12              : GNU General Public License for more details.
      13              : 
      14              : You should have received a copy of the GNU General Public License
      15              : along with GCC; see the file COPYING3.  If not see
      16              : <http://www.gnu.org/licenses/>.  */
      17              : 
      18              : #define IN_TARGET_CODE 1
      19              : 
      20              : #define INCLUDE_STRING
      21              : #include "config.h"
      22              : #include "system.h"
      23              : #include "coretypes.h"
      24              : #include "target.h"
      25              : #include "tm.h"
      26              : #include "tm_jit.h"
      27              : #include "jit/jit-target.h"
      28              : #include "jit/jit-target-def.h"
      29              : 
      30              : /* Implement TARGET_JIT_REGISTER_CPU_TARGET_INFO.  */
      31              : 
      32              : #ifndef CROSS_DIRECTORY_STRUCTURE
      33              : extern const char *host_detect_local_cpu (int argc, const char **argv);
      34              : #endif
      35              : 
      36              : #if TARGET_64BIT_DEFAULT
      37              : const char* x86_bits = "64";
      38              : #else
      39              : const char* x86_bits = "32";
      40              : #endif
      41              : 
      42              : void
      43         1326 : ix86_jit_register_target_info (void)
      44              : {
      45              : #ifndef CROSS_DIRECTORY_STRUCTURE
      46         1326 :   const char *params[] = {"arch", x86_bits};
      47         1326 :   const char* local_cpu = host_detect_local_cpu (2, params);
      48         1326 :   if (local_cpu)
      49              :   {
      50         1326 :     std::string arch = local_cpu;
      51         1326 :     free (const_cast <char *> (local_cpu));
      52              : 
      53         1326 :     const char* arg = "-march=";
      54         1326 :     size_t arg_pos = arch.find (arg) + strlen (arg);
      55         1326 :     size_t end_pos = arch.find (" ", arg_pos);
      56              : 
      57         1326 :     std::string cpu = arch.substr (arg_pos, end_pos - arg_pos);
      58         1326 :     jit_target_set_arch (cpu);
      59         1326 :   }
      60              : #endif
      61              : 
      62         1326 :   if (targetm.scalar_mode_supported_p (TImode))
      63              :   {
      64         1326 :     jit_target_add_supported_target_dependent_type (GCC_JIT_TYPE_UINT128_T);
      65         1326 :     jit_target_add_supported_target_dependent_type (GCC_JIT_TYPE_INT128_T);
      66              :   }
      67              : 
      68         1326 :   if (float16_type_node != NULL && TYPE_PRECISION (float16_type_node) == 16)
      69         1326 :     jit_target_add_supported_target_dependent_type (GCC_JIT_TYPE_FLOAT16);
      70              : 
      71         1326 :   if (float32_type_node != NULL && TYPE_PRECISION (float32_type_node) == 32)
      72         1326 :     jit_target_add_supported_target_dependent_type (GCC_JIT_TYPE_FLOAT32);
      73              : 
      74         1326 :   if (float64_type_node != NULL && TYPE_PRECISION (float64_type_node) == 64)
      75         1326 :     jit_target_add_supported_target_dependent_type (GCC_JIT_TYPE_FLOAT64);
      76              : 
      77         1326 :   if (float128_type_node != NULL && TYPE_PRECISION (float128_type_node) == 128)
      78         1326 :     jit_target_add_supported_target_dependent_type (GCC_JIT_TYPE_FLOAT128);
      79              : 
      80              : #define ADD_TARGET_INFO jit_add_target_info
      81              : #include "i386-rust-and-jit.inc"
      82              : #undef ADD_TARGET_INFO
      83         1326 : }
        

Generated by: LCOV version 2.4-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.