DECLARE_CODE_SEGMENT()
declare_alignment(2)
+define_c_label(x86_64_fpe_reset_traps)
+ OP(push,q) REG(rbp)
+ OP(mov,q) TW(REG(rsp),REG(rbp))
+ OP(sub,q) TW(IMM(8),REG(rsp))
+ stmxcsr IND(REG(rsp))
+ # Clear 7 (invalid operation mask)
+ # 8 (denormalized operand mask)
+ # 9 (zero-divide exception mask)
+ # 10 (overflow exception mask)
+ # 11 (underflow exception mask)
+ # 15 (flush-to-zero (if set, gives non-IEEE semantics))
+ OP(and,l) TW(IMM(HEX(ffff707f)),IND(REG(rsp)))
+ # Set 12 (precision exception mask)
+ OP(or,l) TW(IMM(HEX(1000)),IND(REG(rsp)))
+ ldmxcsr IND(REG(rsp))
+ leave
+ ret
+
# C_to_interface passes control from C into Scheme. To C it is a
# unary procedure; its one argument is passed in rdi. It saves the
# state of the C world (the C frame pointer and stack pointer) and
int offset = (COMPILER_REGBLOCK_N_FIXED * (sizeof (SCHEME_OBJECT)));
unsigned char * rsi_value = ((unsigned char *) Registers);
+ x86_64_fpe_reset_traps ();
+
/* These must match machines/x86-64/lapgen.scm */
SETUP_REGISTER (asm_scheme_to_interface); /* 0 */
*/
\f
#define ASM_RESET_HOOK x86_64_reset_hook
+#define FPE_RESET_TRAPS x86_64_fpe_reset_traps
#define CMPINT_USE_STRUCS 1
# define ASM_ENTRY_POINT(name) name
#endif
-extern int ASM_ENTRY_POINT (x86_64_interface_initialize) (void);
+extern void ASM_ENTRY_POINT (x86_64_fpe_reset_traps) (void);
extern void asm_assignment_trap (void);
extern void asm_dont_serialize_cache (void);