Skip to content

Compile bug: clang-18.1.3 compile fail (vsetivli) #13358

Closed
@xfan1024

Description

@xfan1024

Git commit

llama.cpp version: bc4e112

Operating systems

docker.io/riscv64/ubuntu:24.04
clang version: 18.1.3

GGML backends

CPU

Problem description & steps to reproduce

cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --config Release -j64

Compile command

cmake --build build --config Release -j64

Relevant log output

/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5206:17: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5206 |                 "vsetivli zero, 16, e8, m1\n\t"
      |                 ^
<inline asm>:1:21: note: instantiated into assembly here
    1 |         vsetivli zero, 16, e8, m1
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5211:41: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5211 |                 "vse8.v v0, (%[scale])\n\t"
      |                                         ^
<inline asm>:7:21: note: instantiated into assembly here
    7 |         vsetivli zero, 16, e16, m2
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5215:39: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5215 |                 "vwmul.vv v4, v0, v2\n\t"
      |                                       ^
<inline asm>:11:21: note: instantiated into assembly here
   11 |         vsetivli zero, 16, e32, m4
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5232:21: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5232 |                     "vsetvli zero, %[vl32], e8, m2\n\t"
      |                     ^
<inline asm>:1:20: note: instantiated into assembly here
    1 |         vsetvli zero, a5, e8, m2
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5239:43: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5239 |                     "vand.vi v4, v4, 0x3\n\t"
      |                                           ^
<inline asm>:9:20: note: instantiated into assembly here
    9 |         vsetvli zero, a7, e8, m8
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5241:42: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5241 |                     "vle8.v v8, (%[q8])\n\t"
      |                                          ^
<inline asm>:11:20: note: instantiated into assembly here
   11 |         vsetvli zero, a6, e8, m4
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5244:45: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5244 |                     "vwmul.vv v24, v4, v12\n\t"
      |                                             ^
<inline asm>:14:21: note: instantiated into assembly here
   14 |         vsetivli zero, 16, e16, m2
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5254:48: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5254 |                     "vwredsum.vs v14, v30, v0\n\t"
      |                                                ^
<inline asm>:24:20: note: instantiated into assembly here
   24 |         vsetivli zero, 4, e32, m1
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:5261:47: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 5261 |                     "vslideup.vi v11, v13, 2\n\t"
      |                                               ^
<inline asm>:31:20: note: instantiated into assembly here
   31 |         vsetivli zero, 8, e32, m2
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6257:17: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6257 |                 "vsetivli zero, 12, e8, m1\n\t"
      |                 ^
<inline asm>:1:21: note: instantiated into assembly here
    1 |         vsetivli zero, 12, e8, m1
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6259:34: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6259 |                 "vmv1r.v v2, v0\n\t"
      |                                  ^
<inline asm>:4:20: note: instantiated into assembly here
    4 |         vsetivli zero, 2, e64, m1
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6264:41: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6264 |                 "vslideup.vi v0, v2, 1\n\t" // {aux[0], aux[1], aux[0], aux[1]}
      |                                         ^
<inline asm>:9:20: note: instantiated into assembly here
    9 |         vsetivli zero, 4, e32, m1
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6275:37: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6275 |                 "vor.vv v7, v6, v3\n\t"
      |                                     ^
<inline asm>:20:21: note: instantiated into assembly here
   20 |         vsetivli zero, 16, e8, m1
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6317:50: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6317 |                     "vadd.vi v14, v14, -4, v0.t\n\t"
      |                                                  ^
<inline asm>:26:20: note: instantiated into assembly here
   26 |         vsetvli zero, a3, e8, m8
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6319:42: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6319 |                     "vle8.v v0, (%[q8])\n\t"
      |                                          ^
<inline asm>:28:20: note: instantiated into assembly here
   28 |         vsetvli zero, a4, e8, m4
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6322:45: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6322 |                     "vwmul.vv v24, v4, v12\n\t"
      |                                             ^
<inline asm>:31:21: note: instantiated into assembly here
   31 |         vsetivli zero, 16, e16, m2
      |                            ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6332:48: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6332 |                     "vwredsum.vs v14, v30, v0\n\t"
      |                                                ^
<inline asm>:41:20: note: instantiated into assembly here
   41 |         vsetivli zero, 4, e32, m1
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:6339:47: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 6339 |                     "vslideup.vi v11, v13, 2\n\t"
      |                                               ^
<inline asm>:48:20: note: instantiated into assembly here
   48 |         vsetivli zero, 8, e32, m2
      |                           ^
/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-quants.c:7269:17: error: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]
 7269 |                 "vsetivli zero, 12, e8, m1\n\t"
      |                 ^
<inline asm>:1:21: note: instantiated into assembly here
    1 |         vsetivli zero, 12, e8, m1
      |                            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions