示例#1
0
文件: util.py 项目: forrestv/pyable
def load_double(code, reg, val):
    data = extarray.extarray('d', (val, ))
    data.change_type('L')

    # reg better be an mmx or xmm, should we check?
    code.add(x86.push(data[0]))
    code.add(x86.pshufd(reg, mem.MemRef(regs.rsp, data_size=128), 0x44))
    return code.add(x86.add(regs.rsp, 8))
示例#2
0
文件: util.py 项目: forrestv/pyable
def load_float(code, reg, val, clear=False):
    data = extarray.extarray('f', (val, ))
    data.change_type('I')

    # reg better be an mmx or xmm, should we check?
    code.add(x86.push(data[0]))
    code.add(x86.pshufd(reg, mem.MemRef(regs.rsp, data_size=128), 0))
    return code.add(x86.add(regs.rsp, 8))
示例#3
0
def load_float(code, reg, val, clear = False):
  data = extarray.extarray('f', (val,))
  data.change_type('I')

  # reg better be an mmx or xmm, should we check?
  code.add(x86.push(data[0]))
  code.add(x86.pshufd(reg, mem.MemRef(regs.rsp, data_size = 128), 0))
  return code.add(x86.add(regs.rsp, 8))
示例#4
0
def load_double(code, reg, val):
  data = extarray.extarray('d', (val,))
  data.change_type('L')

  # reg better be an mmx or xmm, should we check?
  code.add(x86.push(data[0]))
  code.add(x86.pshufd(reg, mem.MemRef(regs.rsp, data_size = 128), 0x44))
  return code.add(x86.add(regs.rsp, 8))
示例#5
0
def load_float(code, reg, val, clear=False):
    data = extarray.extarray('f', (val, ))
    data.change_type('I')

    # reg better be an mmx or xmm, should we check?
    code.add(x86.push(data[0]))
    code.add(x86.movd(reg, mem.MemRef(regs.rsp, data_size=32)))
    ret = code.add(x86.add(regs.rsp, 8))

    if clear == False:
        # Need to duplicate the value out across now
        # Assumes reg is xmm
        ret = x86.pshufd(reg, reg, 0)

    return ret