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 power9 support to GCC, patch #6 (IEEE 128-bit hardware support)


On Sun, Nov 08, 2015 at 07:44:52PM -0500, Michael Meissner wrote:
> +/* Split a conversion from __float128 to an integer type into separate insns.
> +   OPERANDS points to the destination, source, and V2DI temporary
> +   register. CODE is either FIX or UNSIGNED_FIX.  */

dot space space

> +;; ISA 2.08 IEEE 128-bit floating point support.

3.0

> +(define_code_attr fix_fixuns	 [(fix   "fix")   (unsigned_fix   "fixuns")])
> +(define_code_attr float_floatuns [(float "float") (unsigned_float "floatuns")])

You could instead do an "uns" attribute so you would write fix<uns> etc.

> +;; 0 says do sign-extension, 1 says zero-extension
> +(define_insn "*ieee128_mtvsrw"
> +  [(set (match_operand:V2DI 0 "altivec_register_operand" "=v,v,v,v")
> +	(unspec:V2DI [(match_operand:SI 1 "nonimmediate_operand" "r,Z,r,Z")
> +		      (match_operand:SI 2 "const_0_to_1_operand" "O,O,n,n")]
> +		     UNSPEC_IEEE128_MOVE))]
> +  "TARGET_FLOAT128_HW"
> +  "@
> +   mtvsrwa %x0,%1
> +   lxsiwax %x0,%y1
> +   mtvsrwz %x0,%1
> +   lxsiwzx %x0,%y1"
> +  [(set_attr "type" "mffgpr,fpload,mffgpr,fpload")])

Tricky, is there no cleaner way to do this?


Segher


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