News for hackers. Stuff that matters.
Re:Implementing Cosine in C from Scratch (2020) by stephencanon on Tuesday March 29, 2022 @04:48PM (#30848165)
Moving between x87 and xmm registers is actually fairly cheap (it's through memory, so it's not free, but it's also not _that_ bad). FSIN itself is catastrophically slow.
Re:Implementing Cosine in C from Scratch (2020) by jhgb on Tuesday March 29, 2022 @05:24PM (#30848563)
Fair enough, and I imagine there may even be some forwarding going on? There often is when a load follows a store, if I remember correctly. (Of course this will be microarchitecture-dependent.)