• Huacai Chen's avatar
    LoongArch: Add vector extensions support · 61650023
    Huacai Chen authored
    Add LoongArch's vector extensions support, which including 128bit LSX
    (i.e., Loongson SIMD eXtension) and 256bit LASX (i.e., Loongson Advanced
    SIMD eXtension).
    
    Linux kernel doesn't use vector itself, it only handle exceptions and
    context save/restore. So it only needs a subset of these instructions:
    
    * Vector load/store:   vld vst vldx vstx xvld xvst xvldx xvstx
    * 8bit-elements move:  vpickve2gr.b xvpickve2gr.b vinsgr2vr.b xvinsgr2vr.b
    * 16bit-elements move: vpickve2gr.h xvpickve2gr.h vinsgr2vr.h xvinsgr2vr.h
    * 32bit-elements move: vpickve2gr.w xvpickve2gr.w vinsgr2vr.w xvinsgr2vr.w
    * 64bit-elements move: vpickve2gr.d xvpickve2gr.d vinsgr2vr.d xvinsgr2vr.d
    * Elements permute:    vpermi.w vpermi.d xvpermi.w xvpermi.d xvpermi.q
    
    Introduce AS_HAS_LSX_EXTENSION and AS_HAS_LASX_EXTENSION to avoid non-
    vector toolchains complains unsupported instructions.
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    61650023
ptrace.c 23.9 KB