setrounding is thread unsafe. Is there a problem with making the rounding mode thread- or task-local?
setrounding