equal
deleted
inserted
replaced
111 int|long) |
111 int|long) |
112 args="$args -KAtomicAdd" |
112 args="$args -KAtomicAdd" |
113 ;; |
113 ;; |
114 esac |
114 esac |
115 |
115 |
|
116 # The value of `value3` is chosen such that when added to `value1` or `value2` |
|
117 # it will result in carrying of bits over to the next byte, thereby detecting |
|
118 # possible errors in endianness conversion e.g. if say for atomic addition the |
|
119 # augend is incorrectly processed |
116 case $type in |
120 case $type in |
117 short) |
121 short) |
118 value1=(short)0x0102 |
122 value1=(short)0x0102 |
119 value2=(short)0x1112 |
123 value2=(short)0x1112 |
120 value3=(short)0x2122 |
124 value3=(short)0xFFFE |
121 ;; |
125 ;; |
122 char) |
126 char) |
123 value1=(char)0x0102 |
127 value1=(char)0x0102 |
124 value2=(char)0x1112 |
128 value2=(char)0x1112 |
125 value3=(char)0x2122 |
129 value3=(char)0xFFFE |
126 ;; |
130 ;; |
127 int) |
131 int) |
128 value1=0x01020304 |
132 value1=0x01020304 |
129 value2=0x11121314 |
133 value2=0x11121314 |
130 value3=0x21222324 |
134 value3=0xFFFEFDFC |
131 ;; |
135 ;; |
132 long) |
136 long) |
133 value1=0x0102030405060708L |
137 value1=0x0102030405060708L |
134 value2=0x1112131415161718L |
138 value2=0x1112131415161718L |
135 value3=0x2122232425262728L |
139 value3=0xFFFEFDFCFBFAF9F8L |
136 ;; |
140 ;; |
137 float) |
141 float) |
138 value1=0x01020304 |
142 value1=0x01020304 |
139 value2=0x11121314 |
143 value2=0x11121314 |
140 value3=0x21222324 |
144 value3=0xFFFEFDFC |
141 ;; |
145 ;; |
142 double) |
146 double) |
143 value1=0x0102030405060708L |
147 value1=0x0102030405060708L |
144 value2=0x1112131415161718L |
148 value2=0x1112131415161718L |
145 value3=0x2122232425262728L |
149 value3=0xFFFEFDFCFBFAF9F8L |
146 ;; |
150 ;; |
147 esac |
151 esac |
148 |
152 |
149 args="$args -Dvalue1=$value1 -Dvalue2=$value2 -Dvalue3=$value3" |
153 args="$args -Dvalue1=$value1 -Dvalue2=$value2 -Dvalue3=$value3" |
150 |
154 |