Patchwork [i386] : Add castmode mode attribute

login
register
mail settings
Submitter Uros Bizjak
Date Aug. 6, 2011, 8:19 a.m.
Message ID <CAFULd4a5XndKTK67FqpCrG7qMu6Ga4YtzMaHxBBacnuQpNRFMg@mail.gmail.com>
Download mbox | patch
Permalink /patch/108763/
State New
Headers show

Comments

Uros Bizjak - Aug. 6, 2011, 8:19 a.m.
Hello!

This patch will simplify macroization of AVX2 stuff. No functional changes.

2011-08-06  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.md (ssemodesuffix): Remove V8SI mode.
	* config/i386/sse.md (castmode): New mode attribute.
	(avx_<castmode><avxsizesuffix>_<castmode>): Rename from
	avx_<ssemodesuffix><avxsizesuffix>_<ssemodesuffix>.

Bootstrapped on x86_64-pc-linux-gnu, committed to mainline SVN.

Uros.

Patch

Index: i386.md
===================================================================
--- i386.md	(revision 177503)
+++ i386.md	(working copy)
@@ -935,8 +935,7 @@ 
   [(SF "ss") (DF "sd")
    (V8SF "ps") (V4DF "pd")
    (V4SF "ps") (V2DF "pd")
-   (V16QI "b") (V8HI "w") (V4SI "d") (V2DI "q")
-   (V8SI "si")])
+   (V16QI "b") (V8HI "w") (V4SI "d") (V2DI "q")])
 
 ;; SSE vector suffix for floating point modes
 (define_mode_attr ssevecmodesuffix [(SF "ps") (DF "pd")])
Index: sse.md
===================================================================
--- sse.md	(revision 177503)
+++ sse.md	(working copy)
@@ -178,6 +178,9 @@ 
 (define_mode_attr sserotatemax
   [(V16QI "7") (V8HI "15") (V4SI "31") (V2DI "63")])
 
+;; Mapping of mode to cast intrinsic name
+(define_mode_attr castmode [(V8SI "si") (V8SF "ps") (V4DF "pd")])
+
 ;; Instruction suffix for sign and zero extensions.
 (define_code_attr extsuffix [(sign_extend "sx") (zero_extend "zx")])
 
@@ -10233,7 +10236,7 @@ 
    (set_attr "prefix" "vex")
    (set_attr "mode" "<MODE>")])
 
-(define_insn_and_split "avx_<ssemodesuffix><avxsizesuffix>_<ssemodesuffix>"
+(define_insn_and_split "avx_<castmode><avxsizesuffix>_<castmode>"
   [(set (match_operand:AVX256MODE2P 0 "nonimmediate_operand" "=x,m")
 	(unspec:AVX256MODE2P
 	  [(match_operand:<ssehalfvecmode> 1 "nonimmediate_operand" "xm,x")]