diff options
author | Jim Wilson <wilson@cygnus.com> | 1998-05-05 00:44:36 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-05-04 18:44:36 -0600 |
commit | 2e14a41b63bb3ac89e91b85e58ae3d0f3e3798c9 (patch) | |
tree | 5e64e512121f84b885b6d4e82b04b218c81115f9 /gcc/config | |
parent | fd34c882b9d23ef58b1bdf6ebd66d0d796ffbf79 (diff) | |
download | gcc-2e14a41b63bb3ac89e91b85e58ae3d0f3e3798c9.zip gcc-2e14a41b63bb3ac89e91b85e58ae3d0f3e3798c9.tar.gz gcc-2e14a41b63bb3ac89e91b85e58ae3d0f3e3798c9.tar.bz2 |
i386.c (output_fix_trunc): Add code to emulate non-popping DImode case.
* i386.c (output_fix_trunc): Add code to emulate non-popping DImode
case.
From-SVN: r19538
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4a29f88..73ca40c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3943,8 +3943,7 @@ output_fix_trunc (insn, operands) int stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; rtx xops[2]; - if (! STACK_TOP_P (operands[1]) - || (GET_MODE (operands[0]) == DImode && ! stack_top_dies)) + if (! STACK_TOP_P (operands[1])) abort (); xops[0] = GEN_INT (12); @@ -3963,6 +3962,17 @@ output_fix_trunc (insn, operands) { if (stack_top_dies) output_asm_insn (AS1 (fistp%z0,%0), operands); + else if (GET_MODE (operands[0]) == DImode && ! stack_top_dies) + { + /* There is no DImode version of this without a stack pop, so + we must emulate it. It doesn't matter much what the second + instruction is, because the value being pushed on the FP stack + is not used except for the following stack popping store. + This case can only happen without optimization, so it doesn't + matter that it is inefficient. */ + output_asm_insn (AS1 (fistp%z0,%0), operands); + output_asm_insn (AS1 (fild%z0,%0), operands); + } else output_asm_insn (AS1 (fist%z0,%0), operands); } |