[llvm-bugs] [Bug 50806] New: [SIMD] product of two extended halves of vectors should generate extmul_low/high
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Jun 22 12:30:50 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50806
Bug ID: 50806
Summary: [SIMD] product of two extended halves of vectors
should generate extmul_low/high
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: WebAssembly
Assignee: unassignedbugs at nondot.org
Reporter: clang at evan.coeusgroup.com
CC: llvm-bugs at lists.llvm.org
Here are some examples (or on Compiler Explorer:
https://godbolt.org/z/Ynnhz8srj):
#include <stdint.h>
#pragma clang diagnostic ignored "-Wmissing-prototypes"
typedef int8_t i8x16 __attribute__((__vector_size__(16)));
typedef int16_t i16x8 __attribute__((__vector_size__(16)));
typedef int32_t i32x4 __attribute__((__vector_size__(16)));
typedef int64_t i64x2 __attribute__((__vector_size__(16)));
typedef uint8_t u8x16 __attribute__((__vector_size__(16)));
typedef uint16_t u16x8 __attribute__((__vector_size__(16)));
typedef uint32_t u32x4 __attribute__((__vector_size__(16)));
typedef uint64_t u64x2 __attribute__((__vector_size__(16)));
i16x8
i8x16_extmul_low(i8x16 a, i8x16 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 0, 1, 2, 3, 4, 5, 6, 7),
__typeof__(int16_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 0, 1, 2, 3, 4, 5, 6, 7),
__typeof__(int16_t __attribute__((__vector_size__(16))))
);
}
i32x4
i16x8_extmul_low(i16x8 a, i16x8 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 0, 1, 2, 3),
__typeof__(int32_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 0, 1, 2, 3),
__typeof__(int32_t __attribute__((__vector_size__(16))))
);
}
i64x2
i32x4_extmul_low(i32x4 a, i32x4 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 0, 1),
__typeof__(int64_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 0, 1),
__typeof__(int64_t __attribute__((__vector_size__(16))))
);
}
i16x8
i8x16_extmul_high(i8x16 a, i8x16 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 8, 9, 10, 11, 12, 13, 14, 15),
__typeof__(int16_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 8, 9, 10, 11, 12, 13, 14, 15),
__typeof__(int16_t __attribute__((__vector_size__(16))))
);
}
i32x4
i16x8_extmul_high(i16x8 a, i16x8 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 4, 5, 6, 7),
__typeof__(int32_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 4, 5, 6, 7),
__typeof__(int32_t __attribute__((__vector_size__(16))))
);
}
i64x2
i32x4_extmul_high(i32x4 a, i32x4 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 2, 3),
__typeof__(int64_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 2, 3),
__typeof__(int64_t __attribute__((__vector_size__(16))))
);
}
u16x8
u8x16_extmul_low(u8x16 a, u8x16 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 0, 1, 2, 3, 4, 5, 6, 7),
__typeof__(uint16_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 0, 1, 2, 3, 4, 5, 6, 7),
__typeof__(uint16_t __attribute__((__vector_size__(16))))
);
}
u32x4
u16x8_extmul_low(u16x8 a, u16x8 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 0, 1, 2, 3),
__typeof__(uint32_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 0, 1, 2, 3),
__typeof__(uint32_t __attribute__((__vector_size__(16))))
);
}
u64x2
u32x4_extmul_low(u32x4 a, u32x4 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 0, 1),
__typeof__(uint64_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 0, 1),
__typeof__(uint64_t __attribute__((__vector_size__(16))))
);
}
u16x8
u8x16_extmul_high(u8x16 a, u8x16 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 8, 9, 10, 11, 12, 13, 14, 15),
__typeof__(uint16_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 8, 9, 10, 11, 12, 13, 14, 15),
__typeof__(uint16_t __attribute__((__vector_size__(16))))
);
}
u32x4
u16x8_extmul_high(u16x8 a, u16x8 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 4, 5, 6, 7),
__typeof__(uint32_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 4, 5, 6, 7),
__typeof__(uint32_t __attribute__((__vector_size__(16))))
);
}
u64x2
u32x4_extmul_high(u32x4 a, u32x4 b) {
return
__builtin_convertvector(
__builtin_shufflevector(a, a, 2, 3),
__typeof__(uint64_t __attribute__((__vector_size__(16))))
)
*
__builtin_convertvector(
__builtin_shufflevector(b, b, 2, 3),
__typeof__(uint64_t __attribute__((__vector_size__(16))))
);
}
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210622/06b9bb80/attachment.html>
More information about the llvm-bugs
mailing list