< prev index next >

test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleScalar.java

Print this page
rev 55894 : 8222897: [vector] Renaming of shift, rotate operations. Few other api changes.
Summary: Renaming of shift, rotate operations. Few other api changes.
Reviewed-by: jrose, briangoetz


 243 
 244 
 245 
 246 
 247 
 248 
 249 
 250 
 251 
 252 
 253 
 254 
 255 
 256 
 257 
 258 
 259 
 260 
 261 
 262 












 263     @Benchmark
 264     public void max(Blackhole bh) {
 265         double[] as = fa.apply(size);
 266         double[] bs = fb.apply(size);
 267         double[] rs = fr.apply(size);
 268 
 269         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 270             for (int i = 0; i < as.length; i++) {
 271                 double a = as[i];
 272                 double b = bs[i];
 273                 rs[i] = (double)(Math.max(a, b));
 274             }
 275         }
 276 
 277         bh.consume(rs);
 278     }
 279 
 280     @Benchmark
 281     public void min(Blackhole bh) {
 282         double[] as = fa.apply(size);
 283         double[] bs = fb.apply(size);
 284         double[] rs = fr.apply(size);
 285 
 286         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 287             for (int i = 0; i < as.length; i++) {
 288                 double a = as[i];
 289                 double b = bs[i];
 290                 rs[i] = (double)(Math.min(a, b));
 291             }
 292         }
 293 
 294         bh.consume(rs);
 295     }
 296 
 297 
 298 
 299 
 300     @Benchmark
 301     public void addAll(Blackhole bh) {
 302         double[] as = fa.apply(size);
 303         double r = 0;
 304         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 305             r = 0;
 306             for (int i = 0; i < as.length; i++) {
 307                 r += as[i];
 308             }
 309         }
 310         bh.consume(r);
 311     }
 312 
 313     @Benchmark
 314     public void mulAll(Blackhole bh) {
 315         double[] as = fa.apply(size);
 316         double r = 1;
 317         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 318             r = 1;
 319             for (int i = 0; i < as.length; i++) {
 320                 r *= as[i];
 321             }
 322         }
 323         bh.consume(r);
 324     }
 325 
 326     @Benchmark
 327     public void minAll(Blackhole bh) {
 328         double[] as = fa.apply(size);
 329         double r = Double.POSITIVE_INFINITY;
 330         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 331             r = Double.POSITIVE_INFINITY;
 332             for (int i = 0; i < as.length; i++) {
 333                 r = (double)Math.min(r, as[i]);
 334             }
 335         }
 336         bh.consume(r);
 337     }
 338 
 339     @Benchmark
 340     public void maxAll(Blackhole bh) {
 341         double[] as = fa.apply(size);
 342         double r = Double.NEGATIVE_INFINITY;
 343         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 344             r = Double.NEGATIVE_INFINITY;
 345             for (int i = 0; i < as.length; i++) {
 346                 r = (double)Math.max(r, as[i]);
 347             }
 348         }
 349         bh.consume(r);
 350     }
 351 
 352 
 353 
 354     @Benchmark
 355     public void lessThan(Blackhole bh) {
 356         double[] as = fa.apply(size);
 357         double[] bs = fb.apply(size);
 358 
 359         boolean r = false;
 360         for (int ic = 0; ic < INVOC_COUNT; ic++) {




 243 
 244 
 245 
 246 
 247 
 248 
 249 
 250 
 251 
 252 
 253 
 254 
 255 
 256 
 257 
 258 
 259 
 260 
 261 
 262 
 263 
 264 
 265 
 266 
 267 
 268 
 269 
 270 
 271 
 272 
 273 
 274 
 275     @Benchmark
 276     public void max(Blackhole bh) {
 277         double[] as = fa.apply(size);
 278         double[] bs = fb.apply(size);
 279         double[] rs = fr.apply(size);
 280 
 281         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 282             for (int i = 0; i < as.length; i++) {
 283                 double a = as[i];
 284                 double b = bs[i];
 285                 rs[i] = (double)(Math.max(a, b));
 286             }
 287         }
 288 
 289         bh.consume(rs);
 290     }
 291 
 292     @Benchmark
 293     public void min(Blackhole bh) {
 294         double[] as = fa.apply(size);
 295         double[] bs = fb.apply(size);
 296         double[] rs = fr.apply(size);
 297 
 298         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 299             for (int i = 0; i < as.length; i++) {
 300                 double a = as[i];
 301                 double b = bs[i];
 302                 rs[i] = (double)(Math.min(a, b));
 303             }
 304         }
 305 
 306         bh.consume(rs);
 307     }
 308 
 309 
 310 
 311 
 312     @Benchmark
 313     public void addLanes(Blackhole bh) {
 314         double[] as = fa.apply(size);
 315         double r = 0;
 316         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 317             r = 0;
 318             for (int i = 0; i < as.length; i++) {
 319                 r += as[i];
 320             }
 321         }
 322         bh.consume(r);
 323     }
 324 
 325     @Benchmark
 326     public void mulLanes(Blackhole bh) {
 327         double[] as = fa.apply(size);
 328         double r = 1;
 329         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 330             r = 1;
 331             for (int i = 0; i < as.length; i++) {
 332                 r *= as[i];
 333             }
 334         }
 335         bh.consume(r);
 336     }
 337 
 338     @Benchmark
 339     public void minLanes(Blackhole bh) {
 340         double[] as = fa.apply(size);
 341         double r = Double.POSITIVE_INFINITY;
 342         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 343             r = Double.POSITIVE_INFINITY;
 344             for (int i = 0; i < as.length; i++) {
 345                 r = (double)Math.min(r, as[i]);
 346             }
 347         }
 348         bh.consume(r);
 349     }
 350 
 351     @Benchmark
 352     public void maxLanes(Blackhole bh) {
 353         double[] as = fa.apply(size);
 354         double r = Double.NEGATIVE_INFINITY;
 355         for (int ic = 0; ic < INVOC_COUNT; ic++) {
 356             r = Double.NEGATIVE_INFINITY;
 357             for (int i = 0; i < as.length; i++) {
 358                 r = (double)Math.max(r, as[i]);
 359             }
 360         }
 361         bh.consume(r);
 362     }
 363 
 364 
 365 
 366     @Benchmark
 367     public void lessThan(Blackhole bh) {
 368         double[] as = fa.apply(size);
 369         double[] bs = fb.apply(size);
 370 
 371         boolean r = false;
 372         for (int ic = 0; ic < INVOC_COUNT; ic++) {


< prev index next >