Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
55d5d340
Commit
55d5d340
authored
Sep 22, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid stdint types to make MSVC happy.
parent
f670c79b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
43 deletions
+31
-43
tests/run/fused_cmethods.srctree
tests/run/fused_cmethods.srctree
+31
-43
No files found.
tests/run/fused_cmethods.srctree
View file @
55d5d340
...
...
@@ -81,7 +81,6 @@ called = []
######## pkg/user.pxd ########
from libc.stdint cimport *
from .registers cimport Registers, SubRegisters
cdef class UseRegisters:
...
...
@@ -96,66 +95,55 @@ cdef class UseRegisters:
def __init__(self, reg_type=Registers):
self.registers = reg_type()
called.append("Before setFullFlags")
self.registers.setFullFlags(<u
int32_t>0xffffffff, <uint32_
t>0)
self.registers.setFullFlags(<u
nsigned int>12345, <unsigned in
t>0)
called.append("After setFullFlags")
def call_write(self):
called.append("Before regWriteWithOpWords")
self.registers.regWriteWithOpWords(0, <u
int32_
t>0)
self.registers.regWriteWithOpWords(0, <u
nsigned in
t>0)
called.append("After regWriteWithOpWords")
def call_non_fused(self):
called.append("Before nonFusedMiddle")
self.registers.nonFusedMiddle(0, <u
int32_
t>0)
self.registers.nonFusedMiddle(0, <u
nsigned in
t>0)
called.append("After nonFusedMiddle")
called.append("Before nonFusedBottom")
self.registers.nonFusedBottom(0, <u
int32_
t>0)
self.registers.nonFusedBottom(0, <u
nsigned in
t>0)
called.append("After nonFusedBottom")
called.append("Before nonFusedTop")
self.registers.nonFusedTop(0, <u
int32_
t>0)
self.registers.nonFusedTop(0, <u
nsigned in
t>0)
called.append("After nonFusedTop")
def call_sub(self):
assert isinstance(self.registers, SubRegisters), type(self.registers)
called.append("Before nonFusedSub")
(<SubRegisters>self.registers).nonFusedSub(0, <u
int32_
t>0)
(<SubRegisters>self.registers).nonFusedSub(0, <u
nsigned in
t>0)
called.append("After nonFusedSub")
called.append("Before fusedSub")
(<SubRegisters>self.registers).fusedSub(0, <u
int32_
t>0)
(<SubRegisters>self.registers).fusedSub(0, <u
nsigned in
t>0)
called.append("After fusedSub")
######## pkg/registers.pxd ########
from libc.stdint cimport *
cdef:
ctypedef fused uint8_t_uint16_t_uint32_t:
uint8_t
uint16_t
uint32_t
ctypedef fused uint16_t_uint32_t_uint64_t:
uint16_t
uint32_t
uint64_t
from cython cimport integral
cdef class Registers:
cdef u
int64_t
regs[1]
cdef void nonFusedTop(self, u
int16_t regId, uint32_
t value)
cdef void regWriteWithOpWords(self, u
int16_t regId, uint16_t_uint32_t_uint64_t
value)
cdef void nonFusedMiddle(self, u
int16_t regId, uint32_
t value)
cdef void setFullFlags(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1)
cdef void nonFusedBottom(self, u
int16_t regId, uint32_
t value)
cdef void lastFusedImplFirst(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1)
cdef u
nsigned long long
regs[1]
cdef void nonFusedTop(self, u
nsigned short regId, unsigned in
t value)
cdef void regWriteWithOpWords(self, u
nsigned short regId, integral
value)
cdef void nonFusedMiddle(self, u
nsigned short regId, unsigned in
t value)
cdef void setFullFlags(self,
integral reg0, unsigned in
t reg1)
cdef void nonFusedBottom(self, u
nsigned short regId, unsigned in
t value)
cdef void lastFusedImplFirst(self,
integral reg0, unsigned in
t reg1)
cdef class SubRegisters(Registers):
cdef void fusedSub(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1)
cdef void nonFusedSub(self, u
int16_t regId, uint32_
t value)
cdef void fusedSub(self,
integral reg0, unsigned in
t reg1)
cdef void nonFusedSub(self, u
nsigned short regId, unsigned in
t value)
######## pkg/registers.pyx ########
...
...
@@ -166,32 +154,32 @@ cdef class Registers:
def __init__(self):
pass
cdef void lastFusedImplFirst(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1):
cdef void lastFusedImplFirst(self,
integral reg0, unsigned in
t reg1):
called.append("lastFusedImplFirst was called")
cdef void nonFusedTop(self, u
int16_t regId, uint32_
t value):
cdef void nonFusedTop(self, u
nsigned short regId, unsigned in
t value):
called.append("nonFusedTop was called")
cdef void regWriteWithOpWords(self, u
int16_t regId, uint16_t_uint32_t_uint64_t
value):
cdef void regWriteWithOpWords(self, u
nsigned short regId, integral
value):
called.append("regWriteWithOpWords was called")
self.regs[regId] = value
called.append("regWriteWithOpWords leave function")
cdef void nonFusedMiddle(self, u
int16_t regId, uint32_
t value):
cdef void nonFusedMiddle(self, u
nsigned short regId, unsigned in
t value):
called.append("nonFusedMiddle was called")
cdef void setFullFlags(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1):
cdef void setFullFlags(self,
integral reg0, unsigned in
t reg1):
called.append("setFullFlags was called")
cdef void nonFusedBottom(self, u
int16_t regId, uint32_
t value):
cdef void nonFusedBottom(self, u
nsigned short regId, unsigned in
t value):
called.append("nonFusedBottom was called")
cdef class SubRegisters(Registers):
cdef void fusedSub(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1):
cdef void fusedSub(self,
integral reg0, unsigned in
t reg1):
called.append("fusedSub was called")
cdef void nonFusedSub(self, u
int16_t regId, uint32_
t value):
cdef void nonFusedSub(self, u
nsigned short regId, unsigned in
t value):
called.append("nonFusedSub was called")
...
...
@@ -200,9 +188,9 @@ cdef class SubRegisters(Registers):
from .registers cimport *
cdef class SubSubRegisters(SubRegisters):
cdef void fusedSubSubFirst(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1)
cdef void nonFusedSubSub(self, u
int16_t regId, uint32_
t value)
cdef void fusedSubSubLast(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1)
cdef void fusedSubSubFirst(self,
integral reg0, unsigned in
t reg1)
cdef void nonFusedSubSub(self, u
nsigned short regId, unsigned in
t value)
cdef void fusedSubSubLast(self,
integral reg0, unsigned in
t reg1)
######## pkg/sub.pyx ########
...
...
@@ -210,11 +198,11 @@ cdef class SubSubRegisters(SubRegisters):
from . import called
cdef class SubSubRegisters(SubRegisters):
cdef void fusedSubSubFirst(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1):
cdef void fusedSubSubFirst(self,
integral reg0, unsigned in
t reg1):
called.append("fusedSubSubFirst was called")
cdef void nonFusedSubSub(self, u
int16_t regId, uint32_
t value):
cdef void nonFusedSubSub(self, u
nsigned short regId, unsigned in
t value):
called.append("nonFusedSubSub was called")
cdef void fusedSubSubLast(self,
uint8_t_uint16_t_uint32_t reg0, uint32_
t reg1):
cdef void fusedSubSubLast(self,
integral reg0, unsigned in
t reg1):
called.append("fusedSubSubLast was called")
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment