当前位置: 首页>>代码示例>>C++>>正文


C++ JavascriptSIMDFloat64x2::GetValue方法代码示例

本文整理汇总了C++中JavascriptSIMDFloat64x2::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ JavascriptSIMDFloat64x2::GetValue方法的具体用法?C++ JavascriptSIMDFloat64x2::GetValue怎么用?C++ JavascriptSIMDFloat64x2::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JavascriptSIMDFloat64x2的用法示例。


在下文中一共展示了JavascriptSIMDFloat64x2::GetValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ARGUMENTS

    Var SIMDFloat64x2Lib::EntryClamp(RecyclableObject* function, CallInfo callInfo, ...)
    {
        PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);

        ARGUMENTS(args, callInfo);
        ScriptContext* scriptContext = function->GetScriptContext();

        AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
        Assert(!(callInfo.Flags & CallFlags_New));

        // we expect at least 3 explicit args with Float64x2 type
        if (args.Info.Count >= 4 &&
            JavascriptSIMDFloat64x2::Is(args[1]) &&
            JavascriptSIMDFloat64x2::Is(args[2]) &&
            JavascriptSIMDFloat64x2::Is(args[3]))
        {
            JavascriptSIMDFloat64x2 *t     = JavascriptSIMDFloat64x2::FromVar(args[1]);
            JavascriptSIMDFloat64x2 *lower = JavascriptSIMDFloat64x2::FromVar(args[2]);
            JavascriptSIMDFloat64x2 *upper = JavascriptSIMDFloat64x2::FromVar(args[3]);
            Assert(t && lower && upper);

            SIMDValue tValue, lowerValue, upperValue, resultValue;

            tValue = t->GetValue();
            lowerValue = lower->GetValue();
            upperValue = upper->GetValue();

            resultValue = SIMDFloat64x2Operation::OpClamp(tValue, lowerValue, upperValue);

            return JavascriptSIMDFloat64x2::New(&resultValue, scriptContext);
        }

        JavascriptError::ThrowTypeError(scriptContext, JSERR_SimdFloat64x2TypeMismatch, L"clamp");
    }
开发者ID:EdwardBetts,项目名称:spidernode,代码行数:34,代码来源:SIMDFloat64x2Lib.cpp

示例2: ARGUMENTS

    Var JavascriptSIMDFloat64x2::EntryToString(RecyclableObject* function, CallInfo callInfo, ...)
    {
        PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);

        ARGUMENTS(args, callInfo);
        ScriptContext* scriptContext = function->GetScriptContext();

        AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
        Assert(!(callInfo.Flags & CallFlags_New));

        if (args.Info.Count == 0 || JavascriptOperators::GetTypeId(args[0]) != TypeIds_SIMDFloat64x2)
        {
            JavascriptError::ThrowTypeError(scriptContext, JSERR_This_NeedSimd, L"SIMDFloat64x2.toString");
        }

        JavascriptSIMDFloat64x2 *instance = JavascriptSIMDFloat64x2::FromVar(args[0]);
        Assert(instance);

        wchar_t stringBuffer[SIMD_STRING_BUFFER_MAX];
        SIMDValue value = instance->GetValue();

        JavascriptSIMDFloat64x2::ToStringBuffer(value, stringBuffer, SIMD_STRING_BUFFER_MAX);

        JavascriptString* string = JavascriptString::NewCopySzFromArena(stringBuffer, scriptContext, scriptContext->GeneralAllocator());

        return string;
    }
开发者ID:Rootkitsmm,项目名称:ChakraCore,代码行数:27,代码来源:JavascriptSimdFloat64x2.cpp


注:本文中的JavascriptSIMDFloat64x2::GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。