Query compiler optimizations for target-cpus

I had a question, but was able to find an answer and thought I would write it down here in case anyone else has use for it (hello, future self – I see I forgot I had already looked this up, again).

Basically we were looking at some optimizations the other day and wondered if there was some way to easily be able to see what version of simd optimizations could/would be used, given a target-cpu.

First use rustc –print target-cpus to get a list of recognized cpu types. Next, given a target-cpu, run rustc –print cfg -C target-cpu=<target-cpu>, which will show what cfg’s will be set by the compiler for that target-cpu, which includes simd types.

5 Likes

(I took the liberty to update title and category. Feel free to revert.)

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.