summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-04-18 11:33:14 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-04-19 09:06:52 +0200
commitbe10d1427a708d860b85f1abf03b3d1e8f530bad (patch)
treee1d1841e5572ff5d99d40864aa5310a57fa274be /ir/be/betranshlp.c
parentf6005c769a6e3c5047d3f8ff0de2d96b4445c140 (diff)
be: Factorise code to extract 32 bits from a tarval.
Diffstat (limited to 'ir/be/betranshlp.c')
-rw-r--r--ir/be/betranshlp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ir/be/betranshlp.c b/ir/be/betranshlp.c
index c04959d..f41514d 100644
--- a/ir/be/betranshlp.c
+++ b/ir/be/betranshlp.c
@@ -813,3 +813,13 @@ void be_get_allocatable_regs(ir_graph const *const irg,
rbitset_set(raw_bitset, i);
}
}
+
+uint32_t be_get_tv_bits32(ir_tarval *const tv, unsigned const offset)
+{
+ uint32_t val;
+ val = (uint32_t)get_tarval_sub_bits(tv, offset);
+ val |= (uint32_t)get_tarval_sub_bits(tv, offset + 1) << 8;
+ val |= (uint32_t)get_tarval_sub_bits(tv, offset + 2) << 16;
+ val |= (uint32_t)get_tarval_sub_bits(tv, offset + 3) << 24;
+ return val;
+}