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
5bc7cd8e
Commit
5bc7cd8e
authored
Jan 09, 1997
by
Stan Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use SImode instead of HImode if aligned.
From-SVN: r13479
parent
72acf258
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
2 deletions
+85
-2
gcc/config/i386/i386.c
+80
-1
gcc/config/i386/i386.h
+5
-1
gcc/config/i386/i386.md
+0
-0
No files found.
gcc/config/i386/i386.c
View file @
5bc7cd8e
...
...
@@ -388,6 +388,85 @@ optimization_options (level)
#endif
}
/* Sign-extend a 16-bit constant */
struct
rtx_def
*
i386_sext16_if_const
(
op
)
struct
rtx_def
*
op
;
{
if
(
GET_CODE
(
op
)
==
CONST_INT
)
{
HOST_WIDE_INT
val
=
INTVAL
(
op
);
HOST_WIDE_INT
sext_val
;
if
(
val
&
0x8000
)
sext_val
=
val
|
~
0xffff
;
else
sext_val
=
val
&
0xffff
;
if
(
sext_val
!=
val
)
op
=
GEN_INT
(
sext_val
);
}
return
op
;
}
/* Return nonzero if the rtx is aligned */
static
int
i386_aligned_reg_p
(
regno
)
int
regno
;
{
return
(
regno
==
STACK_POINTER_REGNUM
||
(
!
flag_omit_frame_pointer
&&
regno
==
FRAME_POINTER_REGNUM
));
}
int
i386_aligned_p
(
op
)
rtx
op
;
{
/* registers and immediate operands are always "aligned" */
if
(
GET_CODE
(
op
)
!=
MEM
)
return
1
;
/* Don't even try to do any aligned optimizations with volatiles */
if
(
MEM_VOLATILE_P
(
op
))
return
0
;
/* Get address of memory operand */
op
=
XEXP
(
op
,
0
);
switch
(
GET_CODE
(
op
))
{
case
CONST_INT
:
if
(
INTVAL
(
op
)
&
3
)
break
;
return
1
;
/* match "reg + offset" */
case
PLUS
:
if
(
GET_CODE
(
XEXP
(
op
,
1
))
!=
CONST_INT
)
break
;
if
(
INTVAL
(
XEXP
(
op
,
1
))
&
3
)
break
;
op
=
XEXP
(
op
,
0
);
if
(
GET_CODE
(
op
)
!=
REG
)
break
;
/* fall through */
case
REG
:
return
i386_aligned_reg_p
(
REGNO
(
op
));
}
return
0
;
}
/* Return nonzero if INSN looks like it won't compute useful cc bits
as a side effect. This information is only a hint. */
int
i386_cc_probably_useless_p
(
insn
)
rtx
insn
;
{
return
!
next_cc0_user
(
insn
);
}
/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine specific
attribute for DECL. The attributes in ATTRIBUTES have previously been
assigned to DECL. */
...
...
@@ -854,7 +933,7 @@ asm_add (n, x)
output_asm_insn
(
AS1
(
dec
%
L0
,
%
0
),
xops
);
else
if
(
n
==
1
)
output_asm_insn
(
AS1
(
inc
%
L0
,
%
0
),
xops
);
else
if
(
n
<
0
)
else
if
(
n
<
0
||
n
==
128
)
{
xops
[
1
]
=
GEN_INT
(
-
n
);
output_asm_insn
(
AS2
(
sub
%
L0
,
%
1
,
%
0
),
xops
);
...
...
gcc/config/i386/i386.h
View file @
5bc7cd8e
...
...
@@ -157,7 +157,8 @@ extern int target_flags;
#define TARGET_PENTIUMPRO (ix86_cpu == PROCESSOR_PENTIUMPRO)
#define TARGET_USE_LEAVE (ix86_cpu == PROCESSOR_I386)
#define TARGET_PUSH_MEMORY (ix86_cpu == PROCESSOR_I386)
#define TARGET_ZERO_EXTEND_WITH_AND (ix86_cpu != PROCESSOR_I386)
#define TARGET_ZERO_EXTEND_WITH_AND (ix86_cpu != PROCESSOR_I386 \
&& ix86_cpu != PROCESSOR_PENTIUMPRO)
#define TARGET_DOUBLE_WITH_ADD (ix86_cpu != PROCESSOR_I386)
#define TARGET_USE_BIT_TEST (ix86_cpu == PROCESSOR_I386)
#define TARGET_UNROLL_STRLEN (ix86_cpu != PROCESSOR_I386)
...
...
@@ -2604,6 +2605,9 @@ do { \
extern
void
override_options
();
extern
void
order_regs_for_local_alloc
();
extern
char
*
output_strlen_unroll
();
extern
struct
rtx_def
*
i386_sext16_if_const
();
extern
int
i386_aligned_p
();
extern
int
i386_cc_probably_useless_p
();
extern
int
i386_valid_decl_attribute_p
();
extern
int
i386_valid_type_attribute_p
();
extern
int
i386_return_pops_args
();
...
...
gcc/config/i386/i386.md
View file @
5bc7cd8e
This diff is collapsed.
Click to expand it.
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