Commit 0659ce6f by James Greenhalgh Committed by James Greenhalgh

[AArch64] Map frint intrinsics to standard pattern names directly.

gcc/
	* config/aarch64/aarch64-builtins.c
	(aarch64_builtin_vectorized_function): Fold to standard pattern names.
	* config/aarch64/aarch64-simd-builtins.def (frintn): New.
	(frintz): Rename to...
	(btrunc): ...this.
	(frintp): Rename to...
	(ceil): ...this.
	(frintm): Rename to...
	(floor): ...this.
	(frinti): Rename to...
	(nearbyint): ...this.
	(frintx): Rename to...
	(rint): ...this.
	(frinta): Rename to...
	(round): ...this.
	* config/aarch64/aarch64-simd.md
	(aarch64_frint<frint_suffix><mode>): Delete.
	(<frint_pattern><mode>2): Convert to insn.
	* config/aarch64/aarch64.md (unspec): Add UNSPEC_FRINTN.
	* config/aarch64/iterators.md (FRINT): Add UNSPEC_FRINTN.
	(frint_pattern): Likewise.
	(frint_suffix): Likewise.

From-SVN: r198394
parent ea78906a
2013-04-29 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64-builtins.c
(aarch64_builtin_vectorized_function): Fold to standard pattern names.
* config/aarch64/aarch64-simd-builtins.def (frintn): New.
(frintz): Rename to...
(btrunc): ...this.
(frintp): Rename to...
(ceil): ...this.
(frintm): Rename to...
(floor): ...this.
(frinti): Rename to...
(nearbyint): ...this.
(frintx): Rename to...
(rint): ...this.
(frinta): Rename to...
(round): ...this.
* config/aarch64/aarch64-simd.md
(aarch64_frint<frint_suffix><mode>): Delete.
(<frint_pattern><mode>2): Convert to insn.
* config/aarch64/aarch64.md (unspec): Add UNSPEC_FRINTN.
* config/aarch64/iterators.md (FRINT): Add UNSPEC_FRINTN.
(frint_pattern): Likewise.
(frint_suffix): Likewise.
2013-04-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/57081
......
......@@ -1224,19 +1224,19 @@ aarch64_builtin_vectorized_function (tree fndecl, tree type_out, tree type_in)
&& in_mode == N##Fmode && in_n == C)
case BUILT_IN_FLOOR:
case BUILT_IN_FLOORF:
return AARCH64_FIND_FRINT_VARIANT (frintm);
return AARCH64_FIND_FRINT_VARIANT (floor);
case BUILT_IN_CEIL:
case BUILT_IN_CEILF:
return AARCH64_FIND_FRINT_VARIANT (frintp);
return AARCH64_FIND_FRINT_VARIANT (ceil);
case BUILT_IN_TRUNC:
case BUILT_IN_TRUNCF:
return AARCH64_FIND_FRINT_VARIANT (frintz);
return AARCH64_FIND_FRINT_VARIANT (btrunc);
case BUILT_IN_ROUND:
case BUILT_IN_ROUNDF:
return AARCH64_FIND_FRINT_VARIANT (frinta);
return AARCH64_FIND_FRINT_VARIANT (round);
case BUILT_IN_NEARBYINT:
case BUILT_IN_NEARBYINTF:
return AARCH64_FIND_FRINT_VARIANT (frinti);
return AARCH64_FIND_FRINT_VARIANT (nearbyint);
case BUILT_IN_SQRT:
case BUILT_IN_SQRTF:
return AARCH64_FIND_FRINT_VARIANT (sqrt);
......
......@@ -247,13 +247,14 @@
BUILTIN_VDQ_BHSI (BINOP, umax, 3)
BUILTIN_VDQ_BHSI (BINOP, umin, 3)
/* Implemented by aarch64_frint<frint_suffix><mode>. */
BUILTIN_VDQF (UNOP, frintz, 0)
BUILTIN_VDQF (UNOP, frintp, 0)
BUILTIN_VDQF (UNOP, frintm, 0)
BUILTIN_VDQF (UNOP, frinti, 0)
BUILTIN_VDQF (UNOP, frintx, 0)
BUILTIN_VDQF (UNOP, frinta, 0)
/* Implemented by <frint_pattern><mode>2. */
BUILTIN_VDQF (UNOP, btrunc, 2)
BUILTIN_VDQF (UNOP, ceil, 2)
BUILTIN_VDQF (UNOP, floor, 2)
BUILTIN_VDQF (UNOP, nearbyint, 2)
BUILTIN_VDQF (UNOP, rint, 2)
BUILTIN_VDQF (UNOP, round, 2)
BUILTIN_VDQF (UNOP, frintn, 2)
/* Implemented by aarch64_fcvt<frint_suffix><su><mode>. */
BUILTIN_VDQF (UNOP, fcvtzs, 0)
......
......@@ -1232,7 +1232,9 @@
(set_attr "simd_mode" "<MODE>")]
)
(define_insn "aarch64_frint<frint_suffix><mode>"
;; Vector versions of the floating-point frint patterns.
;; Expands to btrunc, ceil, floor, nearbyint, rint, round.
(define_insn "<frint_pattern><mode>2"
[(set (match_operand:VDQF 0 "register_operand" "=w")
(unspec:VDQF [(match_operand:VDQF 1 "register_operand" "w")]
FRINT))]
......@@ -1242,15 +1244,6 @@
(set_attr "simd_mode" "<MODE>")]
)
;; Vector versions of the floating-point frint patterns.
;; Expands to btrunc, ceil, floor, nearbyint, rint, round.
(define_expand "<frint_pattern><mode>2"
[(set (match_operand:VDQF 0 "register_operand")
(unspec:VDQF [(match_operand:VDQF 1 "register_operand")]
FRINT))]
"TARGET_SIMD"
{})
(define_insn "aarch64_fcvt<frint_suffix><su><mode>"
[(set (match_operand:<FCVT_TARGET> 0 "register_operand" "=w")
(FIXUORS:<FCVT_TARGET> (unspec:<FCVT_TARGET>
......
......@@ -74,6 +74,7 @@
UNSPEC_FRINTA
UNSPEC_FRINTI
UNSPEC_FRINTM
UNSPEC_FRINTN
UNSPEC_FRINTP
UNSPEC_FRINTX
UNSPEC_FRINTZ
......
......@@ -692,7 +692,8 @@
UNSPEC_UZP1 UNSPEC_UZP2])
(define_int_iterator FRINT [UNSPEC_FRINTZ UNSPEC_FRINTP UNSPEC_FRINTM
UNSPEC_FRINTI UNSPEC_FRINTX UNSPEC_FRINTA])
UNSPEC_FRINTN UNSPEC_FRINTI UNSPEC_FRINTX
UNSPEC_FRINTA])
(define_int_iterator FCVT [UNSPEC_FRINTZ UNSPEC_FRINTP UNSPEC_FRINTM
UNSPEC_FRINTA])
......@@ -787,12 +788,14 @@
(UNSPEC_FRINTM "floor")
(UNSPEC_FRINTI "nearbyint")
(UNSPEC_FRINTX "rint")
(UNSPEC_FRINTA "round")])
(UNSPEC_FRINTA "round")
(UNSPEC_FRINTN "frintn")])
;; frint suffix for floating-point rounding instructions.
(define_int_attr frint_suffix [(UNSPEC_FRINTZ "z") (UNSPEC_FRINTP "p")
(UNSPEC_FRINTM "m") (UNSPEC_FRINTI "i")
(UNSPEC_FRINTX "x") (UNSPEC_FRINTA "a")])
(UNSPEC_FRINTX "x") (UNSPEC_FRINTA "a")
(UNSPEC_FRINTN "n")])
(define_int_attr fcvt_pattern [(UNSPEC_FRINTZ "btrunc") (UNSPEC_FRINTA "round")
(UNSPEC_FRINTP "ceil") (UNSPEC_FRINTM "floor")])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment