Coder Social home page Coder Social logo

Comments (3)

RevySR avatar RevySR commented on September 16, 2024

gcc-13 on sg2042: pass

from gcc.

Cooper-Qu avatar Cooper-Qu commented on September 16, 2024

首先,编译jpeg-xl时,会执行测试程序lib/tests/color_management_test,发生"src/tcmalloc.cc Attempt to free invalid pointer 0xa3fdffffa3fbffff "错误的lib/tests/color_management_test测试程序,而并非编译命令。

然后,缩小错误排查范围,将编译cache_aligned.cc文件的选项中去掉vector(比如-march=rv64gc),程序执行通过;加上vector(比如-march=rv64gcv0p7),则程序会执行出错。即使关闭优化-O0,加vector也会出错。

查看cache_aligned.cc,加和不加vector唯一的影响是:

struct AllocationHeader {
  void* allocated;
  size_t allocated_size;
  uint8_t left_padding[hwy::kMaxVectorSize];
};

hwy::kMaxVectorSize来自于/usr/include/hwy/base.h,

//------------------------------------------------------------------------------                                                                                                                                                                                         
// kMaxVectorSize (undocumented, pending removal)                                                                                                                                                                                                                        

#if HWY_ARCH_X86
static constexpr HWY_MAYBE_UNUSED size_t kMaxVectorSize = 64;  // AVX-512                                                                                                                                                                                                
#elif HWY_ARCH_RVV && defined(__riscv_vector)                                                                                                                                                                                                                            
// Not actually an upper bound on the size.                                                                                                                                                                                                                              
static constexpr HWY_MAYBE_UNUSED size_t kMaxVectorSize = 4096;                                                                                                                                                                                                          
#else
static constexpr HWY_MAYBE_UNUSED size_t kMaxVectorSize = 16;                                                                                                                                                                                                            
#endif 

继续查看cache_aligned.cc的代码,发现jpeg-xl对RVV的适配代码只有libjxl/libjxl@c5207e0

根据上述的分析,可以基本上排除编译的问题(加不加vector的反汇编也只有left_padding的size区别,并没有逻辑上的不一致),而是jpeg-xl对RVV的适配存在BUG

from gcc.

RevySR avatar RevySR commented on September 16, 2024

RVV引用 highway 代码

highway 新版本头文件识别改成识别 __riscv_v_intrinsic macro
xtheadv 已经分开
jpeg-xlhighway 升级版本后解决问题

from gcc.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.