projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
316eeed
)
Turn if cascade into switch.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 6 Dec 2011 08:31:34 +0000
(09:31 +0100)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 6 Dec 2011 08:31:34 +0000
(09:31 +0100)
ir/be/sparc/sparc_transform.c
patch
|
blob
|
history
diff --git
a/ir/be/sparc/sparc_transform.c
b/ir/be/sparc/sparc_transform.c
index
1c73f5d
..
c8f6302
100644
(file)
--- a/
ir/be/sparc/sparc_transform.c
+++ b/
ir/be/sparc/sparc_transform.c
@@
-2134,16
+2134,12
@@
static const arch_register_req_t float4_req = {
static const arch_register_req_t *get_float_req(ir_mode *mode)
{
static const arch_register_req_t *get_float_req(ir_mode *mode)
{
- unsigned bits = get_mode_size_bits(mode);
-
assert(mode_is_float(mode));
assert(mode_is_float(mode));
- if (bits == 32) {
- return &float1_req;
- } else if (bits == 64) {
- return &float2_req;
- } else {
- assert(bits == 128);
- return &float4_req;
+ switch (get_mode_size_bits(mode)) {
+ case 32: return &float1_req;
+ case 64: return &float2_req;
+ case 128: return &float4_req;
+ default: panic("invalid float mode");
}
}
}
}