diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2017-05-22 13:07:30 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2017-05-23 19:10:22 +0800 |
commit | 12719dbbb66be89cf9be4ddad36a24d7cc004ebd (patch) | |
tree | 5ba3b955274ebfb483f5e171affcf9989e209e32 | |
parent | 6b8b74c9c1dd51bc185bf621927a056cbfc347b2 (diff) |
Backend: Add sel ir output for MATH function
We only output MATH function before, now we can know which math
function is it.
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | backend/src/backend/gen_insn_selection_output.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/backend/src/backend/gen_insn_selection_output.cpp b/backend/src/backend/gen_insn_selection_output.cpp index f23e8c8d..33f0d15d 100644 --- a/backend/src/backend/gen_insn_selection_output.cpp +++ b/backend/src/backend/gen_insn_selection_output.cpp @@ -142,6 +142,48 @@ namespace gbe } } + if (insn.opcode == SEL_OP_MATH) { + switch (insn.extra.function) { + case GEN_MATH_FUNCTION_INV: + strcat(opname, ".inv"); + break; + case GEN_MATH_FUNCTION_LOG: + strcat(opname, ".log"); + break; + case GEN_MATH_FUNCTION_EXP: + strcat(opname, ".exp"); + break; + case GEN_MATH_FUNCTION_SQRT: + strcat(opname, ".sqrt"); + break; + case GEN_MATH_FUNCTION_RSQ: + strcat(opname, ".rsq"); + break; + case GEN_MATH_FUNCTION_SIN: + strcat(opname, ".sin"); + break; + case GEN_MATH_FUNCTION_COS: + strcat(opname, ".cos"); + break; + case GEN_MATH_FUNCTION_FDIV: + strcat(opname, ".fdiv"); + break; + case GEN_MATH_FUNCTION_POW: + strcat(opname, ".pow"); + break; + case GEN_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER: + strcat(opname, ".intdivmod"); + break; + case GEN_MATH_FUNCTION_INT_DIV_QUOTIENT: + strcat(opname, ".intdiv"); + break; + case GEN_MATH_FUNCTION_INT_DIV_REMAINDER: + strcat(opname, ".intmod"); + break; + } + } + + int n = strlen(opname); if(n >= OP_NAME_LENGTH - 20) { cout << "opname too long: " << opname << endl; |