diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2004-02-19 18:50:57 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2004-02-19 18:50:57 +0000 |
commit | 0e1d7f3250b8a658688453eeb5f206d0f9e6d2a2 (patch) | |
tree | be89e4c0e2565b25b32a59e6188690809c53b427 /gcc | |
parent | c6e9f0ebd9e10ae5ef71a57968cc034f901a4e25 (diff) | |
download | gcc-0e1d7f3250b8a658688453eeb5f206d0f9e6d2a2.zip gcc-0e1d7f3250b8a658688453eeb5f206d0f9e6d2a2.tar.gz gcc-0e1d7f3250b8a658688453eeb5f206d0f9e6d2a2.tar.bz2 |
md.texi (Standard Names): Document additional dependency on fix pattern.
2004-02-19 Aldy Hernandez <aldyh@redhat.com>
* doc/md.texi (Standard Names): Document additional dependency on
fix pattern.
* optabs.c (ftruncify): Remove.
(expand_fix): Manually inline ftruncify above.
(can_fix_p): Add FIXME note.
From-SVN: r78116
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/doc/md.texi | 3 | ||||
-rw-r--r-- | gcc/optabs.c | 21 |
3 files changed, 22 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 73dfbb4..0c8a7d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2004-02-19 Aldy Hernandez <aldyh@redhat.com> + * doc/md.texi (Standard Names): Document additional dependency on + fix pattern. + + * optabs.c (ftruncify): Remove. + (expand_fix): Manually inline ftruncify above. + (can_fix_p): Add FIXME note. + +2004-02-19 Aldy Hernandez <aldyh@redhat.com> + * config/rs6000/spe.md (spe_fixunssfsi2): Rename to spe_fixuns_truncsfsi2. diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index b3cb5df..11848a5 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -2865,6 +2865,9 @@ point mode @var{n} as a signed number and store in operand 0 (which has mode @var{n}). This instruction's result is defined only when the value of operand 1 is an integer. +If the machine description defines this pattern, it also needs to +define the @code{ftrunc} pattern. + @cindex @code{fixuns@var{mn}2} instruction pattern @item @samp{fixuns@var{m}@var{n}2} Convert operand 1 (valid for floating point mode @var{m}) to fixed diff --git a/gcc/optabs.c b/gcc/optabs.c index 7a47a6f..cf3099b 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -105,7 +105,6 @@ static void prepare_cmp_insn (rtx *, rtx *, enum rtx_code *, rtx, static enum insn_code can_fix_p (enum machine_mode, enum machine_mode, int, int *); static enum insn_code can_float_p (enum machine_mode, enum machine_mode, int); -static rtx ftruncify (rtx); static optab new_optab (void); static convert_optab new_convert_optab (void); static inline optab init_optab (enum rtx_code); @@ -4434,6 +4433,9 @@ can_fix_p (enum machine_mode fixmode, enum machine_mode fltmode, return icode; } + /* FIXME: This requires a port to define both FIX and FTRUNC pattern + for this to work. We need to rework the fix* and ftrunc* patterns + and documentation. */ tab = unsignedp ? ufix_optab : sfix_optab; icode = tab->handlers[fixmode][fltmode].insn_code; if (icode != CODE_FOR_nothing @@ -4673,15 +4675,8 @@ expand_float (rtx to, rtx from, int unsignedp) } } -/* expand_fix: generate code to convert FROM to fixed point - and store in TO. FROM must be floating point. */ - -static rtx -ftruncify (rtx x) -{ - rtx temp = gen_reg_rtx (GET_MODE (x)); - return expand_unop (GET_MODE (x), ftrunc_optab, x, temp, 0); -} +/* Generate code to convert FROM to fixed point and store in TO. FROM + must be floating point. */ void expand_fix (rtx to, rtx from, int unsignedp) @@ -4716,7 +4711,11 @@ expand_fix (rtx to, rtx from, int unsignedp) from = convert_to_mode (fmode, from, 0); if (must_trunc) - from = ftruncify (from); + { + rtx temp = gen_reg_rtx (GET_MODE (from)); + from = expand_unop (GET_MODE (from), ftrunc_optab, from, + temp, 0); + } if (imode != GET_MODE (to)) target = gen_reg_rtx (imode); |