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
ccba022b
Commit
ccba022b
authored
Sep 09, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(gen_highpart): New function.
From-SVN: r2084
parent
89b48889
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
gcc/emit-rtl.c
+65
-0
No files found.
gcc/emit-rtl.c
View file @
ccba022b
...
...
@@ -692,6 +692,71 @@ gen_lowpart (mode, x)
abort
();
}
/* Like `gen_lowpart', but refer to the most significant part.
This is used to access the imaginary part of a complex number. */
rtx
gen_highpart
(
mode
,
x
)
enum
machine_mode
mode
;
register
rtx
x
;
{
/* This case loses if X is a subreg. To catch bugs early,
complain if an invalid MODE is used even in other cases. */
if
(
GET_MODE_SIZE
(
mode
)
>
UNITS_PER_WORD
&&
GET_MODE_SIZE
(
mode
)
!=
GET_MODE_UNIT_SIZE
(
GET_MODE
(
x
)))
abort
();
if
(
GET_CODE
(
x
)
==
CONST_DOUBLE
#if !(TARGET_FLOAT_FORMAT != HOST_FLOAT_FORMAT || defined(REAL_IS_NOT_DOUBLE))
&&
GET_MODE_CLASS
(
GET_MODE
(
x
))
!=
MODE_FLOAT
#endif
)
return
gen_rtx
(
CONST_INT
,
VOIDmode
,
CONST_DOUBLE_HIGH
(
x
)
&
GET_MODE_MASK
(
mode
));
else
if
(
GET_CODE
(
x
)
==
CONST_INT
)
return
const0_rtx
;
else
if
(
GET_CODE
(
x
)
==
MEM
)
{
register
int
offset
=
0
;
#if !WORDS_BIG_ENDIAN
offset
=
(
MAX
(
GET_MODE_SIZE
(
GET_MODE
(
x
)),
UNITS_PER_WORD
)
-
MAX
(
GET_MODE_SIZE
(
mode
),
UNITS_PER_WORD
));
#endif
#if !BYTES_BIG_ENDIAN
if
(
GET_MODE_SIZE
(
mode
)
<
UNITS_PER_WORD
)
offset
-=
(
GET_MODE_SIZE
(
mode
)
-
MIN
(
UNITS_PER_WORD
,
GET_MODE_SIZE
(
GET_MODE
(
x
))));
#endif
return
change_address
(
x
,
mode
,
plus_constant
(
XEXP
(
x
,
0
),
offset
));
}
else
if
(
GET_CODE
(
x
)
==
SUBREG
)
{
/* The only time this should occur is when we are looking at a
multi-word item with a SUBREG whose mode is the same as that of the
item. It isn't clear what we would do if it wasn't. */
if
(
SUBREG_WORD
(
x
)
!=
0
)
abort
();
return
gen_highpart
(
mode
,
SUBREG_REG
(
x
));
}
else
if
(
GET_CODE
(
x
)
==
REG
)
{
int
word
=
0
;
#if !WORDS_BIG_ENDIAN
if
(
GET_MODE_SIZE
(
GET_MODE
(
x
))
>
UNITS_PER_WORD
)
word
=
((
GET_MODE_SIZE
(
GET_MODE
(
x
))
-
MAX
(
GET_MODE_SIZE
(
mode
),
UNITS_PER_WORD
))
/
UNITS_PER_WORD
);
#endif
if
(
REGNO
(
x
)
<
FIRST_PSEUDO_REGISTER
)
return
gen_rtx
(
REG
,
mode
,
REGNO
(
x
)
+
word
);
else
return
gen_rtx
(
SUBREG
,
mode
,
x
,
word
);
}
else
abort
();
}
/* Return 1 iff X, assumed to be a SUBREG,
refers to the least significant part of its containing reg.
If X is not a SUBREG, always return 1 (it is its own low part!). */
...
...
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