This is an archive of the discontinued LLVM Phabricator instance.

[AVX512][BUILTIN][vpermilps][intrinsics] Fixing two incorrect IMM check.
ClosedPublic

Authored by m_zuckerman on Jun 29 2016, 6:01 AM.

Details

Summary

By SPEC, instruction vpermilps gets IMM bigger than 15.
Below, you can see that IMM can be any number between 0 to 255 include.

SELECT4(src, control){
CASE(control[1:0])
0: tmp[31:0] := src[31:0]
1: tmp[31:0] := src[63:32]
2: tmp[31:0] := src[95:64]
3: tmp[31:0] := src[127:96]
ESAC
RETURN tmp[31:0]
}

tmp_dst[31:0] := SELECT4(a[127:0], imm8[1:0])
tmp_dst[63:32] := SELECT4(a[127:0], imm8[3:2])
tmp_dst[95:64] := SELECT4(a[127:0], imm8[5:4])
tmp_dst[127:96] := SELECT4(a[127:0], imm8[7:6])
FOR j := 0 to 3
i := j*32
IF k[j]

		dst[i+31:i] := tmp_dst[i+31:i]

ELSE

		dst[i+31:i] := src[i+31:i]

FI
ENDFOR
dst[MAX:128] := 0

Diff Detail

Repository
rL LLVM

Event Timeline

m_zuckerman retitled this revision from to [AVX512][BUILTIN] Deleting two incorrect lines, conflicting SPEC.
m_zuckerman updated this object.
m_zuckerman added a subscriber: cfe-commits.
m_zuckerman retitled this revision from [AVX512][BUILTIN] Deleting two incorrect lines, conflicting SPEC to [AVX512][BUILTIN][vpermilps][intrinsics] Fixing two incorrect IMM check. .Jun 29 2016, 6:04 AM
igorb accepted this revision.Jun 29 2016, 6:11 AM
igorb edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 29 2016, 6:11 AM
craig.topper added inline comments.Jun 29 2016, 9:00 PM
lib/Sema/SemaChecking.cpp
1568 ↗(On Diff #62212)

Can you put these adjacent to vpermilps512_mask?

This revision was automatically updated to reflect the committed changes.