[llvm-bugs] [Bug 38221] New: error: unknown instruction for inline asm "cvt.s.pl %0, %4\n\t"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 19 05:14:59 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38221

            Bug ID: 38221
           Summary: error: unknown instruction for inline asm "cvt.s.pl
                    %0, %4\n\t"
           Product: clang
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lesliezhai at llvm.org.cn
                CC: llvm-bugs at lists.llvm.org

Hi LLVM developers,

I am building OpenJDK8[1] with LLVM toolchain[2] for mips64el, it[3] failed 
to build:


/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:429:13:
error: unknown instruction
            "cvt.s.pl %0, %4\n\t"
            ^
<inline asm>:1:2: note: instantiated into assembly here
        cvt.s.pl $f0, $f0
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:429:31:
error: unknown instruction
            "cvt.s.pl %0, %4\n\t"
                              ^
<inline asm>:2:2: note: instantiated into assembly here
        cvt.s.pu $f1, $f0
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:430:31:
error: unknown instruction
            "cvt.s.pu %1, %4\n\t"
                              ^
<inline asm>:3:2: note: instantiated into assembly here
        cvt.s.pl $f2, $f1
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:431:31:
error: unknown instruction
            "cvt.s.pl %2, %5\n\t"
                              ^
<inline asm>:4:2: note: instantiated into assembly here
        cvt.s.pu $f3, $f1
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:441:37:
error: unknown instruction
                "add.s  %2, %4, %6\n\t"
                                    ^
<inline asm>:3:2: note: instantiated into assembly here
        pll.ps $f0, $f1, $f2
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:491:17:
error: unknown instruction
                "cvt.s.pu %3, %9\n\t"
                ^
<inline asm>:1:2: note: instantiated into assembly here
        cvt.s.pu $f3, $f0
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:491:35:
error: unknown instruction
                "cvt.s.pu %3, %9\n\t"
                                  ^
<inline asm>:2:2: note: instantiated into assembly here
        cvt.s.pl $f4, $f0
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:492:35:
error: unknown instruction
                "cvt.s.pl %4, %9\n\t"
                                  ^
<inline asm>:3:2: note: instantiated into assembly here
        cvt.s.pu $f5, $f1
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:493:36:
error: unknown instruction
                "cvt.s.pu %5, %10\n\t"
                                   ^
<inline asm>:4:2: note: instantiated into assembly here
        cvt.s.pl $f6, $f1
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:494:36:
error: unknown instruction
                "cvt.s.pl %6, %10\n\t"
                                   ^
<inline asm>:5:2: note: instantiated into assembly here
        cvt.s.pu $f7, $f2
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:495:36:
error: unknown instruction
                "cvt.s.pu %7, %11\n\t"
                                   ^
<inline asm>:6:2: note: instantiated into assembly here
        cvt.s.pl $f8, $f2
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:498:41:
error: unknown instruction
                "madd.s %2, %4, %6, %8\n\t"
                                        ^
<inline asm>:9:2: note: instantiated into assembly here
        pll.ps $f0, $f1, $f2
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:464:37:
error: unknown instruction
                "mul.s  %2, %4, %6\n\t"
                                    ^
<inline asm>:3:2: note: instantiated into assembly here
        pll.ps $f0, $f1, $f2
        ^
/home/loongson/jdk8-mips/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp:453:37:
error: unknown instruction
                "sub.s  %2, %4, %6\n\t"
                                    ^
<inline asm>:3:2: note: instantiated into assembly here
        pll.ps $f0, $f1, $f2


But reduced testcase1 is able to work:

$ cat t.s
cvt.s.pl $f0, $f1
$ clang -c t.s -o t.o
$ file t.o
t.o: ELF 64-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV), not
stripped

And reduced testcase2 is able to work too:

$ cat t.cpp
void t() {
  float ft_upper = 6, ft_lower = 5, fs_upper = 4, fs_lower = 3;
  double ft_value = 2, fs_value = 1;
  __asm__ __volatile__ (
    "cvt.s.pl %0, %4\n\t"
    "cvt.s.pu %1, %4\n\t"
    "cvt.s.pl %2, %5\n\t"
    "cvt.s.pu %3, %5\n\t"
    : "=f" (fs_lower), "=f" (fs_upper), "=f" (ft_lower), "=f" (ft_upper)
    : "f" (fs_value), "f" (ft_value)
  );
}
$ clang++ -c t.cpp -o t.o
$ file t.o
t.o: ELF 64-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV), not
stripped


1. http://hg.loongnix.org/
2. Loongson clang version 7.0.0 (git at github.com:Loong-Language/loong-clang.git
c36069cffc57a30a20782bf327a87bed4e48a6c2)
(git at github.com:Loong-Language/loong-llvm.git
59cb663e72874dda740aa2b18bf47ba65b32fe9b) (based on LLVM 7.0.0svn)
Target: mips64el-redhat-linux
Thread model: posix
InstalledDir: /opt/loong-llvm/bin
Found candidate GCC installation: /usr/lib/gcc/mips64el-redhat-linux/4.9.3
Selected GCC installation: /usr/lib/gcc/mips64el-redhat-linux/4.9.3
Candidate multilib: .;
Selected multilib: .;
3. inline asm is here
http://hg.loongnix.org/jdk8-mips64-public/hotspot/file/tip/src/os_cpu/linux_mips/vm/os_linux_mips.cpp#l432
4. Also experienced other bug
http://lists.llvm.org/pipermail/llvm-dev/2018-July/124717.html


Regards,
Leslie Zhai

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180719/8c6589d3/attachment-0001.html>


More information about the llvm-bugs mailing list