diff options
author | Richard Stallman <rms@gnu.org> | 1993-03-31 05:54:18 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-03-31 05:54:18 +0000 |
commit | 0c5e217dc9018fdba67ba5f61daf0571e4debeee (patch) | |
tree | 684d8846e19f3d3c408508a4f86eb3bc1a215744 | |
parent | d3159aee6e9cee2364f234181678f634cd3ba031 (diff) | |
download | gcc-0c5e217dc9018fdba67ba5f61daf0571e4debeee.zip gcc-0c5e217dc9018fdba67ba5f61daf0571e4debeee.tar.gz gcc-0c5e217dc9018fdba67ba5f61daf0571e4debeee.tar.bz2 |
(rtx_to_tree_code): New function.
From-SVN: r3944
-rw-r--r-- | gcc/explow.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 2cc6461..91cb743 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1010,3 +1010,41 @@ hard_libcall_value (mode) { return LIBCALL_VALUE (mode); } + +/* Look up the tree code for a given rtx code + to provide the arithmetic operation for REAL_ARITHMETIC. + The function returns an int because the caller may not know + what `enum tree_code' means. */ + +int +rtx_to_tree_code (code) + enum rtx_code code; +{ + enum tree_code tcode; + + switch (code) + { + case PLUS: + tcode = PLUS_EXPR; + break; + case MINUS: + tcode = MINUS_EXPR; + break; + case MULT: + tcode = MULT_EXPR; + break; + case DIV: + tcode = RDIV_EXPR; + break; + case SMIN: + tcode = MIN_EXPR; + break; + case SMAX: + tcode = MAX_EXPR; + break; + default: + tcode = LAST_AND_UNUSED_TREE_CODE; + break; + } + return ((int) tcode); +} |