|
| From: | Richard Henderson |
| Subject: | Re: [Qemu-ppc] [PATCH v2 1/2] target-ppc: add vextu[bhw]lx instructions |
| Date: | Thu, 24 Nov 2016 15:42:40 +0100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 11/24/2016 12:32 PM, Nikunj A Dadhania wrote:
+#if defined(HOST_WORDS_BIGENDIAN)
+# if defined(CONFIG_INT128)
+# define VEXTULX_DO(name, size) \
+ target_ulong glue(helper_, name)(target_ulong a, ppc_avr_t *b) \
+ { \
+ int index = (a & 0xf) * 8; \
+ return int128_rshift(b->u128, index) & \
+ MAKE_64BIT_MASK(0, size); \
+ }
+# else
+# define VEXTULX_DO(name, size) \
+ target_ulong glue(helper_, name)(target_ulong a, ppc_avr_t *b) \
+ { \
+ int index = (a & 0xf) * 8; \
+ Int128 value = int128_make128(b->u64[LO_IDX], \
+ b->u64[HI_IDX]); \
+ return int128_rshift(value, index) & \
+ MAKE_64BIT_MASK(0, size); \
+ }
+# endif
Why are these duplicated?Clearly the missed trick is that you should *never* check CONFIG_INT128 and always rely on Int128.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |