; SF/DF constraint for arithmetic on VSX registers. This is intended to be
; used for DFmode instructions added in ISA 2.06 (power7) and SFmode
; instructions added in ISA 2.07 (power8)
-(define_mode_attr Fv2 [(SF "wy") (DF "ws") (DI "wi")])
+(define_mode_attr Fv2 [(SF "wa") (DF "ws") (DI "wi")])
+
+; Which isa is needed for those float instructions?
+(define_mode_attr Fisa [(SF "p8v") (DF "*") (DI "*")])
; s/d suffix for things like sdiv/ddiv
(define_mode_attr Fs [(SF "s") (DF "d")])
"@
fadd<Ftrad> %0,%1,%2
xsadd<Fvsx> %x0,%x1,%x2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>")])
(define_expand "sub<mode>3"
[(set (match_operand:SFDF 0 "gpc_reg_operand")
"@
fsub<Ftrad> %0,%1,%2
xssub<Fvsx> %x0,%x1,%x2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>")])
(define_expand "mul<mode>3"
[(set (match_operand:SFDF 0 "gpc_reg_operand")
"@
fmul<Ftrad> %0,%1,%2
xsmul<Fvsx> %x0,%x1,%x2"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "isa" "*,<Fisa>")])
(define_expand "div<mode>3"
[(set (match_operand:SFDF 0 "gpc_reg_operand")
"@
fdiv<Ftrad> %0,%1,%2
xsdiv<Fvsx> %x0,%x1,%x2"
- [(set_attr "type" "<Fs>div")])
+ [(set_attr "type" "<Fs>div")
+ (set_attr "isa" "*,<Fisa>")])
(define_insn "*sqrt<mode>2_internal"
[(set (match_operand:SFDF 0 "gpc_reg_operand" "=<Ff>,<Fv2>")
"@
fsqrt<Ftrad> %0,%1
xssqrt<Fvsx> %x0,%x1"
- [(set_attr "type" "<Fs>sqrt")])
+ [(set_attr "type" "<Fs>sqrt")
+ (set_attr "isa" "*,<Fisa>")])
(define_expand "sqrt<mode>2"
[(set (match_operand:SFDF 0 "gpc_reg_operand")
"@
fre<Ftrad> %0,%1
xsre<Fvsx> %x0,%x1"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>")])
(define_insn "*rsqrt<mode>2"
[(set (match_operand:SFDF 0 "gpc_reg_operand" "=<Ff>,<Fv2>")
"@
frsqrte<Ftrad> %0,%1
xsrsqrte<Fvsx> %x0,%x1"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>")])
;; Floating point comparisons
(define_insn "*cmp<mode>_fpr"
"@
fcmpu %0,%1,%2
xscmpudp %0,%x1,%x2"
- [(set_attr "type" "fpcompare")])
+ [(set_attr "type" "fpcompare")
+ (set_attr "isa" "*,<Fisa>")])
;; Floating point conversions
(define_expand "extendsfdf2"
(define_insn_and_split "*extendsfdf2_fpr"
[(set (match_operand:DF 0 "gpc_reg_operand" "=d,?d,d,ws,?ws,wa,v")
- (float_extend:DF (match_operand:SF 1 "reg_or_mem_operand" "0,f,m,0,wy,Z,wY")))]
+ (float_extend:DF (match_operand:SF 1 "reg_or_mem_operand" "0,f,m,0,wa,Z,wY")))]
"TARGET_HARD_FLOAT && !HONOR_SNANS (SFmode)"
"@
#
DONE;
}
[(set_attr "type" "fp,fpsimple,fpload,fp,fpsimple,fpload,fpload")
- (set_attr "isa" "*,*,*,*,*,p8v,p9v")])
+ (set_attr "isa" "*,*,*,*,p8v,p8v,p9v")])
(define_insn "*extendsfdf2_snan"
[(set (match_operand:DF 0 "gpc_reg_operand" "=d,ws")
- (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f,wy")))]
+ (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f,wa")))]
"TARGET_HARD_FLOAT && HONOR_SNANS (SFmode)"
"@
frsp %0,%1
xsrsp %x0,%x1"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,p8v")])
(define_expand "truncdfsf2"
[(set (match_operand:SF 0 "gpc_reg_operand")
"")
(define_insn "*truncdfsf2_fpr"
- [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wy")
+ [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa")
(float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "d,ws")))]
"TARGET_HARD_FLOAT"
"@
frsp %0,%1
xsrsp %x0,%x1"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,p8v")])
;; This expander is here to avoid FLOAT_WORDS_BIGENDIAN tests in
;; builtins.c and optabs.c that are not correct for IBM long double
})
(define_insn "floatdisf2_fcfids"
- [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wy")
+ [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa")
(float:SF (match_operand:DI 1 "gpc_reg_operand" "d,wi")))]
"TARGET_HARD_FLOAT && TARGET_FCFIDS"
"@
fcfids %0,%1
xscvsxdsp %x0,%x1"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,p8v")])
(define_insn_and_split "*floatdisf2_mem"
- [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wy,wy")
+ [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa,wa")
(float:SF (match_operand:DI 1 "memory_operand" "m,m,Z")))
(clobber (match_scratch:DI 2 "=d,d,wi"))]
"TARGET_HARD_FLOAT && TARGET_FCFIDS"
emit_insn (gen_floatdisf2_fcfids (operands[0], operands[2]));
DONE;
}
- [(set_attr "length" "8")])
+ [(set_attr "length" "8")
+ (set_attr "isa" "*,p8v,p8v")])
;; This is not IEEE compliant if rounding mode is "round to nearest".
;; If the DI->DF conversion is inexact, then it's possible to suffer
(set_attr "isa" "*,p8v")])
(define_insn_and_split "*floatunsdisf2_mem"
- [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wy,wy")
+ [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa,wa")
(unsigned_float:SF (match_operand:DI 1 "memory_operand" "m,m,Z")))
(clobber (match_scratch:DI 2 "=d,d,wi"))]
"TARGET_HARD_FLOAT && TARGET_FCFIDUS"
emit_insn (gen_floatunsdisf2_fcfidus (operands[0], operands[2]));
DONE;
}
- [(set_attr "length" "8")
- (set_attr "type" "fpload")])
+ [(set_attr "type" "fpload")
+ (set_attr "length" "8")
+ (set_attr "isa" "*,p8v,p8v")])
\f
;; Define the TImode operations that can be done in a small number
;; of instructions. The & constraints are to prevent the register
(define_insn_and_split "movsf_from_si"
[(set (match_operand:SF 0 "nonimmediate_operand"
"=!r, f, v, wa, m, Z,
- Z, wy, ?r, !r")
+ Z, wa, ?r, !r")
(unspec:SF [(match_operand:SI 1 "input_operand"
"m, m, wY, Z, r, f,
- wa, r, wy, r")]
+ wa, r, wa, r")]
UNSPEC_SF_FROM_SI))
(clobber (match_scratch:DI 2
"=X, X, X, X, X, X,
fpstore, vecfloat, mffgpr, *")
(set_attr "isa"
"*, *, p9v, p8v, *, *,
- p8v, *, *, *")])
+ p8v, p8v, p8v, *")])
\f
;; Move 64-bit binary/decimal floating point
fmadd<Ftrad> %0,%1,%2,%3
xsmadda<Fvsx> %x0,%x1,%x2
xsmaddm<Fvsx> %x0,%x1,%x3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>,<Fisa>")])
; Altivec only has fma and nfms.
(define_expand "fms<mode>4"
fmsub<Ftrad> %0,%1,%2,%3
xsmsuba<Fvsx> %x0,%x1,%x2
xsmsubm<Fvsx> %x0,%x1,%x3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>,<Fisa>")])
;; If signed zeros are ignored, -(a * b - c) = -a * b + c.
(define_expand "fnma<mode>4"
fnmadd<Ftrad> %0,%1,%2,%3
xsnmadda<Fvsx> %x0,%x1,%x2
xsnmaddm<Fvsx> %x0,%x1,%x3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>,<Fisa>")])
; Not an official optab name, but used from builtins.
(define_expand "nfms<mode>4"
fnmsub<Ftrad> %0,%1,%2,%3
xsnmsuba<Fvsx> %x0,%x1,%x2
xsnmsubm<Fvsx> %x0,%x1,%x3"
- [(set_attr "type" "fp")])
-
+ [(set_attr "type" "fp")
+ (set_attr "isa" "*,<Fisa>,<Fisa>")])
\f
(define_expand "rs6000_get_timebase"
[(use (match_operand:DI 0 "gpc_reg_operand"))]
;; the KFmode -> DFmode conversion using round to odd rather than the normal
;; conversion
(define_insn_and_split "trunc<mode>sf2_hw"
- [(set (match_operand:SF 0 "vsx_register_operand" "=wy")
+ [(set (match_operand:SF 0 "vsx_register_operand" "=wa")
(float_truncate:SF
(match_operand:IEEE128 1 "altivec_register_operand" "v")))
(clobber (match_scratch:DF 2 "=v"))]
operands[2] = gen_reg_rtx (DFmode);
}
[(set_attr "type" "vecfloat")
- (set_attr "length" "8")])
+ (set_attr "length" "8")
+ (set_attr "isa" "p8v")])
;; Conversion between IEEE 128-bit and integer types