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
5ffe63ed
Commit
5ffe63ed
authored
Sep 09, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(convert_modes): New function.
(convert_to_mode): Use that. From-SVN: r5297
parent
0661a3de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
gcc/expr.c
+36
-5
No files found.
gcc/expr.c
View file @
5ffe63ed
...
@@ -1084,7 +1084,36 @@ convert_to_mode (mode, x, unsignedp)
...
@@ -1084,7 +1084,36 @@ convert_to_mode (mode, x, unsignedp)
rtx
x
;
rtx
x
;
int
unsignedp
;
int
unsignedp
;
{
{
return
convert_modes
(
mode
,
VOIDmode
,
x
,
unsignedp
);
}
/* Return an rtx for a value that would result
from converting X from mode OLDMODE to mode MODE.
Both modes may be floating, or both integer.
UNSIGNEDP is nonzero if X is an unsigned value.
This can be done by referring to a part of X in place
or by copying to a new temporary with conversion.
You can give VOIDmode for OLDMODE, if you are sure X has a nonvoid mode.
This function *must not* call protect_from_queue
except when putting X into an insn (in which case convert_move does it). */
rtx
convert_modes
(
mode
,
oldmode
,
x
,
unsignedp
)
enum
machine_mode
mode
,
oldmode
;
rtx
x
;
int
unsignedp
;
{
register
rtx
temp
;
register
rtx
temp
;
if
(
GET_MODE
(
x
)
!=
mode
)
oldmode
=
GET_MODE
(
x
);
/* If X doesnt have a mode, and we didn't specify one,
we have a potential bug, so crash now and get it fixed. */
if
(
oldmode
==
VOIDmode
)
abort
();
/* If FROM is a SUBREG that indicates that we have already done at least
/* If FROM is a SUBREG that indicates that we have already done at least
the required extension, strip it. */
the required extension, strip it. */
...
@@ -1094,7 +1123,7 @@ convert_to_mode (mode, x, unsignedp)
...
@@ -1094,7 +1123,7 @@ convert_to_mode (mode, x, unsignedp)
&&
SUBREG_PROMOTED_UNSIGNED_P
(
x
)
==
unsignedp
)
&&
SUBREG_PROMOTED_UNSIGNED_P
(
x
)
==
unsignedp
)
x
=
gen_lowpart
(
mode
,
x
);
x
=
gen_lowpart
(
mode
,
x
);
if
(
mode
==
GET_MODE
(
x
)
)
if
(
mode
==
oldmode
)
return
x
;
return
x
;
/* There is one case that we must handle specially: If we are converting
/* There is one case that we must handle specially: If we are converting
...
@@ -1115,9 +1144,9 @@ convert_to_mode (mode, x, unsignedp)
...
@@ -1115,9 +1144,9 @@ convert_to_mode (mode, x, unsignedp)
if
(
GET_CODE
(
x
)
==
CONST_INT
if
(
GET_CODE
(
x
)
==
CONST_INT
||
(
GET_MODE_CLASS
(
mode
)
==
MODE_INT
||
(
GET_MODE_CLASS
(
mode
)
==
MODE_INT
&&
GET_MODE_CLASS
(
GET_MODE
(
x
)
)
==
MODE_INT
&&
GET_MODE_CLASS
(
oldmode
)
==
MODE_INT
&&
(
GET_CODE
(
x
)
==
CONST_DOUBLE
&&
(
GET_CODE
(
x
)
==
CONST_DOUBLE
||
(
GET_MODE_SIZE
(
mode
)
<=
GET_MODE_SIZE
(
GET_MODE
(
x
)
)
||
(
GET_MODE_SIZE
(
mode
)
<=
GET_MODE_SIZE
(
oldmode
)
&&
((
GET_CODE
(
x
)
==
MEM
&&
!
MEM_VOLATILE_P
(
x
)
&&
((
GET_CODE
(
x
)
==
MEM
&&
!
MEM_VOLATILE_P
(
x
)
&&
direct_load
[(
int
)
mode
])
&&
direct_load
[(
int
)
mode
])
||
GET_CODE
(
x
)
==
REG
)))))
||
GET_CODE
(
x
)
==
REG
)))))
...
@@ -2246,8 +2275,10 @@ expand_assignment (to, from, want_value, suggest_reg)
...
@@ -2246,8 +2275,10 @@ expand_assignment (to, from, want_value, suggest_reg)
/* If the value is meaningful, convert RESULT to the proper mode.
/* If the value is meaningful, convert RESULT to the proper mode.
Otherwise, return nothing. */
Otherwise, return nothing. */
return
(
want_value
?
convert_to_mode
(
TYPE_MODE
(
TREE_TYPE
(
to
)),
result
,
return
(
want_value
?
convert_modes
(
TYPE_MODE
(
TREE_TYPE
(
to
)),
TREE_UNSIGNED
(
TREE_TYPE
(
to
)))
TYPE_MODE
(
TREE_TYPE
(
from
)),
result
,
TREE_UNSIGNED
(
TREE_TYPE
(
to
)))
:
NULL_RTX
);
:
NULL_RTX
);
}
}
...
...
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