1 Notes 2 ===== 3 4 There seems to be a problem with exp(double) and our emulator. I haven't 5 been able to track it down yet. This does not occur with the emulator 6 supplied by Russell King. 7 8 I also found one oddity in the emulator. I don't think it is serious but 9 will point it out. The ARM calling conventions require floating point 10 registers f4-f7 to be preserved over a function call. The compiler quite 11 often uses an stfe instruction to save f4 on the stack upon entry to a 12 function, and an ldfe instruction to restore it before returning. 13 14 I was looking at some code, that calculated a double result, stored it in f4 15 then made a function call. Upon return from the function call the number in 16 f4 had been converted to an extended value in the emulator. 17 18 This is a side effect of the stfe instruction. The double in f4 had to be 19 converted to extended, then stored. If an lfm/sfm combination had been used, 20 then no conversion would occur. This has performance considerations. The 21 result from the function call and f4 were used in a multiplication. If the 22 emulator sees a multiply of a double and extended, it promotes the double to 23 extended, then does the multiply in extended precision. 24 25 This code will cause this problem: 26 27 double x, y, z; 28 z = log(x)/log(y); 29 30 The result of log(x) (a double) will be calculated, returned in f0, then 31 moved to f4 to preserve it over the log(y) call. The division will be done 32 in extended precision, due to the stfe instruction used to save f4 in log(y).
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.