+2015-02-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (enum s390_builtin):
+ Add S390_BUILTIN_S390_SFPC and S390_BUILTIN_S390_EFPC.
+ (code_for_builtin): Add CODE_FOR_s390_sfpc and CODE_FOR_s390_efpc.
+ (s390_init_builtins): Generate new builtin functions.
+ * config/s390/s390.md (UNSPECV_SFPC, UNSPECV_EFPC): New constants.
+ (s390_sfpc, s390_efpc): New pattern definitions.
+
2015-02-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c: (enum s390_builtin, s390_expand_builtin):
S390_BUILTIN_TX_NESTING_DEPTH,
S390_BUILTIN_TX_ASSIST,
+ S390_BUILTIN_S390_SFPC,
+ S390_BUILTIN_S390_EFPC,
+
S390_BUILTIN_MAX
};
CODE_FOR_tabort,
CODE_FOR_ntstg,
CODE_FOR_etnd,
- CODE_FOR_tx_assist
+ CODE_FOR_tx_assist,
+
+ CODE_FOR_s390_sfpc,
+ CODE_FOR_s390_efpc
};
static void
add_builtin_function ("__builtin_tx_assist", ftype,
S390_BUILTIN_TX_ASSIST, BUILT_IN_MD, NULL, NULL_TREE);
+ /* void foo (unsigned) */
+ ftype = build_function_type_list (void_type_node, unsigned_type_node,
+ NULL_TREE);
+ s390_builtin_decls[S390_BUILTIN_S390_SFPC] =
+ add_builtin_function ("__builtin_s390_sfpc", ftype,
+ S390_BUILTIN_S390_SFPC, BUILT_IN_MD, NULL, NULL_TREE);
/* int foo (void *) */
ftype = build_function_type_list (integer_type_node, ptr_type_node,
add_builtin_function ("__builtin_tend", ftype,
S390_BUILTIN_TEND, BUILT_IN_MD, NULL, NULL_TREE);
+ /* unsigned foo (void) */
+ ftype = build_function_type_list (unsigned_type_node, NULL_TREE);
+ s390_builtin_decls[S390_BUILTIN_S390_EFPC] =
+ add_builtin_function ("__builtin_s390_efpc", ftype,
+ S390_BUILTIN_S390_EFPC, BUILT_IN_MD, NULL, NULL_TREE);
/* void foo (uint64_t *, uint64_t) */
if (TARGET_64BIT)
UNSPECV_ETND
UNSPECV_NTSTG
UNSPECV_PPA
+
+ ; Set and get floating point control register
+ UNSPECV_SFPC
+ UNSPECV_EFPC
])
;;
"TARGET_HTM && INTVAL (operands[2]) < 16"
"ppa\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
+
+
+; Set and get floating point control register
+
+(define_insn "s390_sfpc"
+ [(unspec_volatile [(match_operand:SI 0 "register_operand" "d")]
+ UNSPECV_SFPC)]
+ "TARGET_HARD_FLOAT"
+ "sfpc\t%0")
+
+(define_insn "s390_efpc"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_EFPC))]
+ "TARGET_HARD_FLOAT"
+ "efpc\t%0")