From 97a61d0577bcfefe92df0515ece079234400e7eb Mon Sep 17 00:00:00 2001 From: Chip-Kerchner Date: Wed, 11 Oct 2023 17:36:43 -0500 Subject: [PATCH 1/3] Fix bfloat16_bits union so that it always the sizeof unsigned short. --- test/compare_sgemm_sbgemm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/compare_sgemm_sbgemm.c b/test/compare_sgemm_sbgemm.c index 276fecae9..57d416c94 100644 --- a/test/compare_sgemm_sbgemm.c +++ b/test/compare_sgemm_sbgemm.c @@ -32,7 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. typedef union { unsigned short v; - struct + struct __attribute__((packed)) { #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ unsigned short s:1; From e98e3c4783fe9250c9bda11cada6e82ef627854e Mon Sep 17 00:00:00 2001 From: Chip-Kerchner Date: Wed, 11 Oct 2023 18:05:55 -0500 Subject: [PATCH 2/3] Fix float32_bits union so that it always the sizeof float. --- test/compare_sgemm_sbgemm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/compare_sgemm_sbgemm.c b/test/compare_sgemm_sbgemm.c index 57d416c94..b723b6a3b 100644 --- a/test/compare_sgemm_sbgemm.c +++ b/test/compare_sgemm_sbgemm.c @@ -49,7 +49,7 @@ typedef union typedef union { float v; - struct + struct __attribute__((packed)) { #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ uint32_t s:1; From d46eba06a7a95a61649cf25a1fd350f46d8050b6 Mon Sep 17 00:00:00 2001 From: Chip-Kerchner Date: Thu, 12 Oct 2023 09:41:33 -0500 Subject: [PATCH 3/3] Pack structure only on AIX. --- test/compare_sgemm_sbgemm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/compare_sgemm_sbgemm.c b/test/compare_sgemm_sbgemm.c index b723b6a3b..cf808b56d 100644 --- a/test/compare_sgemm_sbgemm.c +++ b/test/compare_sgemm_sbgemm.c @@ -32,7 +32,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. typedef union { unsigned short v; +#if defined(_AIX) struct __attribute__((packed)) +#else + struct +#endif { #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ unsigned short s:1; @@ -49,7 +53,11 @@ typedef union typedef union { float v; +#if defined(_AIX) struct __attribute__((packed)) +#else + struct +#endif { #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ uint32_t s:1;