diff options
author | Grazvydas Ignotas <[email protected]> | 2018-06-16 21:56:13 +0300 |
---|---|---|
committer | Grazvydas Ignotas <[email protected]> | 2018-06-21 12:17:34 +0300 |
commit | 4e0d93dc0e4d37dff492305fb7aa6408f36ff147 (patch) | |
tree | 144f5bf87162c7d7c2871f2058de46fa2b566644 /src/gallium/drivers/radeonsi/si_descriptors.c | |
parent | af17a29ad86097b5a132d148db44eb3bbb16cebd (diff) |
radeonsi: use shifts for sign extension
Avoids a branch and reduces code size a tiny bit:
text data bss dec hex filename
10804563 398653 2070368 13273584 ca89f0 /tmp/radeonsi_dri.so.old
10804499 398653 2070368 13273520 ca89b0 /tmp/radeonsi_dri.so
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index d3da8a470a4..9de0112878e 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -100,8 +100,8 @@ static uint64_t si_desc_extract_buffer_address(const uint32_t *desc) ((uint64_t)G_008F04_BASE_ADDRESS_HI(desc[1]) << 32); /* Sign-extend the 48-bit address. */ - if (va & (1ull << 47)) - va |= 0xffffull << 48; + va <<= 16; + va = (int64_t)va >> 16; return va; } |