Class: BOAST::BasicBinaryOperator

Inherits:
Operator
  • Object
show all
Defined in:
lib/BOAST/Language/Operators.rb

Constant Summary

Constants inherited from Operator

Operator::DISCARD_OPTIONS

Constants included from Intrinsics

Intrinsics::CONVERSIONS, Intrinsics::INTRINSICS

Class Method Summary collapse

Methods inherited from Operator

convert, inspect

Methods included from PrivateStateAccessor

private_boolean_state_accessor, private_state_accessor

Methods included from Intrinsics

get_conversion_path, get_vector_decl, get_vector_decl_ARM, get_vector_decl_X86, get_vector_name, intrinsics, intrinsics_by_vector_name, type_name_ARM, type_name_X86, vector_type_name

Class Method Details

.string(arg1, arg2, return_type) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/BOAST/Language/Operators.rb', line 35

def BasicBinaryOperator.string(arg1, arg2, return_type)
  if lang == C and (arg1.class == Variable and arg2.class == Variable) and (arg1.type.vector_length > 1 or arg2.type.vector_length > 1) then
    instruction = intrinsics(intr_symbol, return_type.type)
    a1 = convert(arg1, return_type.type)
    a2 = convert(arg2, return_type.type)
    return "#{instruction}( #{a1}, #{a2} )"
  else
    return basic_usage( arg1, arg2 )
  end
end