This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add SSE4.2 support


Hello!

	* config/i386/sse.md (sse4_2_gtv2di3): New pattern for
	SSE4.2.
	(vcondv2di): Likewise.
	(vconduv2di): Likewise.

+(define_expand "vcondv2di"
+  [(set (match_operand:V2DI 0 "register_operand" "")
+        (if_then_else:V2DI
+          (match_operator 3 ""
+            [(match_operand:V2DI 4 "nonimmediate_operand" "")
+             (match_operand:V2DI 5 "nonimmediate_operand" "")])
+          (match_operand:V2DI 1 "general_operand" "")
+          (match_operand:V2DI 2 "general_operand" "")))]
+  "TARGET_SSE4_2"
+{
+  if (ix86_expand_int_vcond (operands))
+    DONE;
+  else
+    FAIL;
+})

This pattern should be merged with existing vcond<mode> pattern, where mode macro is changed to SSEMODEI. The logic to reject unsupported pattern should be contained in ix86_expand_int_vcond(). Please note, that even in SSE4.1, we can expand vector condition for EQ and NE modes. Also, ix86_expand_int_vcond() generates code that simulates conditional move, and other things.

+(define_expand "vconduv2di"
+  [(set (match_operand:V2DI 0 "register_operand" "")
+        (if_then_else:V2DI
+          (match_operator 3 ""
+            [(match_operand:V2DI 4 "nonimmediate_operand" "")
+             (match_operand:V2DI 5 "nonimmediate_operand" "")])
+          (match_operand:V2DI 1 "general_operand" "")
+          (match_operand:V2DI 2 "general_operand" "")))]
+  "TARGET_SSE4_2"
+{
+  if (ix86_expand_int_vcond (operands))
+    DONE;
+  else
+    FAIL;
+})

This expander should be merged with existing vcondu in the same way.


BTW: If it is not too much trouble, could string/text processing
intrinsic be split out into separate patch? The first patch would then
implement only SSE4.2 flags handling and logic/CRC operations that we
are all somehow familiar with, and the second will add string
processing.

Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]