interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / src / ggml-et / et-kernels / scripts / check_unimplemented_instructions.sh

36 lines · 1370 bytes Raw Blame History
1#!/bin/bash
2
3OBJDUMP=$1
4ADDR2LINE=$2
5TARGET_DEBUG=$3
6TARGET_ASM=${TARGET_DEBUG}.S
7BAD_INST_FILE=${TARGET_DEBUG}-BAD-INST.log
8
9# grep expression to find unimplemented instructions
10UNIMPLEMENTED_EXPR="fdiv.s\\|fsqrt.s\\|fcvt.l.s\\|fcvt.lu.s\\|fcvt.s.l\\|fcvt.s.lu\\|fdiv.pi\\|fdivu.pi\\|fremu.pi\\|frem.pi\\|fdiv.ps\\|fsqrt.ps\\|frsq.ps\\|fsin.ps"
11
12# dump assembly into .S file
13${OBJDUMP} -lwdSC ${TARGET_DEBUG} > ${TARGET_ASM}
14
15# check with grep for unimplemented instructions
16# Note: The exit status is 0 if selected lines are found, and 1 if not found.
17grep ${UNIMPLEMENTED_EXPR} ${TARGET_ASM} > /dev/null
18ret=$?
19
20if [ ${ret} -eq 0 ]
21then
22 # unimplemented instructions are found
23 echo -e "BUILD ERROR: Executable file ${TARGET_DEBUG} contains unimplemented instructions. Please review the lines of code listed in ${BAD_INST_FILE}"
24 echo -e "\t For further details, please read paragraph 3.4 of the ETSoC-1 Programmer's Reference Manual (PRM)"
25
26 # addr2line
27 grep ${UNIMPLEMENTED_EXPR} ${TARGET_ASM} | cut -d: -f 1 | ${ADDR2LINE} -i -e ${TARGET_DEBUG} > ${BAD_INST_FILE}
28 grep ${UNIMPLEMENTED_EXPR} ${TARGET_ASM} >> ${BAD_INST_FILE}
29 echo "------------------------------------------------------------"
30 cat ${BAD_INST_FILE}
31 echo "------------------------------------------------------------"
32 exit 1
33
34else
35 rm -f ${BAD_INST_FILE}
36fi