Add a stack_check instruction.
This instruction loads a stack limit from a global variable and compares it to the stack pointer, trapping if the stack has grown beyond the limit. Also add a expand_flags transform group containing legalization patterns for ISAs with CPU flags. Fixes #234.
This commit is contained in:
@@ -10,7 +10,7 @@ from . import recipes as r
|
||||
from . import settings as cfg
|
||||
from . import instructions as x86
|
||||
from .legalize import intel_expand
|
||||
from base.legalize import narrow, expand
|
||||
from base.legalize import narrow, expand_flags
|
||||
from base.settings import allones_funcaddrs, is_pic
|
||||
from .settings import use_sse41
|
||||
|
||||
@@ -22,18 +22,18 @@ except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
I32.legalize_monomorphic(expand)
|
||||
I32.legalize_monomorphic(expand_flags)
|
||||
I32.legalize_type(
|
||||
default=narrow,
|
||||
b1=expand,
|
||||
b1=expand_flags,
|
||||
i32=intel_expand,
|
||||
f32=intel_expand,
|
||||
f64=intel_expand)
|
||||
|
||||
I64.legalize_monomorphic(expand)
|
||||
I64.legalize_monomorphic(expand_flags)
|
||||
I64.legalize_type(
|
||||
default=narrow,
|
||||
b1=expand,
|
||||
b1=expand_flags,
|
||||
i32=intel_expand,
|
||||
i64=intel_expand,
|
||||
f32=intel_expand,
|
||||
|
||||
@@ -18,7 +18,7 @@ intel_expand = XFormGroup(
|
||||
|
||||
Use Intel-specific instructions if needed.
|
||||
""",
|
||||
isa=ISA, chain=shared.expand)
|
||||
isa=ISA, chain=shared.expand_flags)
|
||||
|
||||
a = Var('a')
|
||||
dead = Var('dead')
|
||||
|
||||
Reference in New Issue
Block a user