Home | History | Annotate | Download | only in assembler
      1 /*
      2  * Copyright (C) 2011 STMicroelectronics. All rights reserved.
      3  * Copyright (C) 2008 Apple Inc. All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  * 1. Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  * 2. Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in the
     12  *    documentation and/or other materials provided with the distribution.
     13  *
     14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
     15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     17  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
     18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     21  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     22  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25 */
     26 
     27 #include "config.h"
     28 
     29 #if ENABLE(ASSEMBLER) && CPU(SH4)
     30 
     31 #include "MacroAssemblerSH4.h"
     32 
     33 namespace JSC {
     34 const Condition MacroAssemblerSH4::Equal = SH4Assembler::EQ;
     35 const Condition MacroAssemblerSH4::NotEqual = SH4Assembler::NE;
     36 const Condition MacroAssemblerSH4::GreaterThan = SH4Assembler::GT;
     37 const Condition MacroAssemblerSH4::GreaterThanOrEqual = SH4Assembler::GE;
     38 const Condition MacroAssemblerSH4::LessThan = SH4Assembler::LT;
     39 const Condition MacroAssemblerSH4::LessThanOrEqual = SH4Assembler::LE;
     40 const Condition MacroAssemblerSH4::UGreaterThan = SH4Assembler::HI;
     41 const Condition MacroAssemblerSH4::UGreaterThanOrEqual = SH4Assembler::HS;
     42 const Condition MacroAssemblerSH4::ULessThan = SH4Assembler::LI;
     43 const Condition MacroAssemblerSH4::ULessThanOrEqual = SH4Assembler::LS;
     44 const Condition MacroAssemblerSH4::Zero = SH4Assembler::EQ;
     45 const Condition MacroAssemblerSH4::NonZero = SH4Assembler::NE;
     46 const Condition MacroAssemblerSH4::Overflow = SH4Assembler::OF;
     47 const Condition MacroAssemblerSH4::Above = SH4Assembler::HI;
     48 const Condition MacroAssemblerSH4::AboveOrEqual = SH4Assembler::HS;
     49 const Condition MacroAssemblerSH4::Below = SH4Assembler::LI;
     50 const Condition MacroAssemblerSH4::BelowOrEqual = SH4Assembler::LS;
     51 const Condition MacroAssemblerSH4::DoubleEqual = SH4Assembler::EQ;
     52 const Condition MacroAssemblerSH4::DoubleNotEqual = SH4Assembler::NE;
     53 const Condition MacroAssemblerSH4::DoubleGreaterThan = SH4Assembler::GT;
     54 const Condition MacroAssemblerSH4::DoubleGreaterThanOrEqual = SH4Assembler::GE;
     55 const Condition MacroAssemblerSH4::DoubleLessThan = SH4Assembler::LT;
     56 const Condition MacroAssemblerSH4::DoubleLessThanOrEqual = SH4Assembler::LE;
     57 const Condition MacroAssemblerSH4::DoubleEqualOrUnordered = SH4Assembler::EQU;
     58 const Condition MacroAssemblerSH4::DoubleNotEqualOrUnordered = SH4Assembler::NEU;
     59 const Condition MacroAssemblerSH4::DoubleGreaterThanOrUnordered = SH4Assembler::GTU;
     60 const Condition MacroAssemblerSH4::DoubleGreaterThanOrEqualOrUnordered = SH4Assembler::GEU;
     61 const Condition MacroAssemblerSH4::DoubleLessThanOrUnordered = SH4Assembler::LTU;
     62 const Condition MacroAssemblerSH4::DoubleLessThanOrEqualOrUnordered = SH4Assembler::LEU;
     63 const Condition MacroAssemblerSH4::Signed = SH4Assembler::SI;
     64 
     65 void MacroAssemblerSH4::linkCall(void* code, Call call, FunctionPtr function)
     66 {
     67     SH4Assembler::linkCall(code, call.m_jmp, function.value());
     68 }
     69 
     70 void MacroAssemblerSH4::repatchCall(CodeLocationCall call, CodeLocationLabel destination)
     71 {
     72     SH4Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
     73 }
     74 
     75 void MacroAssemblerSH4::repatchCall(CodeLocationCall call, FunctionPtr destination)
     76 {
     77     SH4Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
     78 }
     79 
     80 } // namespace JSC
     81 
     82 #endif // ENABLE(ASSEMBLER)
     83