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
c9541287
Commit
c9541287
authored
Sep 12, 2000
by
Kazu Hirata
Committed by
Jeff Law
Sep 12, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* genattrtab.c: Fix formatting.
From-SVN: r36364
parent
3ff5f682
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
42 deletions
+55
-42
gcc/ChangeLog
+2
-0
gcc/genattrtab.c
+53
-42
No files found.
gcc/ChangeLog
View file @
c9541287
...
...
@@ -18,6 +18,8 @@ Tue Sep 12 08:53:57 2000 Jeffrey A Law (law@cygnus.com)
2000-09-12 Kazu Hirata <kazu@hxi.com>
* genattrtab.c: Fix formatting.
* unroll.c: Fix formatting.
2000-09-12 Bruce Korb <bkorb@gnu.org>
...
...
gcc/genattrtab.c
View file @
c9541287
...
...
@@ -95,7 +95,6 @@ Boston, MA 02111-1307, USA. */
`volatil' (MEM_VOLATILE_P): During simplify_by_exploding the value of an
EQ_ATTR rtx is true if !volatil and false if volatil. */
#include "hconfig.h"
#include "system.h"
#include "rtl.h"
...
...
@@ -464,7 +463,6 @@ static rtx attr_copy_rtx PARAMS ((rtx));
#define oballoc(size) obstack_alloc (hash_obstack, size)
/* Hash table for sharing RTL and strings. */
/* Each hash table slot is a bucket containing a chain of these structures.
...
...
@@ -540,7 +538,6 @@ attr_hash_add_string (hashcode, str)
rtx attr_rtx (code, [element1, ..., elementn]) */
/*VARARGS1*/
static
rtx
attr_rtx
VPARAMS
((
enum
rtx_code
code
,
...))
{
...
...
@@ -720,7 +717,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...))
break
;
default
:
abort
();
abort
();
}
}
va_end
(
p
);
...
...
@@ -743,7 +740,6 @@ attr_rtx VPARAMS ((enum rtx_code code, ...))
rtx attr_printf (len, format, [arg1, ..., argn]) */
/*VARARGS2*/
static
char
*
attr_printf
VPARAMS
((
register
int
len
,
const
char
*
fmt
,
...))
{
...
...
@@ -798,9 +794,9 @@ attr_string (str, len)
register
char
*
new_str
;
/* Compute the hash code. */
hashcode
=
(
len
+
1
)
*
613
+
(
unsigned
)
str
[
0
];
hashcode
=
(
len
+
1
)
*
613
+
(
unsigned
)
str
[
0
];
for
(
i
=
1
;
i
<=
len
;
i
+=
2
)
hashcode
=
((
hashcode
*
613
)
+
(
unsigned
)
str
[
i
]);
hashcode
=
((
hashcode
*
613
)
+
(
unsigned
)
str
[
i
]);
if
(
hashcode
<
0
)
hashcode
=
-
hashcode
;
...
...
@@ -1641,11 +1637,13 @@ expand_delays ()
for
(
i
=
0
;
i
<
XVECLEN
(
delay
->
def
,
1
);
i
+=
3
)
{
condexp
=
XVECEXP
(
delay
->
def
,
1
,
i
);
if
(
condexp
==
0
)
condexp
=
false_rtx
;
if
(
condexp
==
0
)
condexp
=
false_rtx
;
newexp
=
attr_rtx
(
IF_THEN_ELSE
,
condexp
,
make_numeric_value
(
1
),
make_numeric_value
(
0
));
p
=
attr_printf
(
sizeof
(
"*delay__"
)
+
MAX_DIGITS
*
2
,
"*delay_%d_%d"
,
p
=
attr_printf
(
sizeof
(
"*delay__"
)
+
MAX_DIGITS
*
2
,
"*delay_%d_%d"
,
delay
->
num
,
i
/
3
);
make_internal_attr
(
p
,
newexp
,
1
);
...
...
@@ -1656,7 +1654,7 @@ expand_delays ()
newexp
=
attr_rtx
(
IF_THEN_ELSE
,
condexp
,
make_numeric_value
(
1
),
make_numeric_value
(
0
));
p
=
attr_printf
(
sizeof
(
"*annul_true__"
)
+
MAX_DIGITS
*
2
,
p
=
attr_printf
(
sizeof
(
"*annul_true__"
)
+
MAX_DIGITS
*
2
,
"*annul_true_%d_%d"
,
delay
->
num
,
i
/
3
);
make_internal_attr
(
p
,
newexp
,
1
);
}
...
...
@@ -1668,7 +1666,7 @@ expand_delays ()
newexp
=
attr_rtx
(
IF_THEN_ELSE
,
condexp
,
make_numeric_value
(
1
),
make_numeric_value
(
0
));
p
=
attr_printf
(
sizeof
(
"*annul_false__"
)
+
MAX_DIGITS
*
2
,
p
=
attr_printf
(
sizeof
(
"*annul_false__"
)
+
MAX_DIGITS
*
2
,
"*annul_false_%d_%d"
,
delay
->
num
,
i
/
3
);
make_internal_attr
(
p
,
newexp
,
1
);
}
...
...
@@ -2048,11 +2046,11 @@ expand_units ()
/* Sort the array of ops into increasing ready cost order. */
for
(
i
=
0
;
i
<
num
;
i
++
)
for
(
j
=
num
-
1
;
j
>
i
;
j
--
)
if
(
op_array
[
j
-
1
]
->
ready
<
op_array
[
j
]
->
ready
)
if
(
op_array
[
j
-
1
]
->
ready
<
op_array
[
j
]
->
ready
)
{
op
=
op_array
[
j
];
op_array
[
j
]
=
op_array
[
j
-
1
];
op_array
[
j
-
1
]
=
op
;
op_array
[
j
]
=
op_array
[
j
-
1
];
op_array
[
j
-
1
]
=
op
;
}
/* Determine how many distinct non-default ready cost values there
...
...
@@ -2075,7 +2073,9 @@ expand_units ()
XVEC
(
readycost
,
0
)
=
rtvec_alloc
(
nvalues
*
2
);
XEXP
(
readycost
,
1
)
=
make_numeric_value
(
1
);
nvalues
=
0
;
orexp
=
false_rtx
;
value
=
op_array
[
0
]
->
ready
;
nvalues
=
0
;
orexp
=
false_rtx
;
value
=
op_array
[
0
]
->
ready
;
for
(
i
=
0
;
i
<
num
;
i
++
)
{
op
=
op_array
[
i
];
...
...
@@ -2296,7 +2296,8 @@ encode_units_mask (x)
case
CONST_STRING
:
i
=
atoi
(
XSTR
(
x
,
0
));
if
(
i
<
0
)
abort
();
/* The sign bit encodes a one's compliment mask. */
/* The sign bit encodes a one's compliment mask. */
abort
();
else
if
(
i
!=
0
&&
i
==
(
i
&
-
i
))
/* Only one bit is set, so yield that unit number. */
for
(
j
=
0
;
(
i
>>=
1
)
!=
0
;
j
++
)
...
...
@@ -2893,19 +2894,19 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
char
*
p
,
*
string
;
if
(
GET_CODE
(
exp
)
!=
EQ_ATTR
)
abort
();
abort
();
string
=
(
char
*
)
alloca
(
2
+
strlen
(
XSTR
(
exp
,
0
))
+
strlen
(
XSTR
(
exp
,
1
)));
strcpy
(
string
,
XSTR
(
exp
,
0
));
strcat
(
string
,
"_"
);
strcat
(
string
,
XSTR
(
exp
,
1
));
for
(
p
=
string
;
*
p
;
p
++
)
for
(
p
=
string
;
*
p
;
p
++
)
*
p
=
TOUPPER
(
*
p
);
newexp
=
attr_rtx
(
EQ
,
value
,
attr_rtx
(
SYMBOL_REF
,
attr_string
(
string
,
strlen
(
string
))));
attr_string
(
string
,
strlen
(
string
))));
}
else
if
(
GET_CODE
(
value
)
==
COND
)
{
...
...
@@ -3497,10 +3498,13 @@ optimize_attrs ()
rtx
newexp
;
int
something_changed
=
1
;
int
i
;
struct
attr_value_list
{
struct
attr_value
*
av
;
struct
attr_value_list
{
struct
attr_value
*
av
;
struct
insn_ent
*
ie
;
struct
attr_desc
*
attr
;
struct
attr_value_list
*
next
;
};
struct
attr_desc
*
attr
;
struct
attr_value_list
*
next
;
};
struct
attr_value_list
**
insn_code_values
;
struct
attr_value_list
*
ivbuf
;
struct
attr_value_list
*
iv
;
...
...
@@ -3609,7 +3613,6 @@ simplify_by_alternatives (exp, insn_code, insn_index)
rtx newexp = rtx_alloc (COND);
rtx ultimate;
XVEC (newexp, 0) = rtvec_alloc (len * 2);
/* It will not matter what value we use as the default value
...
...
@@ -3706,8 +3709,8 @@ simplify_by_exploding (exp)
{
struct
dimension
tmp
;
tmp
=
space
[
j
];
space
[
j
]
=
space
[
j
-
1
];
space
[
j
-
1
]
=
tmp
;
space
[
j
]
=
space
[
j
-
1
];
space
[
j
-
1
]
=
tmp
;
}
/* Establish the initial current value. */
...
...
@@ -3875,7 +3878,8 @@ add_values_to_cover (dim)
if
(
nalt
<
dim
->
num_values
)
abort
();
else
if
(
nalt
==
dim
->
num_values
)
;
/* Ok. */
/* OK. */
;
else
if
(
nalt
*
2
<
dim
->
num_values
*
3
)
{
/* Most all the values of the attribute are used, so add all the unused
...
...
@@ -4248,7 +4252,8 @@ gen_attr (exp, lineno)
if
(
!
strcmp
(
attr
->
name
,
"length"
)
&&
!
attr
->
is_numeric
)
{
message_with_line
(
lineno
,
"`length' attribute must take numeric values"
);
message_with_line
(
lineno
,
"`length' attribute must take numeric values"
);
have_error
=
1
;
}
...
...
@@ -4694,7 +4699,8 @@ write_test_expr (exp, flags)
}
attr
=
find_attr
(
XSTR
(
exp
,
0
),
0
);
if
(
!
attr
)
abort
();
if
(
!
attr
)
abort
();
/* Now is the time to expand the value of a constant attribute. */
if
(
attr
->
is_const
)
...
...
@@ -4764,7 +4770,7 @@ write_test_expr (exp, flags)
address of the next insn for forward branches, and both with
adjustments that account for the worst-case possible stretching of
intervening alignments between this insn and its destination. */
printf
(
"insn_current_reference_address (insn)"
);
printf
(
"insn_current_reference_address (insn)"
);
break
;
case
CONST_STRING
:
...
...
@@ -5296,11 +5302,11 @@ write_toplevel_expr (p)
int
i
;
for
(
i
=
0
;
i
<
MAX_ATTRS_INDEX
;
++
i
)
for
(
attr
=
attrs
[
i
];
attr
;
attr
=
attr
->
next
)
for
(
attr
=
attrs
[
i
];
attr
;
attr
=
attr
->
next
)
if
(
!
attr
->
is_const
)
write_expr_attr_cache
(
p
,
attr
);
printf
(
" register unsigned long accum = 0;
\n\n
"
);
printf
(
" register unsigned long accum = 0;
\n\n
"
);
while
(
GET_CODE
(
p
)
==
IOR
)
{
...
...
@@ -5519,7 +5525,8 @@ write_eligible_delay (kind)
if
(
num_delays
>
1
)
{
attr
=
find_attr
(
"*delay_type"
,
0
);
if
(
!
attr
)
abort
();
if
(
!
attr
)
abort
();
common_av
=
find_most_used
(
attr
);
printf
(
" insn = delay_insn;
\n
"
);
...
...
@@ -5547,7 +5554,8 @@ write_eligible_delay (kind)
printf
(
" {
\n
"
);
attr
=
find_attr
(
"*delay_1_0"
,
0
);
if
(
!
attr
)
abort
();
if
(
!
attr
)
abort
();
common_av
=
find_most_used
(
attr
);
for
(
av
=
attr
->
first_value
;
av
;
av
=
av
->
next
)
...
...
@@ -5576,7 +5584,8 @@ write_eligible_delay (kind)
sprintf
(
str
,
"*%s_%d_%d"
,
kind
,
delay
->
num
,
i
/
3
);
attr
=
find_attr
(
str
,
0
);
if
(
!
attr
)
abort
();
if
(
!
attr
)
abort
();
common_av
=
find_most_used
(
attr
);
for
(
av
=
attr
->
first_value
;
av
;
av
=
av
->
next
)
...
...
@@ -5681,8 +5690,7 @@ write_complex_function (unit, name, connection)
printf
(
"static int %s_unit_%s PARAMS ((rtx, rtx));
\n
"
,
unit
->
name
,
name
);
printf
(
"static int
\n
"
);
printf
(
"%s_unit_%s (executing_insn, candidate_insn)
\n
"
,
unit
->
name
,
name
);
printf
(
"%s_unit_%s (executing_insn, candidate_insn)
\n
"
,
unit
->
name
,
name
);
printf
(
" rtx executing_insn;
\n
"
);
printf
(
" rtx candidate_insn;
\n
"
);
printf
(
"{
\n
"
);
...
...
@@ -5696,7 +5704,8 @@ write_complex_function (unit, name, connection)
str
=
(
char
*
)
alloca
(
strlen
(
unit
->
name
)
+
strlen
(
name
)
+
strlen
(
connection
)
+
10
);
sprintf
(
str
,
"*%s_cases"
,
unit
->
name
);
case_attr
=
find_attr
(
str
,
0
);
if
(
!
case_attr
)
abort
();
if
(
!
case_attr
)
abort
();
common_av
=
find_most_used
(
case_attr
);
for
(
av
=
case_attr
->
first_value
;
av
;
av
=
av
->
next
)
...
...
@@ -5729,7 +5738,8 @@ write_complex_function (unit, name, connection)
printf
(
" case %d:
\n
"
,
i
);
sprintf
(
str
,
"*%s_%s_%d"
,
unit
->
name
,
connection
,
i
);
attr
=
find_attr
(
str
,
0
);
if
(
!
attr
)
abort
();
if
(
!
attr
)
abort
();
/* If single value, just write it. */
value
=
find_single_value
(
attr
);
...
...
@@ -5945,8 +5955,10 @@ extend_range (range, min, max)
int
min
;
int
max
;
{
if
(
range
->
min
>
min
)
range
->
min
=
min
;
if
(
range
->
max
<
max
)
range
->
max
=
max
;
if
(
range
->
min
>
min
)
range
->
min
=
min
;
if
(
range
->
max
<
max
)
range
->
max
=
max
;
}
static
rtx
...
...
@@ -6025,7 +6037,6 @@ write_const_num_delay_slots ()
}
}
extern
int
main
PARAMS
((
int
,
char
**
));
int
...
...
@@ -6090,7 +6101,7 @@ from the machine description file `md'. */\n\n");
case
DEFINE_INSN
:
case
DEFINE_PEEPHOLE
:
case
DEFINE_ASM_ATTRIBUTES
:
gen_insn
(
desc
,
lineno
);
gen_insn
(
desc
,
lineno
);
break
;
case
DEFINE_ATTR
:
...
...
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