- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While trying to emulate mm512_scalef_ps and mm512_scalef_round_ps, I noticed that there is no difference in the pseudocode provided in the Intel Intrinsics Guide.
Could it be clarified what the difference is between in the two intrinsics ?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The mm512_scalef_ps does the rounding based on the rounding mode in the MXCSR.
The mm512_scalef_round_ps gets an additional rounding control parameter and use this rounding instead of the default (in MXCSR).
You can clearly see this in the description below (taken from the Intel intrinsic guide).
Scale the packed single-precision (32-bit) floating-point elements in a using values from b, and store the results in dst.
Rounding is done according to the rounding[3:0] parameter, which can be one of:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The rounding you're talking about is the FLOOR() function in the pseudo-code, or is it something in addition to the FLOOR()?
Assuming the former, instead of FLOOR(tmp_src2[31:0]) shouldn't the pseudo-code be ROUND(tmp_src2[i+31:i], rounding[3:0]) for scalef_round and something like ROUND(tmp_src2[i+31:i], MXCSR[2:0] | _MM_FROUND_NO_EXC) for scalef?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have since tried using _mm_setcsr to set the rounding mode before calling scalef to emulate scalef_round behaviour.
I was unable to emulate scalef_round using this.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page