[PATCH, i386]: AMD bdver3 enablement
Uros Bizjak
ubizjak@gmail.com
Mon Nov 5 08:06:00 GMT 2012
On Mon, Nov 5, 2012 at 8:33 AM, Gopalasubramanian, Ganesh
<Ganesh.Gopalasubramanian@amd.com> wrote:
> Couple of changes done with respect to the review comments.
>
> 1. sseshuf type attribute is handled in unit attribute calculation.
> 2. sseadd1 instruction attribute is handled in the new scheduler descriptions.
>
> The patch is attached as (patch.txt).
> The new file (bdver3.md) describing the pipelines is also attached.
- [(set_attr "type" "sselog")
+ [(set (attr "type")
+ (if_then_else (eq_attr "cpu" "bdver3")
+ (const_string "sseshuf")
+ (const_string "sselog")))
(set_attr "length_immediate" "1")
(set_attr "prefix" "vex")
(set_attr "mode" "V8SF")])
@@ -3911,7 +3914,10 @@
}
}
[(set_attr "isa" "noavx,avx")
- (set_attr "type" "sselog")
+ (set (attr "type")
+ (if_then_else (eq_attr "cpu" "bdver3")
+ (const_string "sseshuf")
+ (const_string "sselog")))
(set_attr "length_immediate" "1")
(set_attr "prefix" "orig,vex")
(set_attr "mode" "V4SF")])
@@ -4018,7 +4024,27 @@
vmovlps\t{%2, %1, %0|%0, %1, %2}
%vmovlps\t{%2, %0|%0, %2}"
[(set_attr "isa" "noavx,avx,noavx,avx,*")
- (set_attr "type" "sselog,sselog,ssemov,ssemov,ssemov")
+ (set (attr "type")
+ (cond [(and (eq_attr "cpu" "bdver3")
+ (eq_attr "alternative" "0"))
+ (const_string "sseshuf")
+ (and (eq_attr "cpu" "bdver3")
+ (eq_attr "alternative" "1"))
+ (const_string "sseshuf")
+ (eq_attr "alternative" "2")
+ (const_string "ssemov")
+ (eq_attr "alternative" "3")
+ (const_string "ssemov")
+ (eq_attr "alternative" "4")
+ (const_string "ssemov")
+ (and (not (eq_attr "cpu" "bdver3"))
+ (eq_attr "alternative" "0"))
+ (const_string "sselog")
+ (and (not (eq_attr "cpu" "bdver3"))
+ (eq_attr "alternative" "1"))
+ (const_string "sselog")
+ ]
+ (const_string "*" )))
(set_attr "length_immediate" "1,1,*,*,*")
(set_attr "prefix" "orig,vex,orig,vex,maybe_vex")
(set_attr "mode" "V4SF,V4SF,V2SF,V2SF,V2SF")])
@@ -4072,7 +4098,23 @@
vbroadcastss\t{%1, %0|%0, %1}
shufps\t{$0, %0, %0|%0, %0, 0}"
[(set_attr "isa" "avx,avx,noavx")
- (set_attr "type" "sselog1,ssemov,sselog1")
+ (set (attr "type")
+ (cond [(and (eq_attr "cpu" "bdver3")
+ (eq_attr "alternative" "0"))
+ (const_string "sseshuf")
+ (and (eq_attr "cpu" "bdver3")
+ (eq_attr "alternative" "2"))
+ (const_string "sseshuf")
+ (eq_attr "alternative" "1")
+ (const_string "ssemov")
+ (and (not (eq_attr "cpu" "bdver3"))
+ (eq_attr "alternative" "0"))
+ (const_string "sselog1")
+ (and (not (eq_attr "cpu" "bdver3"))
+ (eq_attr "alternative" "2"))
+ (const_string "sselog1")
+ ]
+ (const_string "*" )))
Please don't conditionally change type attribute. Change sselog{,1}
attribute unconditionally to sseshuf{,1} and handle them in the same
way as sselog{,1}.
In other words, add new attributes to all places where original
attributes are handled.
Otherwise, the patch looks good.
Uros.
More information about the Gcc-patches
mailing list