OLD | NEW |
1 /* | 1 /* |
2 * Floating point number functions. | 2 * Floating point number functions. |
3 * | 3 * |
4 * Copyright (C) 2001-2007 Peter Johnson | 4 * Copyright (C) 2001-2007 Peter Johnson |
5 * | 5 * |
6 * Based on public-domain x86 assembly code by Randall Hyde (8/28/91). | 6 * Based on public-domain x86 assembly code by Randall Hyde (8/28/91). |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
11 * 1. Redistributions of source code must retain the above copyright | 11 * 1. Redistributions of source code must retain the above copyright |
12 * notice, this list of conditions and the following disclaimer. | 12 * notice, this list of conditions and the following disclaimer. |
13 * 2. Redistributions in binary form must reproduce the above copyright | 13 * 2. Redistributions in binary form must reproduce the above copyright |
14 * notice, this list of conditions and the following disclaimer in the | 14 * notice, this list of conditions and the following disclaimer in the |
15 * documentation and/or other materials provided with the distribution. | 15 * documentation and/or other materials provided with the distribution. |
16 * | 16 * |
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' | 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' |
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE | 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE |
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
27 * POSSIBILITY OF SUCH DAMAGE. | 27 * POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 #include "util.h" | 29 #include "util.h" |
30 /*@unused@*/ RCSID("$Id: floatnum.c 1954 2007-09-16 20:41:16Z peter $"); | |
31 | 30 |
32 #include <ctype.h> | 31 #include <ctype.h> |
33 | 32 |
34 #include "coretype.h" | 33 #include "coretype.h" |
35 #include "bitvect.h" | 34 #include "bitvect.h" |
36 #include "file.h" | 35 #include "file.h" |
37 | 36 |
38 #include "errwarn.h" | 37 #include "errwarn.h" |
39 #include "floatnum.h" | 38 #include "floatnum.h" |
40 | 39 |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 fprintf(f, "%02x ", out[i]); | 751 fprintf(f, "%02x ", out[i]); |
753 fprintf(f, "\n"); | 752 fprintf(f, "\n"); |
754 | 753 |
755 /* 80-bit (extended precision) format */ | 754 /* 80-bit (extended precision) format */ |
756 fprintf(f, "80-bit: %d: ", | 755 fprintf(f, "80-bit: %d: ", |
757 yasm_floatnum_get_sized(flt, out, 10, 80, 0, 0, 0)); | 756 yasm_floatnum_get_sized(flt, out, 10, 80, 0, 0, 0)); |
758 for (i=0; i<10; i++) | 757 for (i=0; i<10; i++) |
759 fprintf(f, "%02x ", out[i]); | 758 fprintf(f, "%02x ", out[i]); |
760 fprintf(f, "\n"); | 759 fprintf(f, "\n"); |
761 } | 760 } |
OLD | NEW |