Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
7d4d4d22
Commit
7d4d4d22
authored
Mar 22, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r563
parent
333e0f7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
3 deletions
+56
-3
gcc/fold-const.c
+56
-3
No files found.
gcc/fold-const.c
View file @
7d4d4d22
...
@@ -738,6 +738,46 @@ target_isinf (x)
...
@@ -738,6 +738,46 @@ target_isinf (x)
}
}
}
}
/* Check whether an IEEE double precision number is a NaN. */
int
target_isnan
(
x
)
REAL_VALUE_TYPE
x
;
{
/* The IEEE 64-bit double format. */
union
{
REAL_VALUE_TYPE
d
;
struct
{
unsigned
sign
:
1
;
unsigned
exponent
:
11
;
unsigned
mantissa1
:
20
;
unsigned
mantissa2
;
}
little_endian
;
struct
{
unsigned
mantissa2
;
unsigned
mantissa1
:
20
;
unsigned
exponent
:
11
;
unsigned
sign
:
1
;
}
big_endian
;
}
u
;
u
.
d
=
dconstm1
;
if
(
u
.
big_endian
.
sign
==
1
)
{
u
.
d
=
x
;
return
(
u
.
big_endian
.
exponent
==
2047
&&
(
u
.
big_endian
.
mantissa1
!=
0
||
u
.
big_endian
.
mantissa2
!=
0
));
}
else
{
u
.
d
=
x
;
return
(
u
.
little_endian
.
exponent
==
2047
&&
(
u
.
little_endian
.
mantissa1
!=
0
||
u
.
little_endian
.
mantissa2
!=
0
));
}
}
/* Check for minus zero in an IEEE double precision number. */
/* Check for minus zero in an IEEE double precision number. */
int
int
...
@@ -762,6 +802,15 @@ target_isinf (x)
...
@@ -762,6 +802,15 @@ target_isinf (x)
return
0
;
return
0
;
}
}
/* Let's assume other float formats don't have NaNs.
(This can be overridden by redefining REAL_VALUE_ISNAN.) */
target_isnan
(
x
)
REAL_VALUE_TYPE
x
;
{
return
0
;
}
/* Let's assume other float formats don't have minus zero.
/* Let's assume other float formats don't have minus zero.
(This can be overridden by redefining REAL_VALUE_MINUS_ZERO.) */
(This can be overridden by redefining REAL_VALUE_MINUS_ZERO.) */
...
@@ -1408,9 +1457,13 @@ operand_equal_p (arg0, arg1, only_const)
...
@@ -1408,9 +1457,13 @@ operand_equal_p (arg0, arg1, only_const)
&&
TREE_INT_CST_HIGH
(
arg0
)
==
TREE_INT_CST_HIGH
(
arg1
))
&&
TREE_INT_CST_HIGH
(
arg0
)
==
TREE_INT_CST_HIGH
(
arg1
))
return
1
;
return
1
;
/* Detect when real constants are equal.
But reject weird values because we can't be sure what to do with them. */
if
(
TREE_CODE
(
arg0
)
==
TREE_CODE
(
arg1
)
if
(
TREE_CODE
(
arg0
)
==
TREE_CODE
(
arg1
)
&&
TREE_CODE
(
arg0
)
==
REAL_CST
&&
TREE_CODE
(
arg0
)
==
REAL_CST
&&
REAL_VALUES_EQUAL
(
TREE_REAL_CST
(
arg0
),
TREE_REAL_CST
(
arg1
)))
&&
REAL_VALUES_EQUAL
(
TREE_REAL_CST
(
arg0
),
TREE_REAL_CST
(
arg1
))
&&
!
REAL_VALUE_ISINF
(
TREE_REAL_CST
(
arg0
))
&&
!
REAL_VALUE_ISNAN
(
TREE_REAL_CST
(
arg0
)))
return
1
;
return
1
;
if
(
only_const
)
if
(
only_const
)
...
@@ -1562,8 +1615,8 @@ invert_truthvalue (arg)
...
@@ -1562,8 +1615,8 @@ invert_truthvalue (arg)
/* For floating-point comparisons, it isn't safe to invert the condition.
/* For floating-point comparisons, it isn't safe to invert the condition.
So just enclose a TRUTH_NOT_EXPR around what we have. */
So just enclose a TRUTH_NOT_EXPR around what we have. */
if
(
TREE_CODE
(
type
)
==
REAL_TYPE
if
(
TREE_CODE
_CLASS
(
TREE_CODE
(
arg
))
==
'<'
&&
TREE_CODE
_CLASS
(
TREE_CODE
(
arg
))
==
'<'
)
&&
TREE_CODE
(
TREE_TYPE
(
TREE_OPERAND
(
arg
,
0
)))
==
REAL_TYPE
)
return
build1
(
TRUTH_NOT_EXPR
,
type
,
arg
);
return
build1
(
TRUTH_NOT_EXPR
,
type
,
arg
);
switch
(
TREE_CODE
(
arg
))
switch
(
TREE_CODE
(
arg
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment