return v;
}
+static inline __attribute__((always_inline)) uint64_t
+__gen_address(__gen_user_data *data, void *location,
+ __gen_address_type address, uint32_t delta,
+ NDEBUG_UNUSED uint32_t start, uint32_t end)
+{
+ uint64_t addr_u64 = __gen_combine_address(data, location, address, delta);
+ if (end == 31) {
+ return addr_u64;
+ } else if (end < 63) {
+ const unsigned shift = 63 - end;
+ return (addr_u64 << shift) >> shift;
+ } else {
+ return addr_u64;
+ }
+}
+
static inline __attribute__((always_inline)) uint32_t
__gen_float(float v)
{
if dw.size == 32:
if dw.address:
- print(" dw[%d] = __gen_combine_address(data, &dw[%d], values->%s, %s);" % (index, index, dw.address.name + field.dim, v))
+ print(" dw[%d] = __gen_address(data, &dw[%d], values->%s, %s, %d, %d);" %
+ (index, index, dw.address.name + field.dim, v,
+ dw.address.start - dword_start, dw.address.end - dword_start))
continue
if dw.address:
v_address = "v%d_address" % index
- print(" const uint64_t %s =\n __gen_combine_address(data, &dw[%d], values->%s, %s);" %
- (v_address, index, dw.address.name + field.dim, v))
+ print(" const uint64_t %s =\n __gen_address(data, &dw[%d], values->%s, %s, %d, %d);" %
+ (v_address, index, dw.address.name + field.dim, v,
+ dw.address.start - dword_start, dw.address.end - dword_start))
if len(dw.fields) > address_count:
print(" dw[%d] = %s;" % (index, v_address))
print(" dw[%d] = (%s >> 32) | (%s >> 32);" % (index + 1, v_address, v))