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
b1ec3c92
Commit
b1ec3c92
authored
Jul 06, 1992
by
Charles Hannum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
entered into RCS
From-SVN: r1472
parent
5f4f0e22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
114 deletions
+123
-114
gcc/explow.c
+37
-40
gcc/expmed.c
+0
-0
gcc/global.c
+40
-31
gcc/local-alloc.c
+7
-6
gcc/optabs.c
+39
-37
No files found.
gcc/explow.c
View file @
b1ec3c92
...
...
@@ -29,12 +29,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "insn-flags.h"
#include "insn-codes.h"
/* Return an rtx for the sum of X and the integer C. */
/* Return an rtx for the sum of X and the integer C.
This fucntion should be used via the `plus_constant' macro. */
rtx
plus_constant
(
x
,
c
)
plus_constant
_wide
(
x
,
c
)
register
rtx
x
;
register
int
c
;
register
HOST_WIDE_INT
c
;
{
register
RTX_CODE
code
;
register
enum
machine_mode
mode
;
...
...
@@ -51,15 +53,15 @@ plus_constant (x, c)
switch
(
code
)
{
case
CONST_INT
:
return
gen_rtx
(
CONST_INT
,
VOIDmode
,
(
INTVAL
(
x
)
+
c
)
);
return
GEN_INT
(
INTVAL
(
x
)
+
c
);
case
CONST_DOUBLE
:
{
int
l1
=
CONST_DOUBLE_LOW
(
x
);
int
h1
=
CONST_DOUBLE_HIGH
(
x
);
int
l2
=
c
;
int
h2
=
c
<
0
?
~
0
:
0
;
int
lv
,
hv
;
HOST_WIDE_INT
l1
=
CONST_DOUBLE_LOW
(
x
);
HOST_WIDE_INT
h1
=
CONST_DOUBLE_HIGH
(
x
);
HOST_WIDE_INT
l2
=
c
;
HOST_WIDE_INT
h2
=
c
<
0
?
~
0
:
0
;
HOST_WIDE_INT
lv
,
hv
;
add_double
(
l1
,
h1
,
l2
,
h2
,
&
lv
,
&
hv
);
...
...
@@ -117,7 +119,7 @@ plus_constant (x, c)
}
if
(
c
!=
0
)
x
=
gen_rtx
(
PLUS
,
mode
,
x
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
c
));
x
=
gen_rtx
(
PLUS
,
mode
,
x
,
GEN_INT
(
c
));
if
(
GET_CODE
(
x
)
==
SYMBOL_REF
||
GET_CODE
(
x
)
==
LABEL_REF
)
return
x
;
...
...
@@ -127,12 +129,14 @@ plus_constant (x, c)
return
x
;
}
/* This is the same as `plus_constant', except that it handles LO_SUM. */
/* This is the same as `plus_constant', except that it handles LO_SUM.
This function should be used via the `plus_constant_for_output' macro. */
rtx
plus_constant_for_output
(
x
,
c
)
plus_constant_for_output
_wide
(
x
,
c
)
register
rtx
x
;
register
int
c
;
register
HOST_WIDE_INT
c
;
{
register
RTX_CODE
code
=
GET_CODE
(
x
);
register
enum
machine_mode
mode
=
GET_MODE
(
x
);
...
...
@@ -239,7 +243,7 @@ expr_size (exp)
tree
exp
;
{
return
expand_expr
(
size_in_bytes
(
TREE_TYPE
(
exp
)),
0
,
TYPE_MODE
(
sizetype
),
0
);
NULL_RTX
,
TYPE_MODE
(
sizetype
),
0
);
}
/* Return a copy of X in which all memory references
...
...
@@ -377,15 +381,15 @@ memory_address (mode, x)
rtx
y
=
eliminate_constant_term
(
x
,
&
constant_term
);
if
(
constant_term
==
const0_rtx
||
!
memory_address_p
(
mode
,
y
))
return
force_operand
(
x
,
0
);
return
force_operand
(
x
,
NULL_RTX
);
y
=
gen_rtx
(
PLUS
,
GET_MODE
(
x
),
copy_to_reg
(
y
),
constant_term
);
if
(
!
memory_address_p
(
mode
,
y
))
return
force_operand
(
x
,
0
);
return
force_operand
(
x
,
NULL_RTX
);
return
y
;
}
if
(
GET_CODE
(
x
)
==
MULT
||
GET_CODE
(
x
)
==
MINUS
)
return
force_operand
(
x
,
0
);
return
force_operand
(
x
,
NULL_RTX
);
/* If we have a register that's an invalid address,
it must be a hard reg of the wrong class. Copy it to a pseudo. */
...
...
@@ -408,7 +412,7 @@ memory_address (mode, x)
if
(
general_operand
(
x
,
Pmode
))
return
force_reg
(
Pmode
,
x
);
else
return
force_operand
(
x
,
0
);
return
force_operand
(
x
,
NULL_RTX
);
}
return
x
;
}
...
...
@@ -550,7 +554,7 @@ force_reg (mode, x)
and that X can be substituted for it. */
if
(
CONSTANT_P
(
x
))
{
rtx
note
=
find_reg_note
(
insn
,
REG_EQUAL
,
0
);
rtx
note
=
find_reg_note
(
insn
,
REG_EQUAL
,
NULL_RTX
);
if
(
note
)
XEXP
(
note
,
0
)
=
x
;
...
...
@@ -662,16 +666,13 @@ round_push (size)
{
int
new
=
(
INTVAL
(
size
)
+
align
-
1
)
/
align
*
align
;
if
(
INTVAL
(
size
)
!=
new
)
size
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
new
);
size
=
GEN_INT
(
new
);
}
else
{
size
=
expand_divmod
(
0
,
CEIL_DIV_EXPR
,
Pmode
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
),
0
,
1
);
size
=
expand_mult
(
Pmode
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
),
0
,
1
);
size
=
expand_divmod
(
0
,
CEIL_DIV_EXPR
,
Pmode
,
size
,
GEN_INT
(
align
),
NULL_RTX
,
1
);
size
=
expand_mult
(
Pmode
,
size
,
GEN_INT
(
align
),
NULL_RTX
,
1
);
}
#endif
/* STACK_BOUNDARY */
return
size
;
...
...
@@ -867,14 +868,12 @@ allocate_dynamic_stack_space (size, target, known_align)
if
(
known_align
%
BIGGEST_ALIGNMENT
!=
0
)
{
if
(
GET_CODE
(
size
)
==
CONST_INT
)
size
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
(
INTVAL
(
size
)
+
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
)));
size
=
GEN_INT
(
INTVAL
(
size
)
+
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
));
else
size
=
expand_binop
(
Pmode
,
add_optab
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
),
0
,
1
,
OPTAB_LIB_WIDEN
);
GEN_INT
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
-
1
),
NULL_RTX
,
1
,
OPTAB_LIB_WIDEN
);
}
#endif
...
...
@@ -887,9 +886,9 @@ allocate_dynamic_stack_space (size, target, known_align)
{
rtx
dynamic_offset
=
expand_binop
(
Pmode
,
sub_optab
,
virtual_stack_dynamic_rtx
,
stack_pointer_rtx
,
0
,
1
,
OPTAB_LIB_WIDEN
);
stack_pointer_rtx
,
NULL_RTX
,
1
,
OPTAB_LIB_WIDEN
);
size
=
expand_binop
(
Pmode
,
add_optab
,
size
,
dynamic_offset
,
0
,
1
,
OPTAB_LIB_WIDEN
);
NULL_RTX
,
1
,
OPTAB_LIB_WIDEN
);
}
#endif
/* SETJMP_VIA_SAVE_AREA */
...
...
@@ -953,14 +952,12 @@ allocate_dynamic_stack_space (size, target, known_align)
if
(
known_align
%
BIGGEST_ALIGNMENT
!=
0
)
{
target
=
expand_divmod
(
0
,
CEIL_DIV_EXPR
,
Pmode
,
target
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
),
0
,
1
);
GEN_INT
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
),
NULL_RTX
,
1
);
target
=
expand_mult
(
Pmode
,
target
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
),
0
,
1
);
GEN_INT
(
BIGGEST_ALIGNMENT
/
BITS_PER_UNIT
),
NULL_RTX
,
1
);
}
#endif
...
...
gcc/expmed.c
View file @
b1ec3c92
This diff is collapsed.
Click to expand it.
gcc/global.c
View file @
b1ec3c92
...
...
@@ -96,6 +96,13 @@ static int *allocno_size;
static
int
*
reg_may_share
;
/* Define the number of bits in each element of `conflicts' and what
type that element has. We use the largest integer format on the
host machine. */
#define INT_BITS HOST_BITS_PER_WIDE_INT
#define INT_TYPE HOST_WIDE_INT
/* max_allocno by max_allocno array of bits,
recording whether two allocno's conflict (can't go in the same
hardware register).
...
...
@@ -103,7 +110,7 @@ static int *reg_may_share;
`conflicts' is not symmetric; a conflict between allocno's i and j
is recorded either in element i,j or in element j,i. */
static
int
*
conflicts
;
static
INT_TYPE
*
conflicts
;
/* Number of ints require to hold max_allocno bits.
This is the length of a row in `conflicts'. */
...
...
@@ -114,11 +121,11 @@ static int allocno_row_words;
#define CONFLICTP(I, J) \
(conflicts[(I) * allocno_row_words + (J) / INT_BITS] \
& (1 << ((J) % INT_BITS)))
& (
(INT_TYPE)
1 << ((J) % INT_BITS)))
#define SET_CONFLICT(I, J) \
(conflicts[(I) * allocno_row_words + (J) / INT_BITS] \
|= (1 << ((J) % INT_BITS)))
|= (
(INT_TYPE)
1 << ((J) % INT_BITS)))
/* Set of hard regs currently live (during scan of all insns). */
...
...
@@ -194,21 +201,19 @@ static int local_reg_live_length[FIRST_PSEUDO_REGISTER];
/* Bit mask for allocnos live at current point in the scan. */
static
int
*
allocnos_live
;
#define INT_BITS HOST_BITS_PER_INT
static
INT_TYPE
*
allocnos_live
;
/* Test, set or clear bit number I in allocnos_live,
a bit vector indexed by allocno. */
#define ALLOCNO_LIVE_P(I) \
(allocnos_live[(I) / INT_BITS] & (1 << ((I) % INT_BITS)))
(allocnos_live[(I) / INT_BITS] & (
(INT_TYPE)
1 << ((I) % INT_BITS)))
#define SET_ALLOCNO_LIVE(I) \
(allocnos_live[(I) / INT_BITS] |= (1 << ((I) % INT_BITS)))
(allocnos_live[(I) / INT_BITS] |= (
(INT_TYPE)
1 << ((I) % INT_BITS)))
#define CLEAR_ALLOCNO_LIVE(I) \
(allocnos_live[(I) / INT_BITS] &= ~(1 << ((I) % INT_BITS)))
(allocnos_live[(I) / INT_BITS] &= ~(
(INT_TYPE)
1 << ((I) % INT_BITS)))
/* This is turned off because it doesn't work right for DImode.
(And it is only used for DImode, so the other cases are worthless.)
...
...
@@ -457,10 +462,12 @@ global_alloc (file)
allocno_row_words
=
(
max_allocno
+
INT_BITS
-
1
)
/
INT_BITS
;
conflicts
=
(
int
*
)
alloca
(
max_allocno
*
allocno_row_words
*
sizeof
(
int
));
bzero
(
conflicts
,
max_allocno
*
allocno_row_words
*
sizeof
(
int
));
conflicts
=
(
INT_TYPE
*
)
alloca
(
max_allocno
*
allocno_row_words
*
sizeof
(
INT_TYPE
));
bzero
(
conflicts
,
max_allocno
*
allocno_row_words
*
sizeof
(
INT_TYPE
));
allocnos_live
=
(
int
*
)
alloca
(
allocno_row_words
*
sizeof
(
int
));
allocnos_live
=
(
INT_TYPE
*
)
alloca
(
allocno_row_words
*
sizeof
(
INT_TYPE
));
/* If there is work to be done (at least one reg to allocate),
perform global conflict analysis and allocate the regs. */
...
...
@@ -534,7 +541,7 @@ global_alloc (file)
if
(
reg_renumber
[
allocno_reg
[
allocno_order
[
i
]]]
>=
0
)
continue
;
}
if
(
!
reg_preferred_or_nothing
(
allocno_reg
[
allocno_order
[
i
]])
)
if
(
reg_alternate_class
(
allocno_reg
[
allocno_order
[
i
]])
!=
NO_REGS
)
find_reg
(
allocno_order
[
i
],
HARD_CONST
(
0
),
1
,
0
,
0
);
}
}
...
...
@@ -593,7 +600,7 @@ global_conflicts ()
for
(
b
=
0
;
b
<
n_basic_blocks
;
b
++
)
{
bzero
(
allocnos_live
,
allocno_row_words
*
sizeof
(
int
));
bzero
(
allocnos_live
,
allocno_row_words
*
sizeof
(
INT_TYPE
));
/* Initialize table of registers currently live
to the state at the beginning of this basic block.
...
...
@@ -609,7 +616,8 @@ global_conflicts ()
are explicitly marked in basic_block_live_at_start. */
{
register
int
offset
,
bit
;
register
int
offset
;
REGSET_ELT_TYPE
bit
;
register
regset
old
=
basic_block_live_at_start
[
b
];
int
ax
=
0
;
...
...
@@ -620,7 +628,7 @@ global_conflicts ()
#endif
for
(
offset
=
0
,
i
=
0
;
offset
<
regset_size
;
offset
++
)
if
(
old
[
offset
]
==
0
)
i
+=
HOST_BITS_PER_INT
;
i
+=
REGSET_ELT_BITS
;
else
for
(
bit
=
1
;
bit
;
bit
<<=
1
,
i
++
)
{
...
...
@@ -699,7 +707,7 @@ global_conflicts ()
#ifdef AUTO_INC_DEC
for
(
link
=
REG_NOTES
(
insn
);
link
;
link
=
XEXP
(
link
,
1
))
if
(
REG_NOTE_KIND
(
link
)
==
REG_INC
)
mark_reg_store
(
XEXP
(
link
,
0
),
0
);
mark_reg_store
(
XEXP
(
link
,
0
),
NULL_RTX
);
#endif
/* If INSN has multiple outputs, then any reg that dies here
...
...
@@ -857,8 +865,8 @@ prune_preferences ()
LOSERS, if non-zero, is a HARD_REG_SET indicating registers that cannot
be used for this allocation.
If AL
L
_REGS_P is zero, consider only the preferred class of ALLOCNO's reg.
Otherwise ignore that preferred class.
If AL
T
_REGS_P is zero, consider only the preferred class of ALLOCNO's reg.
Otherwise ignore that preferred class
and use the alternate class
.
If ACCEPT_CALL_CLOBBERED is nonzero, accept a call-clobbered hard reg that
will have to be saved and restored at calls.
...
...
@@ -869,10 +877,10 @@ prune_preferences ()
If not, do nothing. */
static
void
find_reg
(
allocno
,
losers
,
al
l
_regs_p
,
accept_call_clobbered
,
retrying
)
find_reg
(
allocno
,
losers
,
al
t
_regs_p
,
accept_call_clobbered
,
retrying
)
int
allocno
;
HARD_REG_SET
losers
;
int
al
l
_regs_p
;
int
al
t
_regs_p
;
int
accept_call_clobbered
;
int
retrying
;
{
...
...
@@ -882,8 +890,9 @@ find_reg (allocno, losers, all_regs_p, accept_call_clobbered, retrying)
#endif
HARD_REG_SET
used
,
used1
,
used2
;
enum
reg_class
class
=
all_regs_p
?
ALL_REGS
:
reg_preferred_class
(
allocno_reg
[
allocno
]);
enum
reg_class
class
=
(
alt_regs_p
?
reg_alternate_class
(
allocno_reg
[
allocno
])
:
reg_preferred_class
(
allocno_reg
[
allocno
]));
enum
machine_mode
mode
=
PSEUDO_REGNO_MODE
(
allocno_reg
[
allocno
]);
if
(
accept_call_clobbered
)
...
...
@@ -1042,7 +1051,7 @@ find_reg (allocno, losers, all_regs_p, accept_call_clobbered, retrying)
&&
CALLER_SAVE_PROFITABLE
(
allocno_n_refs
[
allocno
],
allocno_calls_crossed
[
allocno
]))
{
find_reg
(
allocno
,
losers
,
al
l
_regs_p
,
1
,
retrying
);
find_reg
(
allocno
,
losers
,
al
t
_regs_p
,
1
,
retrying
);
if
(
reg_renumber
[
allocno_reg
[
allocno
]]
>=
0
)
{
caller_save_needed
=
1
;
...
...
@@ -1146,7 +1155,7 @@ retry_global_alloc (regno, forbidden_regs)
if
(
N_REG_CLASSES
>
1
)
find_reg
(
allocno
,
forbidden_regs
,
0
,
0
,
1
);
if
(
reg_renumber
[
regno
]
<
0
&&
!
reg_preferred_or_nothing
(
regno
)
)
&&
reg_alternate_class
(
regno
)
!=
NO_REGS
)
find_reg
(
allocno
,
forbidden_regs
,
1
,
0
,
1
);
/* If we found a register, modify the RTL for the register to
...
...
@@ -1563,13 +1572,13 @@ mark_elimination (from, to)
int
i
;
for
(
i
=
0
;
i
<
n_basic_blocks
;
i
++
)
if
((
basic_block_live_at_start
[
i
][
from
/
HOST_BITS_PER_INT
]
&
(
1
<<
(
from
%
HOST_BITS_PER_INT
)))
!=
0
)
if
((
basic_block_live_at_start
[
i
][
from
/
REGSET_ELT_BITS
]
&
(
(
REGSET_ELT_TYPE
)
1
<<
(
from
%
REGSET_ELT_BITS
)))
!=
0
)
{
basic_block_live_at_start
[
i
][
from
/
HOST_BITS_PER_INT
]
&=
~
(
1
<<
(
from
%
HOST_BITS_PER_INT
));
basic_block_live_at_start
[
i
][
to
/
HOST_BITS_PER_INT
]
|=
(
1
<<
(
to
%
HOST_BITS_PER_INT
));
basic_block_live_at_start
[
i
][
from
/
REGSET_ELT_BITS
]
&=
~
(
(
REGSET_ELT_TYPE
)
1
<<
(
from
%
REGSET_ELT_BITS
));
basic_block_live_at_start
[
i
][
to
/
REGSET_ELT_BITS
]
|=
(
(
REGSET_ELT_TYPE
)
1
<<
(
to
%
REGSET_ELT_BITS
));
}
}
...
...
gcc/local-alloc.c
View file @
b1ec3c92
...
...
@@ -922,7 +922,7 @@ update_equiv_regs ()
||
reg_n_sets
[
regno
]
!=
1
)
continue
;
note
=
find_reg_note
(
insn
,
REG_EQUAL
,
0
);
note
=
find_reg_note
(
insn
,
REG_EQUAL
,
NULL_RTX
);
/* Record this insn as initializing this register. */
reg_equiv_init_insn
[
regno
]
=
insn
;
...
...
@@ -947,7 +947,7 @@ update_equiv_regs ()
MEM remains unchanged for the life of the register, add a REG_EQUIV
note. */
note
=
find_reg_note
(
insn
,
REG_EQUIV
,
0
);
note
=
find_reg_note
(
insn
,
REG_EQUIV
,
NULL_RTX
);
if
(
note
==
0
&&
reg_basic_block
[
regno
]
>=
0
&&
GET_CODE
(
SET_SRC
(
set
))
==
MEM
...
...
@@ -1155,11 +1155,12 @@ block_alloc (b)
if
(
GET_CODE
(
PATTERN
(
insn
))
==
CLOBBER
&&
(
r0
=
XEXP
(
PATTERN
(
insn
),
0
),
GET_CODE
(
r0
)
==
REG
)
&&
(
link
=
find_reg_note
(
insn
,
REG_LIBCALL
,
0
))
!=
0
&&
(
link
=
find_reg_note
(
insn
,
REG_LIBCALL
,
NULL_RTX
))
!=
0
&&
GET_CODE
(
XEXP
(
link
,
0
))
==
INSN
&&
(
set
=
single_set
(
XEXP
(
link
,
0
)))
!=
0
&&
SET_DEST
(
set
)
==
r0
&&
SET_SRC
(
set
)
==
r0
&&
(
note
=
find_reg_note
(
XEXP
(
link
,
0
),
REG_EQUAL
,
0
))
!=
0
)
&&
(
note
=
find_reg_note
(
XEXP
(
link
,
0
),
REG_EQUAL
,
NULL_RTX
))
!=
0
)
{
if
(
r1
=
XEXP
(
note
,
0
),
GET_CODE
(
r1
)
==
REG
/* Check that we have such a sequence. */
...
...
@@ -1245,7 +1246,7 @@ block_alloc (b)
/* If this is an insn that has a REG_RETVAL note pointing at a
CLOBBER insn, we have reached the end of a REG_NO_CONFLICT
block, so clear any register number that combined within it. */
if
((
note
=
find_reg_note
(
insn
,
REG_RETVAL
,
0
))
!=
0
if
((
note
=
find_reg_note
(
insn
,
REG_RETVAL
,
NULL_RTX
))
!=
0
&&
GET_CODE
(
XEXP
(
note
,
0
))
==
INSN
&&
GET_CODE
(
PATTERN
(
XEXP
(
note
,
0
)))
==
CLOBBER
)
no_conflict_combined_regno
=
-
1
;
...
...
@@ -1988,7 +1989,7 @@ no_conflict_p (insn, r0, r1)
rtx
insn
,
r0
,
r1
;
{
int
ok
=
0
;
rtx
note
=
find_reg_note
(
insn
,
REG_LIBCALL
,
0
);
rtx
note
=
find_reg_note
(
insn
,
REG_LIBCALL
,
NULL_RTX
);
rtx
p
,
last
;
/* If R1 is a hard register, return 0 since we handle this case
...
...
gcc/optabs.c
View file @
b1ec3c92
...
...
@@ -402,8 +402,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
&&
!
add_equal_note
(
pat
,
temp
,
binoptab
->
code
,
xop0
,
xop1
))
{
delete_insns_since
(
last
);
return
expand_binop
(
mode
,
binoptab
,
op0
,
op1
,
0
,
unsignedp
,
methods
);
return
expand_binop
(
mode
,
binoptab
,
op0
,
op1
,
NULL_RTX
,
unsignedp
,
methods
);
}
emit_insn
(
pat
);
...
...
@@ -454,7 +454,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
else
xop1
=
convert_to_mode
(
wider_mode
,
xop1
,
unsignedp
);
temp
=
expand_binop
(
wider_mode
,
binoptab
,
xop0
,
xop1
,
0
,
temp
=
expand_binop
(
wider_mode
,
binoptab
,
xop0
,
xop1
,
NULL_RTX
,
unsignedp
,
OPTAB_DIRECT
);
if
(
temp
)
{
...
...
@@ -711,18 +711,18 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
&&
smul_widen_optab
->
handlers
[(
int
)
mode
].
insn_code
!=
CODE_FOR_nothing
)
{
rtx
wordm1
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
BITS_PER_WORD
-
1
);
rtx
wordm1
=
GEN_INT
(
BITS_PER_WORD
-
1
);
product
=
expand_binop
(
mode
,
smul_widen_optab
,
op0_low
,
op1_low
,
target
,
1
,
OPTAB_DIRECT
);
op0_xhigh
=
expand_binop
(
word_mode
,
lshr_optab
,
op0_low
,
wordm1
,
0
,
1
,
OPTAB_DIRECT
);
NULL_RTX
,
1
,
OPTAB_DIRECT
);
if
(
op0_xhigh
)
op0_xhigh
=
expand_binop
(
word_mode
,
add_optab
,
op0_high
,
op0_xhigh
,
op0_xhigh
,
0
,
OPTAB_DIRECT
);
else
{
op0_xhigh
=
expand_binop
(
word_mode
,
ashr_optab
,
op0_low
,
wordm1
,
0
,
0
,
OPTAB_DIRECT
);
NULL_RTX
,
0
,
OPTAB_DIRECT
);
if
(
op0_xhigh
)
op0_xhigh
=
expand_binop
(
word_mode
,
sub_optab
,
op0_high
,
op0_xhigh
,
op0_xhigh
,
0
,
...
...
@@ -730,14 +730,14 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
}
op1_xhigh
=
expand_binop
(
word_mode
,
lshr_optab
,
op1_low
,
wordm1
,
0
,
1
,
OPTAB_DIRECT
);
NULL_RTX
,
1
,
OPTAB_DIRECT
);
if
(
op1_xhigh
)
op1_xhigh
=
expand_binop
(
word_mode
,
add_optab
,
op1_high
,
op1_xhigh
,
op1_xhigh
,
0
,
OPTAB_DIRECT
);
else
{
op1_xhigh
=
expand_binop
(
word_mode
,
ashr_optab
,
op1_low
,
wordm1
,
0
,
0
,
OPTAB_DIRECT
);
NULL_RTX
,
0
,
OPTAB_DIRECT
);
if
(
op1_xhigh
)
op1_xhigh
=
expand_binop
(
word_mode
,
sub_optab
,
op1_high
,
op1_xhigh
,
op1_xhigh
,
0
,
...
...
@@ -759,8 +759,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
{
rtx
product_piece
;
rtx
product_high
=
operand_subword
(
product
,
high
,
1
,
mode
);
rtx
temp
=
expand_binop
(
word_mode
,
binoptab
,
op0_low
,
op1_xhigh
,
0
,
0
,
OPTAB_DIRECT
);
rtx
temp
=
expand_binop
(
word_mode
,
binoptab
,
op0_low
,
op1_xhigh
,
NULL_RTX
,
0
,
OPTAB_DIRECT
);
if
(
temp
)
{
...
...
@@ -770,8 +770,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
if
(
product_piece
!=
product_high
)
emit_move_insn
(
product_high
,
product_piece
);
temp
=
expand_binop
(
word_mode
,
binoptab
,
op1_low
,
op0_xhigh
,
0
,
0
,
OPTAB_DIRECT
);
temp
=
expand_binop
(
word_mode
,
binoptab
,
op1_low
,
op0_xhigh
,
NULL_RTX
,
0
,
OPTAB_DIRECT
);
product_piece
=
expand_binop
(
word_mode
,
add_optab
,
temp
,
product_high
,
product_high
,
...
...
@@ -879,7 +879,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
else
xop1
=
convert_to_mode
(
wider_mode
,
xop1
,
unsignedp
);
temp
=
expand_binop
(
wider_mode
,
binoptab
,
xop0
,
xop1
,
0
,
temp
=
expand_binop
(
wider_mode
,
binoptab
,
xop0
,
xop1
,
NULL_RTX
,
unsignedp
,
methods
);
if
(
temp
)
{
...
...
@@ -1152,10 +1152,10 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
if
(
pat
)
{
if
(
GET_CODE
(
pat
)
==
SEQUENCE
&&
!
add_equal_note
(
pat
,
temp
,
unoptab
->
code
,
xop0
,
0
))
&&
!
add_equal_note
(
pat
,
temp
,
unoptab
->
code
,
xop0
,
NULL_RTX
))
{
delete_insns_since
(
last
);
return
expand_unop
(
mode
,
unoptab
,
op0
,
0
,
unsignedp
);
return
expand_unop
(
mode
,
unoptab
,
op0
,
NULL_RTX
,
unsignedp
);
}
emit_insn
(
pat
);
...
...
@@ -1186,7 +1186,8 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
else
xop0
=
convert_to_mode
(
wider_mode
,
xop0
,
unsignedp
);
temp
=
expand_unop
(
wider_mode
,
unoptab
,
xop0
,
0
,
unsignedp
);
temp
=
expand_unop
(
wider_mode
,
unoptab
,
xop0
,
NULL_RTX
,
unsignedp
);
if
(
temp
)
{
...
...
@@ -1233,7 +1234,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
insns
=
get_insns
();
end_sequence
();
emit_no_conflict_block
(
insns
,
target
,
op0
,
0
,
emit_no_conflict_block
(
insns
,
target
,
op0
,
NULL_RTX
,
gen_rtx
(
unoptab
->
code
,
mode
,
op0
));
return
target
;
}
...
...
@@ -1282,7 +1283,8 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
else
xop0
=
convert_to_mode
(
wider_mode
,
xop0
,
unsignedp
);
temp
=
expand_unop
(
wider_mode
,
unoptab
,
xop0
,
0
,
unsignedp
);
temp
=
expand_unop
(
wider_mode
,
unoptab
,
xop0
,
NULL_RTX
,
unsignedp
);
if
(
temp
)
{
...
...
@@ -1341,7 +1343,7 @@ emit_unop_insn (icode, target, op0, code)
pat
=
GEN_FCN
(
icode
)
(
temp
,
op0
);
if
(
GET_CODE
(
pat
)
==
SEQUENCE
&&
code
!=
UNKNOWN
)
add_equal_note
(
pat
,
temp
,
code
,
op0
,
0
);
add_equal_note
(
pat
,
temp
,
code
,
op0
,
NULL_RTX
);
emit_insn
(
pat
);
...
...
@@ -1645,9 +1647,9 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
enum
machine_mode
result_mode
=
insn_operand_mode
[(
int
)
CODE_FOR_cmpstrqi
][
0
];
rtx
result
=
gen_reg_rtx
(
result_mode
);
emit_insn
(
gen_cmpstrqi
(
result
,
x
,
y
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
)));
emit_cmp_insn
(
result
,
const0_rtx
,
comparison
,
0
,
result_mode
,
0
,
0
);
emit_insn
(
gen_cmpstrqi
(
result
,
x
,
y
,
size
,
GEN_INT
(
align
)));
emit_cmp_insn
(
result
,
const0_rtx
,
comparison
,
NULL_RTX
,
result_mode
,
0
,
0
);
}
else
#endif
...
...
@@ -1659,9 +1661,9 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
enum
machine_mode
result_mode
=
insn_operand_mode
[(
int
)
CODE_FOR_cmpstrhi
][
0
];
rtx
result
=
gen_reg_rtx
(
result_mode
);
emit_insn
(
gen_cmpstrhi
(
result
,
x
,
y
,
size
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
)));
emit_cmp_insn
(
result
,
const0_rtx
,
comparison
,
0
,
result_mode
,
0
,
0
);
emit_insn
(
gen_cmpstrhi
(
result
,
x
,
y
,
size
,
GEN_INT
(
align
)));
emit_cmp_insn
(
result
,
const0_rtx
,
comparison
,
NULL_RTX
,
result_mode
,
0
,
0
);
}
else
#endif
...
...
@@ -1673,8 +1675,9 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
rtx
result
=
gen_reg_rtx
(
result_mode
);
emit_insn
(
gen_cmpstrsi
(
result
,
x
,
y
,
convert_to_mode
(
SImode
,
size
,
1
),
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
)));
emit_cmp_insn
(
result
,
const0_rtx
,
comparison
,
0
,
result_mode
,
0
,
0
);
GEN_INT
(
align
)));
emit_cmp_insn
(
result
,
const0_rtx
,
comparison
,
NULL_RTX
,
result_mode
,
0
,
0
);
}
else
#endif
...
...
@@ -1691,7 +1694,7 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
size
,
Pmode
);
#endif
emit_cmp_insn
(
hard_libcall_value
(
TYPE_MODE
(
integer_type_node
)),
const0_rtx
,
comparison
,
0
,
const0_rtx
,
comparison
,
NULL_RTX
,
TYPE_MODE
(
integer_type_node
),
0
,
0
);
}
return
;
...
...
@@ -1752,7 +1755,7 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
{
x
=
convert_to_mode
(
wider_mode
,
x
,
unsignedp
);
y
=
convert_to_mode
(
wider_mode
,
y
,
unsignedp
);
emit_cmp_insn
(
x
,
y
,
comparison
,
0
,
emit_cmp_insn
(
x
,
y
,
comparison
,
NULL_RTX
,
wider_mode
,
unsignedp
,
align
);
return
;
}
...
...
@@ -1778,7 +1781,7 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
there is still a value that can represent the result "less than". */
emit_cmp_insn
(
hard_libcall_value
(
SImode
),
const1_rtx
,
comparison
,
0
,
SImode
,
unsignedp
,
0
);
comparison
,
NULL_RTX
,
SImode
,
unsignedp
,
0
);
return
;
}
...
...
@@ -1949,7 +1952,7 @@ emit_float_lib_cmp (x, y, comparison)
SImode
,
2
,
x
,
mode
,
y
,
mode
);
emit_cmp_insn
(
hard_libcall_value
(
SImode
),
const0_rtx
,
comparison
,
0
,
SImode
,
0
,
0
);
NULL_RTX
,
SImode
,
0
,
0
);
}
/* Generate code to indirectly jump to a location given in the rtx LOC. */
...
...
@@ -2866,7 +2869,7 @@ expand_float (to, from, unsignedp)
correct its value by 2**bitwidth. */
do_pending_stack_adjust
();
emit_cmp_insn
(
from
,
const0_rtx
,
GE
,
0
,
GET_MODE
(
from
),
0
,
0
);
emit_cmp_insn
(
from
,
const0_rtx
,
GE
,
NULL_RTX
,
GET_MODE
(
from
),
0
,
0
);
emit_jump_insn
(
gen_bge
(
label
));
/* On SCO 3.2.1, ldexp rejects values outside [0.5, 1).
Rather than setting up a dconst_dot_5, let's hope SCO
...
...
@@ -3039,7 +3042,7 @@ expand_fix (to, from, unsignedp)
We only need to check all real modes, since we know we didn't find
anything with a wider integer mode. */
if
(
unsignedp
&&
GET_MODE_BITSIZE
(
GET_MODE
(
to
))
<=
HOST_BITS_PER_INT
)
if
(
unsignedp
&&
GET_MODE_BITSIZE
(
GET_MODE
(
to
))
<=
HOST_BITS_PER_
WIDE_
INT
)
for
(
fmode
=
GET_MODE
(
from
);
fmode
!=
VOIDmode
;
fmode
=
GET_MODE_WIDER_MODE
(
fmode
))
/* Make sure we won't lose significant bits doing this. */
...
...
@@ -3066,7 +3069,7 @@ expand_fix (to, from, unsignedp)
/* See if we need to do the subtraction. */
do_pending_stack_adjust
();
emit_cmp_insn
(
from
,
limit
,
GE
,
0
,
GET_MODE
(
from
),
0
,
0
);
emit_cmp_insn
(
from
,
limit
,
GE
,
NULL_RTX
,
GET_MODE
(
from
),
0
,
0
);
emit_jump_insn
(
gen_bge
(
lab1
));
/* If not, do the signed "fix" and branch around fixup code. */
...
...
@@ -3079,11 +3082,10 @@ expand_fix (to, from, unsignedp)
will often generate better code. */
emit_label
(
lab1
);
target
=
expand_binop
(
GET_MODE
(
from
),
sub_optab
,
from
,
limit
,
0
,
0
,
OPTAB_LIB_WIDEN
);
NULL_RTX
,
0
,
OPTAB_LIB_WIDEN
);
expand_fix
(
to
,
target
,
0
);
target
=
expand_binop
(
GET_MODE
(
to
),
xor_optab
,
to
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
1
<<
(
bitsize
-
1
)),
GEN_INT
((
HOST_WIDE_INT
)
1
<<
(
bitsize
-
1
)),
to
,
1
,
OPTAB_LIB_WIDEN
);
if
(
target
!=
to
)
...
...
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