Comments
Patch
@@ -32792,7 +32792,8 @@ ix86_rtx_costs (rtx x, int code_i, int o
case AND:
case IOR:
case XOR:
- if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && GET_MODE_SIZE (mode) > UNITS_PER_WORD)
{
*total = (cost->add * 2
+ (rtx_cost (XEXP (x, 0), outer_code, opno, speed)
@@ -0,0 +1,17 @@
+/* PR target/54592 */
+/* { dg-do compile } */
+/* { dg-options "-Os -msse2" } */
+/* { dg-require-effective-target sse2 } */
+
+#include <emmintrin.h>
+
+void
+func (__m128i * foo, size_t a, size_t b, int *dst)
+{
+ __m128i x = foo[a];
+ __m128i y = foo[b];
+ __m128i sum = _mm_add_epi32 (x, y);
+ *dst = _mm_cvtsi128_si32 (sum);
+}
+
+/* { dg-final { scan-assembler "paddd\[^\n\r\]*(\\(\[^\n\r\]*\\)|XMMWORD PTR)" } } */