Class: AArch64::Instructions::CAS

Inherits:
Instruction show all
Defined in:
lib/aarch64/instructions/cas.rb

Overview

CAS, CASA, CASAL, CASL – A64 Compare and Swap word or doubleword in memory CAS <Ws>, <Wt>, [<Xn|SP>,,#0] CASA <Ws>, <Wt>, [<Xn|SP>,,#0] CASAL <Ws>, <Wt>, [<Xn|SP>,,#0] CASL <Ws>, <Wt>, [<Xn|SP>,,#0] CAS <Xs>, <Xt>, [<Xn|SP>,,#0] CASA <Xs>, <Xt>, [<Xn|SP>,,#0] CASAL <Xs>, <Xt>, [<Xn|SP>,,#0] CASL <Xs>, <Xt>, [<Xn|SP>,,#0]

Instance Method Summary collapse

Constructor Details

#initialize(s, t, n, l, o0, sf) ⇒ CAS

Returns a new instance of CAS.



14
15
16
17
18
19
20
21
# File 'lib/aarch64/instructions/cas.rb', line 14

def initialize s, t, n, l, o0, sf
  @s  = check_mask(s, 0x1f)
  @t  = check_mask(t, 0x1f)
  @n  = check_mask(n, 0x1f)
  @l  = check_mask(l, 0x01)
  @o0 = check_mask(o0, 0x01)
  @sf = check_mask(sf, 0x01)
end

Instance Method Details

#encode(_) ⇒ Object



23
24
25
# File 'lib/aarch64/instructions/cas.rb', line 23

def encode _
  CAS(@sf, @l, @s, @o0, @n, @t)
end