# Using Java's Vector API to Implement SIMD-Style FizzBuzz

DevFeed: [Using Java's Vector API to Implement SIMD-Style FizzBuzz](<https://devfeed.tech/articles/fizzbuzz-simd-style-18820.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/fizzbuzz-simd-style/>)

Published: 2021-03-08T15:25:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [API](<https://devfeed.tech/topics/api.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [x86](<https://devfeed.tech/topics/x86.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [java](<https://devfeed.tech/tags/java.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>), [x86](<https://devfeed.tech/tags/x86.md>)

## AI overview

This tutorial explores Java 16's incubating Vector API through a SIMD-style implementation of FizzBuzz. It explains how SIMD performs one operation on multiple data items, contrasts explicit vectorization with JIT auto-vectorization, and discusses portable vector computation.

## Source excerpt

Table of Contents What's SIMD Anyways? Vectorizing FizzBuzz Examining the Native Code Avoiding Scalar Processing of Tail Elements Wrap-Up Java 16 is around the corner, so there's no better time than now for learning more about the features which the new version will bring. After exploring the support for Unix domain sockets a while ago, I've lately been really curious about the incubating Vector API, as defined by JEP 338, developed under the umbrella of Project Panama, which aims at "interconnecting JVM and native code". Vectors?!? Of course this is not about renewing the ancient Java collection types like java.util.Vector (<insert some pun about this here>), but rather about an API which lets Java developers take advantage of the vector calculation capabilities you can find in most CPUs these days. Now I'm by no means an expert on low-level programming leveraging specific CPU instructions, but exactly that's why I hope to make the case with this post that the new Vector API makes these capabilities approachable to a wide audience of Java programmers.