View Issue Details

IDProjectCategoryView StatusLast Update
0015493CentOS-7gccpublic2018-11-30 21:18
Status newResolutionopen 
Product Version7.5.1804 
Target VersionFixed in Version 
Summary0015493: Static rounding mode for intel CPUs doesn't appear to be working
DescriptionIntel, with the introduction of AVX-512, has a static rounding mode that can be accompanied with every arithmetic instruction for float or single precision. It's very well possible I'm misinterpreting how they're supposed to work (though, I don't think I am, given that the rounding intrinsics themselves are absent from the AVX512 extensions in GCC).

I'm uploading a simple trivial test case that can be compiled (with devtoolset-7's gcc 7).
Steps To ReproduceCompile application with -mavx512f, run it.
Additional InformationWe'd expect the results to be rounded to the nearest integers. Instead, it would appear there's no rounding applied at all. The emitted instruction by the compiler seems correct, but there's some interplay between AVX512 and the kernel. I imagine most of that interplay is register state for context switching, and admittedly I don't have another OS / installation to test this against, but the result is not what I'd expect.

[0.20000000, 0.80000000, 1.60000000, 1.80000000, 0.40000000, 0.20000000, 1.10000000, 1.80000000]

The emitted instruction:
  40049b: 62 f1 fd 18 59 c1 vmulpd {rn-sae},%zmm1,%zmm0,%zmm0
TagsNo tags attached.




2018-11-26 22:21


test_mulround.c (537 bytes)


2018-11-30 21:18

reporter   ~0033181

Ahh, disregard this. It appears this refers to the floating point rounding mode for calculations at the tail end of the mantissa bits. A somewhat misleading instruction name. It appears the "round scale" operations are what are supposed to replace the round instructions.

Issue History

Date Modified Username Field Change
2018-11-26 22:21 ilikerackmounts New Issue
2018-11-26 22:21 ilikerackmounts File Added: test_mulround.c
2018-11-30 21:18 ilikerackmounts Note Added: 0033181