blob: 510a3c10cd1bfb36619e75866e5895bd51fac637 [file] [log] [blame]
Vladimir Marko20421b92016-07-26 16:38:11 +01001%default { "compare":"1" }
Bill Buzbee3b0b4b92016-02-02 13:45:36 +00002 /*
Bill Buzbee1d011d92016-04-04 16:59:29 +00003 * Generic one-operand compare-and-branch operation. Provide a "condition"
4 * fragment that specifies the comparison to perform.
Bill Buzbee3b0b4b92016-02-02 13:45:36 +00005 *
6 * for: if-eqz, if-nez, if-ltz, if-gez, if-gtz, if-lez
7 */
8 /* if-cmp vAA, +BBBB */
Bill Buzbee3b0b4b92016-02-02 13:45:36 +00009 lsr w0, wINST, #8 // w0<- AA
10 GET_VREG w2, w0 // w2<- vAA
Bill Buzbee1d011d92016-04-04 16:59:29 +000011 FETCH_S wINST, 1 // w1<- branch offset, in code units
Vladimir Marko20421b92016-07-26 16:38:11 +010012 .if ${compare}
Bill Buzbee3b0b4b92016-02-02 13:45:36 +000013 cmp w2, #0 // compare (vA, 0)
Vladimir Marko20421b92016-07-26 16:38:11 +010014 .endif
15 ${branch} MterpCommonTakenBranchNoFlags
Bill Buzbee1d011d92016-04-04 16:59:29 +000016 cmp wPROFILE, #JIT_CHECK_OSR // possible OSR re-entry?
17 b.eq .L_check_not_taken_osr
18 FETCH_ADVANCE_INST 2
Bill Buzbee3b0b4b92016-02-02 13:45:36 +000019 GET_INST_OPCODE ip // extract opcode from wINST
20 GOTO_OPCODE ip // jump to next instruction