Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
4d7ff739
Commit
4d7ff739
authored
Nov 08, 2008
by
Christoph Mallon
Browse files
Remove pointless assert, (x & 7) == (int){0,1,2,3,4,5,6,7}[x & 7] is always true.
[r23529]
parent
364f62c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_emitter.c
View file @
4d7ff739
...
...
@@ -462,54 +462,42 @@ static void ia32_emit_cfop_target(const ir_node *node)
ia32_emit_block_name
(
block
);
}
/*
* coding of conditions
*/
struct
cmp2conditon_t
{
const
char
*
name
;
int
num
;
};
/*
* positive conditions for signed compares
*/
static
const
struct
cmp2conditon_
t
cmp2condition_s
[]
=
{
{
NULL
,
pn_Cmp_False
},
/* always false */
{
"e"
,
pn_Cmp_Eq
},
/* == */
{
"l"
,
pn_Cmp_Lt
},
/* < */
{
"le"
,
pn_Cmp_Le
},
/* <= */
{
"g"
,
pn_Cmp_Gt
},
/* > */
{
"ge"
,
pn_Cmp_Ge
},
/* >= */
{
"ne"
,
pn_Cmp_Lg
},
/* != */
{
NULL
,
pn_Cmp_Leg
},
/* always true */
static
const
char
*
cons
t
cmp2condition_s
[]
=
{
NULL
,
/* always false */
"e"
,
/* == */
"l"
,
/* <
*/
"le"
,
/* <= */
"g"
,
/* >
*/
"ge"
,
/* >= */
"ne"
,
/* != */
NULL
/* always true */
};
/*
* positive conditions for unsigned compares
*/
static
const
struct
cmp2conditon_
t
cmp2condition_u
[]
=
{
{
NULL
,
pn_Cmp_False
},
/* always false */
{
"e"
,
pn_Cmp_Eq
},
/* == */
{
"b"
,
pn_Cmp_Lt
},
/* < */
{
"be"
,
pn_Cmp_Le
},
/* <= */
{
"a"
,
pn_Cmp_Gt
},
/* > */
{
"ae"
,
pn_Cmp_Ge
},
/* >= */
{
"ne"
,
pn_Cmp_Lg
},
/* != */
{
NULL
,
pn_Cmp_Leg
},
/* always true
*/
static
const
char
*
cons
t
cmp2condition_u
[]
=
{
NULL
,
/* always false */
"e"
,
/* == */
"b"
,
/* <
*/
"be"
,
/* <= */
"a"
,
/* >
*/
"ae"
,
/* >= */
"ne"
,
/* != */
NULL
/* always true */
};
static
void
ia32_emit_cmp_suffix
(
int
pnc
)
{
const
char
*
str
;
if
((
pnc
&
ia32_pn_Cmp_float
)
||
(
pnc
&
ia32_pn_Cmp_unsigned
))
{
pnc
=
pnc
&
7
;
assert
(
cmp2condition_u
[
pnc
].
num
==
pnc
);
str
=
cmp2condition_u
[
pnc
].
name
;
if
(
pnc
&
ia32_pn_Cmp_float
||
pnc
&
ia32_pn_Cmp_unsigned
)
{
str
=
cmp2condition_u
[
pnc
&
7
];
}
else
{
pnc
=
pnc
&
7
;
assert
(
cmp2condition_s
[
pnc
].
num
==
pnc
);
str
=
cmp2condition_s
[
pnc
].
name
;
str
=
cmp2condition_s
[
pnc
&
7
];
}
be_emit_string
(
str
);
...
...
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