OLD | NEW |
1 /* Fixed-point arithmetic support. | 1 /* Fixed-point arithmetic support. |
2 Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. | 2 Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify it under | 6 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 7 the terms of the GNU General Public License as published by the Free |
8 Software Foundation; either version 3, or (at your option) any later | 8 Software Foundation; either version 3, or (at your option) any later |
9 version. | 9 version. |
10 | 10 |
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY | 11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or | 12 WARRANTY; without even the implied warranty of MERCHANTABILITY or |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 return false; | 777 return false; |
778 } | 778 } |
779 | 779 |
780 /* Compare fixed-point values by tree_code. | 780 /* Compare fixed-point values by tree_code. |
781 Note that OP0 and OP1 must have the same mode. */ | 781 Note that OP0 and OP1 must have the same mode. */ |
782 | 782 |
783 bool | 783 bool |
784 fixed_compare (int icode, const FIXED_VALUE_TYPE *op0, | 784 fixed_compare (int icode, const FIXED_VALUE_TYPE *op0, |
785 const FIXED_VALUE_TYPE *op1) | 785 const FIXED_VALUE_TYPE *op1) |
786 { | 786 { |
787 enum tree_code code = icode; | 787 enum tree_code code = (enum tree_code) icode; |
788 gcc_assert (op0->mode == op1->mode); | 788 gcc_assert (op0->mode == op1->mode); |
789 | 789 |
790 switch (code) | 790 switch (code) |
791 { | 791 { |
792 case NE_EXPR: | 792 case NE_EXPR: |
793 return !double_int_equal_p (op0->data, op1->data); | 793 return !double_int_equal_p (op0->data, op1->data); |
794 | 794 |
795 case EQ_EXPR: | 795 case EQ_EXPR: |
796 return double_int_equal_p (op0->data, op1->data); | 796 return double_int_equal_p (op0->data, op1->data); |
797 | 797 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 if (SIGNED_FIXED_POINT_MODE_P (f->mode)) | 1141 if (SIGNED_FIXED_POINT_MODE_P (f->mode)) |
1142 { | 1142 { |
1143 int i_f_bits = GET_MODE_IBIT (f->mode) + GET_MODE_FBIT (f->mode); | 1143 int i_f_bits = GET_MODE_IBIT (f->mode) + GET_MODE_FBIT (f->mode); |
1144 int sign_bit = get_fixed_sign_bit (f->data, i_f_bits); | 1144 int sign_bit = get_fixed_sign_bit (f->data, i_f_bits); |
1145 if (sign_bit == 1) | 1145 if (sign_bit == 1) |
1146 return true; | 1146 return true; |
1147 } | 1147 } |
1148 | 1148 |
1149 return false; | 1149 return false; |
1150 } | 1150 } |
OLD | NEW |