[PATCH] XCore target: add support to build MultiSource/Benchmarks/SciMark2-C

robert lytton robert at xmos.com
Thu Feb 13 11:19:05 PST 2014


robertlytton added you to the CC list for the revision "XCore target: add support to build MultiSource/Benchmarks/SciMark2-C".

The xcore target is ending up with -ve zero instead of +ve zero.
Is this an important difference?
If not, is it reasonable to use abs()?
Robert

http://llvm-reviews.chandlerc.com/D2771

Files:
  MultiSource/Benchmarks/SciMark2-C/scimark2.c

Index: MultiSource/Benchmarks/SciMark2-C/scimark2.c
===================================================================
--- MultiSource/Benchmarks/SciMark2-C/scimark2.c
+++ MultiSource/Benchmarks/SciMark2-C/scimark2.c
@@ -1,6 +1,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#if defined(__XS1B__)
+#include <math.h>
+#endif
 
 #include "Random.h"
 #include "kernel.h"
@@ -72,6 +75,11 @@
          * to see the actual output. */
         SCALE = 10000000;
   
+#if defined(__XS1B__)
+        // Turn "-0.00" to "0.00" when printed.
+        res[1] = fabs(res[1]);
+        res[5] = fabs(res[5]);
+#endif
         res[0] = (res[1] + res[2] + res[3] + res[4] + res[5]) / 5;
 
         /* print out results  */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2771.1.patch
Type: text/x-patch
Size: 729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140213/c77ed6cc/attachment.bin>


More information about the llvm-commits mailing list