mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-25 16:11:44 +00:00
WIP
This commit is contained in:
@@ -1547,14 +1547,14 @@ proc genAsmStmt(p: BProc, t: PNode) =
|
||||
if whichPragma(i) == wAsmSyntax:
|
||||
asmSyntax = i[1].strVal
|
||||
|
||||
if asmSyntax != "" and
|
||||
if asmSyntax != "" and
|
||||
not (
|
||||
asmSyntax == "gcc" and hasGnuAsm in CC[p.config.cCompiler].props or
|
||||
asmSyntax == "vcc" and hasGnuAsm notin CC[p.config.cCompiler].props):
|
||||
localError(
|
||||
p.config, t.info,
|
||||
p.config, t.info,
|
||||
"Your compiler does not support the specified inline assembler")
|
||||
|
||||
|
||||
genAsmOrEmitStmt(p, t, isAsmStmt=true, s)
|
||||
# see bug #2362, "top level asm statements" seem to be a mis-feature
|
||||
# but even if we don't do this, the example in #2362 cannot possibly
|
||||
|
||||
@@ -594,4 +594,30 @@ NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "P
|
||||
#define NIM_NOALIAS __restrict
|
||||
/* __restrict is said to work for all the C(++) compilers out there that we support */
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# define NIM_ERR_FLAG() /* nothing to declare: uses HW flag */
|
||||
# define NIM_ERR_JUMP(lab) __asm__ goto("jc %l0" \
|
||||
: \
|
||||
: \
|
||||
: \
|
||||
: lab)
|
||||
# define NIM_ERR_SET() __asm__ volatile("stc" \
|
||||
: \
|
||||
: \
|
||||
: "cc" \
|
||||
)
|
||||
|
||||
# define NIM_ERR_CLEAR() __asm__ volatile("clc" \
|
||||
: \
|
||||
: \
|
||||
: "cc" \
|
||||
)
|
||||
|
||||
#else
|
||||
# define NIM_ERR_FLAG() NIM_BOOL* nimErr_
|
||||
# define NIM_ERR_JUMP(lab) if (NIM_UNLIKELY(*nimErr_)) goto lab
|
||||
# define NIM_ERR_CLEAR() *nimErr_ = NIM_FALSE
|
||||
# define NIM_ERR_SET() *nimErr_ = NIM_TRUE
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* NIMBASE_H */
|
||||
|
||||
Reference in New Issue
Block a user