jmp scheme_to_interface')
\f
define(define_binary_operation,
+`define_binary_operation_with_setup($1,$2,$3,$4,
+ `OP(shl,l) TW(IMM(TC_LENGTH),REG(eax))')')
+
+define(define_binary_operation_with_setup,
`declare_alignment(2)
define_hook_label(generic_$1)
OP(pop,l) REG(edx)
asm_generic_$1_fix:
OP(mov,l) TW(REG(edx),REG(eax))
OP(mov,l) TW(REG(ebx),REG(ecx))
- OP(shl,l) TW(IMM(TC_LENGTH),REG(eax))
+ $5 # Set up eax.
OP(shl,l) TW(IMM(TC_LENGTH),REG(ecx))
OP($3,l) TW(REG(ecx),REG(eax)) # subl
jo asm_generic_$1_fail
# define_binary_operation( $1, $2, $3, $4)
define_binary_operation(add,2b,add,fadd)
define_binary_operation(subtract,28,sub,fsub)
-define_binary_operation(multiply,29,imul,fmul)
+
+# To set up eax, kill its tag, but leave it unshifted; the other
+# operand will be shifted already, so that it will already include the
+# factor of 2^6 desired in the product.
+define_binary_operation_with_setup(multiply,29,imul,fmul,
+ `OP(and,l) TW(rmask,REG(eax))')
+
# Divide needs to check for 0, so we cant really use the following
# define_binary_operation(divide,23,NONE,fdiv)
jmp scheme_to_interface')
\f
define(define_binary_operation,
-`define_binary_operation_with_fixup($1,$2,$3,$4,
+`define_binary_operation_with_setup($1,$2,$3,$4,
`OP(shl,q) TW(IMM(TC_LENGTH),REG(rax))')')
-define(define_binary_operation_with_fixup,
+define(define_binary_operation_with_setup,
`declare_alignment(2)
define_hook_label(generic_$1)
OP(pop,q) REG(rdx)
define_binary_operation(add,2b,add,addsd)
define_binary_operation(subtract,28,sub,subsd)
-# No fixup -- leave it unshifted.
-define_binary_operation_with_fixup(multiply,29,imul,mulsd)
+# To set up rax, kill its tag, but leave it unshifted; the other
+# operand will be shifted already, so that it will already include the
+# factor of 2^6 desired in the product.
+define_binary_operation_with_setup(multiply,29,imul,mulsd,
+ `OP(and,q) TW(rmask,REG(rax))')
# define_binary_predicate(name,index,jcc)
# define_binary_predicate( $1, $2, $3)