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
55f8a64c
Commit
55f8a64c
authored
Nov 08, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(gen_int_relational): Handle overflow when incrementing cmp1.
From-SVN: r2714
parent
8843f6e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
11 deletions
+27
-11
gcc/config/mips/mips.c
+27
-11
No files found.
gcc/config/mips/mips.c
View file @
55f8a64c
...
...
@@ -1554,20 +1554,21 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert)
int
reverse_regs
;
/* reverse registers in test */
int
invert_const
;
/* != 0 if invert value if cmp1 is constant */
int
invert_reg
;
/* != 0 if invert value if cmp1 is register */
int
unsignedp
;
/* != 0 for unsigned comparisons. */
};
static
struct
cmp_info
info
[
(
int
)
ITEST_MAX
]
=
{
{
XOR
,
0
,
65535
,
0
,
0
,
0
,
0
},
/* EQ */
{
XOR
,
0
,
65535
,
0
,
0
,
1
,
1
},
/* NE */
{
LT
,
-
32769
,
32766
,
1
,
1
,
1
,
0
},
/* GT */
{
LT
,
-
32768
,
32767
,
0
,
0
,
1
,
1
},
/* GE */
{
LT
,
-
32768
,
32767
,
0
,
0
,
0
,
0
},
/* LT */
{
LT
,
-
32769
,
32766
,
1
,
1
,
0
,
1
},
/* LE */
{
LTU
,
-
32769
,
32766
,
1
,
1
,
1
,
0
},
/* GTU */
{
LTU
,
-
32768
,
32767
,
0
,
0
,
1
,
1
},
/* GEU */
{
LTU
,
-
32768
,
32767
,
0
,
0
,
0
,
0
},
/* LTU */
{
LTU
,
-
32769
,
32766
,
1
,
1
,
0
,
1
},
/* LEU */
{
XOR
,
0
,
65535
,
0
,
0
,
0
,
0
,
0
},
/* EQ */
{
XOR
,
0
,
65535
,
0
,
0
,
1
,
1
,
0
},
/* NE */
{
LT
,
-
32769
,
32766
,
1
,
1
,
1
,
0
,
0
},
/* GT */
{
LT
,
-
32768
,
32767
,
0
,
0
,
1
,
1
,
0
},
/* GE */
{
LT
,
-
32768
,
32767
,
0
,
0
,
0
,
0
,
0
},
/* LT */
{
LT
,
-
32769
,
32766
,
1
,
1
,
0
,
1
,
0
},
/* LE */
{
LTU
,
-
32769
,
32766
,
1
,
1
,
1
,
0
,
1
},
/* GTU */
{
LTU
,
-
32768
,
32767
,
0
,
0
,
1
,
1
,
1
},
/* GEU */
{
LTU
,
-
32768
,
32767
,
0
,
0
,
0
,
0
,
1
},
/* LTU */
{
LTU
,
-
32769
,
32766
,
1
,
1
,
0
,
1
,
1
},
/* LEU */
};
enum
internal_test
test
;
...
...
@@ -1631,7 +1632,22 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert)
if
(
GET_CODE
(
cmp1
)
==
CONST_INT
)
{
if
(
p_info
->
const_add
!=
0
)
cmp1
=
GEN_INT
(
INTVAL
(
cmp1
)
+
p_info
->
const_add
);
{
HOST_WIDE_INT
new
=
INTVAL
(
cmp1
)
+
p_info
->
const_add
;
/* If modification of cmp1 caused overflow,
we would get the wrong answer if we follow the usual path;
thus, x > 0xffffffffu would turn into x > 0u. */
if
((
p_info
->
unsignedp
?
(
unsigned
HOST_WIDE_INT
)
new
>
INTVAL
(
cmp1
)
:
new
>
INTVAL
(
cmp1
))
!=
(
p_info
->
const_add
>
0
))
/* 1 is the right value in the LE and LEU case.
In the GT and GTU case, *p_invert is already set,
so this is effectively 0. */
return
force_reg
(
SImode
,
const1_rtx
);
else
cmp1
=
GEN_INT
(
new
);
}
}
else
if
(
p_info
->
reverse_regs
)
{
...
...
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