microDeintNeonCode = '''
const unsigned dRegs = %(dRegs)d;
const unsigned regs = 2 * dRegs;
- const unsigned perDReg = (2 * sizeof(FloatRegBits)) /
- sizeof(Element);
+ const unsigned perDReg =
+ (2 * sizeof(uint32_t)) / sizeof(Element);
union convStruct {
- FloatRegBits cRegs[regs];
+ uint32_t cRegs[regs];
Element elements[dRegs * perDReg];
} conv1, conv2;
microInterNeonCode = '''
const unsigned dRegs = %(dRegs)d;
const unsigned regs = 2 * dRegs;
- const unsigned perDReg = (2 * sizeof(FloatRegBits)) /
- sizeof(Element);
+ const unsigned perDReg =
+ (2 * sizeof(uint32_t)) / sizeof(Element);
union convStruct {
- FloatRegBits cRegs[regs];
+ uint32_t cRegs[regs];
Element elements[dRegs * perDReg];
} conv1, conv2;
FpDestS%(reg)dP1_uw = gtoh(destRegs[%(reg)d].fRegs[1]);
''' % { "reg" : reg }
microUnpackNeonCode = '''
- const unsigned perDReg = (2 * sizeof(FloatRegBits)) /
- sizeof(Element);
+ const unsigned perDReg = (2 * sizeof(uint32_t)) / sizeof(Element);
union SourceRegs {
- FloatRegBits fRegs[2 * %(sRegs)d];
+ uint32_t fRegs[2 * %(sRegs)d];
Element elements[%(sRegs)d * perDReg];
} sourceRegs;
union DestReg {
- FloatRegBits fRegs[2];
+ uint32_t fRegs[2];
Element elements[perDReg];
} destRegs[%(dRegs)d];
FpDestS%(reg)dP1_uw = gtoh(destRegs[%(reg)d].fRegs[1]);
''' % { "reg" : reg }
microUnpackAllNeonCode = '''
- const unsigned perDReg = (2 * sizeof(FloatRegBits)) /
- sizeof(Element);
+ const unsigned perDReg = (2 * sizeof(uint32_t)) / sizeof(Element);
union SourceRegs {
- FloatRegBits fRegs[2 * %(sRegs)d];
+ uint32_t fRegs[2 * %(sRegs)d];
Element elements[%(sRegs)d * perDReg];
} sourceRegs;
union DestReg {
- FloatRegBits fRegs[2];
+ uint32_t fRegs[2];
Element elements[perDReg];
} destRegs[%(dRegs)d];
sourceRegs[%(reg)d].fRegs[1] = htog(FpOp1S%(reg)dP1_uw);
''' % { "reg" : reg }
microPackNeonCode = '''
- const unsigned perDReg = (2 * sizeof(FloatRegBits)) /
- sizeof(Element);
+ const unsigned perDReg =
+ (2 * sizeof(uint32_t)) / sizeof(Element);
union SourceReg {
- FloatRegBits fRegs[2];
+ uint32_t fRegs[2];
Element elements[perDReg];
} sourceRegs[%(sRegs)d];
union DestRegs {
- FloatRegBits fRegs[2 * %(dRegs)d];
+ uint32_t fRegs[2 * %(dRegs)d];
Element elements[%(dRegs)d * perDReg];
} destRegs;
readDest=False, pairwise=False, toInt=False):
global header_output, exec_output
eWalkCode = simdEnabledCheckCode + '''
- typedef FloatReg FloatVect[rCount];
+ typedef float FloatVect[rCount];
FloatVect srcRegs1, srcRegs2;
'''
if toInt:
readDestCode = ''
if readDest:
readDestCode = 'destReg = destRegs[r];'
- destType = 'FloatReg'
+ destType = 'float'
writeDest = 'destRegs[r] = destReg;'
if toInt:
- destType = 'FloatRegBits'
+ destType = 'uint32_t'
writeDest = 'destRegs.regs[r] = destReg;'
if pairwise:
eWalkCode += '''
for (unsigned r = 0; r < rCount; r++) {
- FloatReg srcReg1 = (2 * r < rCount) ?
+ float srcReg1 = (2 * r < rCount) ?
srcRegs1[2 * r] : srcRegs2[2 * r - rCount];
- FloatReg srcReg2 = (2 * r < rCount) ?
+ float srcReg2 = (2 * r < rCount) ?
srcRegs1[2 * r + 1] : srcRegs2[2 * r + 1 - rCount];
%(destType)s destReg;
%(readDest)s
else:
eWalkCode += '''
for (unsigned r = 0; r < rCount; r++) {
- FloatReg srcReg1 = srcRegs1[r];
- FloatReg srcReg2 = srcRegs2[r];
+ float srcReg1 = srcRegs1[r];
+ float srcReg2 = srcRegs2[r];
%(destType)s destReg;
%(readDest)s
%(op)s
def twoEqualRegInstFp(name, Name, opClass, types, rCount, op, readDest=False):
global header_output, exec_output
eWalkCode = simdEnabledCheckCode + '''
- typedef FloatReg FloatVect[rCount];
+ typedef float FloatVect[rCount];
FloatVect srcRegs1, srcRegs2, destRegs;
'''
for reg in range(rCount):
mnemonic);
} else {
for (unsigned i = 0; i < rCount; i++) {
- FloatReg srcReg1 = srcRegs1[i];
- FloatReg srcReg2 = srcRegs2[imm];
- FloatReg destReg;
+ float srcReg1 = srcRegs1[i];
+ float srcReg2 = srcRegs2[imm];
+ float destReg;
%(readDest)s
%(op)s
destRegs[i] = destReg;
readDestCode = 'destReg = gtoh(destRegs.regs[i]);'
readOpCode = 'Element srcElem1 = gtoh(srcRegs1.elements[i]);'
if fromInt:
- readOpCode = 'FloatRegBits srcReg1 = gtoh(srcRegs1.regs[i]);'
+ readOpCode = 'uint32_t srcReg1 = gtoh(srcRegs1.regs[i]);'
declDest = 'Element destElem;'
writeDestCode = 'destRegs.elements[i] = htog(destElem);'
if toInt:
- declDest = 'FloatRegBits destReg;'
+ declDest = 'uint32_t destReg;'
writeDestCode = 'destRegs.regs[i] = htog(destReg);'
eWalkCode += '''
for (unsigned i = 0; i < eCount; i++) {
readDest=False, toInt=False):
global header_output, exec_output
eWalkCode = simdEnabledCheckCode + '''
- typedef FloatReg FloatVect[rCount];
+ typedef float FloatVect[rCount];
FloatVect srcRegs1;
'''
if toInt:
readDestCode = ''
if readDest:
readDestCode = 'destReg = destRegs[i];'
- destType = 'FloatReg'
+ destType = 'float'
writeDest = 'destRegs[r] = destReg;'
if toInt:
- destType = 'FloatRegBits'
+ destType = 'uint32_t'
writeDest = 'destRegs.regs[r] = destReg;'
eWalkCode += '''
for (unsigned r = 0; r < rCount; r++) {
- FloatReg srcReg1 = srcRegs1[r];
+ float srcReg1 = srcRegs1[r];
%(destType)s destReg;
%(readDest)s
%(op)s
twoRegMiscInst("vcgt", "NVcgtQ", "SimdCmpOp", signedTypes, 4, vcgtCode)
vcgtfpCode = '''
FPSCR fpscr = (FPSCR) FpscrExc;
- float res = binaryOp(fpscr, srcReg1, (FloatReg)0.0, vcgtFunc,
+ float res = binaryOp(fpscr, srcReg1, (float)0.0, vcgtFunc,
true, true, VfpRoundNearest);
destReg = (res == 0) ? -1 : 0;
if (res == 2.0)
twoRegMiscInst("vcge", "NVcgeQ", "SimdCmpOp", signedTypes, 4, vcgeCode)
vcgefpCode = '''
FPSCR fpscr = (FPSCR) FpscrExc;
- float res = binaryOp(fpscr, srcReg1, (FloatReg)0.0, vcgeFunc,
+ float res = binaryOp(fpscr, srcReg1, (float)0.0, vcgeFunc,
true, true, VfpRoundNearest);
destReg = (res == 0) ? -1 : 0;
if (res == 2.0)
twoRegMiscInst("vceq", "NVceqQ", "SimdCmpOp", signedTypes, 4, vceqCode)
vceqfpCode = '''
FPSCR fpscr = (FPSCR) FpscrExc;
- float res = binaryOp(fpscr, srcReg1, (FloatReg)0.0, vceqFunc,
+ float res = binaryOp(fpscr, srcReg1, (float)0.0, vceqFunc,
true, true, VfpRoundNearest);
destReg = (res == 0) ? -1 : 0;
if (res == 2.0)
twoRegMiscInst("vcle", "NVcleQ", "SimdCmpOp", signedTypes, 4, vcleCode)
vclefpCode = '''
FPSCR fpscr = (FPSCR) FpscrExc;
- float res = binaryOp(fpscr, srcReg1, (FloatReg)0.0, vcleFunc,
+ float res = binaryOp(fpscr, srcReg1, (float)0.0, vcleFunc,
true, true, VfpRoundNearest);
destReg = (res == 0) ? -1 : 0;
if (res == 2.0)
twoRegMiscInst("vclt", "NVcltQ", "SimdCmpOp", signedTypes, 4, vcltCode)
vcltfpCode = '''
FPSCR fpscr = (FPSCR) FpscrExc;
- float res = binaryOp(fpscr, srcReg1, (FloatReg)0.0, vcltFunc,
+ float res = binaryOp(fpscr, srcReg1, (float)0.0, vcltFunc,
true, true, VfpRoundNearest);
destReg = (res == 0) ? -1 : 0;
if (res == 2.0)
4, vcltfpCode, toInt = True)
vswpCode = '''
- FloatRegBits mid;
+ uint32_t mid;
for (unsigned r = 0; r < rCount; r++) {
mid = srcReg1.regs[r];
srcReg1.regs[r] = destReg.regs[r];
union
{
uint8_t bytes[32];
- FloatRegBits regs[8];
+ uint32_t regs[8];
} table;
union
{
uint8_t bytes[8];
- FloatRegBits regs[2];
+ uint32_t regs[2];
} destReg, srcReg2;
const unsigned length = %(length)d;