Lines Matching +full:21 +full:- +full:k
1 // SPDX-License-Identifier: GPL-2.0-or-later
13 #include <asm/ppc-opcode.h>
14 #include <asm/code-patching.h>
64 regs->msr = msr; in init_pt_regs()
68 asm volatile("mfmsr %0" : "=r"(regs->msr)); in init_pt_regs()
70 regs->msr |= MSR_FP; in init_pt_regs()
71 regs->msr |= MSR_VEC; in init_pt_regs()
72 regs->msr |= MSR_VSX; in init_pt_regs()
74 msr = regs->msr; in init_pt_regs()
80 pr_info("%-14s : %s\n", mnemonic, result); in show_result()
86 pr_info("%-14s : %-50s %s\n", mnemonic, descr, result); in show_result_with_descr()
93 int stepped = -1; in test_ld()
111 int stepped = -1; in test_pld()
134 int stepped = -1; in test_lwz()
152 int stepped = -1; in test_plwz()
176 int stepped = -1; in test_lwzx()
195 int stepped = -1; in test_std()
213 int stepped = -1; in test_pstd()
236 int stepped = -1; in test_ldarx_stdcx()
294 int stepped = -1; in test_lfsx_stfsx()
337 int stepped = -1; in test_plfs_pstfs()
384 int stepped = -1; in test_lfdx_stfdx()
427 int stepped = -1; in test_plfd_pstfd()
500 int stepped = -1; in test_lvx_stvx()
557 int stepped = -1; in test_lxvd2x_stxvd2x()
623 int stepped = -1; in test_lxvp_stxvp()
710 int stepped = -1; in test_lxvpx_stxvpx()
799 int stepped = -1; in test_plxvp_pstxvp()
911 /* Extreme values for si0||si1 (the MLS:D-form 34 bit immediate field) */
913 #define SI_MAX (BIT(33) - 1)
914 #define SI_UMAX (BIT(34) - 1)
961 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
963 .gpr[21] = LONG_MIN,
969 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
971 .gpr[21] = LONG_MIN,
977 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
979 .gpr[21] = LONG_MAX,
985 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
987 .gpr[21] = ULONG_MAX,
993 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
995 .gpr[21] = ULONG_MAX,
1001 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
1003 .gpr[21] = INT_MIN,
1009 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
1011 .gpr[21] = INT_MIN,
1017 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
1019 .gpr[21] = INT_MAX,
1025 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
1027 .gpr[21] = UINT_MAX,
1033 .instr = ppc_inst(PPC_RAW_ADD(20, 21, 22)),
1035 .gpr[21] = UINT_MAX,
1047 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1049 .gpr[21] = LONG_MIN,
1055 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1057 .gpr[21] = LONG_MIN,
1064 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1066 .gpr[21] = LONG_MAX,
1072 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1074 .gpr[21] = ULONG_MAX,
1080 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1082 .gpr[21] = ULONG_MAX,
1088 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1090 .gpr[21] = INT_MIN,
1096 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1098 .gpr[21] = INT_MIN,
1104 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1106 .gpr[21] = INT_MAX,
1112 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1114 .gpr[21] = UINT_MAX,
1120 .instr = ppc_inst(PPC_RAW_ADD_DOT(20, 21, 22)),
1122 .gpr[21] = UINT_MAX,
1133 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1135 .gpr[21] = LONG_MIN,
1141 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1143 .gpr[21] = LONG_MIN,
1149 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1151 .gpr[21] = LONG_MAX,
1157 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1159 .gpr[21] = ULONG_MAX,
1165 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1167 .gpr[21] = ULONG_MAX,
1173 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1175 .gpr[21] = INT_MIN,
1181 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1183 .gpr[21] = INT_MIN,
1189 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1191 .gpr[21] = INT_MAX,
1197 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1199 .gpr[21] = UINT_MAX,
1205 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1207 .gpr[21] = UINT_MAX,
1213 .instr = ppc_inst(PPC_RAW_ADDC(20, 21, 22)),
1215 .gpr[21] = LONG_MIN | (uint)INT_MIN,
1227 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1229 .gpr[21] = LONG_MIN,
1235 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1237 .gpr[21] = LONG_MIN,
1244 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1246 .gpr[21] = LONG_MAX,
1252 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1254 .gpr[21] = ULONG_MAX,
1260 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1262 .gpr[21] = ULONG_MAX,
1268 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1270 .gpr[21] = INT_MIN,
1276 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1278 .gpr[21] = INT_MIN,
1284 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1286 .gpr[21] = INT_MAX,
1292 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1294 .gpr[21] = UINT_MAX,
1300 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1302 .gpr[21] = UINT_MAX,
1308 .instr = ppc_inst(PPC_RAW_ADDC_DOT(20, 21, 22)),
1310 .gpr[21] = LONG_MIN | (uint)INT_MIN,
1321 .instr = ppc_inst(PPC_RAW_DIVDE(20, 21, 22)),
1323 .gpr[21] = LONG_MIN,
1329 .instr = ppc_inst(PPC_RAW_DIVDE(20, 21, 22)),
1332 .gpr[21] = 1L,
1338 .instr = ppc_inst(PPC_RAW_DIVDE(20, 21, 22)),
1340 .gpr[21] = LONG_MIN,
1351 .instr = ppc_inst(PPC_RAW_DIVDE_DOT(20, 21, 22)),
1353 .gpr[21] = LONG_MIN,
1359 .instr = ppc_inst(PPC_RAW_DIVDE_DOT(20, 21, 22)),
1362 .gpr[21] = 1L,
1368 .instr = ppc_inst(PPC_RAW_DIVDE_DOT(20, 21, 22)),
1370 .gpr[21] = LONG_MIN,
1381 .instr = ppc_inst(PPC_RAW_DIVDEU(20, 21, 22)),
1384 .gpr[21] = LONG_MIN,
1390 .instr = ppc_inst(PPC_RAW_DIVDEU(20, 21, 22)),
1393 .gpr[21] = 1L,
1399 .instr = ppc_inst(PPC_RAW_DIVDEU(20, 21, 22)),
1401 .gpr[21] = LONG_MIN,
1406 .descr = "RA = LONG_MAX - 1, RB = LONG_MAX",
1407 .instr = ppc_inst(PPC_RAW_DIVDEU(20, 21, 22)),
1409 .gpr[21] = LONG_MAX - 1,
1415 .instr = ppc_inst(PPC_RAW_DIVDEU(20, 21, 22)),
1418 .gpr[21] = LONG_MIN + 1,
1429 .instr = ppc_inst(PPC_RAW_DIVDEU_DOT(20, 21, 22)),
1432 .gpr[21] = LONG_MIN,
1438 .instr = ppc_inst(PPC_RAW_DIVDEU_DOT(20, 21, 22)),
1441 .gpr[21] = 1L,
1447 .instr = ppc_inst(PPC_RAW_DIVDEU_DOT(20, 21, 22)),
1449 .gpr[21] = LONG_MIN,
1454 .descr = "RA = LONG_MAX - 1, RB = LONG_MAX",
1455 .instr = ppc_inst(PPC_RAW_DIVDEU_DOT(20, 21, 22)),
1457 .gpr[21] = LONG_MAX - 1,
1463 .instr = ppc_inst(PPC_RAW_DIVDEU_DOT(20, 21, 22)),
1466 .gpr[21] = LONG_MIN + 1,
1478 .instr = TEST_PADDI(21, 22, SI_MIN, 0),
1480 .gpr[21] = 0,
1486 .instr = TEST_PADDI(21, 22, SI_MAX, 0),
1488 .gpr[21] = 0,
1494 .instr = TEST_PADDI(21, 22, SI_MAX, 0),
1496 .gpr[21] = 0,
1502 .instr = TEST_PADDI(21, 22, SI_UMAX, 0),
1504 .gpr[21] = 0,
1510 .instr = TEST_PADDI(21, 22, 0x1, 0),
1512 .gpr[21] = 0,
1518 .instr = TEST_PADDI(21, 22, SI_MIN, 0),
1520 .gpr[21] = 0,
1526 .instr = TEST_PADDI(21, 22, SI_MAX, 0),
1528 .gpr[21] = 0,
1534 .instr = TEST_PADDI(21, 22, SI_MAX, 0),
1536 .gpr[21] = 0,
1542 .instr = TEST_PADDI(21, 22, 0x1, 0),
1544 .gpr[21] = 0,
1550 .instr = TEST_PADDI(21, 22, SI_MAX, 0),
1552 .gpr[21] = 0,
1558 .instr = TEST_PADDI(21, 0, SI_MIN, 0),
1560 .gpr[21] = 0x0,
1565 .instr = TEST_PADDI(21, 22, SI_MIN, 0),
1567 .gpr[21] = 0x0,
1573 .instr = TEST_PADDI(21, 0, 0, 1),
1575 .gpr[21] = 0,
1580 .instr = TEST_PADDI(21, 0, SI_MIN, 1),
1582 .gpr[21] = 0,
1588 .instr = TEST_PADDI(21, 22, 0, 1),
1591 .gpr[21] = 0,
1607 return -EINVAL; in emulate_compute_instr()
1610 regs->nip = patch_site_addr(&patch__exec_instr); in emulate_compute_instr()
1615 return -EFAULT; in emulate_compute_instr()
1617 return -EFAULT; in emulate_compute_instr()
1632 return -EINVAL; in execute_compute_instr()
1638 return -EFAULT; in execute_compute_instr()
1657 unsigned int i, j, k; in run_tests_compute() local
1664 if (test->cpu_feature && !early_cpu_has_feature(test->cpu_feature)) { in run_tests_compute()
1665 show_result(test->mnemonic, "SKIP (!CPU_FTR)"); in run_tests_compute()
1669 for (j = 0; j < MAX_SUBTESTS && test->subtests[j].descr; j++) { in run_tests_compute()
1670 instr = test->subtests[j].instr; in run_tests_compute()
1671 flags = test->subtests[j].flags; in run_tests_compute()
1672 regs = &test->subtests[j].regs; in run_tests_compute()
1699 for (k = 0; k < 32; k++) { in run_tests_compute()
1700 ignore_gpr = flags & IGNORE_GPR(k); in run_tests_compute()
1701 if (!ignore_gpr && exp.gpr[k] != got.gpr[k]) { in run_tests_compute()
1703 gpr_mismatch(k, exp.gpr[k], got.gpr[k]); in run_tests_compute()
1726 show_result_with_descr(test->mnemonic, in run_tests_compute()
1727 test->subtests[j].descr, in run_tests_compute()
1735 printk(KERN_INFO "Running instruction emulation self-tests ...\n"); in test_emulate_step()