Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. #include "Linderdaum.h"
  2. sEnvironment* Env = NULL;
  3.  
  4. volatile float af = 1.0f;
  5. volatile float bf = 1.0f;
  6. volatile int a = 1;
  7. volatile int b = 1;
  8.  
  9. APPLICATION_ENTRY_POINT
  10. {
  11. Env = new sEnvironment();
  12.  
  13. Env->DeployDefaultEnvironment( "", "CommonMedia" );
  14.  
  15. double Start = Env->GetSeconds();
  16.  
  17. float Sum1 = 0.0f;
  18.  
  19. for ( int i = 0; i != 200000000; i++ ) { Sum1 += af + bf; }
  20.  
  21. double End = Env->GetSeconds();
  22.  
  23. Env->Logger->Log( L_DEBUG, LStr::ToStr( Sum1, 4 ) );
  24. Env->Logger->Log( L_DEBUG, "Float: " + LStr::ToStr( End-Start, 5 ) );
  25.  
  26. Start = Env->GetSeconds();
  27.  
  28. int Sum2 = 0;
  29.  
  30. for ( int i = 0; i != 200000000; i++ ) { Sum2 += a + b; }
  31.  
  32. End = Env->GetSeconds();
  33.  
  34. Env->Logger->Log( L_DEBUG, LStr::ToStr( Sum2, 4 ) );
  35. Env->Logger->Log( L_DEBUG, "Int: " + LStr::ToStr( End-Start, 5 ) );
  36.  
  37. Env->RequestExit();
  38.  
  39. APPLICATION_EXIT_POINT( Env );
  40. }
  41.  
  42. APPLICATION_SHUTDOWN
  43. {}
  44.  
  45. (Main):01:30:11.769 Float: 0.72119
  46. (Main):01:30:12.347 Int: 0.57875
  47.  
  48. (Main):01:43:39.468 Float: 0.72247
  49. (Main):01:43:40.040 Int: 0.57212
  50.  
  51. (Main):01:39:25.844 Float: 0.21671
  52. (Main):01:39:26.060 Int: 0.21511
  53.  
  54. (Main):01:33:27.603 Float: 0.70670
  55. (Main):01:33:27.814 Int: 0.21130
  56.  
  57. 01-27 01:31:01.171 I/LEngine (15364): (Main):01:31:01.177 Float: 6.47994
  58. 01-27 01:31:02.257 I/LEngine (15364): (Main):01:31:02.262 Int: 1.08442
  59.  
  60. float Sum1 = 2.0f;
  61.  
  62. for ( int i = 0; i != 200000000; i++ )
  63. {
  64. Sum1 *= af * bf;
  65. }
  66. ...
  67. int Sum2 = 2;
  68.  
  69. for ( int i = 0; i != 200000000; i++ )
  70. {
  71. Sum2 *= a * b;
  72. }
  73.  
  74. (Main):02:00:39.977 Float: 0.87484
  75. (Main):02:00:40.559 Int: 0.58221
  76.  
  77. (Main):01:59:27.175 Float: 0.77970
  78. (Main):01:59:27.739 Int: 0.56328
  79.  
  80. (Main):02:05:10.413 Float: 0.86724
  81. (Main):02:05:10.631 Int: 0.21741
  82.  
  83. (Main):02:09:58.355 Float: 0.29311
  84. (Main):02:09:58.571 Int: 0.21595
  85.  
  86. 01-27 02:02:20.152 I/LEngine (15809): (Main):02:02:20.156 Float: 6.97402
  87. 01-27 02:02:22.765 I/LEngine (15809): (Main):02:02:22.769 Int: 2.61264
  88.  
  89. .thumb_func
  90. .globl add
  91. add:
  92. mov r3,#0
  93. loop:
  94. add r3,r0,r1
  95. sub r2,#1
  96. bne loop
  97. mov r0,r3
  98. bx lr
  99.  
  100. .thumb_func
  101. .globl m4add
  102. m4add:
  103. vmov s0,r0
  104. vmov s1,r1
  105. m4loop:
  106. vadd.f32 s2,s0,s1
  107. sub r2,#1
  108. bne m4loop
  109. vmov r0,s2
  110. bx lr
  111.  
  112. 00004E2C
  113. 00004E2C
  114. 00004E2E
  115. 00004E2E
  116. 00004E2C
  117. 00004E2E
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement