* BF is the condition register bit field which can range from 0-7. But for
* testing purposes, we only use BF values of '0' and '5'.
*/
-static void _test_dtstdc(int BF, int DCM, dfp_val_t val1, dfp_val_t x1 __attribute__((unused)))
+static void _test_dtstdc(int BF, int DCM, dfp_val_t *val1, dfp_val_t *x1 __attribute__((unused)))
{
- _Decimal64 f14 = val1.dec_val;
+ _Decimal64 f14 = val1->dec_val;
if (DCM < 0 || DCM > 5 || !(BF == 0 || BF == 5)) {
fprintf(stderr, "Invalid inputs to asm test: a=%d, b=%d\n", BF, DCM);
return;
}
}
-static void _test_dtstdcq(int BF, int DCM, dfp_val_t val1, dfp_val_t x1 __attribute__((unused)))
+static void _test_dtstdcq(int BF, int DCM, dfp_val_t *val1, dfp_val_t *x1 __attribute__((unused)))
{
- _Decimal128 f14 = val1.dec_val128;
+ _Decimal128 f14 = val1->dec_val128;
if (DCM < 0 || DCM > 5 || !(BF == 0 || BF == 5)) {
fprintf(stderr, "Invalid inputs to asm test: a=%d, b=%d\n", BF, DCM);
return;
* BF is the condition register bit field which can range from 0-7. But for
* testing purposes, we only use BF values of '0' and '5'.
*/
-static void _test_dtstdg(int BF, int DGM, dfp_val_t val1, dfp_val_t x1 __attribute__((unused)))
+static void _test_dtstdg(int BF, int DGM, dfp_val_t *val1, dfp_val_t *x1 __attribute__((unused)))
{
- _Decimal64 f14 = val1.dec_val;
+ _Decimal64 f14 = val1->dec_val;
if (DGM < 0 || DGM > 5 || !(BF == 0 || BF == 5)) {
fprintf(stderr, "Invalid inputs to asm test: a=%d, b=%d\n", BF, DGM);
return;
}
}
-static void _test_dtstdgq(int BF, int DGM, dfp_val_t val1, dfp_val_t x1 __attribute__((unused)))
+static void _test_dtstdgq(int BF, int DGM, dfp_val_t *val1, dfp_val_t *x1 __attribute__((unused)))
{
- _Decimal128 f14 = val1.dec_val128;
+ _Decimal128 f14 = val1->dec_val128;
if (DGM < 0 || DGM > 5 || !(BF == 0 || BF == 5)) {
fprintf(stderr, "Invalid inputs to asm test: a=%d, b=%d\n", BF, DGM);
return;
* from 0-7, but for testing purposes, we only use BF values of '4' and '7'.
*/
static void
-_test_dtstex(int BF, int x __attribute__((unused)), dfp_val_t val1, dfp_val_t val2)
+_test_dtstex(int BF, int x __attribute__((unused)), dfp_val_t *val1, dfp_val_t *val2)
{
- _Decimal64 f14 = val1.dec_val;
- _Decimal64 f16 = val2.dec_val;
+ _Decimal64 f14 = val1->dec_val;
+ _Decimal64 f16 = val2->dec_val;
if (!(BF == 4 || BF == 7)) {
fprintf(stderr, "Invalid input to asm test: a=%d\n", BF);
return;
}
}
-static void _test_dtstexq(int BF, int x __attribute__((unused)), dfp_val_t val1, dfp_val_t val2)
+static void _test_dtstexq(int BF, int x __attribute__((unused)), dfp_val_t *val1, dfp_val_t *val2)
{
- _Decimal128 f14 = val1.dec_val128;
- _Decimal128 f16 = val2.dec_val128;
+ _Decimal128 f14 = val1->dec_val128;
+ _Decimal128 f16 = val2->dec_val128;
if (!(BF == 4 || BF == 7)) {
fprintf(stderr, "Invalid input to asm test: a=%d\n", BF);
return;
-typedef void (*test_func_t)(int a, int b, dfp_val_t val1, dfp_val_t val2);
+typedef void (*test_funcp_t)(int a, int b, dfp_val_t *val1, dfp_val_t *val2);
typedef void (*test_driver_func_t)(void);
typedef struct test_table
{
typedef struct dfp_test
{
- test_func_t test_func;
+ test_funcp_t test_func;
const char * name;
dfp_test_args_t * targs;
int num_tests;
typedef struct dfp_one_arg_test
{
- test_func_t test_func;
+ test_funcp_t test_func;
const char * name;
precision_type_t precision;
const char * op;
static void test_dfp_ClassAndGroupTest_ops(void)
{
- test_func_t func;
+ test_funcp_t func;
dfp_val_t test_val, dummy;
int k = 0;
unsigned int flags;
SET_FPSCR_ZERO;
SET_CR_XER_ZERO;
- (*func)(BF, data_class_OR_group, test_val, dummy);
+
+ /* There is an ABI change in how 128 bit arguments are aligned
+ * with GCC 5.0. The compiler generates a "note" about this
+ * starting with GCC 4.8. To avoid generating the "note", pass
+ * the address of the 128-bit arguments rather then the value.
+ */
+ (*func)(BF, data_class_OR_group, &test_val, &dummy);
GET_CR(flags);
condreg = ((flags >> (4 * (7-BF)))) & 0xf;
static void test_dfp_ExpTest_ops(void)
{
dfp_val_t test_val1, test_val2;
- test_func_t func;
+ test_funcp_t func;
int k = 0;
while ((func = dfp_ExpTest_tests[k].test_func)) {
SET_FPSCR_ZERO;
SET_CR_XER_ZERO;
- (*func)(BF, 0, test_val1, test_val2);
+ /* There is an ABI change in how 128 bit arguments are aligned
+ * with GCC 5.0. The compiler generates a "note" about this
+ * starting with GCC 4.8. To avoid generating the "note", pass
+ * the address of the 128-bit arguments rather then the value.
+ */
+ (*func)(BF, 0, &test_val1, &test_val2);
GET_CR(flags);
condreg = ((flags >> (4 * (7-BF)))) & 0xf;
enum BF_vals { BF_val1 = 0, BF_val2 = 1, BF_val3 =6};
// The assembly-level instructions being tested
-static void _test_dtstsf(unsigned int BF, unsigned int ref_sig, dfp_val_t valB)
+static void _test_dtstsf(unsigned int BF, unsigned int ref_sig, dfp_val_t *valB)
{
- _Decimal64 f16 = valB.dec_val;
+ _Decimal64 f16 = valB->dec_val;
register HWord_t r14 __asm__ ("r14");
double f14;
r14 = (HWord_t)&ref_sig;
}
}
-static void _test_dtstsfq(unsigned int BF, unsigned int ref_sig, dfp_val_t valB)
+static void _test_dtstsfq(unsigned int BF, unsigned int ref_sig, dfp_val_t *valB)
{
- _Decimal128 f16 = valB.dec_val128;
+ _Decimal128 f16 = valB->dec_val128;
register HWord_t r14 __asm__ ("r14");
double f14;
r14 = (HWord_t)&ref_sig;
}
}
-static dfp_val_t _test_ddedpd(unsigned int SP, dfp_val_t valB)
+static dfp_val_t _test_ddedpd(unsigned int SP, dfp_val_t *valB)
{
_Decimal64 ret = 0;
dfp_val_t result;
- _Decimal64 f16 = valB.dec_val;
+ _Decimal64 f16 = valB->dec_val;
switch (SP) {
case 0:
__asm__ __volatile__ ("ddedpd. 0, %0, %1" : "=f" (ret) : "f" (f16));
}
-static dfp_val_t _test_ddedpdq(unsigned int SP, dfp_val_t valB)
+static dfp_val_t _test_ddedpdq(unsigned int SP, dfp_val_t *valB)
{
_Decimal128 ret = 0;
dfp_val_t result;
- _Decimal128 f16 = valB.dec_val128;
+ _Decimal128 f16 = valB->dec_val128;
switch (SP) {
case 0:
__asm__ __volatile__ ("ddedpdq 0, %0, %1" : "=f" (ret) : "f" (f16));
return result;
}
-static dfp_val_t _test_denbcd(unsigned int S, dfp_val_t valB)
+static dfp_val_t _test_denbcd(unsigned int S, dfp_val_t *valB)
{
_Decimal64 ret = 0;
dfp_val_t result;
- _Decimal64 f16 = valB.dec_val;
+ _Decimal64 f16 = valB->dec_val;
switch (S) {
case 0:
__asm__ __volatile__ ("denbcd. 0, %0, %1" : "=f" (ret) : "f" (f16));
}
-static dfp_val_t _test_denbcdq(unsigned int S, dfp_val_t valB)
+static dfp_val_t _test_denbcdq(unsigned int S, dfp_val_t *valB)
{
_Decimal128 ret = 0;
dfp_val_t result;
- _Decimal128 f16 = valB.dec_val128;
+ _Decimal128 f16 = valB->dec_val128;
switch (S) {
case 0:
__asm__ __volatile__ ("denbcdq 0, %0, %1" : "=f" (ret) : "f" (f16));
}
-typedef void (*test_func_t)(unsigned int imm, unsigned int imm2, dfp_val_t valB);
-typedef dfp_val_t (*test_func_bcd_t)(unsigned int imm, dfp_val_t valB);
+typedef void (*test_funcp_t)(unsigned int imm, unsigned int imm2, dfp_val_t *valB);
+typedef dfp_val_t (*test_func_bcdp_t)(unsigned int imm, dfp_val_t *valB);
typedef void (*test_driver_func_t)(void);
typedef struct test_table
{
typedef struct dfp_one_arg_test
{
- test_func_t test_func;
+ test_funcp_t test_func;
const char * name;
precision_type_t precision;
const char * op;
typedef struct dfp_one_arg_bcd_test
{
- test_func_bcd_t test_func;
+ test_func_bcdp_t test_func;
const char * name;
precision_type_t precision;
const char * op;
static void test_dfp_ddedpd_ops(void)
{
- test_func_bcd_t func;
+ test_func_bcdp_t func;
dfp_val_t test_val;
int k = 0;
for (SP = 0; SP < 4; SP++) {
dfp_val_t result;
- result = (*func)(SP, test_val);
+
+ /* There is an ABI change in how 128 bit arguments are aligned
+ * with GCC 5.0. The compiler generates a "note" about this
+ * starting with GCC 4.8. To avoid generating the "note", pass
+ * the address of the 128-bit arguments rather then the value.
+ */
+ result = (*func)(SP, &test_val);
printf("%s (SP=%d) %s", test_def.name, SP, test_def.op);
if (test_def.precision == LONG_TEST) {
printf("%016llx ==> %016llx\n", test_val.u64_val, result.u64_val);
static void test_dfp_denbcd_ops(void)
{
- test_func_bcd_t func;
+ test_func_bcdp_t func;
dfp_val_t test_val;
int num_test_vals;
test_val.u128.vall = bcd128_vals[(i * 2) + 1];
}
- result = (*func)(S, test_val);
+ /* There is an API change in how 128 bit arguments are aligned
+ * with GCC 5.0. The compiler generates a "note" about this
+ * starting with GCC 4.8. To avoid generating the "note", pass
+ * the address of the 128-bit arguments rather then the value.
+ */
+ result = (*func)(S, &test_val);
printf("%s (S=%d) %s", test_def.name, S, test_def.op);
if (test_def.precision == LONG_TEST) {
printf("%016llx ==> %016llx\n", test_val.u64_val, result.u64_val);
static void test_dfp_test_significance_ops(void)
{
- test_func_t func;
+ test_funcp_t func;
dfp_val_t test_valB;
int k = 0;
unsigned int BF_vals[] = {BF_val1, BF_val2, BF_val3};
BF = BF_vals[bf_idx];
SET_FPSCR_ZERO;
SET_CR_XER_ZERO;
- (*func)(BF, reference_sig, test_valB);
+ /* There is an ABI change in how 128 bit arguments are aligned
+ * with GCC 5.0. The compiler generates a "note" about this
+ * starting with GCC 4.9. To avoid generating the "note", pass
+ * the address of the 128-bit arguments rather then the value.
+ */
+ (*func)(BF, reference_sig, &test_valB);
GET_CR(flags);
condreg = ((flags >> (4 * (7-BF)))) & 0xf;