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
3d678dca
Commit
3d678dca
authored
Jul 06, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
entered into RCS
From-SVN: r1470
parent
0d92cbff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
42 deletions
+93
-42
gcc/genattrtab.c
+31
-8
gcc/genemit.c
+23
-21
gcc/genrecog.c
+39
-13
No files found.
gcc/genattrtab.c
View file @
3d678dca
...
...
@@ -170,6 +170,8 @@ struct attr_desc
struct
attr_value
*
default_val
;
/* Default value for this attribute. */
};
#define NULL_ATTR (struct attr_desc *) NULL
/* Structure for each DEFINE_DELAY. */
struct
delay_desc
...
...
@@ -546,7 +548,7 @@ attr_rtx (va_alist)
}
else
if
(
code
==
CONST_INT
)
{
int
arg0
=
va_arg
(
p
,
int
);
HOST_WIDE_INT
arg0
=
va_arg
(
p
,
HOST_WIDE_INT
);
if
(
arg0
==
0
)
return
false_rtx
;
if
(
arg0
==
1
)
...
...
@@ -570,6 +572,10 @@ attr_rtx (va_alist)
XINT
(
rt_val
,
i
)
=
va_arg
(
p
,
int
);
break
;
case
'w'
:
/* A wide integer? */
XWINT
(
rt_val
,
i
)
=
va_arg
(
p
,
HOST_WIDE_INT
);
break
;
case
's'
:
/* A string? */
XSTR
(
rt_val
,
i
)
=
va_arg
(
p
,
char
*
);
break
;
...
...
@@ -772,9 +778,22 @@ attr_copy_rtx (orig)
}
break
;
default
:
case
'n'
:
case
'i'
:
XINT
(
copy
,
i
)
=
XINT
(
orig
,
i
);
break
;
case
'w'
:
XWINT
(
copy
,
i
)
=
XWINT
(
orig
,
i
);
break
;
case
's'
:
case
'S'
:
XSTR
(
copy
,
i
)
=
XSTR
(
orig
,
i
);
break
;
default
:
abort
();
}
}
return
copy
;
...
...
@@ -880,7 +899,7 @@ check_attr_test (exp, is_const)
case
CONST_INT
:
/* Either TRUE or FALSE. */
if
(
XINT
(
exp
,
0
))
if
(
X
W
INT
(
exp
,
0
))
return
true_rtx
;
else
return
false_rtx
;
...
...
@@ -1644,10 +1663,10 @@ expand_units ()
and busy cost. Then make an attribute for use in the conflict
function. */
op
->
condexp
=
check_attr_test
(
op
->
condexp
,
0
);
op
->
busyexp
=
check_attr_value
(
op
->
busyexp
,
0
);
op
->
busyexp
=
check_attr_value
(
op
->
busyexp
,
NULL_ATTR
);
str
=
attr_printf
(
strlen
(
unit
->
name
)
+
11
,
"*%s_case_%d"
,
unit
->
name
,
op
->
num
);
make_internal_attr
(
str
,
make_canonical
(
0
,
op
->
busyexp
));
make_internal_attr
(
str
,
make_canonical
(
NULL_ATTR
,
op
->
busyexp
));
/* Make our adjustment to the two COND's being computed. If we are
the last operation class, place our values into the default of
...
...
@@ -3499,7 +3518,11 @@ write_test_expr (exp, in_comparison)
/* Constant integer. */
case
CONST_INT
:
printf
(
"%d"
,
XINT
(
exp
,
0
));
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
printf
(
"%d"
,
XWINT
(
exp
,
0
));
#else
printf
(
"%ld"
,
XWINT
(
exp
,
0
));
#endif
break
;
/* A random C expression. */
...
...
@@ -4481,9 +4504,9 @@ main (argc, argv)
/* Set up true and false rtx's */
true_rtx
=
rtx_alloc
(
CONST_INT
);
XINT
(
true_rtx
,
0
)
=
1
;
X
W
INT
(
true_rtx
,
0
)
=
1
;
false_rtx
=
rtx_alloc
(
CONST_INT
);
XINT
(
false_rtx
,
0
)
=
0
;
X
W
INT
(
false_rtx
,
0
)
=
0
;
RTX_UNCHANGING_P
(
true_rtx
)
=
RTX_UNCHANGING_P
(
false_rtx
)
=
1
;
RTX_INTEGRATED_P
(
true_rtx
)
=
RTX_INTEGRATED_P
(
false_rtx
)
=
1
;
...
...
gcc/genemit.c
View file @
3d678dca
...
...
@@ -146,7 +146,7 @@ gen_exp (x)
if
(
x
==
0
)
{
printf
(
"
0
"
);
printf
(
"
NULL_RTX
"
);
return
;
}
...
...
@@ -202,25 +202,27 @@ gen_exp (x)
case
CONST_INT
:
if
(
INTVAL
(
x
)
==
0
)
{
printf
(
"const0_rtx"
);
return
;
}
if
(
INTVAL
(
x
)
==
1
)
{
printf
(
"const1_rtx"
);
return
;
}
if
(
INTVAL
(
x
)
==
-
1
)
{
printf
(
"constm1_rtx"
);
return
;
}
if
(
INTVAL
(
x
)
==
STORE_FLAG_VALUE
)
{
printf
(
"const_true_rtx"
);
return
;
}
printf
(
"const0_rtx"
);
else
if
(
INTVAL
(
x
)
==
1
)
printf
(
"const1_rtx"
);
else
if
(
INTVAL
(
x
)
==
-
1
)
printf
(
"constm1_rtx"
);
else
if
(
INTVAL
(
x
)
==
STORE_FLAG_VALUE
)
printf
(
"const_true_rtx"
);
else
printf
(
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
"GEN_INT (%d)"
,
#else
"GEN_INT (%ld)"
,
#endif
INTVAL
(
x
));
return
;
case
CONST_DOUBLE
:
/* These shouldn't be written in MD files. Instead, the appropriate
routines in varasm.c should be called. */
abort
();
}
printf
(
"gen_rtx ("
);
...
...
@@ -237,7 +239,7 @@ gen_exp (x)
if
(
fmt
[
i
]
==
'e'
||
fmt
[
i
]
==
'u'
)
gen_exp
(
XEXP
(
x
,
i
));
else
if
(
fmt
[
i
]
==
'i'
)
printf
(
"%u"
,
(
unsigned
)
XINT
(
x
,
i
));
printf
(
"%u"
,
XINT
(
x
,
i
));
else
if
(
fmt
[
i
]
==
's'
)
printf
(
"
\"
%s
\"
"
,
XSTR
(
x
,
i
));
else
if
(
fmt
[
i
]
==
'E'
)
...
...
gcc/genrecog.c
View file @
3d678dca
...
...
@@ -83,6 +83,8 @@ struct decision
int
elt_zero_int
;
/* Required value for XINT (rtl, 0) */
int
test_elt_one_int
;
/* Nonzero if should test XINT (rtl, 1) */
int
elt_one_int
;
/* Required value for XINT (rtl, 1) */
int
test_elt_zero_wide
;
/* Nonzero if should test XWINT (rtl, 0) */
HOST_WIDE_INT
elt_zero_wide
;
/* Required value for XWINT (rtl, 0) */
char
*
tests
;
/* If nonzero predicate to call */
int
pred
;
/* `preds' index of predicate or -1 */
char
*
c_test
;
/* Additional test to perform */
...
...
@@ -303,8 +305,10 @@ add_to_sequence (pattern, last, position)
new
->
veclen
=
0
;
new
->
test_elt_zero_int
=
0
;
new
->
test_elt_one_int
=
0
;
new
->
test_elt_zero_wide
=
0
;
new
->
elt_zero_int
=
0
;
new
->
elt_one_int
=
0
;
new
->
elt_zero_wide
=
0
;
new
->
tests
=
0
;
new
->
pred
=
-
1
;
new
->
c_test
=
0
;
...
...
@@ -500,6 +504,11 @@ add_to_sequence (pattern, last, position)
this
->
test_elt_one_int
=
1
;
this
->
elt_one_int
=
XINT
(
pattern
,
i
);
}
else
if
(
fmt
[
i
]
==
'w'
&&
i
==
0
)
{
this
->
test_elt_zero_wide
=
1
;
this
->
elt_zero_wide
=
XWINT
(
pattern
,
i
);
}
else
if
(
fmt
[
i
]
==
'E'
)
{
register
int
j
;
...
...
@@ -549,6 +558,8 @@ not_both_true (d1, d2, toplevel)
&&
d1
->
elt_zero_int
!=
d2
->
elt_zero_int
)
||
(
d1
->
test_elt_one_int
&&
d2
->
test_elt_one_int
&&
d1
->
elt_one_int
!=
d2
->
elt_one_int
)
||
(
d1
->
test_elt_zero_wide
&&
d2
->
test_elt_zero_wide
&&
d1
->
elt_zero_wide
!=
d2
->
elt_zero_wide
)
||
(
d1
->
veclen
&&
d2
->
veclen
&&
d1
->
veclen
!=
d2
->
veclen
))
return
1
;
...
...
@@ -742,6 +753,7 @@ merge_trees (oldh, addh)
would cause an infinite recursion. */
if
(
old
->
tests
==
0
&&
old
->
test_elt_zero_int
==
0
&&
old
->
test_elt_one_int
==
0
&&
old
->
veclen
==
0
&&
old
->
test_elt_zero_wide
==
0
&&
old
->
dupno
==
-
1
&&
old
->
mode
==
VOIDmode
&&
old
->
code
==
UNKNOWN
&&
(
old
->
c_test
!=
0
||
add
->
c_test
!=
0
))
...
...
@@ -751,16 +763,18 @@ merge_trees (oldh, addh)
||
(
old
->
pred
>=
0
&&
old
->
pred
==
add
->
pred
)
||
(
old
->
tests
&&
add
->
tests
&&
!
strcmp
(
old
->
tests
,
add
->
tests
)))
&&
old
->
test_elt_zero_int
==
add
->
test_elt_zero_int
&&
old
->
elt_zero_int
==
add
->
elt_zero_int
&&
old
->
test_elt_one_int
==
add
->
test_elt_one_int
&&
old
->
elt_one_int
==
add
->
elt_one_int
&&
old
->
veclen
==
add
->
veclen
&&
old
->
dupno
==
add
->
dupno
&&
old
->
opno
==
add
->
opno
&&
old
->
code
==
add
->
code
&&
old
->
enforce_mode
==
add
->
enforce_mode
&&
old
->
mode
==
add
->
mode
)
&&
old
->
test_elt_zero_int
==
add
->
test_elt_zero_int
&&
old
->
elt_zero_int
==
add
->
elt_zero_int
&&
old
->
test_elt_one_int
==
add
->
test_elt_one_int
&&
old
->
elt_one_int
==
add
->
elt_one_int
&&
old
->
test_elt_zero_wide
==
add
->
test_elt_zero_wide
&&
old
->
elt_zero_wide
==
add
->
elt_zero_wide
&&
old
->
veclen
==
add
->
veclen
&&
old
->
dupno
==
add
->
dupno
&&
old
->
opno
==
add
->
opno
&&
old
->
code
==
add
->
code
&&
old
->
enforce_mode
==
add
->
enforce_mode
&&
old
->
mode
==
add
->
mode
)
{
/* If the additional test is not the same, split both nodes
into nodes that just contain all things tested before the
...
...
@@ -793,6 +807,7 @@ merge_trees (oldh, addh)
split
->
veclen
=
0
;
split
->
test_elt_zero_int
=
0
;
split
->
test_elt_one_int
=
0
;
split
->
test_elt_zero_wide
=
0
;
split
->
tests
=
0
;
split
->
pred
=
-
1
;
}
...
...
@@ -817,6 +832,7 @@ merge_trees (oldh, addh)
split
->
veclen
=
0
;
split
->
test_elt_zero_int
=
0
;
split
->
test_elt_one_int
=
0
;
split
->
test_elt_zero_wide
=
0
;
split
->
tests
=
0
;
split
->
pred
=
-
1
;
}
...
...
@@ -873,7 +889,8 @@ merge_trees (oldh, addh)
if
(
best_position
==
0
)
abort
();
if
(
old
==
0
&&
position_merit
(
0
,
add_mode
,
add
->
code
)
<
best_merit
)
if
(
old
==
0
&&
position_merit
(
NULL_PTR
,
add_mode
,
add
->
code
)
<
best_merit
)
{
add
->
prev
=
0
;
add
->
next
=
oldh
.
first
;
...
...
@@ -964,7 +981,7 @@ write_subroutine (tree, type)
printf
(
"x%d;
\n
"
,
max_depth
);
printf
(
" %s tem;
\n
"
,
type
==
SPLIT
?
"rtx"
:
"int"
);
write_tree
(
tree
,
""
,
0
,
1
,
type
);
write_tree
(
tree
,
""
,
NULL_PTR
,
1
,
type
);
printf
(
" ret0: return %d;
\n
}
\n\n
"
,
type
==
SPLIT
?
0
:
-
1
);
}
...
...
@@ -1278,7 +1295,8 @@ write_tree_1 (tree, prevpos, afterward, type)
if
((
mode
!=
switch_mode
&&
!
p
->
ignore_mode
)
||
(
p
->
code
!=
switch_code
&&
p
->
code
!=
UNKNOWN
&&
!
p
->
ignore_code
)
||
p
->
test_elt_zero_int
||
p
->
test_elt_one_int
||
p
->
veclen
||
p
->
test_elt_zero_int
||
p
->
test_elt_one_int
||
p
->
test_elt_zero_wide
||
p
->
veclen
||
p
->
dupno
>=
0
||
p
->
tests
||
p
->
num_clobbers_to_add
)
{
printf
(
"%sif ("
,
indents
[
indent
]);
...
...
@@ -1297,6 +1315,14 @@ write_tree_1 (tree, prevpos, afterward, type)
printf
(
"XINT (x%d, 0) == %d && "
,
depth
,
p
->
elt_zero_int
);
if
(
p
->
test_elt_one_int
)
printf
(
"XINT (x%d, 1) == %d && "
,
depth
,
p
->
elt_one_int
);
if
(
p
->
test_elt_zero_wide
)
printf
(
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
"XWINT (x%d, 0) == %d && "
,
#else
"XWINT (x%d, 0) == %ld && "
,
#endif
depth
,
p
->
elt_zero_wide
);
if
(
p
->
veclen
)
printf
(
"XVECLEN (x%d, 0) == %d && "
,
depth
,
p
->
veclen
);
if
(
p
->
dupno
>=
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