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
5b0ce758
Commit
5b0ce758
authored
Jul 07, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_mult_highpart): Build constant forms of CNST1 in MODE or
WIDE_MODE, as appropriate. From-SVN: r7676
parent
41b19f3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
gcc/expmed.c
+17
-8
No files found.
gcc/expmed.c
View file @
5b0ce758
...
@@ -2434,9 +2434,19 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
...
@@ -2434,9 +2434,19 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
optab
moptab
;
optab
moptab
;
rtx
tem
;
rtx
tem
;
int
size
=
GET_MODE_BITSIZE
(
mode
);
int
size
=
GET_MODE_BITSIZE
(
mode
);
rtx
op1
;
rtx
op1
,
wide_op1
;
op1
=
immed_double_const
(
cnst1
,
/* We can't support modes wider than HOST_BITS_PER_INT. */
if
(
size
>
HOST_BITS_PER_WIDE_INT
)
abort
();
op1
=
GEN_INT
(
cnst1
);
if
(
GET_MODE_BITSIZE
(
wider_mode
)
<=
HOST_BITS_PER_INT
)
wide_op1
=
op1
;
else
wide_op1
=
immed_double_const
(
cnst1
,
(
unsignedp
(
unsignedp
?
(
HOST_WIDE_INT
)
0
?
(
HOST_WIDE_INT
)
0
:
-
(
cnst1
>>
(
HOST_BITS_PER_WIDE_INT
-
1
))),
:
-
(
cnst1
>>
(
HOST_BITS_PER_WIDE_INT
-
1
))),
...
@@ -2450,7 +2460,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
...
@@ -2450,7 +2460,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
multiply. Maybe change expand_binop to handle widening multiply? */
multiply. Maybe change expand_binop to handle widening multiply? */
op0
=
convert_to_mode
(
wider_mode
,
op0
,
unsignedp
);
op0
=
convert_to_mode
(
wider_mode
,
op0
,
unsignedp
);
tem
=
expand_mult
(
wider_mode
,
op0
,
op1
,
NULL_RTX
,
unsignedp
);
tem
=
expand_mult
(
wider_mode
,
op0
,
wide_
op1
,
NULL_RTX
,
unsignedp
);
tem
=
expand_shift
(
RSHIFT_EXPR
,
wider_mode
,
tem
,
tem
=
expand_shift
(
RSHIFT_EXPR
,
wider_mode
,
tem
,
build_int_2
(
size
,
0
),
NULL_RTX
,
1
);
build_int_2
(
size
,
0
),
NULL_RTX
,
1
);
return
gen_lowpart
(
mode
,
tem
);
return
gen_lowpart
(
mode
,
tem
);
...
@@ -2475,7 +2485,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
...
@@ -2475,7 +2485,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
if
(
target
)
if
(
target
)
/* We used the wrong signedness. Adjust the result. */
/* We used the wrong signedness. Adjust the result. */
return
expand_mult_highpart_adjust
(
mode
,
target
,
op0
,
return
expand_mult_highpart_adjust
(
mode
,
target
,
op0
,
GEN_INT
(
cnst1
)
,
target
,
unsignedp
);
op1
,
target
,
unsignedp
);
/* Thirdly, we try to use a widening multiplication, or a wider mode
/* Thirdly, we try to use a widening multiplication, or a wider mode
multiplication. */
multiplication. */
...
@@ -2491,7 +2501,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
...
@@ -2491,7 +2501,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
moptab
=
unsignedp
?
smul_widen_optab
:
umul_widen_optab
;
moptab
=
unsignedp
?
smul_widen_optab
:
umul_widen_optab
;
if
(
moptab
->
handlers
[(
int
)
wider_mode
].
insn_code
!=
CODE_FOR_nothing
)
if
(
moptab
->
handlers
[(
int
)
wider_mode
].
insn_code
!=
CODE_FOR_nothing
)
{
{
tem
=
expand_binop
(
wider_mode
,
moptab
,
op0
,
op1
,
tem
=
expand_binop
(
wider_mode
,
moptab
,
op0
,
wide_
op1
,
NULL_RTX
,
!
unsignedp
,
OPTAB_WIDEN
);
NULL_RTX
,
!
unsignedp
,
OPTAB_WIDEN
);
if
(
tem
!=
0
)
if
(
tem
!=
0
)
{
{
...
@@ -2500,8 +2510,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
...
@@ -2500,8 +2510,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
build_int_2
(
size
,
0
),
NULL_RTX
,
1
);
build_int_2
(
size
,
0
),
NULL_RTX
,
1
);
tem
=
gen_lowpart
(
mode
,
tem
);
tem
=
gen_lowpart
(
mode
,
tem
);
/* We used the wrong signedness. Adjust the result. */
/* We used the wrong signedness. Adjust the result. */
return
expand_mult_highpart_adjust
(
mode
,
tem
,
op0
,
return
expand_mult_highpart_adjust
(
mode
,
tem
,
op0
,
op1
,
GEN_INT
(
cnst1
),
target
,
unsignedp
);
target
,
unsignedp
);
}
}
}
}
...
@@ -2512,7 +2521,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
...
@@ -2512,7 +2521,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp)
}
}
/* Pass NULL_RTX as target since TARGET has wrong mode. */
/* Pass NULL_RTX as target since TARGET has wrong mode. */
tem
=
expand_binop
(
wider_mode
,
moptab
,
op0
,
op1
,
tem
=
expand_binop
(
wider_mode
,
moptab
,
op0
,
wide_
op1
,
NULL_RTX
,
unsignedp
,
OPTAB_WIDEN
);
NULL_RTX
,
unsignedp
,
OPTAB_WIDEN
);
if
(
tem
==
0
)
if
(
tem
==
0
)
return
0
;
return
0
;
...
...
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