Skip to content
Snippets Groups Projects
  1. Mar 25, 2025
  2. Mar 24, 2025
  3. Mar 10, 2025
  4. Dec 12, 2024
  5. Nov 25, 2024
  6. Nov 05, 2024
    • Jean-François Dagenais's avatar
      scripts/generate_iga64_codes: prevent objcopy from modifying the input file · aef34d33
      Jean-François Dagenais authored and Kamil Konieczny's avatar Kamil Konieczny committed
      
      This script uses objcopy in order to dump a section. Objcopy is meant
      for copying and expects a second argument. Failing that, it uses the
      input file as output. Even though there's no intented change to the
      file, this operation still re-writes the file completely.
      
      In most cases, this re-writes the file as it was before. But in
      cross-compilation cases, the "objcopy" program in the PATH used here
      might be different than the toolchain which generated the ELF file.
      
      In all cases, this causes a racy re-build of the .a, and in the worst
      case, the objcopy re-written .o and .a files are actually incompatible
      with the cross-linker used downstream in the ninja build causing failure
      to find all symbols from the libs passed to this script.
      
      ```
      ../lib/intel_batchbuffer.c:763: undefined reference to
      `gen8_gpgpu_fillfunc'
      ../lib/intel_batchbuffer.c:762: undefined reference to
      `xehp_gpgpu_fillfunc'
      [...]
      ```
      
      The intent of the command was just to extract info from the LIBS, not
      modify them. Using /dev/null as output file ensures the input files will
      not be modified.
      
      Signed-off-by: default avatarJeff Dagenais <jeff.dagenais@gmail.com>
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      aef34d33
  7. Oct 28, 2024
  8. Sep 24, 2024
  9. Sep 20, 2024
  10. Sep 19, 2024
  11. Jul 29, 2024
  12. Jul 02, 2024
    • Andrzej Hajda's avatar
      lib/gpgpu_shader: add inline support for iga64 assembly · 04e219db
      Andrzej Hajda authored and Kamil Konieczny's avatar Kamil Konieczny committed
      
      With this patch adding iga64 assembly should be similar to
      adding x86 assembly inline. Simple example:
          emit_iga64_code(shdr, set_exception, R"ASM(
              or (1|M0) cr0.1<1>:ud cr0.1<0;1,0>:ud ARG(0):ud
          )ASM", value);
      Note presence of 'ARG(0)', it will be replaced by 'value' argument,
      multiple arguments are possible.
      More sophisticated examples in following patches.
      How does it works:
      1. Raw string literals (C++ feature available in gcc as extension):
         R"ASM(...)ASM" allows to use multiline/unescaped string literals.
         If for some reason they cannot be used we could always fallback to
         old ugly way of handling multiline strings with escape characters:
          emit_iga64_code(shdr, set_exception, "\n\
              or (1|M0) cr0.1<1>:ud cr0.1<0;1,0>:ud ARG(0):ud\n\
          ", value);
      2. emit_iga64_code puts the assembly string into special linker section,
         and calls __emit_iga64_code with pointer to external variable
         which will contain code templates generated from the assembly for all
         supported platforms, remaining arguments are put to temporal array
         to eventually patch the code with positional arguments.
      3. During build phase the linker section is scanned for assemblies.
         Every assembly is preprocessed with cpp, to replace ARG(x) macros with
         magic numbers, and to provide different code for different platforms
         if needed. Then output file is compiled with iga64, and then .c file
         is generated with global variables pointing to hexified iga64 codes.
      
      v2:
       - fixed meson paths to script,
       - added check if compiler supports all platforms,
       - include assembly names in MD5 calculations,
       - use more specific name for MD5 sum
      v3:
       - bump minimal meson version to kill "ERROR:  Expecting eol got id." bug
      v4:
       - set minimal meson to 0.49.2 - builder uses it
      v5:
       - revert back minimal ver of meson, instead use old syntax a.contains(b)
      v6:
       - generate_iga64_codes moved to scripts dir,
       - added include guards to iga64_macros.h
      v7:
       - use C++ style comments in generated file,
       - style fixes
      v8:
       - added sanity check for assembly
      
      Signed-off-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Reviewed-by: default avatarZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
      04e219db
  13. Apr 09, 2024
  14. Apr 02, 2024
  15. Mar 28, 2024
  16. Mar 15, 2024
  17. Mar 14, 2024
  18. Mar 11, 2024
  19. Mar 06, 2024
  20. Feb 29, 2024
Loading