comparison gcc/real.c @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* real.c - software floating point emulation. 1 /* real.c - software floating point emulation.
2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
3 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. 3 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
4 Contributed by Stephen L. Moshier (moshier@world.std.com). 5 Contributed by Stephen L. Moshier (moshier@world.std.com).
5 Re-written by Richard Henderson <rth@redhat.com> 6 Re-written by Richard Henderson <rth@redhat.com>
6 7
7 This file is part of GCC. 8 This file is part of GCC.
8 9
23 #include "config.h" 24 #include "config.h"
24 #include "system.h" 25 #include "system.h"
25 #include "coretypes.h" 26 #include "coretypes.h"
26 #include "tm.h" 27 #include "tm.h"
27 #include "tree.h" 28 #include "tree.h"
28 #include "toplev.h" 29 #include "diagnostic-core.h"
29 #include "real.h" 30 #include "real.h"
30 #include "realmpfr.h" 31 #include "realmpfr.h"
31 #include "tm_p.h" 32 #include "tm_p.h"
32 #include "dfp.h" 33 #include "dfp.h"
33 34
1007 return decimal_real_arithmetic (r, code, op0, op1); 1008 return decimal_real_arithmetic (r, code, op0, op1);
1008 1009
1009 switch (code) 1010 switch (code)
1010 { 1011 {
1011 case PLUS_EXPR: 1012 case PLUS_EXPR:
1013 /* Clear any padding areas in *r if it isn't equal to one of the
1014 operands so that we can later do bitwise comparisons later on. */
1015 if (r != op0 && r != op1)
1016 memset (r, '\0', sizeof (*r));
1012 return do_add (r, op0, op1, 0); 1017 return do_add (r, op0, op1, 0);
1013 1018
1014 case MINUS_EXPR: 1019 case MINUS_EXPR:
1020 if (r != op0 && r != op1)
1021 memset (r, '\0', sizeof (*r));
1015 return do_add (r, op0, op1, 1); 1022 return do_add (r, op0, op1, 1);
1016 1023
1017 case MULT_EXPR: 1024 case MULT_EXPR:
1025 if (r != op0 && r != op1)
1026 memset (r, '\0', sizeof (*r));
1018 return do_multiply (r, op0, op1); 1027 return do_multiply (r, op0, op1);
1019 1028
1020 case RDIV_EXPR: 1029 case RDIV_EXPR:
1030 if (r != op0 && r != op1)
1031 memset (r, '\0', sizeof (*r));
1021 return do_divide (r, op0, op1); 1032 return do_divide (r, op0, op1);
1022 1033
1023 case MIN_EXPR: 1034 case MIN_EXPR:
1024 if (op1->cl == rvc_nan) 1035 if (op1->cl == rvc_nan)
1025 *r = *op1; 1036 *r = *op1;