Skip to content

Commit 58dad55

Browse files
author
Evan Cheng
committed
Various SSE2 packed integer intrinsics: pmulhuw, pavgw, etc.
llvm-svn: 27645
1 parent e4f97cc commit 58dad55

File tree

1 file changed

+71
-4
lines changed

1 file changed

+71
-4
lines changed

llvm/lib/Target/X86/X86InstrSSE.td

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,22 +1383,89 @@ def PSUBUSWrr : PDI<0xD9, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
13831383
[(set VR128:$dst, (int_x86_sse2_psubus_w VR128:$src1,
13841384
VR128:$src2))]>;
13851385

1386-
def PSUBSBrm : PDI<0xE8, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1386+
def PSUBSBrm : PDI<0xE8, MRMSrcMem,
1387+
(ops VR128:$dst, VR128:$src1, i128mem:$src2),
13871388
"psubsb {$src2, $dst|$dst, $src2}",
13881389
[(set VR128:$dst, (int_x86_sse2_psubs_b VR128:$src1,
13891390
(bc_v16i8 (loadv2i64 addr:$src2))))]>;
1390-
def PSUBSWrm : PDI<0xE9, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1391+
def PSUBSWrm : PDI<0xE9, MRMSrcMem,
1392+
(ops VR128:$dst, VR128:$src1, i128mem:$src2),
13911393
"psubsw {$src2, $dst|$dst, $src2}",
13921394
[(set VR128:$dst, (int_x86_sse2_psubs_w VR128:$src1,
13931395
(bc_v8i16 (loadv2i64 addr:$src2))))]>;
1394-
def PSUBUSBrm : PDI<0xD8, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1396+
def PSUBUSBrm : PDI<0xD8, MRMSrcMem,
1397+
(ops VR128:$dst, VR128:$src1, i128mem:$src2),
13951398
"psubusb {$src2, $dst|$dst, $src2}",
13961399
[(set VR128:$dst, (int_x86_sse2_psubus_b VR128:$src1,
13971400
(bc_v16i8 (loadv2i64 addr:$src2))))]>;
1398-
def PSUBUSWrm : PDI<0xD9, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1401+
def PSUBUSWrm : PDI<0xD9, MRMSrcMem,
1402+
(ops VR128:$dst, VR128:$src1, i128mem:$src2),
13991403
"psubusw {$src2, $dst|$dst, $src2}",
14001404
[(set VR128:$dst, (int_x86_sse2_psubus_w VR128:$src1,
14011405
(bc_v8i16 (loadv2i64 addr:$src2))))]>;
1406+
1407+
let isCommutable = 1 in {
1408+
def PMULHUWrr : PDI<0xE4, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1409+
"pmulhuw {$src2, $dst|$dst, $src2}",
1410+
[(set VR128:$dst, (int_x86_sse2_pmulhu_w VR128:$src1,
1411+
VR128:$src2))]>;
1412+
def PMULHWrr : PDI<0xE5, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1413+
"pmulhw {$src2, $dst|$dst, $src2}",
1414+
[(set VR128:$dst, (int_x86_sse2_pmulh_w VR128:$src1,
1415+
VR128:$src2))]>;
1416+
def PMULLWrr : PDI<0xD5, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1417+
"pmullw {$src2, $dst|$dst, $src2}",
1418+
[(set VR128:$dst, (v8i16 (mul VR128:$src1, VR128:$src2)))]>;
1419+
def PMULUDQrr : PDI<0xF4, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1420+
"pmuludq {$src2, $dst|$dst, $src2}",
1421+
[(set VR128:$dst, (int_x86_sse2_pmulu_dq VR128:$src1,
1422+
VR128:$src2))]>;
1423+
}
1424+
1425+
def PMULHUWrm : PDI<0xE4, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1426+
"pmulhuw {$src2, $dst|$dst, $src2}",
1427+
[(set VR128:$dst, (int_x86_sse2_pmulhu_w VR128:$src1,
1428+
(bc_v8i16 (loadv2i64 addr:$src2))))]>;
1429+
def PMULHWrm : PDI<0xE5, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1430+
"pmulhw {$src2, $dst|$dst, $src2}",
1431+
[(set VR128:$dst, (int_x86_sse2_pmulh_w VR128:$src1,
1432+
(bc_v8i16 (loadv2i64 addr:$src2))))]>;
1433+
def PMULLWrm : PDI<0xD5, MRMSrcMem,
1434+
(ops VR128:$dst, VR128:$src1, i128mem:$src2),
1435+
"pmullw {$src2, $dst|$dst, $src2}",
1436+
[(set VR128:$dst, (v8i16 (mul VR128:$src1,
1437+
(bc_v8i16 (loadv2i64 addr:$src2)))))]>;
1438+
def PMULUDQrm : PDI<0xF4, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1439+
"pmuludq {$src2, $dst|$dst, $src2}",
1440+
[(set VR128:$dst, (int_x86_sse2_pmulu_dq VR128:$src1,
1441+
(bc_v4i32 (loadv2i64 addr:$src2))))]>;
1442+
1443+
def PMADDWDrr : PDI<0xF5, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1444+
"pmaddwd {$src2, $dst|$dst, $src2}",
1445+
[(set VR128:$dst, (int_x86_sse2_pmadd_wd VR128:$src1,
1446+
VR128:$src2))]>;
1447+
def PMADDWDrm : PDI<0xF5, MRMSrcMem,
1448+
(ops VR128:$dst, VR128:$src1, i128mem:$src2),
1449+
"pmaddwd {$src2, $dst|$dst, $src2}",
1450+
[(set VR128:$dst, (int_x86_sse2_pmadd_wd VR128:$src1,
1451+
(bc_v8i16 (loadv2i64 addr:$src2))))]>;
1452+
1453+
def PAVGBrr : PDI<0xE0, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1454+
"pavgb {$src2, $dst|$dst, $src2}",
1455+
[(set VR128:$dst, (int_x86_sse2_pavg_b VR128:$src1,
1456+
VR128:$src2))]>;
1457+
def PAVGWrr : PDI<0xE3, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
1458+
"pavgw {$src2, $dst|$dst, $src2}",
1459+
[(set VR128:$dst, (int_x86_sse2_pavg_w VR128:$src1,
1460+
VR128:$src2))]>;
1461+
def PAVGBrm : PDI<0xE0, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1462+
"pavgb {$src2, $dst|$dst, $src2}",
1463+
[(set VR128:$dst, (int_x86_sse2_pavg_b VR128:$src1,
1464+
(bc_v16i8 (loadv2i64 addr:$src2))))]>;
1465+
def PAVGWrm : PDI<0xE3, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2),
1466+
"pavgw {$src2, $dst|$dst, $src2}",
1467+
[(set VR128:$dst, (int_x86_sse2_pavg_w VR128:$src1,
1468+
(bc_v8i16 (loadv2i64 addr:$src2))))]>;
14021469
}
14031470

14041471
let isTwoAddress = 1 in {

0 commit comments

Comments
 (0)