Can I do floating point operations in interrupt handler ? (x86 or 64) Also I would like know can I use print function inside the interrupt handler ?
Inside an interrupt handler, don't use anything that can block. That means don't use print functions unless they are non-blocking. Ideally, your ISR should do the bare minimum needed to clear the interrupt and then launch a normal thread to do the rest of the processing. If you need the print statements for debugging, then consider having the non-ISR part of your program declare a global, volatile buffer and have your ISR write your debug data into it. Your non-ISR code can check the buffer and printf
the data from it if needed.
You should avoid floating-point operations inside an ISR (and in kernel code in general) as well.
Most floating point units can generate exceptions divide by zero etc. If your code triggered one of these exceptions from inside an interrupt context the result would be very messy.
Also on x86 some memory/string operations have MMX versions that use the floating point register space as temporary storage so they can do 64bit read/write operations so depending on processor/kernel configuration you might be in for some nasty surprises.
You could end up spending a lot of time debugging this so my advice would be to try and avoid using floating point in kernel code if you possibly can.